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