Vector Fields (Hedgehogs)


Laws are functions that may go from any dimension to any dimension. For example, a law used to make a surface may go from 2D to 3D.

2D to 3D laws may also be viewed as vector fields on a surface. (1Dto3D laws may be viewed as vector fields on a curve and 3D to 3D laws may be viewed as a vector field in space.) These vector fields may be illustrated as hedgehog markings.

The key to being able to sweep along a non-planar path is the establishment of rails along the path. The rails serve to align the profile correctly to the path as it is swept. Rails are defined using laws, so can be arbitrarily complex to achieve unique results. The array of rails permits piecewise planar sweeping to be handled in an expected, predictable manner. The api_make_rails function and the law:make-rails Scheme extension perform automatic creation of the rail law array.

Scheme AIDE can be used to view the default rail alignment and to test user-defined rails. The law:make-rails Scheme extension can be used with law:hedgehog to see the rails along a path. The hedgehog markings can also be used to display a vector field, which is similar to the rails for sweeping.

Scheme Example


			; Create a 1D Hedgehog
(define my_edge(edge:law "vec(cos(x),sin(x),x/10)" 0 500))
;; my_edge
(define my_base_law(law "vec(cos(x),sin(x),x/10)"))
;; my_base_law
(define my_hair_law(law "vec(cos(x),sin(x),0)"))
;; my_hair_law
(define h1(law:hedgehog my_hair_law my_base_law 0 50 200 ))
;; h1
; Create a 2D Hedgehog
(define my_face(face:law "vec(x,y,cos(x)*sin(y))" -5 5 -5 5))
;; my_face
(define my_base_law(law "vec(x,y,cos(x)*sin(y))"))
;; my_base_law
(define dx(law:derivative my_base_law))
;; dx
(define dy(law:derivative my_base_law "y"))
;; dy
(define norm(law "cross(law1,law2)" dx dy))
;; norm
(define h1(law:hedgehog norm my_base_law -5 5 -5 5 20 ))
;; h1
; Create a 3D Hedgehog
(define my_base_law(law "vec(x,y,z)"))
;; my_base_law
(define my_hair_law(law "norm(vec(x,y,z))"))
;; my_hair_law
(define h1
     (law:hedgehog my_hair_law my_base_law -10 10 -10 10 -10 10))
;; h1

Figure. Hedgehog Examples

[Top]