Skip to content

Boundary First Flattening

Example

import mouette as M

mesh = M.mesh.load("path/to/mesh")
bff = M.parametrization.BoundaryFirstFlattening(mesh, bnd_scale_fctr=scale, verbose=True)
mesh = bff.run() # /!\ mesh is not modified in place

BoundaryFirstFlattening(mesh, bnd_scale_fctr=None, bnd_curvature=None, verbose=False, **kwargs)

Bases: BaseParametrization

Boundary First Flattening: A conformal flattening algorithm with control over the boundary conditions, either in terms of scale factor or curvature

References
  • [1] Boundary First Flattening, Rohan Sawhney and Keenan Crane, ACM ToG, 2017
Warning

This algorithm reorders the vertices so that boundary vertices are labeled [0, N-1] in order. Therefore, the uvs coordinates are not computed on the original mesh but on a reordered copy. Access the final result with self.mesh

Example

https://github.com/GCoiffier/mouette/blob/main/examples/parametrization/bff.py

Parameters:

Name Type Description Default
mesh SurfaceMesh

the input surface. Should be a triangulation of a topological disk.

required
bnd_scale_fctr Attribute

Scale factor on the boundary. Ignores values for interior vertices. Defaults to None. If provided, will automatically compute boundary curvature and ignore the bnd_curvaturea argument.

None
bnd_curvature Attribute

Geodesic curvature on the boundary. Ignores values for interior vertices. Defaults to None. If provided (and no bnd_scale_fctr is provided), will automatically compute boundary scale factors.

None
verbose bool

verbose mode. Defaults to False.

False

Other Parameters:

Name Type Description
save_on_corners bool

if True, stores the results on face corners instead of vertices. Defaults to True

use_cotan bool

if True, uses the cotan Laplacian instead of the connectivity Laplacian. Defaults to True.

hilbert_transform bool

if True, extends the boundary values with the Hilbert transform

Attributes:

Name Type Description
uvs Attribute

an attribute containing the uv-coordinates of the parametrization

Raises:

Type Description
Exception

if the mesh is not the triangulation of a topological disk

Note

If neither of bnd_scale_fctr and bnd_curvature are provided, the algorithm will run in default mode with scale factors = 0 on the boundary. Otherwise, provided scale factors have priority over provided curvatures.

flat_mesh property

A flat representation of the mesh where uv-coordinates are copied to xy.

Returns:

Name Type Description
SurfaceMesh SurfaceMesh

the flat mesh

run()

Run the algorithm

Raises:

Type Description
Exception

If the mesh is not a triangulation of a topological disk

Returns:

Name Type Description
SurfaceMesh SurfaceMesh

a copy of the original mesh with reordered vertices and computed uv-coordinates