mesh_subdivide_doosabin

compas.datastructures.mesh_subdivide_doosabin(mesh, k=1, fixed=None)[source]

Subdivide a mesh following the doo-sabin scheme.

Parameters:
meshcompas.datastructures.Mesh

The mesh object that will be subdivided.

kint, optional

The number of levels of subdivision.

fixedlist[int], optional

A list of fixed vertices.

Returns:
compas.datastructures.Mesh

A new subdivided mesh.

Examples

>>> from compas.geometry import Box
>>> from compas.datastructures import Mesh
>>> box = Box.from_corner_corner_height([0.0, 0.0, 0.0], [1.0, 1.0, 0.0], 1.0)
>>> mesh = Mesh.from_shape(box)
>>> k = 2
>>> subd = mesh_subdivide_doosabin(mesh, k=k)
>>> mesh is subd
False
>>> type(mesh) is type(subd)
True