solid:cylinder
List of: Scheme Extensions
Subjects: Model Object
Contents: Constructors

Action: Creates a right circular cylinder.

Filename: cstr/cstr_scm/sld_scm.cxx

APIs: api_solid_cylinder_cone

Syntax: (solid:cylinder {{start-pos end-pos} | {x-start


y-start z-start x-end y-end z-end}} radius


[ratio=1 {position3 | {x3 y3 z3}}])

Arg Types: start-pos position

end-pos position

x-start real

y-start real

z-start real

x-end real

y-end real

z-end real

radius real

ratio real

position3 position

x3 real

y3 real

z3 real



Returns: entity

Description: The argument start-pos or (or x-start, y-start, and z-start) specifies the start position of the cylinder. The argument end-pos ( or x-end, y-end, and z-end) specifies the end position of the cylinder. As you can see, there are two syntax formats available for defining the starting and ending positions for creating a cylinder. The first (original) syntax format defines the positional arguments by placing them in 'position' statements enclosed in parenthesis (as shown in the example below with creating cyl1). However, the second syntax format defines the positional arguments without using the 'position' statement or the additional set of parenthesis (as shown in the example below with defining cyl2 and cyl3). The two formats are otherwise identical and accomplish the same. The format you choose must be used for all three of the positional arguments.


The argument radius specifies the radii for the base and top.


If the optional arguments ratio and position3 (or x3, y3, and z3) are specified, an elliptical cylinder is created. If ratio is specified, the ratio between the major and minor axis of the ellipse is used. If position3 (or x3, y3, and z3) is specified, the vector from the projection of position3 (or x3, y3, and z3) on to the axis of the cylinder to position3 (or x3, y3, and z3) specifies the major axis. If position3 (or x3, y3, and z3) is not specified, the major axis is defined by the projection of the x-axis of the active work coordinate system onto the plane that is defined by position1 and the vector from position1 to position2.


Note position3 cannot lie on the axis of the cylinder or an error occurs.


start-pos specifies the start position of the cylinder.


x-start, y-start, and z-start specifies the start position of the cylinder.


end-pos specifies the end position of the cylinder.


x-end, y-end, and z-end specifies the end position of the cylinder.


ratio is the ratio between the major and minor axis of the ellipse.


position3 (or x3, y3, and z3) is the vector from the projection of position3 (or x3, y3, and z3) on to the axis of the cylinder to position3 (or x3, y3, and z3).


x3, y3, and z3 are the syntax arguments for position3 argument.

Limitations: Positional arguments format must be consistent. Refer to Description.

Example: ; solid:cylinder

; Create solid cylinder 1.

(define cyl1


(solid:cylinder (position 0 0 0)


(position 25 25 0) 30))

;; cyl1

; OUTPUT Definition


; Set a color for cyl1

(entity:set-color cyl1 2)

;; ()

; Create solid cylinder 2.

(define cyl2


(solid:cylinder 2 2 2 -20 -20 0 15 3))

;; cyl2

; Set a color for cyl2

(entity:set-color cyl2 3)

;; ()

; Create solid cylinder 3.

(define cyl3


(solid:cylinder 2 2 2 -20 -20 0 15 3 -5 -5 0))

;; cyl3

; Set a color for cyl3

(entity:set-color cyl3 4)

;; ()

; OUTPUT Example



Figure 3-3. solid:cylinder
PDF/CSTR/03SCN.PDF
HTM/DATA/CSTR/CSTR/03SCN/0010.HTM