Action:
|
Crates a law that transforms positions.
|
|
Derivation:
|
transform_law_data : base_transform_law_data : law_data : ACIS_OBJECT : -
|
|
Syntax:
|
TRANS
|
|
Description:
|
The trans law symbol requires that my_law return positions. It produces positions that have been transformed by the my_transf. rotate is used on vectors, while trans is used to transform positions.
|
|
Example:
|
; law "TRANS"
|
|
; Create a transform, and then create its inverse.
|
|
(define my_trans_rot (transform:rotation
|
|
(position 0 0 0) (gvector 1 0 0) 90))
|
|
;; my_trans_rot
|
|
; => #[transform 1075284160]
|
|
(define my_trans_move (transform:translation
|
|
(gvector 1 0 0)))
|
|
;; my_trans_move
|
|
; => #[transform 1075284848]
|
|
(define my_t_comp (transform:compose
|
|
my_trans_rot my_trans_move))
|
|
;; my_t_comp
|
|
(define my_law (law "trans(vec(x,y,z),trans1)"
|
|
my_t_comp))
|
|
;; my_law
|
|
; => #[law "TRANS(VEC(X,Y,Z),TRANS1)"]
|
|
|
; This transforms the given law "VEC(X,Y,Z)" by
|
|
; the supplied transform, my_t_comp
|
|
(law:eval my_law (list 0 0 1))
|
|
;; (1 -1 6.12323399573677e-17)
|
|
; In this example, the input vector is (0, 0, 1).
|
|
; It gets rotated by 90 degrees, causing y to be
|
|
; -1 and then gets moved along x axis by 1.
|
|
; z is approximately zero.
|