mesh_remesh

compas_cgal.meshing.mesh_remesh(mesh, target_edge_length, number_of_iterations=10, do_project=True)

Remeshing of a triangle mesh.

Parameters:
meshcompas_cgal.types.VerticesFaces

The mesh to remesh.

target_edge_lengthfloat

The target edge length.

number_of_iterationsint, optional

Number of remeshing iterations.

do_projectbool, optional

If True, reproject vertices onto the input surface when they are created or displaced.

Returns:
compas_cgal.types.VerticesFacesNumpy

Notes

This remeshing function only constrains the edges on the boundary of the mesh. Protecting specific features or edges is not implemented yet.

Examples

>>> from compas.geometry import Sphere, Polyhedron
>>> from compas_cgal.meshing import mesh_remesh
>>> sphere = Sphere(0.5, point=[1, 1, 1])
>>> mesh = sphere.to_vertices_and_faces(u=32, v=32, triangulated=True)
>>> V, F = mesh_remesh(mesh, 1.0)
>>> shape = Polyhedron(V.tolist(), F.tolist())