RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
    • Sketches and constraints
    • Features
    • Outputs, regions and published values
    • Configurations
    • Occurrences and mates
    • Patterns, mirrors and fasteners
    • Drawing views and annotations
    • Evaluate
    • Import and export
    • Scripting and sweeps
Docs>CAD>MCAD reference

Patterns, mirrors and fasteners

A pattern repeats occurrences by a layout, and a mirror reflects them. Each copy is keyed, so a mate, a drawing balloon or a diagnostic can name one copy: rib@ribs[3] is the copy of rib at key 3 of the pattern ribs. Copies are counted with their seed: a linear pattern of count = 6 places the seed and five more.

This frame repeats a rib every 50 mm, spokes around a hub, and mirrors the row of ribs to the far side.

runmat 0.7
std 1

part rib {
    sketch s on origin.yz {
        l1 = line(start = [0 mm, 0 mm], end = [40 mm, 0 mm])
        l2 = line(start = [40 mm, 0 mm], end = [40 mm, 20 mm])
        l3 = line(start = [40 mm, 20 mm], end = [0 mm, 20 mm])
        l4 = line(start = [0 mm, 20 mm], end = [0 mm, 0 mm])
    }
    feature body = extrude(profile = sketch.s, distance = 2 mm)
    output rib = { body = feature.body.body, part_number = "RB-40" }
}
runmat 0.7
std 1

part spoke {
    sketch s on origin.xy {
        l1 = line(start = [10 mm, -2 mm], end = [50 mm, -2 mm])
        l2 = line(start = [50 mm, -2 mm], end = [50 mm, 2 mm])
        l3 = line(start = [50 mm, 2 mm], end = [10 mm, 2 mm])
        l4 = line(start = [10 mm, 2 mm], end = [10 mm, -2 mm])
    }
    feature body = extrude(profile = sketch.s, distance = 3 mm)
    output spoke = { body = feature.body.body }
}
runmat 0.7
std 1

assembly frame {
    input pitch : length = 50 mm
    input rib_count : count = 6

    use part rib as rib
    use part spoke as spoke {
        placement = { placement = offset, offset = { translation = [0 mm, 100 mm, 0 mm] } }
    }

    pattern ribs = linear(seeds = [rib], direction = [1, 0, 0], spacing = input.pitch, count = input.rib_count)
    pattern spokes = circular(seeds = [spoke], axis_point = [0 mm, 100 mm, 0 mm], axis = [0, 0, 1], count = 8, angle = 360 deg)
    mirror ribs_far = {
        seeds = [ribs],
        plane = { plane = explicit, point = [0 mm, 50 mm, 0 mm], normal = [0, 1, 0] },
        hand = symmetric(point = [0 mm, 50 mm, 0 mm], normal = [0, 1, 0])
    }

    part_number = "FR-300"
}

Pattern layouts

pattern <name> = <layout>(seeds = […], …):

LayoutParametersCopies
lineardirection (a unit vector), spacing, countcount in all, spacing apart
gridfirst, first_spacing, first_count, second, second_spacing, second_counta two-way array
circularaxis_point, axis, count, anglecount equally spaced over angle
tablerows = [{ key, offset }]one copy per row, keyed by the row
follow_patternoccurrence, publishone copy per key of a hole pattern a part publishes, the seed on the first key
  • skip leaves keyed copies out, and when makes the pattern conditional on the assembly's options.
  • A follow pattern keeps fasteners on their holes: when the part's hole pattern gains a hole, the assembly gains a fastener at the new key.

Mirrors

mirror <name> = { seeds = […], plane = …, hand = … } reflects occurrences about a plane:

  • plane = { plane = explicit, point = […], normal = […] } gives the plane.
  • hand = symmetric(point, normal) places the seed's own design reflected, for a part that is its own mirror image about that plane (in the part's own coordinates).
  • hand = opposite(source, configuration, point, normal) places the opposite-hand design: source = { definition = { kind = part, name = <design> } } names it, configuration selects the member that is the seed's mirror image about the plane point, normal (in the part's own coordinates), and the BOM lists both part numbers. A part with a left- and a right-hand version usually carries the other hand as a configuration with its own part number:
mirror ribs_port = {
    seeds = [rib],
    plane = { plane = explicit, point = [0 mm, 0 mm, 0 mm], normal = [0, 1, 0] },
    hand = opposite(source = { definition = { kind = part, name = rib } }, configuration = { select = named, name = port }, point = [0 mm, 0 mm, 0 mm], normal = [0, 1, 0])
}

See Product families and configurations for a handed part built this way.

  • A seed may be a pattern of the same assembly. The mirror then reflects the pattern's seeds and every copy, keeping their keys and skips: rib@ribs_far[3] is the image of rib@ribs[3]. A copy reached twice, such as a seed listed directly and through its pattern, is an error that names both routes.

Fasteners

fasteners <name> = { … } lays out a fastener set along a path through a stack of occurrences, such as a riveted lap joint. The fastener's family is a part, found by name like any other design:

runmat 0.7
std 1

part hi_lok {
    input diameter : length = 4.8 mm
    input grip : length = 6 mm
    sketch s on origin.xy {
        c = circle(center = [0 mm, 0 mm], radius = input.diameter / 2)
    }
    feature shank = extrude(profile = sketch.s, distance = input.grip)
    output hi_lok = { body = feature.shank.body, part_number = "HL-4.8" }
}
fasteners lap0 = {
    layout = along(
        occurrence = [{ name = skin }],
        path = laps,
        chains = [lap0],
        spacing = { spacing = pitch, pitch = 21.6 mm },
        edge_distance = 2 * 4.8 mm,
        rows = [{ key = r0, offset = 0 mm }, { key = r1, offset = 25 mm }]
    ),
    fastener = {
        family = { kind = part, name = hi_lok },
        diameter = 4.8 mm,
        grip = { grip = auto }
    },
    stack = [[{ name = skin }], [{ name = stringer }]],
    exceptions = [
        {
            at = { at = station, station = 74.4 mm, chain = lap0, row = r0 },
            action = { action = oversize, delta = 0.4 mm }
        }
    ]
}
FieldMeaning
layoutWhere the fasteners go: along(…) a published path, with a spacing, an edge distance and rows.
fastenerThe family: a fastener part by name, with from = "<folder>" when it lives in another folder such as a shared library. The diameter, and the grip (auto reads it from the stack).
stackThe occurrences each fastener passes through, top to bottom.
exceptionsChanges at given stations: an oversize fastener, a skipped one.

The check reports a path that is missing or too short, an exception that matches no fastener or several, two fasteners with one key, and a stack no fastener in the family fits.

On this page
  • Pattern layouts
  • Mirrors
  • Fasteners