MeshSolver.add_shrinking_edge_constraint

MeshSolver.add_shrinking_edge_constraint(start_vertex, end_vertex, weight=1.0, shrink_factor=0.25)

Add a shrinking edge constraint to the solver.

A shrinking edge constraint tries to shrink the edge length by a specified factor. This is particularly useful for cable nets and other structures that need to maintain tension. The constraint creates a min/max range of ±5% around the target length.

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.

shrink_factorfloat, optional

Target shrinking factor (default=0.25). The target length will be (1.0 - shrink_factor) times the original length.

Returns:
int

ID of the added constraint.