Skip to main content

Crate geop_ops_pattern

Crate geop_ops_pattern 

Source
Expand description

Repeating and moving bodies, as operations of a program (see geop_core_editor::part_operation::PartOperation):

  • LinearPattern: copies in a row along a direction, or in a grid along two.
  • CircularPattern: copies turned around an axis.
  • Pattern: copies wherever a list of frames puts them — along a curve, at points, from a table, filling a face, at holes (see geop_ops_model::spacing::Frames).
  • Mirror: a mirror image in a plane.
  • MoveBody: bodies, or a copy of them, turned and shifted.
  • ScaleBody: bodies scaled about a point, evenly or along each axis.
  • DeformBody: bodies tapered, twisted or bent about an axis.

The first four repeat bodies or features.

Each acts on solids, and on sheets — faces standing on their own — and keeps what it makes as new bodies, or combines it with a solid as an extrude does (geop_ops_model::Combine): joined to the bodies themselves, or cut from another solid. The copies are moved exactly as the bodies are (see geop_core_topology::Model::transform_body): every surface and curve by the same motion, each pcurve as it was.

§Patterning a feature

Patterns and mirrors also repeat features — a hole cut by an extrude, a boss joined to a plate, a tapped hole with its thread — picked by a face each made. A step only sees the part the steps before it built, never their arguments; what it sees of a feature is what the feature’s step recorded on the part as it combined its tools (see geop_ops_model::Feature), and a feature is picked by a face it made (Feature). A pattern copies those tools, moves them, and combines each copy with the solid the feature lies on as the feature combined it: why that, rather than running the step again, is said in features.rs.

§Spacing

Where instances go — in a row, each a step from the last or spread over an extent, round an axis, along a curve, at points, filling a face — is geop_ops_model::spacing’s, shared with every operation that lays out instances (a placed part’s copies, fasteners in holes, too).

Modules§

examples
The examples of patterns an editor offers: a plate drilled with a row of holes, one hole patterned; and two drawn in the editor, a turbine and a flange, each patterned round its axis.

Structs§

CircularPattern
Copies the bodies bodies — solids, and sheets by one of their faces — or does the features features again, turned around an axis: count instances, the bodies themselves the first, each Spacing::Step degrees from the last, or spread evenly over Spacing::Extent degrees — over a full turn of 360°, the last a step short of coming round onto the first again. Turning goes counter-clockwise looking against the axis, the other way if reversed.
CircularPatternArgs
DeformBody
Tapers, pinches, shears, twists or bends the bodies bodies — solids, and sheets by one of their faces — about the axis through origin along axis, over the zone from start to end along it (measured from origin): in place, every entity keeping its name. Before the zone a body stays where it is; past it, it is carried on as the zone’s end leaves it — turned rigidly by a twist or a bend, scaled across the axis by a taper or a pinch. A shear is affine: one map along the whole axis, so nothing is divided at the zone’s ends.
DeformBodyArgs
Direction
One direction of a row or a grid of instances.
Feature
What a step did by combining tools with a solid — a cut, a boss, a hole — as an element of the model: named by the step, and picked by a face it made (see FeatureFaces), lit as every face of it that is left. A feature of a part placed in the part is picked as one of that part, behind its instance.
LinearPattern
Copies the bodies bodies — solids, and sheets by one of their faces — or the features features in a row along a direction, or in a grid along two: count instances along each, the bodies or features themselves the first, each Spacing::Step from the last or spread evenly over Spacing::Extent.
LinearPatternArgs
Mirror
Mirrors the bodies bodies — solids, and sheets by one of their faces — or does the features features again mirrored, in a plane: a planar face, a datum plane, a frame’s plane. The mirror image is a valid body of its own, its faces turned around so that they face out again; the bodies themselves stay.
MirrorArgs
MoveBody
Moves the bodies bodies — solids, and sheets by one of their faces — turned by angle degrees about axis, if any (counter-clockwise looking against it), then shifted by translation. Moved, every entity keeps its name; with copy, the bodies stay and a moved copy of them is made, the copy of each entity named X named move(M,X) for the operation M.
MoveBodyArgs
Offset
One instance of a Frames::Table: how far it is from the seed along each axis — numbers, or formulas of the part’s parameters.
Pattern
Copies the bodies bodies — solids, and sheets by one of their faces — or does the features features again wherever frames puts them (see Frames): in a row or a grid, round an axis, along a curve, at points — the seed at the first, or where it is said to be — at the offsets of a table, filling a flat face on a grid, or at the holes features drilled. Linear and circular patterns are two of these, with a dialog of their own (crate::LinearPattern, crate::CircularPattern).
PatternArgs
ScaleBody
Scales the bodies bodies — solids, and sheets by one of their faces — about the point about by factors along the world’s x, y and z: in place, every entity keeping its name. Exact: a NURBS curve or surface scaled is its control points scaled, weights and parametrization kept, so every pcurve stays as it is. Unequal factors make a circle an ellipse — exactly, as a NURBS. A negative factor mirrors (an odd number of them turns every face around, so the normals still point out); a factor of zero is refused.
ScaleBodyArgs
Seeds
What a pattern repeats: bodies — kept as new bodies, or combined as combine says — or features, each copy combined as its feature was (see [crate::features]). Its fields are among those of the step’s arguments.

Enums§

Deform
How a DeformBody deforms: each about the axis, over the zone.
Frames
Where the instances of a pattern go (see the module’s docs).
PatternDirection
A direction to go along: a line — a straight edge, a datum axis or a frame’s, a sketch’s line — or a plane, along its normal: a flat face, a datum plane, a sketch’s plane.
PointsRef
Where something goes: a vertex, a datum point or a frame’s origin, a sketch’s point — or a sketch, standing for its points that no line, arc or spline runs through.
TurnAxis
An axis to turn about: a line — a straight edge, a datum axis or a frame’s, a sketch’s line — or what a round element turns around: a circular edge, a cylindrical or conical face, a sketch’s circle or arc.

Functions§

body
The body named name: a solid, or the sheet of the face of that name.
feature
The feature of the step step.
register
Adds what this crate offers an editor to r: patterns, mirrors and moved bodies.

Type Aliases§

BodyRef
A body of the part: a solid by its name, or a sheet by one of its faces’.
FeatureRef
A feature of the part, or of a part placed in it, by the step that made it.