init_network#

init_network(k)#

Initialize a dynamic bead–spring network from a planar diagram.

Each arc (ep1—ep2) is represented by a short polyline sampled from a PolySegment through [center(ep1.node), center(arc), center(ep2.node)]. Consecutive samples are connected by bonds; consecutive triples form stiffness constraints. For each vertex, adjacent incident samples define an angular constraint with the ideal angle 2π / degree(vertex).

Parameters:

k (PlanarDiagram) – Input planar diagram.

Returns:

Network – A constructed bead–spring network ready for simulation.

Return type:

Network