Expand description
Turn a Model into a renderable PrimitiveScene: one triangle mesh
(faces), line list (edges), and point list (vertices).
Every face — trimmed or not — has its outer boundary (and any holes)
sampled from their pcurves into (u, v) polygons, then triangulated by
[grid::triangulate_face]: a curvature-sized (u, v) grid with every
cell clipped exactly against the trim (see that module’s doc comment),
so a flat patch renders as a couple of triangles and a curved one gets
whatever resolution its own curvature actually needs — mapped through
surface.evaluate, the rendered mesh always both respects the face’s
real trim and follows its true curvature.
Modules§
- polygon_
triangulate - 2-D ear-clipping triangulation of a simple polygon with holes.
- stl
- STL export: a
RasterizedModel’s faces as a triangle mesh file.
Structs§
- Rasterized
Model - A
Modelrasterized once, with every sampled point/polyline/triangle kept alongside the id of the entity it came from.
Functions§
- face_
triangles_ uv - Triangulate
face’s trimmed region in(u, v)space — see [grid::triangulate_face] for the actual (curvature-sized grid, clipped to the trim) algorithm; this just forwards to it. Kept as its own name/doc entry point since it’spubAPI several other crates (geop-cad-base::pick, this module’s ownrasterize_model) call by name. - rasterize_
model - Rasterize
modelinto aPrimitiveScene:points(one per vertex),lines(one per edge), andtriangles(one mesh per face,nsamples per parametric direction / edge_loop segment). Untrimmed (no-hole) faces are drawn in blue, holed faces in olive. - rasterize_
model_ tagged - Sample every vertex/edge/face of
modelinto aRasterizedModel.nis a quality: how finely a curve or surface that actually curves is approximated (see [sample_curve] and [grid::triangulate_face]), not a fixed sample count — a straight edge or flat face stays cheap. - rasterize_
model_ wireframe - Like
rasterize_model, but draws each face as a wireframe of its triangulation instead of filled/shaded triangles — useful when overlaying traced intersection curves on top of the faces, since a solid mesh can occlude or visually blend with the curves. - rasterize_
model_ with_ face_ color - Like
rasterize_model, butface_colorpicks each face’s color directly (byFaceId) instead of the default blue/olive untrimmed/holed convention — e.g. coloring by which solid a face belongs to, regardless of whether that face happens to have a hole. - rasterize_
topology - Rasterize
model’s raw topology (as opposed to just its final shape — seesuper::rasterize_model): every vertex, edge, coedge and face, each labelled with its id,nsamples per curve/coedge.