edge:spring
List of: Scheme Extensions
Subjects: Construction Geometry, Model Object
Contents: Constructors

Action: Creates an edge from a spring definition.

Filename: cstr/cstr_scm/edge_scm.cxx

APIs: api_edge_spring

Syntax: (edge:spring axis-point axis-vector


start-position handedness thread-distance


rotation-degrees {[trans-height trans-degrees


thread-distance rotation-degrees]...})

Arg Types: axis-point position

axis-vector gvector

start-position position

handedness boolean

thread-distance real

rotation-degrees real

trans-height real

trans-degrees real

Returns: edge

Description: This extension links together several helix pieces and transition regions to make one edge. The transition regions between the helix pieces ensure G2 continuity. The final edge consists of a helix followed by zero or more transition/helix pairs.


The edge returned has information associated with it that indicates where the axis of the helix is located. If the edge is then swept, a rail law is created that orients the profile relative to the center axis, rather than using a minimum rotation rail. This improves the speed of sweeping, and results in the intuitive sweeping of a spring.


All helix and subsequent transition/helix pairs are explicitly listed as parameters. As a minimum, one helix (thread distance and angle) must be specified. After that, any number of transition pieces (height and angle) and helix pieces may be specified, as long as they are specified in transition/helix pairs.


The axis-point, axis-vector, and start-position arguments determine the location of the multi-helix. The radius of the helix is calculated as the distance from the start position to the axis.


The handedness argument determines the spring direction with respect to the axis vector. TRUE is right handed, and FALSE is left handed.


The rotation-degrees argument determines how far the given spring section rotates about the axis, and can be greater than one revolution (360 degrees). The thread-distance argument determines the distance between adjacent loops, assuming that the rotation is greater than one revolution.


The trans-height argument determines the distance for a transition piece, while trans-degrees dictates the rotation (in degrees) that occurs over the transition piece. Following the transition piece, another rotation section can be specified using thread-distance and rot-degrees parameters.


The specification of a transition region and second spring area is optional. When specified, all four parameters trans-height, trans-degrees, a second thread-distance, and a second rot-degrees are required. Any number of additional transition regions and additional helical sections can be specified as long as the set of all four parameters is given for each section.


Refer to Appendix D, Spring Scheme Examples, for additional illustrations and Scheme examples.


axis-point, axis-vector, and start-position arguments determine the location of the multi-helix.


handedness argument determines the spring direction with respect to the axis vector. TRUE is right handed, and FALSE is left handed.


thread-distance argument determines the distance between adjacent loops, assuming that the rotation is greater than one revolution.


rotation-degrees argument determines how far the given spring section rotates about the axis, and can be greater than one revolution (360 degrees).


trans-height argument determines the distance for a transition piece.


trans-degrees dictates the rotation (in degrees) that occurs over the transition piece.

Example: ; edge:spring

; Create axis points.

; Set the view's eye position, target position,

; and up vector.

(define viewset (view:set (position -50 -50 -100)


(position 0 0 0)


(gvector 0 0 1)))

;; viewset

(define axis-point (position 0 0 0))

;; axis-point

(define axis-vector(gvector 0 1 0))

;; axis-vector

(define start-position (position 1 0 0))

;; start-position

(define spring (edge:spring axis-point axis-vector


start-position #t 0 270


10 360 1 (law:eval "3*360+90") ))

;; spring

(define zoom (zoom-all))

;; zoom

; OUTPUT Example 1


; Additional Example

(part:clear)

;; #t

; Set the view's eye position, target position,

; and up vector.

(define viewset (view:set (position -50 -50 -100)


(position 0 0 0)


(gvector 0 0 1)))

;; viewset

(define spring (edge:spring axis-point axis-vector


start-position #t 0 270


20 (law:eval "2*360") 1 (law:eval "5*360")


10 360 1 (law:eval "3*360+90") ))

;; spring

(define zoom (zoom-all))

;; zoom

; OUTPUT Example 2


; Additional Example

(part:clear)

;; #t

; Set the view's eye position, target position,

; and up vector.

(define viewset (view:set (position -50 -50 -100)


(position 0 0 0)


(gvector 0 0 1)))

;; viewset

(define spring (edge:spring axis-point axis-vector


start-position #t 0 270


20 (law:eval "2*360") 1 (law:eval "3*360")


20 (law:eval "2*360") 1 (law:eval "3*360")


20 (law:eval "2*360") 1 (law:eval "5*360+90")


20 (law:eval "2*360") 1 (law:eval "3*360")


20 (law:eval "2*360") 1 (law:eval "3*360") ))

;; spring

(define zoom (zoom-all))

;; zoom

; OUTPUT Example 3





Figure 2-21. edge:spring
PDF/CSTR/02SCA.PDF
HTM/DATA/CSTR/CSTR/02SCA/0044.HTM