Action:
|
Creates a new pattern by applying a root transformation to an existing pattern.
|
|
Filename:
|
kern/kern_scm/pattern_scm.cxx
|
|
Syntax:
|
(pattern:set-root-transf pat root-transf)
|
|
Arg Types:
|
pat
|
pattern
|
|
root-transf
|
transform
|
|
Returns:
|
pattern
|
|
Description:
|
Applies a root transformation to an existing pattern, replacing the existing root transformation, if any.
|
|
|
pat specifies a pattern.
|
|
|
root-transf specifies the root transformation to be applied.
|
|
Example:
|
; pattern:set-root-transf
|
|
; make a body and a copy
|
|
(define body1 (solid:sphere (position 0 0 0) 1))
|
|
;; body1
|
|
(define body2 (entity:copy body1))
|
|
;; body2
|
|
; make a linear pattern along the x-axis
|
|
(define pat1 (pattern:linear (gvector 5 0 0) 5))
|
|
;; pat1
|
|
; apply the pattern to the original body
|
|
(define apply (entity:pattern body1 pat1))
|
|
;; apply
|
|
; make a new pattern from the original, but
|
|
; translated four units in the y direction
|
|
(define root-transf (transform:translation
|
|
|
(gvector 0 4 0)))
|
|
;; root-transf
|
|
(define pat2 (pattern:set-root-transf
|
|
|
pat1 root-transf))
|
|
;; pat2
|
|
; apply the new pattern to the second body
|
|
(define apply2 (entity:pattern body2 pat2))
|
|
;; apply2
|