Scheme Extensions Ra thru Zz |
|
|
Technical Article |
gvector | gvector |
position | position |
Description
A ray is not visible. An important usage for a ray is to pierce a body
or object for selection purposes.
; ray ; Create ray1 from a position and a gvector. (define ray1 (ray (position 0 0 0) (gvector 0 1 0))) ;; ray1 ; Create ray2 from a position and a gvector. (ray (position 78 5 12) (gvector 0 0 1)) ;; #[ray (78 5 12) (0 0 1)] ; Do something useful with ray. ; Create a block. (define block1 (solid:block (position -10 -5 -15) (position 25 25 25))) ;; block1 ; Remember the face. (define face1 (pick:face ray1)) ;; face1 ; Highlight the face crossed by the ray. (entity:set-highlight face1 #t) ;; #[entity 3 1] |
[Top]
ray | ray |
Description
The argument ray specifies a position
and a gvector. This extension returns the gvector direction from a ray.
; ray:gvector ; Define a ray. (define ray1 (ray (position -5 -5 -5) (gvector 1 0 0))) ;; ray1 ; Extract the gvector component of a ray. (ray:gvector ray1) ;; #[gvector 1 0 0] ; Get the gvector component of a read event. (ray:gvector (pick:ray (read-event))) ; Using the mouse, select a screen position. ;; #[gvector 0.119924328873844 0.949842878199001 ;; 0.288819428153296] |
[Top]
ray | ray |
Description
The argument ray specifies a position
and a gvector. This extension returns the position of the ray.
; ray:position ; Define a ray. (define ray1 (ray (position -5 -5 -5) (gvector 1 0 0))) ;; ray1 ; Extract the position component of a ray. (ray:position ray1) ;; #[position -5 -5 -5] ; get position component of a read event (ray:position (pick:ray (read-event))) ;; #[position -35.0111607852786 -48.3518844171113 ;; -1.77635683940025e-15] |
[Top]
posx | real |
posy | real |
posz | real |
vecx | real |
vecy | real |
vecz | real |
radius | real |
Description
The parameters describe the position and vector for a ray as six reals.
The given ray is constructed and added to the ray queue. It may later
be read by read-ray.
; ray:queue ; Create a ray and add it to the ray queue (ray:queue 1 2 3 4 5 6 7) ;; #[ray (1 2 3) (0.455842 0.569803 0.683763)] |
[Top]
ray | ray |
Description
A ray is considered invalid if the length of the vector is zero.
; ray:valid? ; Test whether an interactively read ray is valid. (ray:valid? (read-ray)) ;; #t |
[Top]
object | scheme-object |
; ray? ; Create a ray. (define ray1 (ray (position -5 -5 -5) (gvector 1 0 0))) ;; ray1 ; Determine if the ray is actually a ray. (ray? ray1) ;; #t ; Determine if a position is a ray. (ray? (position 0 0 0)) ;; #f |
[Top]
None |
Description
If the ray queue contains a ray, it is removed and returned and the ray
size option is set from the queued information. Otherwise, a pick-event
is read, using read-event, and converted to a ray. If journaling is on,
a (ray:queue ....) command is written to the journal file. This results
in a ray in the queue when the journal is replayed.
If the pick-event is from the right mouse button, the ray vector is set to an invalid zero length. This can be used as a stop condition in picking loops.
; read-ray ; Create a ray using the mouse. (read-ray) ; Use the left mouse button to create a pick-event. ;; #[ray (94.7806 -194.257 116.706) ;; (-0.408248 0.816497 -0.408248)] |
[Top]
object | scheme-object |
Description
This extension returns #t if the specified object is a shell; otherwise,
it returns #f.
; shell? ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 8 8 8))) ;; block1 ; Get a list of the block's shells. (define shells1 (entity:shells block1)) ;; shells1 ; Determine if one of the shells ; is actually a shell. (shell? (car shells1)) ;; #t ; Determine if the block is a shell. (shell? block1) ;; #f |
[Top]
object | scheme-object |
; solid? ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 40 40 40))) ;; block1 ; Determine if the solid block is a solid. (solid? block1) ;; #t ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 38)) ;; sphere1 ; Determine if the solid sphere is a solid. (solid? sphere1) ;; #t ; Create a circular edge. (define edge-1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge-1 ; Determine if the edge is a solid. (solid? edge-1) ;; #f |
[Top]
face | face |
Description
Given a face, returns the underlying surface's domain.
; surface:domain ; Create a face to use. (define face1 (face:law "vec(cos(x), y, x)" -20 (law:eval "10*pi") -10 10)) ;; face1 (surface:domain face1) ;; () ; Surface domain: ; -20 : 31.415926535898 ; -10 : 10 |
[Top]
srf | surface |
su | real |
sv | real |
level | integer |
Description
This extension finds the position on a parametric surface with the given
parameter values and optionally calculates the first and second derivatives.
; surface:eval ; Create a planar face. (define face1 (face:plane (position 0 0 0) 30 40)) ;; face1 ; Evaluate the position of a point ; on the planar surface. (surface:eval (surface:from-face face1) 15 15 0) ;; (#[position 15 15 0]) ; Create a conical surface. (define cone1 (face:cone (position 0 0 0) (position 0 50 0) 30 20 0 180)) ;; cone1 ; Evaluate the position and the first derivative ; of a point on the conical surface. (surface:eval (surface:from-face cone1) 0.5 0.5 1) ;; (#[position 23.7458553521721 14.7087101353638 ;; -12.9724199023621] #[gvector -5.16324300907818 ;; 29.4174202707276 2.82069251152796] ;; #[gvector -12.9724199023621 0 ;; -23.7458553521721]) |
[Top]
srf | surface |
su | real |
sv | real |
Description
This extension finds the two principal curvatures of the surface at the
given parameter values. It also returns the directions of the principal
curvatures.
;surface:eval-curvatures ;; Create the surface (solid:wiggle 50 50 50 "anti") ;; #[entity 1 1] ;; (ray:queue 258.188 -312.023 293.684 -0.537024 0.628851 -0.562273 1) (define f (pick-face)) ;; f (surface:eval-curvatures (surface:from-face f) .5 .5) ;; (0.067385584485619 #[gvector -0.576407926659592 ;; -0.281960099592504 -0.766976143254649] ;; 0.120983661175455 #[gvector -0.595361733728196 ;; 0.787806079907338 0.157816306106784]) |
[Top]
surf | surface |
u | real |
v | real |
; surface:eval-normal ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 40 40 40))) ;; block1 ; Get a list of the faces of the solid block. (define entities1 (entity:faces block1)) ;; entities1 ; Convert one face to a surface. (define surface1 (surface:from-face (car entities1))) ;; surface1 ; Evaluate the normal of the surface with the ; specified parameter values. (surface:eval-normal surface1 1 1) ;; #[gvector 0 0 1] |
[Top]
surf | surface |
u | real |
v | real |
; surface:eval-pos ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 40 40 40))) ;; block1 ; Get a list of the faces of the solid block. (define entities1 (entity:faces block1)) ;; entities1 ; Convert one face to a surface. (define surface1 (surface:from-face (car entities1))) ;; surface1 ; Evaluate the position on the surface at the ; specified parameter values. (surface:eval-pos surface1 1 1) ;; #[position 21 21 40] |
[Top]
face | face |
; surface:from-face ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 20 30 40))) ;; block1 ; Get a list of the block's faces. (define entities1 (entity:faces block1)) ;; entities1 ; Convert one of the block's faces to a surface. (surface:from-face (car (cdr entities1))) ;; #[plane surface 401c2310] |
[Top]
srf | surface |
pos | position pair (position point_on_surface gvector) |
Description
Given a surface and a position on the surface, this extension returns the
surface position and gvector.
; surface:point-perp ; Create a conical surface. (define cone1(face:cone (position 20 20 4) (position 20 20 8)2.5 0 0 360 0.6)) ;; cone1 ; Demonstrate the C++ function surface::point_perp() ; through the Scheme interface. (surface:point-perp (surface:from-face cone1) (position 22 20 2.5)) ;; (#[position 23.0337078651685 20 3.14606741573034] ;; #[gvector 0.847998304005088 0 0.52999894000318] ;; #[par-pos -0.402799194402416 0]) |
[Top]
srf | surface |
box-pos-1 | position |
box-pos-2 | position |
Description
Given a surface and (optionally) a 3-space box, returns the u and v parameter
ranges of the surface. Interfaces to the C++ surface::param_range
member function.
The returned value is a pair with the first being the u range and the second one being the v range. Note that #f is used when any end of an interval is unbounded, so for example, (0 . #f) represents an interval starting at 0 but which is unbounded above. An empty interval can be recognized by the first value of the pair being greater than the second.
; surface:range ; Create a conical surface. (define cone1 (face:cone (position 20 20 4) (position 20 20 8) 2.5 0 0 360 0.6)) ;; cone1 (surface:range (surface:from-face cone1)) ;; ((#f . 1.88679622641132) ;; (-3.14159265358979 . 3.14159265358979)) |
[Top]
object | scheme-object |
Description
The extension returns #t if the object is a surface, and #f if it is not
a surface.
; surface? ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create a cylindrical face. (define cyl1 (face:cylinder (position 0 0 0) (position 0 20 0) 10)) ;; cyl1 ; Determine if the solid block is a surface. (surface? block1) ;; #f ; Get a list of the faces of the block. (define entities1 (entity:faces block1)) ;; entities1 ; Convert one face to a surface. (define surface1 (surface:from-face (car entities1))) ;; surface1 ; Determine if one of the surfaces of the block ; is actually a surface. (surface? surface1) ;; #t |
[Top]
entity-list | entity | (entity ...) |
tolerance | real |
report-all | boolean |
file1 | string |
file2 | string |
ao | acis-options |
Description
The entities are saved and restored to test for sharing after
api_deep_copy_entity
has been called. If the command is used in a debug build, pattern filling
the original entities allows a greater level of checking. For debug or
release builds, the original and the deep copy SAT files can be compared
for differences.
This function is primarily for internal testing. However, if derived entities are used outside of ACIS, this command can verify if the entities are deep copyable.
; test:deep-copy ; Create a wiggle (define wiggle1 (solid:wiggle 25 25 25 "anti")) ;; wiggle1 (test:deep-copy wiggle1) ;; #t |
[Top]
arg1 | boolean | real | position | gvector | |
|
par-pos | number_array | graph | |
|
string |
arg2 | boolean | real | position | gvector | |
|
par-pos | number_array | graph | |
|
string |
tolerance | real |
msg | string |
Description
Compares arg1 and arg2
and returns true if they are equal. "Equality" for reals, positions, gvectors,
and the elements of number arrays, is defined as being within the tolerance
value (default PAresabs).
; test:equal (test:equal 2 2) ;; #t (test:equal (position 0 0 0) (position 0 0 1)) ;; #f (test:equal 5 5 "different number") ;; #t (test:equal 5 2 "different number") ;; *** Error test:equal: different number ;; #f |
[Top]
variable | real |
fixed | real |
tolerance | real |
msg | string |
Description
Compares variable to fixed, returning true if the variable is greater than
the fixed. If the variable is less than the fixed by an amount less than
the tolerance, the result is also true.
; test:greater-than (test:greater-than 2 1) ;; #t (test:greater-than 2.0 2.1 0.2 "greater within tolerance") ;; #t |
[Top]
variable | real |
fixed | real |
tolerance | real |
msg | string |
Description
Compares variable to fixed, returning true if the variable is less than
the fixed. If the variable is greater than the fixed by an amount less
than the tolerance, the result is also true.
; test:less-than (test:less-than 1 2) ;; #t (test:less-than 2.1 2.0 0.2 "less-than within tolerance") ;; #t |
[Top]
string | string |
Description
Runs performance test(s) specified by the string
argument. The format of string varies based on the test(s) requested.
Currently, only the ENTITY_LIST
performance test is available.
The format for string is: "ENTITY_LIST
[all | add | clear | assign | lookup | next | index] list_size iteration".
list_size is the size of the
ENTITY_LIST and iteration
specifies how many times the test is to be run. If list_size
and iteration are not specified, the default values 1000 and 1 (respectively)
are assigned.
Limitations
Only
the ENTITY_LIST
performance test is currently available.
; test:performance ; Run entity_list performance test. Request list_size ; and iteration different from defaults. (test:performance "entity_list all 100 10000") ;; () ; Size of the list = 100 ; Number of iteration = 10000 ; 0.810000 seconds to add 100 items 10000 times ; 0.390000 seconds to clear 100 items 10000 times ; 1.151000 seconds to assign 100 items 10000 times ; 0.190000 seconds to lookup 100 items 10000 times ; 0.170000 seconds to next 100 items 10000 times ; 0.541000 seconds to index 100 items 10000 times |
[Top]
text-entity | text |
Description
This extension returns the font name assigned to the text-entity,
which is enclosed in quotes. The font name is composed of foundry, the
family, the weight, the slant, and the set-width. In X Windows, use
the xlsfonts tool to display a list of available fonts.
; text:font ; Create a text entity. (define words (text (position 5 10 15) "Hello World" "new century schoolbook-bold-i-normal" 20)) ;; words ; Get the font value of the text entity. (text:font words) ;; "new century schoolbook-bold-i-normal" |
[Top]
text-entity | text |
Description
This extension returns the position of the point of origin of the text-entity. The origin is located
at the left edge of the left-most (leading) character in the string, at
the baseline on which the character sits.
; text:location ; Create a text entity. (define words (text (position 5 10 15) "Hello World" "new century schoolbook-bold-i-normal" 20)) ;; words ; Get the location of the text entity. (text:location words) ;; #[position 5 10 15] |
[Top]
text-entity | text |
font | string |
; text:set-font ; Create the first text entity. (define words (text (position -20 0 0) "abcdefghijklm" "symbol-medium-r-normal" 30)) ;; words ; Create the second text entity. (define words2 (text (position -20 -20 -20) "nopqrstuvwxyz" "symbol-medium-r-normal" 30)) ;; words2 ; OUTPUT Original ; Set the font of the first text entity. (text:set-font words "courier-bold-r-normal") ;; #[entity 2 1] ; Set the font of the second text entity. (text:set-font words2 "helvetica-bold-r-normal") ;; #[entity 3 1] ; OUTPUT Result |
[Top]
text-entity | text |
location | position |
Description
This extension sets the point of origin (location) for a text-entity.
The origin is located at the left edge of the left-most (leading) character
in the string, at the baseline on which the character sits.
; text:set-location ; Create a text entity. (define words (text (position 0 0 0) "Hello World." "times-medium-r-normal" 30)) ;; words ; Set the location of the text entity. (define location (text:set-location words (position 50 -20 10))) ;; location |
[Top]
text-entity | text |
size | integer |
Description
This extension sets the size of a text-entity.
; text:set-size ; Create a text entity. (define words (text (position 0 0 0) "Hello World." "times-medium-r-normal" 30)) ;; words ; Set the size of the text entity. (define size (text:set-size words 10)) ;; size |
[Top]
text-entity | text |
string | string |
; text:set-string ; Create a text entity. (define words (text (position 0 0 0) "Hello World." "times-medium-r-normal" 30)) ;; words ; Set the string of the text entity. (define string (text:set-string words "Hello Universe!")) ;; string |
[Top]
text-entity | text |
Description
This extension returns the font size, in points, of a text-entity.
; text:size ; Create a text entity. (define words (text (position 0 0 0) "Hello World." "times-medium-r-normal" 20)) ;; words ; Get the size of the text entity. (text:size words) ;; 20 |
[Top]
text-entity | text |
Description
This extension returns the text string in a text-entity,
which is enclosed in quotes.
; text:string ; Create a text entity. (define words (text (position 0 0 0) "Hello World." "times-medium-r-normal" 30)) ;; words ; Get the text entity string. (text:string words) ;; "Hello World." |
[Top]
object | scheme-object |
Description
This extension returns #t if the object is a text entity; otherwise, it
returns #f.
; text? ; Create a text string. (define words (text (position 0 0 0) "Hello World." "times-medium-r-normal" 30)) ;; words ; Determine if the string is a text string. (text? words) ;; #t |
[Top]
None |
Description
The commands timer:start, timer:end,
timer:show-time, and
timer:get-time
are used to measure performance of some command or series of commands.
They measure only the CPU time required to execute the command and not
any delays incurred from entering the commands into Scheme.
; timer:end ; Start the timer (timer:start) ;; "timer on" ; Create a solid block. (define blockA (solid:block (position 0 0 0) (position 20 20 20))) ;; blockA ; Create another solid block (define blockB (solid:block (position 0 0 0) (position -20 -20 -20))) ;; blockB ;Stop timer. (timer:end) ;; "timer off, use timer:get-time" (timer:get-time) ;; 21.271 |
[Top]
None |
Description
The commands timer:start,
timer:end,
timer:show-time,
and timer:get-time are used to measure performance of some command or
series of commands. They measure only the CPU time required to execute
the command and not any delays that might incur from entering the commands
into Scheme. They are used most often to determine the time required to
execute one or more commands.
timer:get-time can be executed/interspersed any number of times throughout a command or series of commands. You can also use timer:show-time to display the amount of time elapsed since timer:start was executed.
; timer:get-time ; Start the timer (timer:start) ;; "timer on" ; Create a solid block. (define blockA (solid:block (position 0 0 0) (position 20 20 20))) ;; blockA ; Create another solid block (define blockB (solid:block (position 0 0 0) (position -20 -20 -20))) ;; blockB ;Stop timer. (timer:end) ;; "timer off, use timer:get-time" (timer:get-time) ;; 21.271 |
[Top]
Description
The commands timer:start,
timer:end,
timer:get-time
and timer:show-time are used to measure performance of some command or
series of commands. This feature measures only the CPU time required to
execute the command and not any delays incurred from entering the commands
into Scheme or any other interference or condition.
timer:show-time can be executed/interspersed any number of times throughout a command or series of commands. timer:show-time returns a real number only after timer:start is executed. If timer:start has not been executed, timer:show-time returns zero (0). You can also use timer:get-time to display the amount of time elapsed since timer:start was executed.
; timer:show-time ; Start the timer (timer:start) ;; "timer on" ; Create a solid block (define blockA (solid:block (position 0 0 0) (position 20 20 20))) ;; blockA ; Create another solid block (define blockB (solid:block (position 0 0 0) (position -20 -20 -20))) ;; blockB ; Set color for blockB (entity:set-color blockB 7) ;; () ;show how much time has passed. (timer:show-time) ;; Elapsed time = 33.989 ;; 356.722 ; Create a third solid block (define blockC (solid:block (position 0 0 0) (position 40 40 40))) ;; blockC ; Set color for blockB (entity:set-color blockC 4) ;; () ;turn timer off. (timer:end) ;; "timer off, use timer:get-time" (timer:get-time) ;; 4.556 |
[Top]
None |
Description
The commands timer:start, timer:end,
timer:show-time, and
timer:get-time are used to measure performance
of some command or series of commands. It measures only the CPU time required
to execute the command and not any delays that might incur from entering
the commands into Scheme.
; timer:start ; Start the timer (timer:start) ;; "timer on" ; Create a solid block. (define blockA (solid:block (position 0 0 0) (position 20 20 20))) ;; blockA ; Create another solid block (define blockB (solid:block (position 0 0 0) (position -20 -20 -20))) ;; blockB ;Stop timer. (timer:end) ;; "timer off, use timer:get-time" (timer:get-time) ;; 2.274 |
[Top]
edges | edge | (edge...) |
tol | integer |
stop_immediately | bool |
ao | acis-options |
Description
Checks the edges in the given list for tolerance. Only edges whose
tolerance is above tol are returned.
; tolmod:check-edge-errors ; create a block (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 ; create a sphere (define sphere1 (solid:sphere (position 5 5 5) 40)) ;; sphere1 ; check edges of all entities (tolmod:check-edge-errors (entity:edges (part:entities))) ;; Worst error : 000000e+000 |
[Top]
edges | edge | (edge...) |
tol | integer |
stop_immediately | bool |
ao | acis-options |
Description
Fixes the edges in the list to be tolerant. When tol is defined,
the only edges made tolerant are those with worse tolerance levels than defined.
; tolmod:check-edge-errors ; create a block (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 ; create a sphere (define sphere1 (solid:sphere (position 5 5 5) 40)) ;; sphere1 ; check and fix bad edges of all entities (tolmod:fix-edge-errors (entity:edges (part:entities))) ;; Worst error : 000000e+000 |
[Top]
origin-position | position |
x-axis | gvector |
y-axis | gvector |
Description
After applying this transform to an entity, the entity has the same relationship
to the working coordinate system that it had to the model coordinate system.
; transform:axes ; Create a WCS. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set the color of the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 15 20 15))) ;; block1 ; OUTPUT Original ; Transform the solid block from model space to ; the created working space as defined by the WCS. (define transform (entity:transform block1 (transform:axes (position 0 0 0) (gvector -8 0 0) (gvector 0 6 0)))) ;; transform ; OUTPUT Result |
[Top]
transform1 | transform |
transform2 | transform |
Description
Concatenates two transforms. Permits the creation of more complex transforms
from simpler transforms such as reflection, rotation, scaling, and translation.
; transform:compose ; Create a WCS. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 ; OUTPUT Original ; Transform the solid block from model space to ; the created working space as defined by the WCS. ; Concatenate two transforms. (define comp1 (transform:compose (transform:rotation (position 0 0 0) (gvector -3 0 0) 45) (transform:axes (position 0 0 0) (gvector -8 0 0) (gvector 0 6 0)))) ;; comp1 ; comp1 (define transform (entity:transform block1 comp1)) ;; transform ; OUTPUT Result |
[Top]
transform | transform |
Description
Copies a transform into a duplicate but distinct transform.
; transform:copy ; Create a WCS. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 ; OUTPUT Original ; Apply a new transform by copying the existing ; transform and adding a translation. (define transform1 (transform:translation (gvector 4 0 0))) ;; transform1 (define copy1 (transform:copy transform1)) ;; copy1 (define entity1 (entity:transform block1 transform1)) ;; entity1 (roll -1) ;; -1 (define entity1 (entity:transform block1 copy1)) ;; entity1 ; OUTPUT Result |
[Top]
None |
Description
This extension creates an identity transform with the following rotation
matrix and translation elements:
| 1
0 0 |
R = | 0 1 0
| T = (0 0 0)
| 0
0 1 |
; transform:identity ; Create an identity transform. (transform:identity) ;; #[transform 1074574992] |
[Top]
transform | transform |
; transform:inverse ; Create a transform, and then create its inverse. (define transform1 (transform:axes (position 0 0 0) (gvector 1 0 0) (gvector 0 0 1))) ;; transform1 (define inverse1 (transform:inverse transform1)) ;; inverse1 ; Create a WCS. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 (define transform (entity:transform block1 transform1)) ;; transform ; OUTPUT Original (define transform2 (entity:transform block1 inverse1)) ;; transform2 ; OUTPUT Result |
[Top]
transform | transform |
Description
Prints the details of a transform.
; transform:print ; create a scaling transform (define s (transform:scaling 1 2 3)) ;; s ; create a rotation transform (define r (transform:rotation (position 0 0 0) (gvector 0 0 1) 30)) ;; r ; create a translation transform (define t (transform:translation (gvector 3 4 5))) ;; t ; compose the three (define sr (transform:compose s r)) ;; sr (define srt (transform:compose (transform:compose s r) t)) ;; srt ; print the result (transform:print srt) ;; #[transform 72496304] ; rotation no reflection shear not identity ; translation part: ; 3.000000 4.000000 5.000000 ; affine part: ; 0.231455 0.133631 0.000000 ; -0.267261 0.462910 0.000000 ; 0.000000 0.000000 0.801784 ; scaling part: ; 3.741657 |
[Top]
plane-position | position |
plane-direction | gvector |
; transform:reflection ; Define a working coordinate system. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 ; OUTPUT Original ; Create a transform and then create its reflection. (define transform1 (transform:reflection (position 0 0 0) (gvector -1 0 0))) ;; transform1 ; Apply the transform to reflect the block. (define transform (entity:transform block1 transform1)) ;; transform ; OUTPUT Result |
[Top]
origin-position | position |
axis-direction | gvector |
angle | real |
; transform:rotation ; Define a working coordinate system. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 ; OUTPUT Original ; Create a transform and then create its reflection. (define transform1 (transform:rotation (position 0 0 0) (gvector -3 0 0) 45)) ;; transform1 ; Apply the transform to reflect the block. (define transform (entity:transform block1 transform1)) ;; transform ; OUTPUT Result |
[Top]
x-scale | real |
y-scale | real |
z-scale | real |
Description
The specified scale must be positive definite. When only the x-scale
term is supplied, a uniform scaling transform is obtained, with which all three components
of positions, gvectors, and entity dimensions are multiplied by the same factor.
When three scaling terms are supplied, a non-uniform scaling transform is created
(unless all three terms are equal). The application of non-uniform scaling transforms
to entities invokes the Space Warping component.
; transform:scaling ; Define a working coordinate system. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 15 20 15))) ;; block1 ; OUTPUT Original ; Create a transform and then create its reflection. (define transform1 (transform:scaling 0.75 0.75 0.25)) ;; transform1 ; Apply the transform to reflect the block. (define transform (entity:transform block1 transform1)) ;; transform ; OUTPUT Result |
[Top]
gvector | gvector |
; transform:translation ; Define a working coordinate system. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 15 20 15))) ;; block1 ; OUTPUT Original ; Create a transform and then create its reflection. (define transform1 (transform:translation (gvector 10 12.5 0))) ;; transform1 ; Apply the transform to reflect the block. (define transform (entity:transform block1 transform1)) ;; transform ; OUTPUT Result |
[Top]
object | scheme-object |
; transform? ; Create a transform. (define transform1 (transform:translation (gvector 1 0 0))) ;; transform1 ; Determine if the transform and its identity ; are actually transforms. (transform? transform1) ;; #t (transform? (transform:identity)) ;; #t |
[Top]
major | integer |
minor | integer |
release | integer |
Description
Returns a version tag scheme object.
; versiontag ; Query for the current versiontag. (versiontag) ;; #[Major=7 Minor=0 Point=0 Tag=70000] ; Create a new version tag scheme object. (versiontag 7 1 0) ;; #[Major=7 Minor=1 Point=0 Tag=70100] |
[Top]
vertex | vertex |
Description
Returns the position of a vertex.
; vertex:position ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 35 35 35))) ;; block1 ; Get a list of the vertices. (entity:vertices block1) ;; (#[entity 3 1] #[entity 4 1] #[entity 5 1] ;; #[entity 6 1] #[entity 7 1] #[entity 8 1] ;; #[entity 9 1] #[entity 10 1]) ; Determine the position of one vertex. (vertex:position (entity 7)) ;; #[position 35 35 0] |
[Top]
object | scheme-object |
; vertex? ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 35 35 35))) ;; block1 ; Get a list of the block's vertices. (entity:vertices block1) ;; (#[entity 3 1] #[entity 4 1] #[entity 5 1] ;; #[entity 6 1] #[entity 7 1] #[entity 8 1] ;; #[entity 9 1] #[entity 10 1]) ; Determine if a vertex is actually a vertex. (vertex? (entity 6)) ;; #t |
[Top]
origin-pos | position |
x-pos | position |
x-vec | gvector |
y-pos | position |
y-vec | gvector |
Description
The origin-pos, x-pos
and y-pos are used to define
the xy-plane. The z-axis is defined by the right hand rule.
; wcs ; Create a new WCS. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; OUTPUT WCS 1 ; Create a second WCS. (define wcs2 (wcs (position 30 0 0) (position 30 30 0) (position 30 0 10))) ;; wcs2 ; Set a color for the wcs. (entity:set-color wcs1 6) ;; () ; OUTPUT WCS 2 |
[Top]
None |
Description
This extension returns the active WCS; otherwise, it returns #f if no WCS
is active.
; wcs:active ; Create a WCS. (define wcs1 (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs1 ; Determine if the WCS is active. (wcs:active) ;; #f ; Set the new WCS to be active. (wcs:set-active wcs1) ;; () ; Get the active WCS. (wcs:active) ;; #[entity 2 1] |
[Top]
transform | transform |
; wcs:from-transform ; Create a new WCS. (define wcs1 (wcs (position 0 0 0) (position 5 0 0) (position 0 5 0))) ;; wcs1 (define transform1 (transform:rotation (position 0 0 0) (gvector -10 0 0) 60)) ;; transform1 ; Create a new WCS from a transform rotation. (define wcs2 (wcs:from-transform transform1)) ;; wcs2 (define transform2 (transform:translation (gvector 10 10 20))) ;; transform2 ; Create a new WCS from a transform translation. (define wcs3 (wcs:from-transform transform2)) ;; wcs3 ; OUTPUT Example |
[Top]
wcs | wcs |
; wcs:origin ; Get the origin position of the current WCS. (wcs:origin) ;; #[position 0 0 0] ; Define a new WCS. (define wcs1 (wcs (position -10 -10 -10) (position 0 10 0) (position 10 0 0))) ;; wcs1 ; Get the origin position of the new WCS. (wcs:origin wcs1) ;; #[position -10 -10 -10] |
[Top]
wcs | wcs |
; wcs:set-active ; Define working coordinate system. (define wcs1 (wcs (position 0 0 0) (position 5 0 0) (position 0 5 0))) ;; wcs1 ; Set a color for wcs1. (entity:set-color wcs1 6) ;; () ; Define a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Set a color for block 1. (entity:set-color block1 3) ;; () ; Define a second working coordinate system. (define wcs2 (wcs (position 15 0 0) (position 20 0 0) (position 0 20 0))) ;; wcs2 ; OUTPUT WCS1 and Block1 ; Set the specified WCS to be the active WCS. (wcs:set-active wcs2) ;; () ; Define another solid block in the specified WCS. (define block2 (solid:block (position 0 0 0) (position 10 10 10))) ;; block2 ; Set a color for the second block. (entity:set-color block2 1) ;; () ; OUTPUT WCS2 and Block2 |
[Top]
wcs | wcs |
; wcs:to-model-transform ; Find the transform of the current WCS to ; model space. (define transform1 (wcs:to-model-transform)) ;; transform1 ; Define a new WCS. (define wcs1 (wcs (position -10 -10 -10) (position 0 10 0) (position 10 0 0))) ;; wcs1 ; Find the transform of the new WCS to model space. (wcs:to-model-transform wcs1) ;; #[transform 1074571672] |
[Top]
wcs | wcs |
; wcs:to-wcs-transform ; Get the transform from the active coordinate ; system to the current WCS. (define transform1 (wcs:to-wcs-transform)) ;; transform1 ; Define a new WCS. (define wcs1 (wcs (position 0 0 0) (position 0 10 0) (gvector 1 0 0))) ;; wcs1 ; Get the transform from the active coordinate ; system to the new WCS. (wcs:to-wcs-transform wcs1) ;; #[transform 1074571664] |
[Top]
wcs | wcs |
; wcs:x-axis ; Find the x-direction of the current WCS. (wcs:x-axis) ;; #[gvector 1 0 0] ; Define a new WCS. (define wcs1 (wcs (position 10 10 10) (position 10 0 0) (position 0 10 0))) ;; wcs1 ; Get the x-direction of the new WCS. (wcs:x-axis wcs1) ;; #[gvector 0 -0.707106781186548 ;; -0.707106781186548] ; Define WCS wcs3. (define wcs13 (wcs (position 3 2 1) (gvector 0 1 0) (position 1 0 0))) ;; wcs13 ; Find the x-direction of WCS wcs3. (wcs:x-axis wcs13) ;; #[gvector 0 1 0] |
[Top]
wcs | wcs |
; wcs:y-axis ; Get the y-direction of the current WCS. (wcs:y-axis) ;; #[gvector 0 1 0] ; Define a new WCS. (define wcs1 (wcs (position 10 10 10) (position 10 0 0) (position 0 10 0))) ;; wcs1 ; Get the y-direction of the new WCS. (wcs:y-axis wcs1) ;; #[gvector -0.816496580927726 0.408248290463863 ;; -0.408248290463863] ; Define WCS wcs3. (define wcs3 (wcs (position 3 2 1) (gvector 0 1 0) (position 1 0 0))) ;; wcs3 ; Get the y-direction of wcs3. (wcs:y-axis wcs3) ;; #[gvector -0.894427190999916 0 ;; -0.447213595499958] |
[Top]
wcs | wcs |
; wcs:z-axis ; Get the z-axis of the current WCS. (wcs:z-axis) ;; #[gvector 0 0 1] ; Define a new WCS. (define wcs1 (wcs (position 10 10 10) (position 10 0 0) (position 0 10 0))) ;; wcs1 ; Get the z-axis of the new WCS. (wcs:z-axis wcs1) ;; #[gvector 0.577350269189626 0.577350269189626 ;; -0.577350269189626] ; Define wcs3. (define wcs3 (wcs (position 3 2 1) (gvector 0 1 0) (position 1 0 0))) ;; wcs3 ; Get the z-axis of wcs3. (wcs:z-axis wcs3) ;; #[gvector -0.447213595499958 0 0.894427190999916] |
[Top]
object | scheme-object |
Description
This extension returns #t if the specified object is a WCS entity; otherwise,
it returns #f.
; wcs? ; Create a wcs. (define wcs1 (wcs (position 0 0 0) (gvector 0 -1 0) (gvector 1 0 0))) ;; wcs1 ; Determine if the WCS is actually a WCS. (wcs? wcs1) ;; #t |
[Top]
wire | wire |
Description
Entity requires a wire entity.
If the specified wire entity
is open, it temporarily closes the wire with a line from the start point
to the end point and computes the area of this closed wire. If the wire
is non-planar, this extension returns zero. This extension does not check
if the wire is self-intersecting or that the resultant area is incorrect.
; wire-body:area ; Create first edge. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Create second edge. (define edge2 (edge:circular (position 0 0 0) 25 180 270)) ;; edge2 ; Create third edge. (define edge3 (edge:linear (position 0 0 0) (position 25 0 0))) ;; edge3 ; Create the wire-body. (define wirebody1 (wire-body (list edge3 edge1 edge2))) ;; wirebody1 ; Get the area of the planar wire-body. (wire-body:area wirebody1) ;; 1472.62155637022 |
[Top]
object | scheme-object |
Description
Queries the wire body if it is planar and returns its normal.
; wire-body:normal ; Create edge 1. (define edge1 (edge:linear (position -20 -10 0) (position 10 -10 0))) ;; edge1 ; Create edge:circular 2. (define edge2 (edge:circular (position 10 0 0) 10 270 360)) ;; edge2 ; Create edge 3. (define edge3 (edge:linear (position 20 0 0) (position 20 20 0))) ;; edge3 ; Create edge 4. (define edge4 (edge:linear (position 20 20 0) (position -10 20 0))) ;; edge4 ; Create edge:circular 5. (define edge5 (edge:circular (position -10 10 0) 10 90 180)) ;; edge5 ; Create edge 6. (define edge6 (edge:linear (position -20 10 0) (position -20 -10 0))) ;; edge6 ; Create a wire-body from the edges. (define wirebody1 (wire-body (list edge1 edge2 edge3 edge4 edge5 edge6))) ;; wirebody1 ; Determine if the wire-body is actually a wire-body. (wire-body:planar? wirebody1) ;; #t ; Determine the wire-body normal (wire-body:normal wirebody1) ;; #[gvector 0 0 -1] |
[Top]
object | scheme-object |
; wire-body:planar? ; Create edge 1. (define edge1 (edge:linear (position -20 -10 0) (position 10 -10 0))) ;; edge1 ; Create edge:circular 2. (define edge2 (edge:circular (position 10 0 0) 10 270 360)) ;; edge2 ; Create edge 3. (define edge3 (edge:linear (position 20 0 0) (position 20 20 0))) ;; edge3 ; Create edge 4. (define edge4 (edge:linear (position 20 20 0) (position -10 20 0))) ;; edge4 ; Create edge:circular 5. (define edge5 (edge:circular (position -10 10 0) 10 90 180)) ;; edge5 ; Create edge 6. (define edge6 (edge:linear (position -20 10 0) (position -20 -10 0))) ;; edge6 ; Create a wire-body from the edges. (define wirebody1 (wire-body (list edge1 edge2 edge3 edge4 edge5 edge6))) ;; wirebody1 ; Determine if the wire-body is actually a wire-body. (wire-body:planar? wirebody1) ;; #t |
[Top]
object | scheme-object |
Description
This extension returns #t if the specified object is a wire body; otherwise,
it returns #f.
; wire-body? ; Create an edge. (define edge1 (edge:circular (position 0 0 0) 25 180 270)) ;; edge1 ; Check to see if the edge is a wire-body. (wire-body? edge1) ;; #f ; Create a wire-body from the edge. (define wirebody1 (wire-body edge1)) ;; wirebody1 ; Check to see if the wire-body is a wire-body. (wire-body? wirebody1) ;; #t |
[Top]
object | scheme-object |
Description
This extension returns #t if the specified object is a wire body; otherwise,
it returns #f.
; wire:closed? ; Create an edge. (define edge1 (edge:circular (position 0 0 0) 25 180 270)) ;; edge1 ; Check to see if the edge is a wire-body. (wire-body? edge1) ;; #f ; Create a wire-body from the edge. (define wirebody1 (wire-body edge1)) ;; wirebody1 ; Check to see if the wire-body is a wire-body. (wire:closed? wirebody1) ; Entity is not a wire. ;; #f |
[Top]
object | scheme-object |
; wire:planar? ; Create edge 1. (define edge1 (edge:linear (position -20 -10 0) (position 10 -10 0))) ;; edge1 ; Create edge:circular 2. (define edge2 (edge:circular (position 10 0 0) 10 270 360)) ;; edge2 ; Create edge 3. (define edge3 (edge:linear (position 20 0 0) (position 20 20 0))) ;; edge3 ; Create edge 4. (define edge4 (edge:linear (position 20 20 0) (position -10 20 0))) ;; edge4 ; Create edge:circular 5. (define edge5 (edge:circular (position -10 10 0) 10 90 180)) ;; edge5 ; Create edge 6. (define edge6 (edge:linear (position -20 10 0) (position -20 -10 0))) ;; edge6 ; Create a wire-body from the edges. (define wirebody1 (wire-body (list edge1 edge2 edge3 edge4 edge5 edge6))) ;; wirebody1 ; Determine if the wire-body is actually a wire-body. (wire:planar? wirebody1) ;; #f (wire:planar? (car (entity:wires wirebody1))) ;; #t |
[Top]
object | scheme-object |
Description
This extension returns #t if the object is a wire; otherwise, it returns
#f. (Use entity:wires to extract a list of wires from a wire body.)
; wire? ; Create an edge. (define edge1 (edge:circular (position 0 0 0) 25 180 270)) ;; edge1 ; Check to see if the edge is a wire. (wire? edge1) ;; #f ; Create a wire-body from the edge. (define body1 (wire-body edge1)) ;; body1 ; Check to see if the wire-body is a wire. (wire? body1) ;; #f ; Create a wire from the wire-body. (define wires1 (entity:wires body1)) ;; wires1 ; Check to see if the wire is a wire. (wire? (car wires1)) ;; #t |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.