Expand description
A B-rep solid from a triangle mesh.
A mesh already says which triangles meet along which edges: once its repeated vertices are welded, two triangles that share two vertices share an edge. So the topology is built from that connectivity directly (one vertex per mesh vertex, one edge per mesh edge), and no geometric sewing search is needed, which is what keeps a mesh of hundreds of thousands of triangles cheap to convert.
Adjacent triangles that lie in one plane merge into one planar face, bounded by the region’s outer loop and its holes, and a run of boundary segments along one straight line between the same two faces becomes one edge: a cube’s twelve triangles become six faces and twelve edges, and the faces take fillets and chamfers as a modelled box’s do.
Curved regions are recognized: triangles across which the surface turns smoothly are grown into regions for as long as their vertices lie on one cylinder, cone, sphere or torus, verified at the stated tolerance, and the region is rebuilt on that surface. Its boundary with each neighbour is placed on the surface exactly (a parallel circle or a ruling of it), so a meshed bore comes back as a cylinder between two circles, and a band all the way round its axis gets a seam as a modelled one has. A sphere or torus with no boundary is one face, a sphere bounded by one circle a cap, and a band round a torus’s tube runs between two of its meridians. A region whose boundary is no such curve, or that nothing canonical fits, stays faceted.
Windings are made consistent across each connected piece and turned outward. A mesh that does not close (a hole, an edge three triangles share, a piece that cannot be oriented) does not fail: it comes back as open shells, with the report saying why.
Structs§
- FitConstraints
- What a fit holds fixed.
- Mesh
Region - One region as found: its triangles, the surface they are built on, and the regions beside it.
- Mesh
Regions - The regions of a mesh, found and not yet built.
- Mesh
Solid - The result of
solid_from_mesh. - Mesh
Solid Options - How
solid_from_meshbuilds. - Mesh
Solid Report - What
solid_from_meshdid, and where the mesh does not close. - Region
Fallback - A curved region the build faceted, and why: see
MeshSolidReport::fallbacks. - Region
Id - Names one region of a
MeshRegions. A merge keeps the first region’s name and retires the second’s; a split keeps the name for one piece and gives the other a new one.
Enums§
- Fallback
Reason - Why a curved region was built as facets instead of on its surface.
- Region
Refusal - Why a step on the regions was refused. The regions are unchanged.
- Surface
Kind - A kind of surface to fit to a region with
MeshRegions::fit.
Functions§
- refine_
solid - Rebuild a solid’s faceted stretches on the surfaces they approximate.
- single_
precision_ quantum - How far single-precision storage may have moved a mesh’s vertices: half
the spacing of
f32values at its largest coordinate on each axis, over the three axes at once. The quantum of a mesh that went throughf32(a render mesh, a binary STL), forMeshSolidOptions::quantum. - solid_
from_ mesh - Build a B-rep from a triangle mesh.