Action:
|
Creates a regular polygon wire-body.
|
|
Filename:
|
cstr/cstr_scm/wire_scm.cxx
|
|
APIs:
|
api_make_polygon
|
|
Syntax:
|
(wire-body:polygon center start normal
|
|
|
side-length sides on-center output-string)
|
|
Arg Types:
|
center
|
position
|
|
start
|
gvector
|
|
normal
|
gvector
|
|
side-length
|
real
|
|
sides
|
integer
|
|
on-center
|
boolean
|
|
output-string
|
string
|
|
Returns:
|
entity
|
|
Description:
|
center is the center of the polygon to be made. (default is (0,0,0)).
|
|
|
start is the vector from center to a vertex or the center of an edge of the polygon (default is (10,0,0)).
|
|
|
normal is a gvector normal to the plane of the polygon (default is (0,0,1)).
|
|
|
side-length determines the length of the sides of the polygon. When
side-length is supplied as a real number (0.0, 1.0 etc.), the order of the arguments is irrelevant except that the
start vector must precede the
normal vector. The
side-length would not be used if its value is less than
resabs, (default is 0.0 - i.e., ignore this value). If
side-length is greater than
resabs, then the length of the
start vector is ignored and only the direction is considered.
|
|
|
sides is the number of sides the polygon should have. (default is 6).
|
|
|
on-center is TRUE when the start is a vector to the center of an edge and FALSE when the start is a vector to a vertex (default is FALSE).
|
|
|
output-string is a string argument will provide output informing the user of all supplied arguments as well as the arguments actually used.
|
|
Limitations:
|
The start vector must be non-zero (default is (10, 0, 0)).
|
|
The normal vector must be non-zero (default is (0, 0, 1)).
|
|
The start and normals must span a two dimensional space.
|
|
The number of sides must be at least 3 (default is 6)
|
|
Example:
|
; wire-body:polygon
|
|
; Create a wire body polygon.
|
|
(define polygon1 (wire-body:polygon (position 0 0 0)
|
|
|
(gvector 10 0 0) (gvector 0 0 1) 6 #t))
|
|
;; polygon1
|
|
; Set a color for one.
|
|
(entity:set-color polygon1 4)
|
|
;; ()
|
|
; OUTPUT original
|
|
|
; Create another wire body polygon.
|
|
(define polygon2 (wire-body:polygon (position 0 0 0)
|
|
|
(gvector 10 0 0) (gvector 0 0 1) 6 #f))
|
|
;; polygon2
|
|
; set a color for two.
|
|
(entity:set-color polygon2 5)
|
|
;; ()
|
|
; OUTPUT Result
|
|
|
|
|
Figure 3-13. wire-body:polygon
|