Action:
|
Creates a hexagonal pattern with cylindrical symmetry.
|
|
Filename:
|
kern/kern_scm/pattern_scm.cxx
|
|
APIs:
|
api_hex_cylindrical_pattern
|
|
Syntax:
|
(pattern:hex-cylindrical center normal num-angular
|
|
|
[num-axial=0] [radius=0])
|
|
Arg Types:
|
center
|
position
|
|
normal
|
gvector
|
|
num-angular
|
integer
|
|
num-axial
|
integer
|
|
radius
|
real
|
|
Returns:
|
pattern
|
|
Description:
|
Creates a two-dimensional hexagonal pattern with cylindrical symmetry.
|
|
|
center specifies the center position of the circular edge.
|
|
|
normal specifies the direction of extension.
|
|
|
num-angular
specifies the number of angular elements in the pattern.
|
|
|
num-axial specifies the number of axial elements in the pattern.
|
|
|
radius specifies the distance between pattern elements.
|
|
Example:
|
; pattern:hex-cylindrical
|
|
; 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
|
|
(entity:set-color (point origin) RED)
|
|
;; ()
|
|
(define transform (entity:transform prism
|
|
|
(transform:axes origin
|
|
|
(gvector 1 0 0) (gvector 0 1 0))))
|
|
;; transform
|
|
; make a pattern
|
|
(define center (position 6 2 3))
|
|
;; center
|
|
(define normal (gvector 0 1 0))
|
|
;; normal
|
|
(define num-angular 8)
|
|
;; num-angular
|
|
(define num-axial 6)
|
|
;; num-axial
|
|
(define spacing 3)
|
|
;; spacing
|
|
(define pat (pattern:hex-cylindrical
|
|
|
center normal num-angular num-axial spacing))
|
|
;; pat
|
|
; apply the pattern to the prism
|
|
(define body (entity:pattern prism pat))
|
|
;; body
|