Action:
|
Creates a radial pattern.
|
|
Filename:
|
kern/kern_scm/pattern_scm.cxx
|
|
APIs:
|
api_radial_pattern
|
|
Syntax:
|
(pattern:radial center normal num-radial
|
|
|
num-angular dist [start] [not-rotate=#f]
|
|
|
[start-angle=0] [end-angle=360] [ratio=1])
|
|
Arg Types:
|
center
|
position
|
|
normal
|
gvector
|
|
num-radial
|
integer
|
|
num-angular
|
integer
|
|
dist
|
real
|
|
start
|
gvector
|
|
not-rotate
|
boolean
|
|
start-angle
|
real
|
|
end-angle
|
real
|
|
ratio
|
real
|
|
Returns:
|
pattern
|
|
Description:
|
Creates a two-dimensional radial pattern. The pattern coordinates are specified in the order (radial,
angular).
|
|
|
center defines the root position (that may or may not lie upon the seed entity).
|
|
|
normal vector sets the orientation of the pattern.
|
|
|
num-radial specifies the number of elements in the radial direction.
|
|
|
num-angular specifies the number of elements in the angular direction.
|
|
|
dist specifies the distance between successive rings of the pattern.
|
|
|
start is an optional argument that specifies the direction of the first spoke of the pattern.
|
|
|
If
not-rotate is true (#t), the elements of the pattern are kept in a fixed relative orientation.
|
|
|
start-angle and
end-angle arguments fix the angular extent of the pattern.
|
|
|
ratio argument sets the ratio of minor/major radii at the pattern perimeter.
|
|
Example:
|
; pattern:radial
|
|
; make a prism
|
|
(define height 1)
|
|
;; height
|
|
(define maj_rad 1)
|
|
;; maj_rad
|
|
(define min_rad 0.5)
|
|
;; min_rad
|
|
(define num_sides 3)
|
|
;; num_sides
|
|
(define prism
|
|
|
(solid:prism height maj_rad min_rad num_sides))
|
|
;; prism
|
|
; position the prism
|
|
(define origin (position 1 2 3))
|
|
;; origin
|
|
(define transform (entity:transform prism
|
|
|
(transform:axes
|
|
|
origin (gvector 1 0 0) (gvector 0 1 0))))
|
|
;; transform
|
|
; make a pattern
|
|
(define center origin)
|
|
;; center
|
|
(define normal (gvector 0 0 1))
|
|
;; normal
|
|
(define num-radial 4)
|
|
;; num-radial
|
|
(define num-angular 5)
|
|
;; num-angular
|
|
(define spacing 3)
|
|
;; spacing
|
|
(define pat (pattern:radial
|
|
|
center normal num-radial num-angular spacing))
|
|
;; pat
|
|
; apply the pattern to the prism
|
|
(define body (entity:pattern prism pat))
|
|
;; body
|