5.14. Edge (element)

<edge> ‐ An edge in a graph (a physical system)

5.14.1. Attributes

NameTypeDefaults
indexINTEGERNone (required)
iniINTEGERNone (required)
endINTEGERNone (required)
rFLOAT1.0
gFLOAT1.0
bFLOAT1.0
widthFLOAT0.0
n_xFLOAT0.0
n_yFLOAT1.0
n_zFLOAT0.0
kFLOAT1.0
lIniFLOAT1.0
lMaxFLOAT10.0

5.14.2. Description

This element defines an edge between two particles in a graph. The integer values of the ini and end attributes define the indices of the particles that are connected by this edge.

The index attribute is required when the edge is the child element of tabedge.

The float values of the k and lIni attributes define the characteristics of the spring represented by this edge. The strength resulting from an extension or a shortening of the spring to a length l is equal to k×(l-lIni). In order to avoid too large extensions of the springs, the float value of the lMax attribute defines the maximal length of an edge.

The float values of the r, g, b, and width attributes define the color and the width of the quadrilateral that will be displayed when drawing the edge. Since the edge is drawn as a quad, it can be necessary to orient the quad to make it visible. The float values of the n_x, n_y, and n_z attributes define the normal vector of the quad and can be used to modify its orientation.

5.14.3. Expected child

None.

5.14.4. Example

The example below defines the edge between particles 1 and 2. It will be drawn as a white quad, 0.01 units wide, and parallel to the yz plane. The spring modeled by this edge has a coefficient 0.001 and an initial length 1.5.

<edge index="1" ini="1" end="2" r="1.0" g="1.0" b="1.0" width="0.01" 
                   n_x="1" n_y="0" n_z="0" k="0.001" lIni="1.5" />