MeshSolver.add_edge_strain_constraint

MeshSolver.add_edge_strain_constraint(start_vertex, end_vertex, weight=1.0, min_range=0.9, max_range=1.1)

Add an edge strain constraint between two specific vertices.

An edge strain constraint tries to keep the distance between two vertices within a specified range relative to the original distance. This directly adds the constraint to the C++ solver.

Parameters:
start_vertexint

Index of the first vertex.

end_vertexint

Index of the second vertex.

weightfloat, optional

Weight of the constraint. Higher values make the constraint stronger. Default is 1.0.

min_rangefloat, optional

Minimum allowed relative length. Default is 0.9 (90% of original length).

max_rangefloat, optional

Maximum allowed relative length. Default is 1.1 (110% of original length).

Returns:
int

ID of the added constraint.