pattern:spherical?
List of: Scheme Extensions
Subjects: Patterns
Contents: Kernel

Action: Determines whether or not a pattern lies on a given sphere.

Filename: kern/kern_scm/pattern_scm.cxx

Syntax: (pattern:spherical? pat {face | center})

Arg Types: pat pattern

face face

center position

Returns: boolean

Description: This extension returns #t if a pattern lies on the spherical surface associated with the face or, alternately, with center. Otherwise, it returns #f.


pat specifies a pattern.


face specifies a spherical face.


center specifies the center point of a spherical surface.

Example: ; pattern:spherical?

; make a spherical pattern

(define center (position 5 6 3))

;; center

(define root (position 0 0 0))

;; root

(define pat (pattern:spherical center 5 root))

;; pat

; is it spherical about its center?

(pattern:spherical? pat center)

;; #t

; make a circular pattern in the xy plane

(define normal (gvector 0 0 1))

;; normal

(set! pat (pattern:elliptical center normal 5))

;; #[pattern

;; trans-vec: "VEC(5,6,3)"

;; x-vec: "DOMAIN(VEC(0,0.4472135954999579,

;; -0.8944271909999159)*COS

;; (0.89759790102?56552*X)*COS

;; (0.7853981633974483*X2)+VEC

;; (0.801783725737273,

;; -0.5345224838248487,

;; -0.2672612419124243)*SIN

;; (0.8975979010256552*X)*COS

;; (0.7853981633974483*X2)+VEC

;; (0.5976143046671968,

;; 0.7171371656006361,

;; 0.3585685828003181)*SIN

;; (0.7853981633974483*X2),0,6,0,4)"

;; y-vec: "VEC(0,0.4472135954999579,

;; -0.8944271909999159)*-1*SIN

;; (0.897597901025655?2*X)+VEC

;; (0.801783725737273,

;; -0.5345224838248487,

;; -0.2672612419124243)*COS

;; (0.8975979010256552*X)"

;; z-vec: "null_law"

;; scale: "null_law"

;; keep: "X2>0ANDX2<4ORNOT(X2>0ANDX2<4)ANDX=0"

;; no list]

; is it spherical about its center?

(pattern:spherical? pat center)

;; #t

; make a circular pattern in the yz plane

(set! pat


(pattern:elliptical center (gvector 1 0 0) 5))

;; #[pattern

;; trans-vec: "VEC(5,6,3)"

;; x-vec:
"DOMAIN(VEC(-1,0,0)*COS

;; (1.256637061435917*X)+VEC

;; (0,-1,0)*SIN(1.256637061435917*X),

;; 0,4)"

;; y-vec:
"VEC(0,0,1)"

;; z-vec:
"null_law"

;; scale:
"null_law"

;; keep:
"null_law"

;; no list]

;is it spherical about its center?

(pattern:spherical? pat center)

;; #t

; make a spherical pattern about a new center

(define new_center (position 5 5 3))

;; new_center

(set! pat (pattern:spherical new_center 5 root))

;; #[pattern

;; trans-vec: "VEC(5,6,3)"

;; x-vec: "DOMAIN(VEC(0,-1,0)*COS

;; (1.256637061435917*X)+VEC

;; (0,0,-1)*SIN(1.25663706?1435917*X),

;; 0,4)"

;; y-vec: "VEC(1,0,0)"

;; z-vec: "null_law"

;; scale: "null_law"

;; keep: "null_law"

;; no list]

; is it spherical about the old center?

(pattern:spherical? pat center)

;; #f
PDF/KERN/14SCI.PDF
HTM/DATA/KERN/KERN/14SCI/0094.HTM