Skip to main content

Crate geop_ops_rasterize

Crate geop_ops_rasterize 

Source
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§

RasterizedModel
A Model rasterized 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’s pub API several other crates (geop-cad-base::pick, this module’s own rasterize_model) call by name.
rasterize_model
Rasterize model into a PrimitiveScene: points (one per vertex), lines (one per edge), and triangles (one mesh per face, n samples 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 model into a RasterizedModel. n is 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, but face_color picks each face’s color directly (by FaceId) 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 — see super::rasterize_model): every vertex, edge, coedge and face, each labelled with its id, n samples per curve/coedge.