|
Many
ACIS creation techniques for solid and surface primitives are very basic. They tend to create objects at the working coordinate system origin with simple geometric relationships. The reason for this is that it simplifies the syntax of the primitive operations if positioning and orientation are left to later steps. Because of this, model entities may need to be moved.
|
|
|
ACIS refers to this operation as a
transformation. A transformation can be used for such things as scaling, reflection, inversion, rotation, etc., in addition to repositioning.
|
|
|
Internally,
ACIS transformations are essentially matrix operations performed on the modeling entity. When combining transformations and/or applying them to an entity,
ACIS performs the more complex linear algebra and matrix tasks for you, allowing you to define in a more general sense the operation desired.
|
|
|
To move entities to more suitable locations, the Scheme extension
entity:transform can be used with defined transformations.
|
|
|
The following example creates a simple block with one corner at the origin. A translation transformation is defined that moves the block along a vector. A rotation transformation is defined that rotates the block 45 degrees around a vector.
|
|
|
Scheme Example
|
|
|
; Create a solid block.
|
|
(define my_block (solid:block (position 0 0 0)
|
|
(position 10 15 20)))
|
|
;; my_block
|
|
; my_block => #[entity 2 1]
|
|
; Create a copy of the block.
|
|
(define my_block2 (entity:copy my_block))
|
|
;; my_block2 => #[entity 3 1]
|
|
; Create a transform to move the block.
|
|
(define my_t_move (transform:translation (gvector 10 12.5 0)))
|
|
;; my_t_move
|
|
(define my_t_rotate (transform:rotation
|
|
(position 15 20 0) (gvector -1 0 1) 45))
|
|
;; my_t_rotate
|
|
(define my_transform (transform:compose
|
|
my_t_move my_t_rotate))
|
|
;; my_transform
|
|
; Apply the transform to the block.
|
|
(entity:transform my_block my_transform)
|
|
;; #[entity 2 1]
|
|
; Refresh the view so that both entities are visible.
|
|
(view:refresh)
|
|
;; #[view 293023412]
|
|
; Save the results to an output file.
|
|
(part:save "tmptrans1.sat")
|
|
;; #t
|
|
|
Some of the Scheme extensions related to transformations on models are:
|
|
|
afig:apply-transform
|
Apply a transform to an animation-figure.
|
|
|
afig:get-transform
|
Get the current transformation for an animation-figure.
|
|
|
afig:set-transform
|
Set the transform for an animation-figure.
|
|
|
curve:transform
|
Modifies a curve or edge by applying a transform.
|
|
|
entity:fix-transform
|
Applies a body transformation to all underlying geometry.
|
|
|
entity:transform
|
Applies a transform to a single entity or list of entities.
|
|
|
gvector:transform
|
Applies a transform to a gvector.
|
|
|
position:transform
|
Applies a transform to a position.
|
|
|
transform:axes
|
Creates a transform that takes an object from model space to the space defined by the new origin and axes.
|
|
|
transform:compose
|
Concatenates two transforms.
|
|
|
transform:copy
|
Copies a transform.
|
|
|
transform:identity
|
Creates an identity transform.
|
|
|
transform:inverse
|
Creates an inverse transform.
|
|
|
transform:reflection
|
Creates a transform to mirror an object through an axis.
|
|
|
transform:rotation
|
Creates a transform to rotate an object about an axis.
|
|
|
transform:scaling
|
Creates a scaling transform.
|
|
|
transform:translation
|
Creates a translation transform.
|
|
|
transform?
|
Determines if a Scheme object is a transform.
|
|
|
wcs:from-transform
|
Creates a work coordinate system given a transform.
|
|
|
wcs:to-model-transform
|
Gets the transform of the active WCS to model space.
|
|
|
wcs:to-wcs-transform
|
Gets the transform from the active WCS to the specified WCS.
|