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

Action: Creates a spherical face.

Filename: cstr/cstr_scm/face_scm.cxx

APIs: api_face_sphere

Syntax: (face:sphere position radius


[latitude-start=-90 [latitude-end=90


[longitude-start=0 [longitude-end=360 [poledir]]]]])

Arg Types: position position

radius real

latitude-start real

latitude-end real

longitude-start real

longitude-end real

poledir vector

Returns: face

Description: This extension creates a spherical face relative to the active WCS. The center is the center of a sphere with the given radius.


angle1 and angle2 make up the latitude and angle3 and angle4 make up the longitude. Latitude moves from the equator 90 degrees to the North Pole or from the equator -90 degrees to the South Pole. Longitude moves from the zero meridian to the east 360 degrees (one complete revolution of the sphere). The default angles are latitude, -90 to 90, and longitude, 0 to 360. A partial sphere may be created, for example, by setting the latitude angles to 0 and 90, which results in the Northern hemisphere.


The north pole points in the direction of the active y-axis; the equator lies in the xz plane; and the zero meridian lies in the xy plane. The zero meridian begins at a positive radius length on the x-axis. Setting the poledir vector creates an alternate z-axis as described in face:plane.


position is the input position argument.


radius is the radius of the sphere.


latitude-start is the starting parameter of the latitude.


latitude-end is the ending parameter of the latitude.


longitude-start is the starting parameter of the longitude.


longitude-end is the ending parameter of the longitude.


poledir vector creates an alternate z-axis as described in face:plane.

Example: ; face:sphere

; Create spherical face 1.

(define face1 (face:sphere (position 0 0 0) 30))

;; face1

; OUTPUT Spherical Face 1


; Clear the first face

(part:clear)

;; #t

; Create spherical face 2.

(define face2


(face:sphere (position 0 0 0) 40 -45 45 0 360))

;; face2

; OUTPUT Spherical Face 2


; Render to show the face.

(render)

;; ()

; OUTPUT Rendered Face





Figure 2-31. face:sphere
PDF/CSTR/02SCA.PDF
HTM/DATA/CSTR/CSTR/02SCA/0068.HTM