Expand description
Triangulating a face.
The second half of tessellation. A face is a trimmed region of a surface, so
the triangulation is built in the surface’s (u, v) parameter space (where
the region is an ordinary polygon with holes) and then lifted back into
space by evaluating the surface at each vertex.
§Why parameter space
Triangulating in 3D would mean deciding which side of a curved boundary a point falls on, in space, which is the point-in-solid problem. In parameter space the boundary is a closed 2D polygon and the question is a winding count. The surface does the rest.
The cost is that parameter space is distorted: equal steps in (u, v) cover
very different distances near a sphere’s pole than near its equator. So the
interior points are chosen by measuring deflection in space and the
triangulation is done in parameter space: measuring where the answer
matters, connecting where it is easy.
§Watertightness
A face’s boundary points come from discretizing the edge’s 3D curve and evaluating the pcurve at those same parameters. Two faces sharing an edge therefore place their boundary vertices at identical spatial positions, and the join has no gap. Discretizing each face’s pcurve independently would give each face its own idea of where the edge runs, and the seams would show.
Functions§
- edge_
chords_ for - The chords the faces below
shapeagree to draw their shared edges to. - face_
boundary - A face’s trimming boundary, in its surface’s parameter space.
- inside_
boundary - Whether a point in parameter space lies inside the region
ringsbound. - inside_
boundary_ with - As
inside_boundary, with the predicate implementation named. - polyline_
of_ edge - Discretize an edge into a polyline in space, for display or coarse queries.
- triangle_
normal - The unit normal of a triangle, or
Noneif it is degenerate. - triangulate
- Triangulate every face below a shape, welded into one mesh.
- triangulate_
face - Triangulate one face.
- triangulate_
face_ with - As
triangulate_face, with the edge chords the shape agreed on (the answer ofedge_chords_for), so the face’s boundary matches its neighbours’ point for point along every edge the map names.
Type Aliases§
- Edge
Chords - The rings bounding a face in parameter space, and whether every boundary
edge met its deflection.
Boundary rings with, per ring vertex, the 3D anchor its edge’s own curve
provides;
Nonewhere an edge has no 3D curve to defer to. The chord each edge must be drawn with, where the caller’s is too coarse.