Functions List


Views and Camera


all-shapes-bounding-box

The function all-shapes-bounding-box returns the two opposing corners of the bounding box in which all the shapes existing in the CAD application are contained.

Parameters:

n/a

Syntax:

(all-shapes-bounding-box)

Example:

> (cylinder (xyz 0 0 0) 2 18)
(box (xyz 4 3 0) (xyz 8 7 10))
#<cylinder 3>
#<box 4>

> (all-shapes-bounding-box)
<bbox: #<xyz:-2.0 -2.0 0.0> #<xyz:8.0 7.0 18.0>>



view-expression

The function view-expression retrieves the camera information from the CAD application, namely the camera location, target location and field-of-view.

Parameters:

n/a

Syntax:

(view-expression)

Example:

> (view-expression)
'(view
  (xyz -10.956948924272252 -55.64157338509792 30.516735349836498)
  (xyz 12.544136363335356 3.713189737094666 8.285768028234536)
  49.999999999999154)



view

The function view sets the camera view in the CAD application by specifying the camera position, the target position and field-of-view.

Parameters:

camera - Camera position
target - Target position
lens - Camera FOV

Syntax:

(view camera target lens)

Example:

> (view (xyz 0 0 0) (xyz 10 10 2) 50.0)
0



erase-2d-top

The function erase-2d-top deletes all the shapes in the CAD environment, sets the perspective to orthographic and sets the view to top.

Parameters:

n/a

Syntax:

(erase-2d-top)

Example:

> (erase-2d-top)
0



zoom-2d-top

The function zoom-2d-top places sets the perspective to orthographic, sets the view to top and zooms to the extents of the shapes inside the CAD environment.

Parameters:

n/a

Syntax:

(zoom-2d-top)

Example:

> (zoom-2d-top)



rotated-view

The function rotated-view rotates a camera view in the CAD application by specifying the rotation angle, rotation point, camera position, the target position and field-of-view.

Parameters:

dphi - Rotation angle
p - Rotation point
camera - Camera position
target - Target position
lens - Camera FOV

Syntax:

(rotated-view dphi p camera target lens)

Example:

> (rotated-view pi/4 (xyz 0 0 0) (xyz 2 2 0) (xyz 10 10 3) 50.0)
0



rotate-current-view

The function rotate-current-view rotates the active view of the CAD application by a specified angle.

Parameters:

dphi - Rotation angle

Syntax:

(rotate-current-view dphi)

Example:

> (rotate-current-view pi/2)
0



set-centered-view

The function set-centered-view sets a view in the CAD application in which the camera is positioned at a specified radial distance, polar angle and azimuth angle from the existing shapes and with a specified field of view. The shapes appear centred in the defined view.

Parameters:

rho - Distance from the objects
phi - Polar angle
psi - Azimuth angle
lens - Camera FOV

Syntax:

(set-centered-view rho phi psi lens)

Example:

> (set-centered-view 40 pi/3 pi/4 50.0)
2
Top