@@ -29,23 +29,24 @@ def setup
2929 # If the connections are known in advance these can be given as parameter as int[][].
3030 # The second index gives index of first and second point of connection in the points
3131 # array. network = WB_Network.new(vertices, connections)
32- creator = HEC_FromNetwork . new
33- creator . setNetwork ( network )
34- # alternatively you can specify a HE_Mesh instead of a WB_Network.
35- creator . setConnectionRadius ( 6 ) # connection radius
36- # number of faces in the connections, min 3, max whatever blows up the CPU
37- creator . setConnectionFacets ( 6 )
38- # rotate the connections by a fraction of a facet. 0 is no rotation, 1 is a rotation over a full facet. More noticeable for low number of facets.
39- creator . setAngleOffset ( 0.25 )
40- # Threshold angle to include sphere in joint.
41- creator . setMinimumBalljointAngle ( TWO_PI / 3.0 )
42- # divide connection into equal parts if larger than maximum length.
43- creator . setMaximumConnectionLength ( 30 )
44- creator . setCap ( true ) # cap open endpoints of connections?
45- creator . setTaper ( true ) # allow connections to have different radii at each end?
46- creator . setCreateIsolatedNodes ( false ) # create spheres for isolated points?
47- # use the value of the WB_Node as scaling factor, only useful if the frame was created using addNode.
48- creator . setUseNodeValues ( true )
32+ creator = HEC_FromNetwork . new . tap do |net |
33+ net . setNetwork ( network )
34+ # alternatively you can specify a HE_Mesh instead of a WB_Network.
35+ net . setConnectionRadius ( 6 ) # connection radius
36+ # number of faces in the connections, min 3, max whatever blows up the CPU
37+ net . setConnectionFacets ( 6 )
38+ # rotate the connections by a fraction of a facet. 0 is no rotation, 1 is a rotation over a full facet. More noticeable for low number of facets.
39+ net . setAngleOffset ( 0.25 )
40+ # Threshold angle to include sphere in joint.
41+ net . setMinimumBalljointAngle ( TWO_PI / 3.0 )
42+ # divide connection into equal parts if larger than maximum length.
43+ net . setMaximumConnectionLength ( 30 )
44+ net . setCap ( true ) # cap open endpoints of connections?
45+ net . setTaper ( true ) # allow connections to have different radii at each end?
46+ net . setCreateIsolatedNodes ( false ) # create spheres for isolated points?
47+ # use the value of the WB_Node as scaling factor, only useful if the frame was created using addNode.
48+ net . setUseNodeValues ( true )
49+ end
4950 @mesh = HE_Mesh . new ( creator )
5051 HET_Diagnosis . validate ( mesh )
5152 @render = WB_Render . new ( self )
0 commit comments