Expand description
Engine-native sketch mode — S0 (data model + solver plumbing + read-only
display). See docs/developer/sketch-mode-rust-plan.md.
This module is the foundation the interactive slices (S1 enter/exit, S2 picking, S3 tools, S4 constraints, S5 dimensions) build on. S0 provides:
doc—SketchDoc, the typed serde mirror of the solver’s{points, geometries, constraints}(+SketchDiagnostics).solve— a direct in-process call to the kernel’s 2D constraint solver (brep_kernel::solve_sketch) for solved coordinates + DOF/mobility.tessellate— a port of the previous sketcher’s overlay-refresh pass: solved geometry → world-space overlay lines/points colored by mobility.session—SketchSession, the{doc, plane, diagnostics}holder (with stubs for the interaction state later slices own).
The engine displays a session read-only via
crate::engine_state::EngineState::set_sketch_overlay.
Re-exports§
pub use doc::SketchConstraint;pub use doc::SketchDiagnostics;pub use doc::SketchDoc;pub use doc::SketchGeometry;pub use doc::SketchPoint;pub use external_ref::classify_uv;pub use external_ref::EdgeLink;pub use external_ref::ExternalRef;pub use session::constraint_ref;pub use session::entity_ref_eq;pub use session::geometry_ref;pub use session::point_ref;pub use session::refs_equal;pub use session::SketchSession;pub use solve::SketchSolverSettings;pub use tessellate::SketchTessellation;
Modules§
- constraint_
glyphs - Geometric-constraint glyphs (S6c) — small, screen-constant line-art marks drawn on the sketch overlay next to the geometry a NON-dimensional constraint acts on.
- dimensions
- Dimension leaders + labels (S5) — a port of the previous sketcher’s dimension rendering.
- doc
SketchDoc— the engine-native mirror of the 2D solver’s sketch JSON.- external_
ref - External-reference edges (S6b-2) — link a picked 3D solid edge into the sketch as a construction reference.
- handdraw
- Freehand (handdraw) recognition (S6b-3) — turn a raw hand-drawn stroke into a clean sketch primitive.
- infer
- Drop-time constraint inference (S6c) — the previous sketcher’s coincident-on-drop / point-on-line-on-drop pair.
- session
SketchSession— the in-flight editing/display state for one sketch.- solve
- Solve wiring — call the kernel’s 2D constraint solver in-process.
- spline
- Spline anchor insertion (S3) — refine an existing spline by subdividing it.
- tessellate
- Overlay tessellation — a port of the previous sketcher’s overlay refresh.
- trim
- Sketch trim tool (S6b) — a faithful port of the previous sketcher’s trim-geometry family.
Structs§
- Plane
Frame - An orthonormal placement frame for a sketch plane — origin + in-plane
x/yaxes + theznormal, all in world space (f64). A plane(u, v)coordinate maps to worldorigin + u·x + v·y(viato_world).
Functions§
- ray_
plane_ uv - Intersect a world-space ray (
origin+dir) with a sketchplaneand return the hit’s in-plane(u, v)coordinate, orNonewhen the ray is parallel to the plane (|dir·n| < 1e-9) or the hit is behind the ray origin (t <= 0).