Skip to main content

Module sketch

Module sketch 

Source
Expand description

Sketch documents, constraint solving, interaction state, and overlay geometry.

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::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
Screen-sized line-art glyphs for geometric constraints.
dimensions
Dimension leaders and labels for distance, point-line distance, angle, radius, and diameter constraints.
doc
Typed sketch JSON shared with the 2D constraint solver.
external_ref
Project solid edges into a sketch as fixed construction references.
handdraw
Recognize freehand strokes as lines, circles, arcs, or cubic Beziers.
infer
Infer coincidence or point-on-line constraints after a single-point drag.
session
A sketch’s solved document, plane, diagnostics, and interaction state.
solve
Solve wiring — call the kernel’s 2D constraint solver in-process.
spline
Insert spline anchors by de Casteljau subdivision without changing the curve.
tessellate
Tessellate solved sketch geometry into world-space overlay lines and points.
trim
Trim sketch geometry between sampled-polyline intersections around the click.

Structs§

PlaneFrame
An orthonormal placement frame for a sketch plane — origin + in-plane x/y axes + the z normal, all in world space (f64). A plane (u, v) coordinate maps to world origin + u·x + v·y (via to_world).

Functions§

ray_plane_uv
Intersect a world-space ray (origin + dir) with a sketch plane and return the hit’s in-plane (u, v) coordinate, or None when the ray is parallel to the plane (|dir·n| < 1e-9) or the hit is behind the ray origin (t <= 0).