Action:
|
Creates a polar-grid pattern.
|
|
Filename:
|
kern/kern_scm/pattern_scm.cxx
|
|
APIs:
|
api_polar_grid_pattern
|
|
Syntax:
|
(pattern:polar-grid center normal num dist
|
|
|
[start] [not-rotate=#f] [hex-symmetry=#f]
|
|
|
[start-angle=0] [end-angle=360] [ratio=1])
|
|
Arg Types:
|
center
|
position
|
|
normal
|
gvector
|
|
num
|
integer
|
|
dist
|
real
|
|
start
|
gvector
|
|
not-rotate
|
boolean
|
|
hex-symmetry
|
boolean
|
|
start-angle
|
real
|
|
end-angle
|
real
|
|
ratio
|
real
|
|
Returns:
|
pattern
|
|
Description:
|
Creates a two-dimensional polar-grid 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 specifies the number of rings in the grid (including the center).
|
|
|
dist specifies the distance between the rings.
|
|
|
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.
|
|
|
If
hex-symmetry is true (#t), the hexagonal symmetry is maintained for patterns extending either 360 or 180 degrees.
|
|
|
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:polar-grid
|
|
; 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_rings 5)
|
|
;; num_rings
|
|
(define spacing 4)
|
|
;; spacing
|
|
(define pat (pattern:polar-grid
|
|
|
center normal num_rings spacing))
|
|
;; pat
|
|
; apply the pattern to the prism
|
|
(define body (entity:pattern prism pat))
|
|
;; body
|