Skinning, Lofting, and Net Surface Singularities


Laws are used by skinning, lofting, and net surfaces to answer questions about the surface being generated.

Finding Intersections

Laws can be used to find intersections:

In the example, two entities are created: a circle and an edge from a sine wave. These two entities do not intersect. Still, laws can be used to find the location where the two entities are closest together. Net surfaces uses this feature when the curves in the network do not intersect.

Scheme Example

(define my_edge1(edge:circular (position 0 0 0) 10))
;; my_edge1
; my_edge1 => #[entity 2 1]
(entity:set-color my_edge1 0)
;; ()
(define my_edge2(edge:law "vec(x,sin(x),5)" -20 20))
;; my_edge2
; my_edge2 => #[entity 3 1]
(entity:set-color my_edge2 0)
;; ()
(define my_law1 (law "cur(edge1)" my_edge1))
;; ()
(define my_law2(law "cur (edge1)" my_edge2))
;; my_law2
; my_law2 => #[law "CUR(EDGE1)"]
(law:domain my_law1)
;; "0.000000 6.283185\n"
(law:domain my_law2)
;; "-20.000000 20.000000\n"
(define my_law_y(law "law1 o y" my_law2))
;; my_law_y
; my_law_y => #[law "(CUR(EDGE1))O(Y)"]
(define dist_vec(law "law1-law2" my_law1 my_law_y))
;; dist_vec
; dist_vec => #[law "CUR(EDGE1)-(CUR(EDGE2))O(Y)"]
(define dist_sq(law "dot(law1,law1)" dist_vec))
;; dist_sq
; dist_sq => #[law "DOT(CUR(EDGE1)-(CUR(EDGE2))O(Y),
;    CUR(EDGE3)-(CUR(EDGE4))O(Y))"]
(law:nlmin2d dist_sq 3 0 1 100 "1")
;; x 3.088359405687513 y -9.985834540073936 z 25.000000000000007
;;    tol 0.000000000000014
;;    #t
(define my_point (dl-item:point (position -9.985834540073936
    (law:eval "sin(-9.985834540073936)") 5)))
;; my_point
; my_point => #[dl-item 40232000]

[Top]