Skip to main content

Module profile

Module profile 

Source
Expand description

Turning a solved sketch into profiles: closed loops of curves grouped into regions (an outer loop with its holes), and those loops into the NURBS curves that extrude and revolve consume.

Connectivity is structural. Two curves are joined exactly when they share an endpoint (the same point, or points joined by crate::Constraint::Coincident) — never because their ends happen to be close. Curves hanging off a loop (open chains, e.g. a helper line) are ignored; curves that branch (three or more meeting at a point) are an error, since the regions they bound are ambiguous.

Nesting and orientation are answered on the real curves. Which loop lies inside which comes from casting a ray and counting crossings with the kernel’s own curve_curve_intersect — the same thing geop_core_topology::contains::face::loops_contain does for a face’s trim, on the same NURBS curves the profile is made of — and which way a loop winds from its signed area, integrated from those curves (loop_signed_area). Polylines are sampled from them too, for drawing.

Structs§

Chain
Curves joined end to end, in order (see Sketch::chain).
Piece
One NURBS piece curve of a chain of a sketch’s curves — a profile loop, or a 3-D sketch’s path — and where it comes from in the sketch: piece index of sketch curve source (counted in the curve’s own direction), running from joint start to joint end in the chain’s direction.
ProfileEdge
One curve of a loop, traversed forwards or backwards — of a text, one of its contours.
ProfileLoop
A closed chain of curves, each ending where the next starts.
Region
An area of the sketch: an outer loop (counter-clockwise) and the holes in it (clockwise).

Enums§

ProfileJoint
Where a joint of a profile comes from in the sketch: a sketch point, or a point a sketch curve had to be split at to become NURBS pieces (see ProfileLoop::to_nurbs) — Split { curve, index } is where piece index of curve starts, counted in the curve’s own direction. A circle has no points of its own, so all of its joints are splits, index = 0 included.
Shape
What a sketch draws to sweep: the areas its curves enclose — one, or several apart, as the letters of a text are — or, for a sweep into a sheet only, the one open chain they form, enclosing nothing.

Functions§

curve_nurbs
One sketch curve as NURBS pieces from its start to its end, built from geometry — how many pieces, from the sketch as drawn, which is design data, so the pieces and their names do not depend on how precisely the geometry is known. A text’s are its contours’ pieces, one contour after the other (see text_contours).
curve_polyline
Points along a curve as drawn, from its start to its end (a circle starts and ends at angle 0) — sampled from its NURBS pieces, dense enough for drawing. A text is no one line: it is drawn contour by contour (see curve_polylines).
curve_polylines
The lines a curve is drawn as: a text one for each contour of its glyphs, closed, any other curve its one line (see curve_polyline).
text_contours
The contours of the text curve, built from geometry: each a loop of NURBS pieces (see text::place).

Type Aliases§

ProfilePiece
A piece of a planar sketch’s profile loop.