map_mesh

map_mesh(target_mesh, pattern_mesh, clip_boundaries=True, simplify_borders=True, fixed_vertices=None, tolerance=1e-06)[source]

Map a 2D pattern mesh onto a 3D target.

Parameters:
target_meshtuple[list[list[float]], list[list[int]]]

A tuple of (vertices, faces) representing the target mesh.

pattern_meshtuple[list[list[float]], list[list[int]]]

A tuple of (vertices, faces) representing the pattern mesh.

clip_boundariesbool, optional

Whether to clip the pattern mesh to the boundaries of the target mesh. Default is True.

simplify_bordersbool, optional

Whether to simplify the border of the pattern mesh. Default is True.

fixed_verticeslist[list[float]], optional

A list of fixed points on the target mesh. Default is None.

tolerancefloat, optional

The tolerance for point comparison, to remove duplicates. Default is 1e-6.

Returns:
tuple[np.array, list[list[int]], np.array, list[bool], list[int]]

A tuple containing:

  • vertices: np.array - The 3D coordinates of the mapped mesh vertices

  • faces: list[list[int]] - The faces of the mapped mesh

  • normals: np.array - The normal vectors at each vertex

  • boundary_flags: list[bool] - Boolean flags indicating if vertices are on the boundary

  • polygon_groups: list[int] - Grouping indices for polygons (to form holes)