tyssue.collisions package¶
Subpackages¶
Submodules¶
tyssue.collisions.intersection module¶
-
tyssue.collisions.intersection.
self_intersections
(sheet)[source]¶ Checks for self collisions for the sheet
- Parameters
sheet (a
Sheet
object) – This object must have a triangular_mesh method returning a valid triangular mesh.- Returns
edge_pairs – Array of shape (n_intersections, 2) with the indices of the pairs of intersecting edges
- Return type
np.ndarray of indices
tyssue.collisions.solvers module¶
-
class
tyssue.collisions.solvers.
CollidingBoxes
(sheet, position_buffer, intersecting_edges)[source]¶ Bases:
object
Utility class to manage collisions
Creates a CollidingBoxes instance
- Parameters
sheet (a :clas:`Sheet` instance) –
position_buffer (np.array of shape (sheet.Nv, sheet.dim):) – positions of the vertices prior to the collisions
intersecting_edges (np.ndarray) – pairs of indices of the intersecting edges
-
get_limits
(shyness=1e-10)[source]¶ Iterator over the position boundaries avoiding the collisions.
- Parameters
shyness (float) – the extra distance between two colliding vertices, on each side of the collision plane.
- Yields
lower, upper (two pd.Series) – those Series are indexed by the vertices of the colliding faces giving the lower and upper bounds for the vertices
-
solve_collisions
(shyness=1e-10)[source]¶ Solves the collisions by finding the collision plane.
Modifies the sheet vertex positions inplace such that they rest at a distance
shyness
apart on each side of the collision plane.- Parameters
shyness (float, default 1e-10) – the extra distance between two colliding vertices, on each side of the collision plane.
on Liu (Based) –
J.-D. –
Ko –
M.-T. –
Chang (&) –
(1998) (R.-C.) –
:param : :param *A simple self-collision avoidance for cloth animation*.: :param Computers & Graphics: :param 22(1): :param 117–128.: :param DOI <https: :type `DOI
-
tyssue.collisions.solvers.
auto_collisions
(fun)[source]¶ Decorator to solve collisions detections after the execution of the decorated function.
It is assumed that the two first arguments of the decorated function are a
Sheet
object and a geometry classNote
The function is re-executed with the updated geometry
-
tyssue.collisions.solvers.
solve_bulk_collisions
(eptm, position_buffer)[source]¶ Corrects the auto-collisions for the outer surface(s) of a 3D epithelium.
- Parameters
eptm (a
Epithelium
object) –position_buffer (np.array of shape (eptm.Nv, eptm.dim):) – positions of the vertices prior to the collisions
- Returns
changed – True if the positions of some vertices were changed
- Return type
bool
-
tyssue.collisions.solvers.
solve_sheet_collisions
(sheet, position_buffer)[source]¶ Corrects the auto-collisions for the outer surface(s) of a 2.5D sheet.
- Parameters
sheet (a
Sheet
object) –position_buffer (np.array of shape (sheet.Nv, sheet.dim):) – positions of the vertices prior to the collisions
- Returns
changed – True if the positions of some vertices were changed
- Return type
bool