Expand description
PartView: a part as the viewport draws it, and picking elements of
it with a Pointer.
A part is drawn from its rasterization — sampled edges, triangulated faces, outlined sketches — and a pick tests against exactly that, never re-deriving geometry of its own, so a pick cannot disagree with what is on screen. The same goes for what the viewer draws besides the part: the datums are laid out here, by the sizes the viewer draws them with, and picked by the same rules.
Each crate draws its own targets into a view: the model its vertices,
edges and faces, the sketches theirs, the datums theirs; an editor
composes them. A pick names what it hits as the crate that drew it named
it (PickedElement) and by the kind of thing drawn (drawn), which
the crate defining an element turns into one (crate::selectable).
The parts placed in a part are drawn by reference: each placed part —
however deep — is listed once, with where it is (ViewInstance), and
drawn from its component’s own view, built once and shared by every
instance of it. Moving a placed part changes where it is, not what is
drawn. A pick moves the pointer into each placed part’s own frame and
names what it hits as that part names it, its target behind the
instance’s path (Located): /bolt:model.
Modules§
- drawn
- The kinds of what a view draws, as a pick names them
(
PickedElement::kind). - icons
- The icons of what several operations draw — the tools of a sketch and of
a 3-D sketch, the dimensions of a drawing, what a pattern repeats or a
blend rounds: SVG on a 20 × 20 grid, drawn in the current colour as a
front end draws every icon (see
crate::editable::OperationInfo::icon). - kept
- How a
PartViewis kept between processes (seegeop_core_program::kept): what a drawer drew of a part, and a placed part as drawn, read back instead of meshed again. Written exactly, so that what is picked in a view read back is what is picked in the view drawn. - lit
Lit: what of a drawn part a set of elements lights — the faces, edges, vertices, solids, sketches and datums a viewer draws lit for the highlights of acrate::editing::Presentation, or for what an answer or an item of the structure points at — andLighting, what of the part drawn and of each part placed in it is lit. The editor sends the lighting (crate::editor::Update::lit); a front end only draws it, so that every front end lights the same things.- picture
picture: a scene drawn into a PNG as the viewer draws it, and theCamerait is seen by, which also says where the pointer of a pixel goes (Camera::pointer): what is clicked in a picture is what the editor’s hit tests pick there, as for a click in a viewer.
Structs§
- Annotations
- What a step draws on the part besides its topology — cosmetic threads —
the value of its target
annotations. - Face
Mesh - A face triangulated, with the surface’s normal at each corner, and what it is known by: its key, a hash of what a viewer is sent of it — so a face drawn alike, in this part or another, is one mesh to a viewer.
- Frame
Pick - A frame picked (see
drawn::FRAME): what it is put on, and what of that it sits at — a corner or a side of a face, an end of an edge — each as a pick names it, of one target. Picked as one element of the kinddrawn::FRAME, namedon_kind/on_name, oron_kind/on_name|at_kind/at_name: no name has a/or a|. - Listed
- An entry of the part’s structure a step adds beside what every part has:
a mate, of kind
mate. - Listing
- The entries of the part’s structure a step adds: the value of its target
listing. - Part
View - A part as the viewport draws it, every element by name — and, serialized,
what a viewer draws. Each crate draws its own targets into it; then
PartView::finishmeasures it. - View
Annotation - Something drawn on the part besides its topology — a cosmetic thread — and what it is called.
- View
Curve - A curve of a sketch, as drawn, in the sketch’s plane, by the name its sketch gives it.
- View
Datum - A datum of the part. A frame’s axes and planes are picked on their own,
by the names its target gives them (
ViewDatum::components). - View
Edge - An edge of the part, as drawn: its curve sampled into a polyline.
- View
Face - A face of the part, as drawn: its name, and its triangles. Serialized,
the triangles are named by their key (
FaceMesh::key): a viewer is sent each mesh once (crate::editor::SceneState::meshes). - View
Instance - A part placed in the part drawn — directly or in a part placed in it — drawn as its part’s own view moved to where it is. Serialized, a viewer gets the part by its key and where to draw it.
- View
Sketch - A sketch of the part, as drawn: its plane, its closed regions (each an
outer loop and its holes), its curves and its points, in the plane’s
u/vcoordinates. - View
Sketch Point - A point of a sketch, as drawn, in the sketch’s plane, by the name its sketch gives it.
- View
Vertex - A vertex of the part, as drawn.
- Visible
- A part as drawn, but what the viewer was told not to draw: what is
seen, which a step editor picks in (see
Scene) — the part before the step, or what the step built, as the viewer shows it.
Constants§
- EMPTY_
EXTENT - How big an empty part’s drawing is: what a viewer frames, and its datum planes’ size, before anything is drawn. Lengths are millimetres, and the parts of a robot are 10 to 500 mm.
- FRAME
- How long a frame datum’s axes are, in reaches: it is drawn at a constant
size on screen, with its origin ball, its axes and the squares of its
planes laid out in fractions of that, in
PartView::pickas in the viewer. - RESOLUTION
- Samples per edge and per parametric direction of a face. A face’s grid is refined further where its own curvature asks for it, so this is the floor, not the ceiling.
Functions§
- annotations
- What the step
stepdraws on the part: defined by a step that draws something, and drawn for every step that does (annotations_of). - annotations_
of - Everything the steps
readersees draw on the part, step by step. - faces_
drawn - How many faces this thread has drawn (
FaceMesh::new) ever: what showing a part drawn before, with other sketches, must not do — so a test bounds it by counting these, not by timing it. - listed_
by_ steps - Every entry the steps
readersees add to the structure, step by step. - listing
- The entries of the part’s structure the step
stepadds. - parts_
drawn - How many parts this thread has drawn (
PartView::finish) ever. Drawing a part is what a pointer event must not do, so a test can bound the work an event does by counting these, rather than timing it. - triangles_
tested - How many triangles this thread has tested a pick’s ray against ever: what a hover must keep few, however many triangles the parts under the pointer have — so a test bounds it by counting these, not by timing it.