Skip to main content

Module sketch

Module sketch 

Source
Expand description

2D sketch data model: points, entities (lines, circles, arcs), and constraints, plus closed-profile extraction for the CSG backends.

A sketch lives in its node’s local XZ plane: sketch coordinates (x, y) map to local (x, 0, y), matching how the mesh backends evaluate 2D primitives. Constraint solving lives in the rscad-sketch crate (it needs std + ezpz); this module only stores the data and derives closed profile loops from it.

Structs§

Profile
Closed profile loops extracted from a sketch, ready for the CSG backends.
SketchData
A 2D sketch: points, entities, and the constraints between them.
SketchEntity
SketchIntersection
An intersection between two entities, as found by SketchData::nearest_intersection.
SketchPoint
A free point in sketch coordinates.

Enums§

SketchConstraint
Geometric constraints between sketch points and entities.
SketchEntityKind
Geometry carried by a sketch entity.

Constants§

DEFAULT_ARC_SEGMENTS
Default tessellation density (segments per full circle) used when a consumer has no better setting.

Functions§

profile_loops
Extract closed loops from the sketch’s lines and arcs (chained through shared or Coincident endpoints) plus standalone circles.
signed_area
Signed loop area (positive = counter-clockwise = outer boundary after profile_loops normalization).

Type Aliases§

SketchId
Stable identifier for sketch points and entities (one shared id space).