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

Action: Creates a sphere centered at the specified position.

Filename: cstr/cstr_scm/sld_scm.cxx

APIs: api_solid_sphere

Syntax: (solid:sphere {center-position | {center-x center-y


center-z}} radius)

Arg Types: center-position position

center-x real

center-y real

center-z real

radius real

Returns: entity

Description: Creates a sphere centered at the specified position. center-position specifies the center position of the sphere. There are two syntax formats available for defining the center-position. The first (original) syntax format defines the center-position by placing the xyz coordinates in a 'position' statement enclosed in parenthesis (as shown in the example below with creating sphere1). However, the second syntax format defines the center position xyz coordinates without using the 'position' statement or the additional set of parenthesis (as shown in the example below with defining sphere2 and sphere3). The two formats are otherwise identical.


center-position specifies the center position of the sphere


center-x, center-y, center-z is the syntax for the positional argument center-position.


radius determines the size of the sphere.

Example: ; solid:sphere

; Create first sphere. Use 'position' syntax format

; for defining the positions.

; Create solid sphere1.

(define sphere1


(solid:sphere (position -4 -4 0) 1.5))

;; sphere1

; Create 2nd sphere.Use alternate position argument

; format. Define radius.

(define sphere2


(solid:sphere -30 0 0 15))

;; sphere2

; Create solid sphere 3.

; Define 2nd sphere using alternate position argument

; format. Define radius.

(define sphere3 (solid:sphere 10 10 10 5)))

;; sphere3

; OUTPUT Example


(render)

;; OUTPUT Rendered Spheres



Figure 3-6. solid:sphere

PDF/CSTR/03SCN.PDF
HTM/DATA/CSTR/CSTR/03SCN/0015.HTM