catmull_clark

compas_cgal.subdivision.catmull_clark(mesh, k=1)[source]

Subdivide a mesh withe the Catmull Clark scheme.

Parameters
  • mesh (tuple[Sequence[[float, float, float] | Point], Sequence[[int, int, int]]]) – The mesh to remesh.

  • k (int, optional) – The number of subdivision steps.

Returns

  • NDArray[(Any, 3), np.float64] – The vertices of the subdivided mesh.

  • NDArray[(Any, 4), np.int32] – The faces of the subdivided mesh.

Examples

>>> from compas.geometry import Box, Polyhedron
>>> from compas_cgal.subdivision import catmull_clark
>>> box = Box.from_width_height_depth(1, 1, 1)
>>> mesh = box.to_vertices_and_faces()
>>> result = catmull_clark(mesh, k=3)
>>> shape = Polyhedron(*result)