Expand description
The vocabulary every operation shares: every target a step of one
operation reads of another, the references into it, and how it is
drawn. An operation crate depends on core/, lib/ and this crate
alone, so what one operation reads of another lives here, and the
operation that produces it keeps only its arguments, form and editor.
A part’s topology: the one NamedModel its steps build, revised by
each in turn (model) — every vertex, edge, face and solid with a
stable name (Namer), and the features the steps made — and the
kinds of element a step refers to in it (elements): vertices,
edges, faces, solids, each picked as a dialog asks for it — and what
they are used as (geometry): points, lines, planes, circles,
curves, bodies. A step that builds into the model is a
ModelOperation; one that builds a tool says how it meets the solid
it is for with a Combine, and how far it goes with an Extent.
The other targets of a part: its sketches (sketch) and 3-D sketches
(sketch3d), its datums (datums), its parameters and properties
(parameters), the parts placed in it with their solids and bill of
materials (placed); and what every operation picks and lays out
alike: any element of the part (selection), an element of a placed
part with its frame (mate_entity), instances in a row (spacing).
§Topological naming
A name says how an entity came to be, never when: it is built only
from inputs that stay the same when a part is rebuilt after an edit
upstream — operation ids, sketch element ids, the names of the entities
an operation consumed, and positions counted along those. Never from an
internal id or the order in which an algorithm happened to create
things. So a program that refers to extrude(box,end) keeps meaning the
same face when the box gets taller, and names are stable text that diffs
well.
Every name has the form kind(operation,arg,...) (see Namer):
kind is the operation that created the entity, operation the id of
the program step that ran it, and the arguments identify the entity
within that step. Operation ids are restricted to
validate_operation_id’s
alphabet, so the arguments of a name — which
may themselves be names — can always be told apart.
Re-exports§
pub use curves::Chain;pub use curves::ChainCurve;pub use curves::Profile;pub use elements::ChainElement;pub use elements::Edge;pub use elements::EdgeChain;pub use elements::Face;pub use elements::ModelElement;pub use elements::Solid;pub use elements::Vertex;pub use elements::read_model;pub use geometry::Body;pub use geometry::Circle;pub use geometry::Curve;pub use geometry::Line;pub use geometry::Path;pub use geometry::PathRef;pub use geometry::Plane;pub use geometry::Point;pub use geometry::Round;pub use geometry::frame_along;pub use geometry::resolve_bodies;pub use notes::CutWire;pub use notes::SolidNote;pub use notes::SolidNotes;pub use notes::notes_of;pub use notes::solid_notes;pub use records::Records;pub use threads::CosmeticThread;pub use threads::Threads;pub use threads::draw_threads;pub use threads::read_threads;pub use threads::threads;
Modules§
- curves
Chain: curves each on[0, 1]and starting where the one before ends, with a stable name for every curve and every joint — what a profile, a path, a rail or a guide is, however it was drawn or picked.- datums
- A part’s datums: reference geometry it is built with, not of — a
point, an axis, a plane or a frame, by name — in the one target
datums, which the steps that add datums revise (Datums). Every part also hasORIGIN, the world’s origin and axes, which no step adds. - elements
- The kinds of element a step refers to in the part’s model (
model): aVertex, anEdge, aFace, aSolid— each anElementReferenceinto the model by its stable name — anEdgeChain, the tangent chain of edges through an edge, and the model itself, read whole. Each says how a dialog picks it (SelectableElement): a vertex, an edge or a face as itself, a solid by a face of it, an edge chain by an edge of it. - geometry
- Geometric kinds of element: what an entity can be used as — a
Point, aLine, aPlane, somethingRound, aCircle, aCurve— whatever target it is in. The model has them where its entities have that shape: a straight edge is a line, a flat face a plane, a circular edge a circle and something round. Other targets — the datums, a sketch, a placed part — have them too, each in its own crate, and an operation that takes several of them holds one of them (geop_core_editor::one_of!). - mate_
entity MateEntity: what a mate holds by — an element of the part itself, or of a part placed in it, however deep — and the reference frame it gives where it is put (MateEntity::frame): where it sits, and which way itszaxis runs.- notes
- What a step says of a solid it built beyond its shape, kept as the
part’s target
solid_notes: a solid only drawn, which is no body (a harness’ swept bundle), the thickness of a sheet-metal body, the wires ordered in a bundle’s place. Whoever weighs, checks or orders a part reads them here, knowing no step that writes them. - parameters
- What a part says of itself besides its shape: the parameters its design
is given by (
definition) — numbers, and the tables a part family looks its size up in — and its properties — title, designation, colour, material — as steps of its program producing targets (steps), set by a program placing it through the run’s inputs (Settings), and read and set in a program (program); where the parts of its instances are placed by it (instance); the configurations of a design (configurations); and the files a field picks from (files). - placed
- Parts placed in a part: the part another program file builds, placed
as a node of the part placing it (see
geop_core_program::placed) by the step that places it, and drawn as a part is drawn (Drawn) — read here, wherever they are placed (placed_parts,locate), with their solids (solids), the bill of materials they make (bom), where an exploded view draws them (explode) and the motions that drive their joints (motion). - records
Records: what a part records of some of its entities besides their shape, by name — the cable a solid is swept from, the sheet a sheet-metal body is bent from — as the value of a target the steps that make them revise.- selection
- One element of a part, picked in the viewport, whatever it is
(
Selected) — a vertex, an edge, a face, a datum, a sketch’s point or curve — and what it can be used as (Shape,Role): a point, a line, a plane, a curve, a circle, something round. What a datum is built from, what a mate holds by, what is measured: a crate that lets the user pick any element of a part reads the pick throughSelectedrather than naming each kind of element itself. - sketch
- The sketch target:
PlacedSketch, a sketch and the plane it was placed on (SketchPlane) — the value of a sketch’s target (sketch) — and what it is to the steps that build on it: as a whole, its profile or a path (PlacedSketch,Path), its plane (Plane), and its points and curves, as what they are (Point,Line,Circle,Round,Curve). It is drawn into the viewport as itself (PlacedSketch::draw), and each of those is picked from what is drawn of it. - sketch3d
- The 3-D sketch target:
PlacedSketch3d, a 3-D sketch as a part holds it — the value of its target (sketch3d) — and what it is to the steps that build on it: a path as a whole (Path), picked by an edge of the wire it is built as. And what of the part a 3-D sketch is given: a point (PointSource), a curve (CurveSource), a line to run along (LineSource). The step that draws one isgeop_ops_sketch3d’s. - spacing
- Where the instances of a pattern go — the bodies or features of a
pattern, the copies of a placed part, fasteners in holes — and the
fields that set it:
Frames, every way of laying instances out, each the motions from the seed to its instances;Spacing, theRowof instances in a line or round an axis, and the count (count_field,whole_count); what they are laid out along, round or at (references); and where a part’s holes are (holes). - tangent
TangentChain: a tangent chain of edges — edges running on into one another between faces tangent across every vertex of it, as one smooth edge — found from any edge of it (tangent_chain), and theLinks it is made of: each edge the way the chain runs along it, with the faces either side.- testing
- What the tests of the operations share about the model: checking it
valid and drawn as its trims say, finding its entities by where they
are, the model an editor shows, building a part of a model given and
steps run on it one by one, and the model a program builds. Only built
for tests: with
testing, or in this crate’s own. - threads
- Cosmetic threads: threads recorded on a round face rather than modelled
— what a drawing, a bill of materials or a fastener check reads, and
what the viewer draws as a helix on the face. Held as the part’s target
threads, and drawn as theannotationsof the step that recorded them (draw_threads).
Structs§
- Body
Names - The names
NamedModel::build_bodygives what it builds: one per vertex, edge and face of theBodySpec, index for index, and the solid’s, if it builds one. - Edge
Description - Face
Description - A face’s boundary loops, each as the coedges it runs through:
+E/-Efor edgeEtraversed forwards / backwards,@Vfor a degenerate coedge sitting at vertexV(a pole). - Feature
- What one step did by combining tools with a solid: each tool, in the order it was combined.
- Feature
Element - 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. - Feature
Faces - Which feature made a face (see
NamedModel::feature_faces). - Feature
Tool - One tool of a
Feature: the solid as its step built it, before it was combined — its geometry and the names of its entities — and how it was combined with the solid it was combined with. - Model
Drawer - Draws a part’s model, as the target
model, and lists its solids and the faces standing on their own, of no solid. Its faces are meshed by oneRasterizer: a part drawn with only some faces changed — the part before a step opened — meshes those again, not all. - Name
Registry - A two-way
RefId <-> Stringmapping. Every entity asuper::NamedModelexposes — a vertex, edge, face or solid — has exactly one live entry here for as long as it exists. Its maps share their structure with their copies, as the topology’s do. - Named
Model - A part’s boundary-representation topology and the name of every vertex,
edge, face and solid in it: what the steps of a program build, one
revision each (see
model). - Namer
- Builds the names one run of one operation gives to what it creates:
kind(operation,arg,...), see the crate docs. - Part
Description - Everything about a part’s topology that its names can express, and the positions of its vertices — with no internal id anywhere, so two parts built by the same program describe identically however their ids came out, and a description diffs well as text. Loops start at their smallest entry and holes are sorted, since neither has a first element of its own.
- Tool
- One solid an extrude or revolve built, for
geop_lib_booleans::combine_toolsto combine: the whole of it, or, with anup_to_nextreach, only up to the next face of the target. - Tool
Reach - How far a tool reaches when it is combined, and how what its
combination creates is named: what, besides the
BooleanOp, a step combines a tool by, and aFeaturerecords.
Enums§
- Boolean
Op - Which boolean to perform.
- Combine
- What an extrude or revolve does with the solid it builds: keep it as a
new body, or combine it by
opwith the solid namedtarget— which that consumes, as a boolean step does. ABooleanOp::Differencecuts the new solid out of the target: an extruded pocket, a drilled hole. - End
- Where a side ends: an
Extent, its length evaluated. - Extent
- How far one side of a tool goes: a length — an angle, in degrees, for a
revolve — plain or a formula of the part’s parameters, or as far as the
solid it is combined with: up to its next face, or through all of it.
Serialized as
{"blind": 20.0},{"blind": {"formula": "height - 2"}},"up_to_next"or"through_all". - RefId
- Every kind of entity a
super::NamedModelnames: the topology entities a user can pick in isolation (a coedge or shell never is).
Constants§
- LONGEST_
ARGUMENT - The longest argument a name spells out (see
Namer::name). - STL_
QUALITY - How finely an STL file’s curved faces are meshed unless asked otherwise: as finely as the editor draws them.
Traits§
- Model
Operation - A kind of step that builds into the part’s model: an extrude, a
boolean, a fillet. Its run is
build_model.
Functions§
- build_
model - Produces the step’s node of the model, a chain:
Obuildingargsinto the model as the steps before left it, or into an empty one, before the first step that builds any. What fails is said in the context of the step and its arguments. - digest
- A long argument of a name, as the name spells it:
#and 32 hex digits, its digest (geop_core_program::cache::digest). A hash rather than a counter, so that a name still depends only on what the entity was made from, and one that does not change between Rust versions, so that a saved program’s names keep meaning the same entities. - element
- The element
nameof the model, of the kindK: what a step’s arguments refer to it by. - face_
hull - Points whose convex hull holds
faces: the control points of their surfaces, each restricted to the box in(u, v)around its face’s outer loop — a NURBS surface lies within the hull of its control points, and a face within the box around its outer loop — enclosed, for sizing a tool that has to reach past them, and for telling which side of a line they lie on, which for a solid touching the line is decided by their enclosures, not by their midpoints. - feature
- The feature of the step
step. - hull
- Points whose convex hull holds the solids named
targets(seeface_hull). None for no solids. - model
- The model a part’s steps build: defined by the first that builds any topology, revised by every later one.
- operation_
of - The id of the step that named the entity
name(seeNamer):Eforextrude(E,end). None for a name no step built. - origin_
of - What the entity named
namewas split off (seeNamer::piece): the first of the names among its arguments — an argument that is a name itself,kind(...), or a long one’sdigest. None, if it has none. - reach_
past - How far along
plane’s normal — forwards forsign = 1, backwards for-1— reaches past everything of the solid whose convex hullhullspans: a side going up to its next face has to be built at least that long to meet whichever face that is. - register
- Adds what the model offers an editor to
r: the part’s model drawn, and its solids and faces listed (ModelDrawer); its datums drawn and listed (datums::DatumsDrawer); its sketches drawn and listed (sketch::SketchDrawer); the steps defining its parameters, tables and properties, and the part drawn in its colour (seeparameters), and the panel switching its configurations (parameters::ConfigurationsPanel). - solid
- The solid named
name. - spread_
along - How far along
plane’s normal the nearest and the furthest ofpointslie from it. - stl_
bytes trianglesas an STL file calledname, each facing out (seeoutward).
Type Aliases§
- Feature
Ref - A feature of the part, or of a part placed in it, by the step that made it.
- Solid
Meshes - Solids, each by name with its triangles.
- Solid
Ref - A solid of the part, by name.