Action:
|
Creates a spherical pattern.
|
|
Filename:
|
kern/kern_scm/pattern_scm.cxx
|
|
APIs:
|
api_spherical_pattern
|
|
Syntax:
|
(pattern:spherical center num-latitudes
|
|
|
root [spacing])
|
|
Arg Types:
|
center
|
position
|
|
num-latitudes
|
integer
|
|
root
|
position
|
|
spacing
|
real
|
|
Returns:
|
pattern
|
|
Description:
|
Creates a two-dimensional spherical pattern about the
center position, with the seed pattern entity at one pole of the associated sphere. The pattern coordinates are specified in the order longitude, latitude.
|
|
|
center specifies the center of the spherical pattern.
|
|
|
num-latitudes specifies the number of latitudinal rings in the pattern. If
num-latitudes is set to zero, this number is instead determined by the optional
spacing parameter.
|
|
|
root specifies the root position of the pattern.
|
|
|
spacing is an optional argument specifying the distance between the elements. The spacing must be given if
num-latitudes is zero.
|
|
Example:
|
; pattern:spherical
|
|
; make a pyramid
|
|
(define height 0.5)
|
|
;; height
|
|
(define maj_rad 1)
|
|
;; maj_rad
|
|
(define min_rad 0.1)
|
|
;; min_rad
|
|
(define num_sides 3)
|
|
;; num_sides
|
|
(define pyramid
|
|
|
(solid:pyramid height maj_rad min_rad num_sides))
|
|
;; pyramid
|
|
;position the pyramid
|
|
(define origin (position 1 2 3))
|
|
;; origin
|
|
(define transform (entity:transform pyramid
|
|
|
(transform:axes
|
|
|
origin (gvector 1 0 0) (gvector 0 1 0))))
|
|
;; transform
|
|
(zoom-all)
|
|
;; #[view 1508128]
|
|
; output original
|
|
|
; make a pattern
|
|
(define center (position 1 2 -2))
|
|
;; center
|
|
(define num-latitudes 10)
|
|
;; num-latitudes
|
|
(define root origin)
|
|
;; root
|
|
(define pat
|
|
|
(pattern:spherical center num-latitudes root))
|
|
;; pat
|
|
; apply the pattern to the pyramid
|
|
(define body (entity:pattern pyramid pat))
|
|
;; body
|
|
; output Result
|
|
|
|
|
Figure 14-6. Spherical Patterns
|