Expand description
The engine-native 3D SKETCH editor’s session: the solved document, its diagnostics, the interaction state (selection, hover, armed tool, working plane), screen-space picking and the overlay tessellation.
The planar sketcher (crate::sketch) lives in a plane’s (u, v) frame
and hit-tests there. A 3D sketch has no such frame: its points are world
points, so picking is done in SCREEN space (every point and polyline
sample projected through the live camera, distances measured in pixels)
and a click lands in 3D through the WORKING PLANE — one of the three world
planes through the sketch’s current anchor (the last placed point) — or on
model geometry under the cursor (see EngineState::sketch3d_cursor_world).
The document and the solver are the kernel’s (brep_kernel::Sketch3dDoc,
brep_kernel::solve_sketch3d_doc); the feature (S3D) solves the same
document on every regenerate, so what the editor shows is what the model
gets.
Structs§
- Applicable
Constraint - A constraint the palette can add for the current selection: the type and the ordered point ids it would take.
- Sketch3d
Constraint - A 3D sketch constraint, kept as a transparent map so authoring metadata (expression text, label offsets) persists exactly.
- Sketch3d
Diagnostics - The solver’s read-only diagnostics: the same shape the 2D sketch solver
publishes (
dof,rank,unknowns,equations,redundant,status,conflicting,conflictingConstraints,pointMobility,geometryMobility), so the editor’s readouts are shared. - Sketch3d
DimLabel - One dimension label the app draws as editable text at a projected world
anchor — the 3D sibling of
crate::sketch::dimensions::DimLabel, in the same JSON shape so the app’s label pass draws both. - Sketch3d
Doc - The editable 3D sketch document.
- Sketch3d
Geometry - A 3D sketch geometry (see the module doc for the point layouts).
- Sketch3d
Point - A 3D sketch point: world coordinates plus the role flags the solver tracks.
- Sketch3d
Session - State for one active 3D sketch.
- Work
Plane - The working plane: one of the three world planes through an anchor.
Constants§
- OVERLAY_
GEOMETRY - The
set_overlaygroup names. Separate from the planar sketch’s so the two editors never clear each other’s groups. - OVERLAY_
GLYPHS - Every group, for a clear.
- OVERLAY_
GROUPS - OVERLAY_
POINTS - OVERLAY_
PREVIEW - OVERLAY_
WORKPLANE - SKETC
H3D_ CONSTRAINT_ TYPES - The constraint vocabulary. Point layouts: a LINE is its two endpoints
[a0, a1](directiona1 − a0); a PLANE is[origin, normalTip](normalnormalTip − origin); an ARC is[center, start, end]. - TOOLS
- The draw tools the 3D editor arms (
selectis the neutral state, stored asNone). - WORK_
PLANES - The three working planes, by name.
Functions§
- entity_
constraint_ ref - entity_
geometry_ ref - entity_
point_ ref - plane_
frame_ of - The frame of a reference plane
[origin, normalTip]. - project
- Project a world point to CSS pixels,
Nonewhen behind the eye. - sample_
arc - The minor arc from
starttoendaboutcenter, sampled;Nonewhen the three points are collinear or the radius is zero. - sample_
bezier - A cubic bezier chain (
3n+1controls), sampled per span.