Functions List


Parametric Representation


division

The function division divides a domain into equal parts. The function takes as parameters the domain start, domain end, number of part to divide the domain and a Boolean value to determine if the domain end is to be included (#t) or excluded (#f). If omitted, the domain end will be excluded.

Parameters:

di – Domain start
df – Domain end
n – Number of domain divisions
#t/#f – Include or exclude domain end

Syntax:

(division di df n [include-df? #f])

Example:

> (division 0 1 4)
’(0 1/4 1/2 3/4 1)

> (division 0 pi 4)
’(0
0.7853981633974483
1.5707963267948966
2.356194490192345
3.141592653589793)



map-division

The function map-division maps a given function onto a specified domain, i.e., applied the function to all the values in the domain. The domain is specified by the domain start, domain end, number of part to divide the domain and a Boolean value to determine if the domain end is to be included (#t) or excluded (#f). If omitted, the domain end will be excluded.

Parameters:

f – Function to be mapped
di – Domain start
df – Domain end
n – Number of domain divisions
#t/#f – Include or exclude domain end

Syntax:

(division di df n [include-df? #f])

Example:

> (spline
 (map-division
  (lambda (t)
    (+pol (xy 0 0)
          (* 2 10 (- (/ 1.0 (cos t)) (cos t)))
          t))
  -1.0
  1.0
  100))
#<spline 0>



surface-grid

The function surface-grid generates a polygonal mesh of a parametric surface, specified by a matrix of points.

Parameters:

surface – Parametric surface (matrix of point)

Syntax:

(surface-grid surface

Example:

(define (moebius-strip s0 s1 m t0 t1 n)
  (map-division (lambda (s t)
                  (cyl (+ 1 (* t (cos (/ s 2))))
                       s
                       (* t (sin (/ s 2)))))
                s0 s1 m t0 t1 n))

(surface-grid (moebius-strip 0 4pi 80 0 0.3 10))
#<surface-grid 0>



thicken

The function thicken applies a uniform thickness to a given shape.

Parameters:

shape – Shape to thicken

Syntax:

(surface-grid surface

Example:

> (thicken
 (surface-grid
  (map-division
   (lambda (x y)
     (xyz x y (- (* x x) (* y y))))
   -0.5 1.3 40
   -2 2 80))
 0.03)
#<thicken 1>
Top