Node SymbolFactory.GetUnitSpring(Double tube_radius, Double coil_radius, Int32 coil_turns, Double spring_coil_length, Double spring_transition_length, Int32 num_circle_segments, Int32 num_spring_transition_segments)
Creates a unit spring scenegraph node, aligned on the z axis going from z=0 to z=1.
The spring tessellation is comprised of cylinder sections on each end, a coil in the center, and smoothed transition sections from the coil to the cylinder ends.
Examples:
GetUnitSpring(0.01, 0.02, 5, 0.20, 0.05) # Short, thin spring bounded by long cylinder sections
GetUnitSpring(0.01, 0.02, 25, 0.70, 0.05) # Long, thin spring bounded by short cylinder sections
GetUnitSpring(0.02, 0.05, 10, 0.65, 0.10) # Thick spring bounded by short cylinder sections
GetUnitSpring(0.01, 0.05, 25, 0.70, 0.05, 16) # Thin, widely coiled spring bounded by short cylinder sections
Note: tube_radius should generally be half (or less) the coil radius for nicer looking springs.
Examples
Parameters
-
tube_radius
Type: Double
Radius of the tube comprising the spring.
-
coil_radius
Type: Double
Radius of the spring coil, measured from the center of the tube.
-
coil_turns
Type: Int32
Number of turns of the spring coil. If less than 2, the spring will be represented as a cylinder.
-
spring_coil_length
Type: Double
Length of the spring coil section. Must be between 0 and 1.
-
spring_transition_length
Type: Double
Length of the spring transition sections (transitioning from the coil to the cylinder ends). Must be between 0 and 0.5, and spring_coil_length + 2 * spring_transition_length must not exceed 1.
-
num_circle_segments
Type: Int32
Number of segments comprising each circle cross-section, higher values will rounder springs with more complex tessellation. Defaults to 8.
-
num_spring_transition_segments
Type: Int32
Number of segments used to transition from spring coil to cylinder ends, higher values will generate smoother transitions. Defaults to 5.
Return Value
Type: Node
Returns spring scenegraph node