Smooth subdivision surfaces (subdivide_surface)
meshioplusplus.subdivide_surface(mesh, scheme="loop", levels=1, ...) refines a surface by a smooth subdivision scheme: each level splits every face and moves the points towards the limit surface, so a coarse control mesh becomes a smooth one. It is the smooth sibling of refine, which splits cells in place without moving any point, and of subdivide, which builds polyhedra (roadmap 9.2).
import meshioplusplus as mp
coarse = mp.icosa_sphere(subdivisions=0)
smooth, report = mp.subdivide_surface(coarse, "loop", levels=3, return_report=True)
quads = mp.subdivide_surface(mp.box_surface(), "catmull_clark", levels=2)Schemes
| scheme | input | output | weights |
|---|---|---|---|
"loop" (Loop 1987) | triangles | triangles, 4 per triangle per level | Warren's β for interior vertices, 3/8–1/8 edge points |
"catmull_clark" (Catmull and Clark 1978) | triangles, quads, polygons | quads, one per face corner per level | face points, edge points and the (n−3)/n vertex rule |
Creases and boundaries
Hoppe et al. (1994) crease rules keep sharp features sharp. An edge whose dihedral angle exceeds crease_angle (degrees, default 60; 0 or less disables) is a crease, and with preserve_boundary=True (the default) every open boundary edge is one too: a crease edge point is the edge's midpoint, a vertex on exactly two crease edges moves along them with the 1/8–3/4–1/8 curve rule, and a corner (three or more crease edges, or a boundary vertex with two non-collinear neighbours) is pinned. The report counts num_crease_edges and num_boundary_edges.
Data
With interpolate_point_data=True (the default) every floating-point point_data array is carried through the same weights as the points, so a field stays as smooth as the surface; other arrays are dropped with a warning. record_parent_ids=True attaches Int64 subdivide:parent_cell, each output face's input face. Cell data, regions and field data are carried per parent.
Surfaces
C++ operations/subdivide_surface.hpp; Python subdivide_surface; C mio_subdivide_surface with mio_subdivide_surface_opts; Fortran mesh%subdivide_surface; Julia subdivide_surface; R mio_subdivide_surface; Octave/MATLAB mio.subdivide_surface; WASM subdivideSurface; both CLIs subdivide-surface; the pipeline step SubdivideSurface; the MCP tool subdivide_surface.