Welcome to entente’s documentation!

entente package

Subpackages

entente.landmarks package

Submodules
entente.landmarks.landmark_composite_recipe module
entente.landmarks.landmark_compositor module
class entente.landmarks.landmark_compositor.LandmarkCompositor(base_mesh, landmark_names)[source]

Bases: object

A tool for compositing landmarks from several examples in relation to a base mesh. Each example is projected onto the base mesh, then the points are averaged.

The tool takes as input:

  • A base mesh
  • Several examples
    • Mesh (in correspondence with the base mesh)
    • xyz coordinates for one or more landmarks

And will output:

  • The xyz coordinates of the comosite landmark on the base mesh
add_example(mesh, landmarks)[source]
result
entente.landmarks.landmarker module

Functions for transferring landmarks from one mesh to another.

This module requires libspatialindex and rtree. See note in trimesh_search.py.

class entente.landmarks.landmarker.Landmarker(source_mesh, landmarks)[source]

Bases: object

An object which encapsulates a source mesh and a set of landmarks on that mesh. Its function is to transfer those landmarks onto a new mesh.

The resultant landmarks will always be on or near the surface of the mesh.

Parameters:
  • source_mesh (lace.mesh.Mesh) – The source mesh
  • landmarks (dict) – A mapping of landmark names to the points, which are 3x1 arraylike objects.
classmethod load(source_mesh_path, landmark_path)[source]

Create a landmarker using the given paths to a source mesh and landmarks.

Parameters:
  • source_mesh_path (str) – File path to the source mesh.
  • landmark_path (str) – File path to a meshlab .pp file containing the landmark points.
transfer_landmarks_onto(target)[source]

Transfer landmarks onto the given target mesh, which must be in the same topology as the source mesh.

Parameters:target (lace.mesh.Mesh) – Target mesh
Returns:A mapping of landmark names to a np.ndarray with shape 3x1.
Return type:dict
entente.landmarks.symmetrize_landmarks module

Submodules

entente.cli module

entente.composite module

entente.composite.composite_meshes(mesh_paths)[source]

Create a composite as a vertex-wise average of several meshes in correspondence. Faces, groups, and other attributes are loaded from the first mesh given.

Parameters:mesh_paths (list) – Paths of the meshes to average.
Returns:The composite mesh.
Return type:lace.mesh.Mesh

entente.equality module

Utilities related to mesh equality.

entente.equality.attr_has_same_shape(first_obj, second_obj, attr)[source]

Given two objects, check if the given arraylike attributes of those objects have the same shape. If one object has an attribute value of None, the other must too.

Parameters:
  • first_obj (obj) – A object with an arraylike attr attribute.
  • second_obj (obj) – Another object with an arraylike attr attribute.
  • attr (str) – The name of the attribute to test.
Returns:

True if attributes are the same shape

Return type:

bool

entente.equality.attr_is_equal(first_obj, second_obj, attr)[source]

Given two objects, check if the given arraylike attributes of those objects are equal. If one object has an attribute value of None, the other must too.

Parameters:
  • first_obj (obj) – A object with an arraylike attr attribute.
  • second_obj (obj) – Another object with an arraylike attr attribute.
  • attr (str) – The name of the attribute to test.
Returns:

True if attributes are equal

Return type:

bool

entente.equality.have_same_topology(first_mesh, second_mesh)[source]

Given two meshes, check if they have the same vertex count and same faces. In other words, check if they have the same topology.

Parameters:
  • first_mesh (lace.mesh.Mesh) – A mesh.
  • second_mesh (lace.mesh.Mesh) – Another mesh.
Returns:

True if meshes have the same topology

Return type:

bool

entente.restore_correspondence module

entente.rigid_transform module

entente.shuffle module

entente.shuffle.shuffle_faces(mesh)[source]

Shuffle the mesh’s face ordering. The mesh is mutated.

Parameters:mesh (lace.mesh.Mesh) – A mesh.
Returns:fx1 mapping of old face indices to new.
Return type:np.ndarray
entente.shuffle.shuffle_vertices(mesh)[source]

Shuffle the mesh’s vertex ordering, preserving the integrity of the faces. The mesh is mutated.

Parameters:mesh (lace.mesh.Mesh) – A mesh.
Returns:vx1 mapping of old vertex indices to new.
Return type:np.ndarray

entente.symmetry module

Indices and tables