Action:
|
Creates a law that returns the positions of the defining surface.
|
|
Derivation:
|
surface_law_data : base_surface_law_data : law_data : ACIS_OBJECT : -
|
|
Syntax:
|
SURF
|
|
Description:
|
surf returns the positions of the defining surface at the parameter value. This law symbol is a way to pass a surface into a law for other purposes, such as evaluation. The dimension of the input,
my_surface_law_data, is two, but when
surf is evaluated, it returns an item in three dimensions.
|
|
|
ACIS defines its own parameter range for a surface which is used by this law.
|
|
Example:
|
; law "SURF"
|
|
; Create a surface to evaluate. (define my_sphere (solid:sphere (position 0 0 0) 10))
|
|
;; my_sphere
|
|
; => #[entity 2 1]
|
|
(define my_surflaw (law "surf(surf1)"
|
|
(car (entity:faces my_sphere))))
|
|
;; my_surflaw
|
|
; => #[law "SURF(SURF1)"]
|
|
(define my_sveclaw (law "surfvec(law1,
|
|
vec(x,y,z), vec(a4, a5))" my_surflaw))
|
|
;; my_sveclaw
|
|
; my_sveclaw =>
|
|
; [SURFVEC(SURF(SURF1),VEC(X,Y,Z), VEC(A4,A5))" ]
|
|
(law:eval my_sveclaw (list 0 0 1 0 0))
|
|
;; (1 0 0 0)
|
|
|
; The law created takes an xyz vector and a uv
|
|
; position on the surface. It returns a uv vector
|
|
; in the direction of the given xyz vector at the
|
|
; given uv position on the surface. It also returns
|
|
; as the last two arguments the uv positions. The uv
|
|
; position is echoed.
|
|
; Here is an example at the pole.
|
|
(law:eval my_sveclaw
|
|
(list 1 1 0 (law:eval "pi/2") 0))
|
|
;; (-1 0 1.5707963267949 0.785398163401155)
|
|
; At the pole, this response means that you have to
|
|
; turn v by pi/4 to get the correct vector.
|