Scheme Extensions Ia thru Qz |
|
|
Technical Article |
run_mode | string |
Description
Set int_cur global cache run mode.
Example
; set new int_cur global cache run mode (iccache:set-mode 'hard_limit') ;; no_limit |
[Top]
new_size | integer |
Description
Set int_cur global cache size.
Example
; set new int_cur global cache size (iccache:set-size 40) ;; 80 |
[Top]
in-ent | entity |
Description
The input entity
in-ent
should be an edge.
; is:helix ; Create a profile to sweep into a helix. (option:set "sil" #f) ;; #t (define profile1 (edge:linear (position 5 0 0) (position 10 0 0))) ;; profile1 (is:helix profile1) ;; #f (define path1(edge:helix (position 0 0 0) (position 0 40 0) (gvector 1 0 0) 10 20 #t)) ;; path1 (define helix1(sweep:law profile1 path1)) ;; helix1 (define edge-list (entity:edges helix1)) ;; edge-list (is:helix (list-ref edge-list 0)) ;; #f (is:helix (list-ref edge-list 1)) ; Axis 0.000000 1.000000 0.000000 ; Root 0.000000 9.325620 0.000000 ; Pitch 20.000000 ; Radius 5.000000 ; Right Handed ;; #t (is:helix (list-ref edge-list 2)) ;; #f (is:helix (list-ref edge-list 3)) ; Axis 0.000000 1.000000 0.000000 ; Root 0.000000 9.328920 0.000000 ; Pitch 20.000000 ; Radius 10.000000 ; Right Handed ;; #t |
[Top]
"law-functions" | string |
type | law | real | position | par-pos | gvector |
law-data | law | real | position | par-pos | gvector | transform | edge | wire |
Description
The law Scheme extension creates a law Scheme data type composed of one or more
law functions.
; law ; Create a new law. (define law1 (law "x+x^2-cos(x)")) ;; law1 ; Evaluate the given law at 1.5 radians (law:eval law1 1.5) ;; 3.6792627983323 ; Another example using law data ; This creates a law that returns the position ; of an edge with its position mapped to the ; closed interval [0,1]. ; Create an edge. (define edge1 (edge:linear (position 0 0 0) (position 40 40 0))) ;; edge1 (define edge-law (law "map(cur(edge1)),edge1)" edge1)) ;; edge-law |
[Top]
law1 | law |
low | real |
high | real |
Description
This returns a list of bounds of the law from the different
interval pairs entered.
; law:bounds ; Define a law and find the bounds on interval. ; Create a law. (define law1 (law "x+x^2-cos(x)")) ;; law1 (law:bounds law1 -2 20) ; -5.350134 to 423.799265 ; Tolerance: 0.001000 ;; (-5.35013412467261 423.799264988314 0.001) |
[Top]
law | law | string | real | position | par-pos | gvector |
Description
Prints out the laws string or a simplified laws string. Determines if a law is
zero, constant, or linear. Tells what its takes and returns. Return the domain
of the law.
; law:check ; Create a law. (define law1 (law "x+x^2-cos(x)")) ;; law1 ; Check the law. (law:check law1) ; (X+X^2)-COS(X ; Simplified (X+X^2)-COS(X) ; Zero #f ; Constant #f ; Linear #f ; Takes 1 argument ; Returns 1 argument ; Dx = 1+2*X+SIN(X) ; Inverse of this law is not available. ; Numerator = (X+X^2)-COS(X) ; Denominator = 1 ; The domain in variable 0 is infinite ;; #t |
[Top]
None |
Description
A static list holding each of one law class is maintained. Therefore, the law
count number will never be zero. This is used for testing of memory leaks in
laws. This command should be used with the collect Scheme extension to find
memory leaks.
; law:count ; Create a law. (define law1 (law "x+x^2-cos(x)")) ;; law1 ; Check to see how many laws are in use. (law:count) ;; 121 ; This return depends on how many laws were defined ; and the number of laws maintained in the law static ; list. |
[Top]
a | real |
b | real |
f-a | real |
f-b | real |
df-a | real |
df-b | real |
Description
Produces a cubic a polynomial with given boundary conditions for both it and
its first derivative.
; law:cubic ; Create a law. (define law1 (law:cubic 0 1 2 3 4 5)) ;; law1 ; According to the definition, if a 0 is input, ; the output should be 2 and its first derivative ; at 0 is 4. (law:eval law1 0) ;; 2 (law:eval law1 1) ;; 3 (define deriv (law:derivative law1)) ;; deriv (law:eval deriv 0) ;; 4 (law:eval deriv 1) ;; 5 |
[Top]
law | law | string | real | position | par-pos | gvector |
with-respect-to | law | string |
Description
The law:derivative returns the exact derivative of the given law function.
; law:derivative ; Define a law to use. (define law1 (law "x^2")) ;; law1 ; To get exact results, take the exact derivative. ; Create the derivative of that law. (define d-law (law:derivative law1)) ;; d-law ; Evaluate the derivative. (law:eval d-law 3) ;; 6 ; Evaluate the second derivative. (law:eval (law:derivative d-law) 3) ;; 2 ; Find the numerical derivative at 3. (law:nderivative law1 3 "x" 1) ;; 5.9999999999838 ; Find the second numerical derivative at 3. (law:nderivative law1 3 "x" 2) ;; 1.9999997294066 |
[Top]
in-law | law |
term | integer |
Description
Returns the end of the domain of a law.
; law:end ; Define a profile to sweep for interesting shape (define profile1 (wire-body:points (list (position 5 0 0) (position 10 0 0) (position 10 5 0) (position 5 5 0) (position 5 0 0)))) ;; profile1 (define path1(edge:helix (position 0 0 0) (position 0 40 0) (gvector 1 0 0) 10 20 #t)) ;; path1 (define helix1(sweep:law profile1 path1)) ;; helix1 (define edge-list(entity:edges helix1)) ;; edge-list (define law1 (law "cur(EDGE1)" (list-ref edge-list 3))) ;; law1 (law:start law1) ;; 0 (law:end law1) ;; 12.5663706143592 |
[Top]
law | law | string | real | position | par-pos | gvector |
input | (entity | entity ...) | real | gvector | position | par-pos |
Description
This Scheme extension evaluates the law at the given input value(s).
; law:eval ; Create a new law. (define law1 (law "x+x^2-cos(x)")) ;; law1 ; Evaluate the given law at 1.5 radians (law:eval law1 1.5) ;; 3.6792627983323 ; Create a law with a multidimensional range. (define mlaw (law "vec(x+2,x+3,x+4,x+5)")) ;; mlaw (law:eval mlaw 3) ;; (5 6 7 8) ; Create a law with a multidimensional domain. (define law2 (law "x^2 + y + z")) ;; law2 (law:eval law2 (list 2 3 4)) ;; 11 (define law3 (law "a3^2 + a2 + a4")) ;; law3 ; When evaluating this, the law function has 4 as its ; highest input index. Thus, the input list has to ; have at least four items. Input a1 is not used in ; the law function, so the first element of list ; is not used. (law:eval law3 (list 1 2 3 4)) ;; 15 ; a3=3, a2=2, and a4=4. (a1=1). |
[Top]
in-law | law | string | real | position | par-pos | gvector |
input | (entity | (entity ...)) | real | gvector | position | par-pos |
; law:eval-par-pos ; Evaluate a parameters position (define law1 (law "vec(x,x^2)")) ;; law1 (law:eval-par-pos law1 2) ;; #[par-pos 2 4] (define law2 (law "vec(x^2, y+3*z)")) ;; law2 (law:eval-par-pos law2 (list 2 3 4)) ;; #[par-pos 4 15] |
[Top]
law | law | string | real | position | par-pos | gvector |
input | (entity | (entity ...)) | real | gvector | position | par-pos |
Description
This Scheme extension evaluates the
law
at the given
input. It is the same as law:eval
except that it returns either a position or a par-pos instead of a real or list
of reals. The output dimension of law has to be two (2) or three (3). The
result is a par-pos when the output dimension is two, and position when it is
three.
; law:eval-position ; Create a new law. (define law1 (law "vec(x,x^2,-cos(x))")) ;; law1 ; Evaluate the given law at 1.5 radians (law:eval-position law1 2) ;; #[position 2 4 0.416146836547142] (define law2 (law "vec(x^2, y, 3 * z)")) ;; law2 ; Evaluate the second law at some input values. (law:eval-position law2 (list 2 3 4)) ;; #[position 4 3 12] (define law3 (law "vec(a3^2,a2,a4)")) ;; law3 ; When evaluating this, the law function has 4 as its ; highest input index. Thus, the input list has to ; have at least four items. In law3, input A1 is ; not used in the law function, so the first element ; of list is not used. ; a3=3, a2=2, and a4=4. (a1=1). (define law4 (law "vec(a3^2,a4)")) ;; law4 (law:eval-position law3 (list 1 2 3 4)) ;; #[position 9 2 4] (law:eval law3 (list 1 2 3 4)) ;; (9 2 4) (law:eval-position law4 (list 1 2 3 4)) ;; #[par-pos 9 4] |
[Top]
law | law | string | real | position | par-pos | gvector |
input | (entity | (entity ...)) | real | position | par-pos |
Description
This Scheme extension evaluates the law at the given input. It is the same as
law:eval except that it returns a gvector instead of a real or
list of reals. The output dimension of law has to be three (3).
; law:eval-vector ; Create a new law. (define law1 (law "vec(x,x^2,-cos(x))")) ;; law1 ; Evaluate the given law at 1.5 radians (law:eval-vector law1 2) ;; #[gvector 2 4 0.416146836547142] (define law2 (law "vec(x^2, y, 3 * z)")) ;; law2 ; Evaluate the second law at some input values. (law:eval-vector law2 (list 2 3 4)) ;; #[gvector 4 3 12] (define law3 (law "vec(a3^2,a2,a4)")) ;; law3 ; When evaluating this, the law function has 4 as its ; highest input index. Thus, the input list has to ; have at least four items. Input A1 is not used in ; the law function, so the first element of list ; is not used. ; a3=3, a2=2, and a4=4. (a1=1). (law:eval-vector law3 (list 1 2 3 4)) ;; #[gvector 9 2 4] (law:eval law3 (list 1 2 3 4)) ;; (9 2 4) |
[Top]
path | entity |
vector-list | law | (law ...) |
number-hair | integer |
size | real |
hair-law | law | string | gvector |
base-law | law | string | position |
start-x | real |
end-x | real |
start-y | real |
end-y | real |
start-z | real |
end-z | real |
Description
The law:hedgehog extension defines vector fields that are attached to a curve.
They are useful for defining orientation when sweeping along a non-planar path.
There are two major ways to use this command. The determination as to which
method is used is based on the first argument type.
If the first argument is an entity, as would be the case for a wire body or edge, then that argument is assumed to be the path and should be followed by a Scheme list of laws, vector-list Optionally, the number of hairs on the hedgehog and its size can be specified.
If the first argument is not an entity, then it is assumed to be a hair-law, which can be a law, string, or gvector. hair-law specifies the direction for the hair vectors. This is followed by base-law, which specifies what is to receive the vector field. Thereafter, this can be followed by 0 or up to 5 arguments. number-hair specifies the number of vectors to use. The start and end parameters limit the range for displaying the vector field.
; law:hedgehog ; The edge is not required, but is useful ; for visualization purposes. It is defined ; the same as base-law. (define edge1 (edge:law "vec(cos(x),sin(x),x/10)" 0 50)) ;; edge1 (define base-law (law "vec(cos(x),sin(x),x/10)")) ;; base-law (define vector-law (law "vec(cos(x),sin(x),0)")) ;; vector-law (define hedgehog1 (law:hedgehog vector-law base-law 0 50 200 )) ;; hedgehog1 ; Another example. ; Clear out the result of the previous example (part:clear) ;; #t ; The face is not required, but is useful ; for visualization purposes. It is defined ; the same as base-law. (define face1 (face:law "vec(x,y,cos(x)*sin(y))" -5 5 -5 5)) ;; face1 (define base-law1(law "vec(x,y,cos(x)*sin(y))")) ;; base-law1 (define dx (law:derivative base-law)) ;; dx (define dy(law:derivative base-law1 "y")) ;; dy (define norm (law "cross(law1,law2)" dx dy)) ;; norm (define hedgehog2 (law:hedgehog norm base-law -5 5 -5 5 20 )) ;; hedgehog2 ; Another example. ; Clear out the previous example (part:clear) ;; #t (define base-law2 (law "vec(x,y,z)")) ;; base-law2 (define hair-law (law "norm(vec(x,y,z))")) ;; hair-law (define hedgehog3 (law:hedgehog hair-law base-law -10 10 -10 10 -10 10)) ;; hedgehog3 |
[Top]
in-law | law |
Description
The inverse of a given law is not supported for most laws. The only supported
law having an inverse is something derived from the bend law.
; law:inverse ; Create a cylinder (define a-part (solid:cylinder (position -20 0 -2) (position 20 0 -2) 0.75)) ;; a-part (entity:bend a-part (position -8 0 -2) (gvector 0 0 1) (gvector 0 1 0) 4 90) ;; #[entity 2 1] (define e-list (entity:edges a-part)) ;; e-list (define law1 (law "cur(EDGE1)" (list-ref e-list 0))) ;; law1 (define law2 (law:inverse law1)) ;; law2 |
[Top]
point1 | position |
gvector1 | gvector |
point2 | position |
gvector2 | gvector |
Description
Returns TRUE if the line given by point1 + t * gvector1 intersects the
line point2 + s * gvector2. Also prints out the parameter values of
the two nearest points.
; law:line-line-intersect ; Create a cylinder ; intersect at (1 2 3) (law:line-line-intersect (position 4 4 4) (gvector 3 2 1) (position 1 10 3) (gvector 0 -.3 0)) ; Lines intersect at (1.000000 2.000000 ; 3.000000) ; Param values are: ; param0 at -1.000000 ; param1 at 26.666667 ;; #t ; no intersection (law:line-line-intersect (position 5 4 4) (gvector 3 2 1) (position 3 10 1) (gvector 0 -.3 0)) ; Param values are: ; param0 at -0.900000 ; param1 at 26.000000 ;; #f |
[Top]
a | real |
b | real |
f-a | real |
f-b | real |
Description
Produces a linear polynomial using the input boundary conditions.
; law:linear ; Create a law. (define law1 (law:linear 0 1 2 3)) ;; law1 (law:eval 0) ;; 0 (law:eval 1) ;; 1 |
[Top]
some-law-functions | string |
law-data | law | real | position | par-pos | gvector | transform | edge | wire |
type | law | real | position | par-pos |
ao | acis-options |
Description
This routine creates a law entity which can be saved and restored from a SAT
file. The law does not have to be attached to model geometry.
; law:make-entity ; Create a law to use (define law1 (law "vec(x^2,cos(x)+arctan(y))")) ;; law1 (define law-ent (law:make-entity law1)) ;; law-ent |
[Top]
path | edge | wire |
twist | law |
axis | law | (law ...) |
faces | face | (face ...) |
user-rails | law | (law ...) |
version | version_tag |
Description
This produces a rail law or a list of rail laws that can be used by sweeping or
law:hedgehog.
If the path is a single edge or a wire with a single underlying edge, then a single rail law is produced. Otherwise, the extension creates multiple rail laws, one for each underlying edge in the path.
The only required argument is the path. If no other arguments are supplied, then the following default rails are created:
(law:make-rails my-path "NULL" (list "NULL" my-law "NULL")) |
; law:make-rails ; is:helix (define path1 (wire-body:offset (wire-body (edge:linear (position 0 0 0) (position 0 0 20))) 5 "x")) ;; path1 (define rail-1 (law:make-rails path1)) ;; rail-1 ; #[law ; "NORM(CROSS(DOMAIN(VEC(-(5*COS(X)), ; -(5*SIN(X)),1),0,20),VEC(0,0,1)))"] ; IF YOU WANT TO SEE THE RAILS, use law:hedgehog |
[Top]
law | law | string | real | position | par-pos | gvector |
value | (entity | (entity ...)) | real | position | gvector | par-pos |
with-respect-to | law |
number-of | integer |
type | integer |
Description
The law:nderivative returns a specified type of derivative of the
given law function.
; law:nderivative ; Define a law to use. (define law1 (law "x^2")) ;; law1 ; Find the numerical derivative at 3. (law:nderivative law1 3 "x" 1) ;; 5.9999999999838 ; Find the second numerical derivative at 3. (law:nderivative law1 3 "x" 2) ;; 1.9999997294066 ; To get exact results, take the exact derivative. ; Create the derivative of that law. (define dlaw (law:derivative law1)) ;; dlaw ; Evaluate the derivative. (law:eval dlaw 3) ;; 6 ; Example of left and right derivatives. (law:nderivative "abs(x)" 0 "x" 1 1) ;; -1 (law:nderivative "abs(x)" 0 "x" 1 2) ;; 1 (law:nderivative "abs(x)" 0 "x" 1 0) ;; -1.52465930505774e-16 ; In the case of non-differentiable functions, ; the normal option returns the average value. |
[Top]
law | law | string | real | position | par-pos | gvector |
low-lim | real |
up-lim | real |
tol | real |
Description
The law:nintegrate Scheme extension computes a numerical integration
on law.
; law:nintegrate ; Define a law to integrate. (define law1 (law "x + 1")) ;; law1 ; Evaluate the law over the range 0 and 1. (law:nintegrate law1 0 1) ;; 1.5 |
[Top]
law | law | string | real | position | par-pos | gvector |
low-lim | real |
up-lim | real |
Description
law:nmax computes where a law is the maximum over a given interval.
; law:nmax ; Define a list of points for a spline edge (define plist (list (position 0 0 0) (position 20 20 0) (position 40 0 0) (position 60 25 0) (position 40 50 0) (position 20 30 0) (position 0 50 0))) ;; plist (define start (gvector 1 1 0)) ;; start (define end (gvector -1 1 0)) ;; end (define testcur1 (edge:spline plist start end)) ;; testcur1 (define law1 (law "map(Curc(edge1),edge1)" testcur1)) ;; law1 (define maxpoint (law:nmax law1 0 1)) ;; maxpoint ; All curves in Scheme are parameterized from 0 to 1. (define point1 (dl-item:point (curve:eval-pos testcur1 maxpoint))) ;; point1 (dl-item:display point1) ;; () ; OUTPUT Result Figure. law:nmax - First Maximum Point on a Test Curve |
[Top]
law | law | string | real | position | par-pos | gvector |
low-lim | real |
up-lim | real |
Description
law:nmin computes where a law is the minimum over a given interval.
; law:nmin ; Define a simple law to find minimum. (law:nmin "x^2+x" -1 1) ;; -0.5 ; Another Example. ; Create the points for a test curve. (define plist (list (position 0 0 0) (position 20 20 20) (position -20 20 20) (position 0 0 0))) ;; plist (define start (gvector 1 1 1)) ;; start (define end (gvector 1 1 1)) ;; end (define testcur (edge:spline plist start end)) ;; testcur ; Create a curve law. (define curlaw (law "map(term(cur(edge1),1),edge1)" testcur)) ;; curlaw ; Find its minimum. (define min (law:nmin curlaw 0 1)) ;; min ; Plot and mark that point. (define minpoint (dl-item:point (curve:eval-pos testcur min))) ;; minpoint (dl-item:display minpoint) ;; () ; OUTPUT Result Figure. law:nmin - Minimum Point on a Test Curve |
[Top]
law | law | string | real | position | par-pos | gvector |
low-lim | real |
up-lim | real |
Description
Returns a list of numbers that represent the roots of the law over a given
range.
; law:nroot ; Find the roots of a sine wave. (law:nroot "sin(x)" 0 10) ;; (0 3.14159265358979 6.2831853071295 9.42477796085266) |
[Top]
law1 | law | string | real | position | par-pos | gvector |
law2 | law | string | real | position | par-pos | gvector |
low-lim | real |
up-lim | real |
Description
This returns a list of real values representing where two laws are equal over a
given range.
; law:nsolve ; Define two laws and find where equal on interval. (law:nsolve "x" "x^3" -2 2) ;; (-1.0 0 1.0) |
[Top]
a | real |
b | real |
f-a | real |
f-b | real |
df-a | real |
df-b | real |
ddf-a | real |
ddf-b | real |
Description
Produces a quintic polynomial with given boundary conditions for it, its first
derivative, and its second derivative.
; law:quintic ; Create a law. (define law1 (law:quintic 0 1 2 3 4 5 6 7)) ;; law1 (law:eval law1 0) ;; 2 (law:eval law1 1) ;; 3 (define dlaw (law:derivative law1)) ;; dlaw (define ddlaw (law:derivative dlaw)) ;; ddlaw (law:eval dlaw 0) ;; 3.99999999999998 (law:eval dlaw 1) ;; 5.00000000000003 (law:eval ddlaw 0) ;; 6 (law:eval ddlaw 1) ;; 7 |
[Top]
a-law | law | string | real | position | par-pos | gvector |
i | integer |
; law:reset-deriv ; Create a law (define a-law (law "x^2+3")) ;; a-law ; Create a deriv-law (define deriv-law (law "2*x")) ;; deriv-law ; Set the derivative (law:set-deriv a-law 0 deriv-law) ;; #t ; Reset the derivative (law:reset-deriv a-law 0) ;; #t |
[Top]
a-law | law | string | real | position | par-pos | gvector |
i | integer |
deriv-law | law | string | real | position | par-pos | gvector |
; law:set-deriv ; Create a law (define a-law (law "x^2+3")) ;; a-law ; Create a deriv-law (define deriv-law (law "2*x")) ;; deriv-law ; Set the derivative (law:set-deriv a-law 0 deriv-law) ;; #t |
[Top]
law | law | string | real | position | par-pos | gvector |
Description
The simplifier should always produce a law that is algebraically equivalent to
the given law, but it may fail to simplify the law completely. Its original
intent was to remove 0s and 1s from derivatives.
; law:simplify ; Create a new law. (define law1 (law "x^2/x-3*x")) ;; law1 ; Simplify the given law. (define simplaw2 (law:simplify law1)) ;; simplaw2 ; Simplify the given law. (define simplaw (law:simplify "x^2/x-3*x")) ;; simplaw |
[Top]
in-law | law |
term | integer |
Description
Returns the start of the domain of a law.
; law:start ; Define a profile to sweep for interesting shape (define profile1 (wire-body:points (list (position 5 0 0) (position 10 0 0) (position 10 5 0) (position 5 5 0) (position 5 0 0)))) ;; profile1 (define path1(edge:helix (position 0 0 0) (position 0 40 0) (gvector 1 0 0) 10 20 #t)) ;; path1 (define helix1(sweep:law profile1 path1)) ;; helix1 (define edge-list(entity:edges helix1)) ;; edge-list (define law1 (law "cur(EDGE1)" (list-ref edge-list 3))) ;; law1 (law:start law1) ;; 0 (law:end law1) ;; 12.5663706143592 (define law2 (law "cur(EDGE1)" (list-ref edge-list 4))) ;; law2 (law:start law2) ;; 0 (law:end law2) ;; 5 |
[Top]
object | scheme-object |
Description
This extension returns a #t if the given object is a law Scheme data type.
Otherwise, it returns a #f.
; law? ; Create a new law. (define law1 (law "x+x^2-cos(x)")) ;; law1 ; Test to see if item is a law Scheme data type. (law? law1) ;; #t ; Evaluate the given law at 1.5 radians (define answer (law:eval law1 1.5)) ;; answer ; Test to see if item is a law Scheme data type. (law? answer) ;; #t ; This is true, because real numbers can be laws. |
[Top]
entity1 | entity |
entity2 | entity |
Description
This extension returns #f if no loop is found that is shared by both entities.
; loop:find ; Create a solid block. (define block1 (solid:block (position 20 30 0) (position 0 0 40))) ;; block1 ; Create a solid cylinder. (define cyl1 (solid:cylinder (position 0 0 0) (position -20 -20 -20) 15 3 (position -5 -5 0))) ;; cyl1 ; Determine if any loops are shared. (loop:find block1 cyl1) ;; #f ; Create an edge list. (define list1 (entity:edges block1)) ;; list1 (define one-edge (car list1)) ;; one-edge (define two-edge (car (cdr list1))) ;; two-edge ; Determine if any loops are shared. (loop:find one-edge two-edge) ;; #[entity 16 1] |
[Top]
loop | entity |
Description
This returns a string specifying the type of loop. This includes "Periphery
loop", "Hole", "Separation loop", "Separation loop (U)", "Separation loop (V)",
"Separation loop (UV)", and "Unknown type of loop".
; loop:type ; Create a model with loops (define profile1 (edge:linear (position 5 0 0) (position 10 0 0))) ;; profile1 (is:helix profile1) ;; #f (define path1(edge:helix (position 0 0 0) (position 0 40 0) (gvector 1 0 0) 10 20 #t)) ;; path1 (define helix1(sweep:law profile1 path1)) ;; helix1 (define loop-list (entity:loops helix1)) ;; loop-list (loop:type (list-ref loop-list 0)) ;; "Periphery loop" |
[Top]
object | scheme-object |
Description
This extension returns #t if the object is a loop; otherwise, it returns #f.
; loop? ; Create a solid cylinder. (define cyl1 (solid:cylinder (position 0 0 0) (position 8 8 8) 32)) ;; cyl1 ; Find the loops of the cylinder. (define loops1 (entity:loops cyl1)) ;; loops1 ; Determine if the cylinders loop is ; actually a loop. (loop? (car (cdr loops1))) ;; #t (loop? cyl1) ;; #f |
[Top]
object | scheme-object |
Description
This extension returns #t if the object is a lump; otherwise it returns #f.
; lump? ; Create a solid cylinder. (define cyl1 (solid:cylinder (position 0 0 0) (position 8 8 8) 32)) ;; cyl1 ; Find the lumps of the cylinder. (define limps1 (entity:lumps cyl1)) ;; limps1 ; Determine if the cylinders lump is ; actually a lump. (lump? (car limps1)) ;; #t (lump? cyl1) ;; #f |
[Top]
minimize_options | minimize_options object |
option_name | string |
option | 0 or 1 |
Description
This command generates a scheme
minimize_options object that can be used to control the behavior of
individual minimization commands. The options are specified as pairs of option
names and associated values. Options not defined explicitly are set to zero.
If the first argument is an existing
minimize_options object, then the option values are initialized to the
values of that object, and then individual option settings are processed. If no
arguments are specified, a minimize_options object with all options set to zero
is returned.
The default behavior of the minimization commands may be set using the
(minimize:set-defaults) command.
; create a minimize_options object to page the geometry to a file ; and delete the approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo |
[Top]
pos1 | position |
pos2 | position |
wcs | wcs |
entity_list | entity | (entity ...) |
minimize_options | minimize_options |
acis_options | acis_options |
Description
This operation minimizes the memory usage of the specified geometric entities
that lie outside of the minimization box. This box is defined by the two
corners, pos1 and pos2, in relation to the coordinate system specified using
wcs. If the wcs argument is omitted, the corners will be taken relative to
model space or the active work coordinate system.
The entities to consider for minimization are specified by the optional entity_list argument. If this list is omitted, all entities of the active part are considered.
The minimize_options argument controls the types of action taken by the minimization mechanism. If the minimize_options object is omitted, the global settings are used.
For the minimization operation to be successful, the paging system must first be initialized with the page:init command.
Example
minimize:box (part:clear) ;; #t ; Initialize the paging system (page:init) ;; #t ; Create two bezier curves (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 ; Set up minimize-options object to page geometry and delete approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo ; Display paging statistics before performing minimize operation (page:stats) ;; (("page-bytes" . 0) ("page-count" . 0) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 0) ("smallest-entry" . 0) ("page-file" . "acis.swp") ;; ("file-size" . 0) ("state" . 1)) ; Minimize everything outside of a box which contains c1 (minimize:box (position 0 0 0) (position 1 1 1) mo) ;; #t ; Display paging statistics after performing minimize operation (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) |
[Top]
entity_list | entity | (entity ...) |
minimize_options | minimize_options |
acis_options | acis_options |
Description
This operation minimizes the memory usage of the specified geometric entities.
The (minimize:entities) command is the scheme interface for
api_minimize_entities.
The minimize_options argument controls the types of action taken by the
minimization mechanism. If the
minimize_options object is omitted, the global settings are used.
For the minimization operation to be successful, the paging system must first
be initialized with the (page:init) command.
Example
; minimize:entities (part:clear) ;; #t ; Initialize the paging system (page:init) ;; #t ; Create two bezier curves (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 ; Set up minimize-options object to page geometry and delete approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo ; Display paging statistics before performing minimize operation (page:stats) ;; (("page-bytes" . 0) ("page-count" . 0) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 0) ("smallest-entry" . 0) ("page-file" . "acis.swp") ;; ("file-size" . 0) ("state" . 1)) ; Minimize all entities in the active part (minimize:entities (part:entities) mo) ;; #t ; Display paging statistics after performing minimize operation (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) |
[Top]
minimize_options | minimize_options |
acis_options | acis_options |
Description
This operation uses the minimization mechanism to reduce the memory usage of
geometric entities associated with inactive parts. The minimize_options
argument controls the types of action taken by the minimization mechanism. If
the minimize_options object is omitted, the global settings are used. For the
minimization operation to be successful, the paging system must first be
initialized with the page:init command.
Example
; minimize:inactive (part:clear) ;; #t ; Initialize the paging system (page:init) ;; #t ; Create first part (define part1 (env:active-part)) ; Create a bezier curve in part1 ;; part1 (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 ; Create second part and make it active (define part2 (part:new)) ;; part2 (env:set-active-part part2) ;; () ; Create a different bezier curve in part2 (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 ; Set up minimize-options object to page geometry to file and delete approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo ; Display paging statistics before performing minimize operation (page:stats) ;; (("page-bytes" . 0) ("page-count" . 0) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 0) ("smallest-entry" . 0) ("page-file" . "acis.swp") ;; ("file-size" . 0) ("state" . 1)) ; Minimize inactive part1 (minimize:inactive mo) ;; #t ; Display paging statistics after performing minimize operation (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) |
[Top]
threshold | integer |
mode | string |
minimize_options | minimize_options |
acis_options | acis_options |
Description
This operation uses the minimization mechanism to reduce the memory usage of
geometric entities based on the time stamp of the top-level entities. In the
"time" mode, entities that have not been accessed for a specified amount of
time are minimized. All entities not accessed within the previous "threshold"
number of seconds are minimized.
In the "memory" mode, the threshold value defines the target memory usage (in
KB) of the current process. The time stamp determines the order in which the
entities are minimized with the "oldest" entity minimized first. If the target
memory use is reached, no additional entities are minimized. Setting the target
memory use to zero minimizes the entire model.
The minimize_options argument controls the types of action taken by the
minimization mechanism. If the
minimize_options object is omitted, the global settings are used.
For the minimization operation to be successful, the paging system must first
be initialized with the page:init command.
Example
; minimize:least-used (part:clear) ;; #t ; Initialize the paging system (page:init) ;; #t ; Set up minimize-options object to page geometry and delete approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo ; Create three bezier curves with 10 second gap after first (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 (system:sleep 10000) ;; 10000 (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 (define c3 (edge:bezier-ndeg (list (position 1 1 1) (position 1 2 1) (position 1 2 2) (position 2 2 2)))) ;; c3 ; Immediately minimize everything that hasn't been accessed in 8 seconds (minimize:least-used 8 mo) ;; #t ; Display paging statistics after performing minimize operation (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) ; Minimize everything (minimize:least-used 0 'memory mo) ;; #t (page:stats) ;; (("page-bytes" . 1536) ("page-count" . 3) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 1551) ("state" . 1)) |
[Top]
minimize_options | minimize_options |
option_name | "geometry_action" or "approx_action" |
option | 0 or 1 |
Description
This command is provided to set the default behavior of the minimization
commands. These include (minimize:entities), (minimize:box),
(minimize:inactive) and (minimize:least-used). Individual options must be
specified as a pair, a string identifying the name of the option and the
associated option value. An option which is not defined explicitly is set to
the default value zero.
If a minimize_options object is provided as the first argument, the default
settings are initialized to the values of that object, and then individually
listed options are set. If no arguments are provided, the default minimization
system options are all set to zero.
It is possible to override the specified default behavior on a case-by-case
basis by passing a minimize_options object into a scheme minimize command.
Example
; minimize:set-defaults (part:load "test.sat") ;; (#[entity 1 1]) ; set the minimization default options individually (minimize:set-defaults "geometry_action" 1 "approx_action" 1) ;; #t ; minimize entities based on default option settings (minimize:entities (part:entities)) ;; #t ; define a minimize_options object (define mo (minimize-options:set "geometry_action" 1)) ;; mo ; set the default options using the minimize_options object (minimize:set-defaults mo "approx_action" 1) ;; #t ; set all the defaults to zero (minimize:set-defaults) ;; #t ; minimize entities using the minimize_options object (minimize:entities (part:entities) mo) #t |
[Top]
type | string |
val | integer |
minimize_options | minimize_options |
acis_options | acis_options |
Description
The minimize:strategy command automates the minimization process. The memory
footprint of geometric entities is automatically minimized in response to
certain events triggered by the part manager. The way in which the memory
minimzation occurs is controlled by the specified strategies.
Currently, three strategies may be defined: "inactive", "time" and "memory". The "val" parameter has an impact only for the "time" and "memory" strategies and has a default value of zero. The optional "minimize_options" and "acis_options" arguments are stored specific to each strategy and used whenever that strategy is invoked in response to a part manager event.
The "inactive" strategy causes geometric entities associated with inactive parts to be minimized when the part manager triggers an "activate part" event. The way the entities are minimized is identical to the action caused by issuing the (minimize:inactive) command.
The "time" strategy is triggered whenever the part manager causes a "change part" or "create part" event. In response, all geometric entities that have not been accessed in the time period specified by "val" (in seconds) will be minimized. This action is equivalent to the effect of the (minimize:least-used 'time) command.
The "memory" strategy causes the least-used geometric entities to be minimized until the memory use is reduced to the amount specifed by the "val" argument. This action is identical to the effect of issuing the (minimize:least-used 'mem) command. This strategy is also triggered by a "change part" or "create part" event.
Each time a (minimize:strategy) command is issued, the specified strategy is
immediately carried out without waiting for an event from the part manager.
Multiple strategies may be defined simultaneously. The part callback mechanism
calls each strategy in the sequence they were defined. All strategies remain in
effect until the (minimize:strategy 'none) command is issued, at which point
all existing strategies are permanently deleted.
The paging system must be initialized with the (page:init) command before any
minimization strategies may be defined. All minimization strategies are lost
when the paging system is terminated.
Example
; minimize:strategy (part:clear) ;; #t ; Initialize the paging system (page:init) ;; #t ; Set up minimize-options object to page geometry and delete approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo ; Set up a strategy that minimizes inactive parts (minimize:strategy 'inactive mo) ;; #t ; Create first curve in first part (define part1 (env:active-part)) ;; part1 (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 ; Show initial paging statistics (page:stats) ;; (("page-bytes" . 0) ("page-count" . 0) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 0) ("smallest-entry" . 0) ("page-file" . "acis.swp") ;; ("file-size" . 0) ("state" . 1)) ; Swtich to a new part -> first curve paged to file (define part2 (part:new)) ;; part2 (env:set-active-part part2) ;; () (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) ; Add strategy to minimize parts not accessed for 10 seconds (minimize:strategy 'time 10 mo) ;; #t ; Create second curve in second part -> no additional paging (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) ; Wait for 11 seconds (system:sleep 11000) ;; 11000 ; Create third curve -> second curve is paged to file due to second strategy (define c3 (edge:bezier-ndeg (list (position 1 1 1) (position 1 2 1) (position 1 2 2) (position 2 2 2)))) (page:stats) ;; (("page-bytes" . 1024) ("page-count" . 2) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 1039) ("state" . 1)) ; Reactivate the first part -> third curve is paged to file due to first strategy (env:set-active-part part1) ;; () (page:stats) ;; (("page-bytes" . 1536) ("page-count" . 3) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 1551) ("state" . 1)) ; Remove the minimization strategies (minimize:strategy 'none) ;; #t |
[Top]
object | scheme-object |
Description
A body is considered to be mixed if it has at least one face and at least one
LUMP with a
SHELL, and at least one
WIRE and one
FACE are attached to that SHELL, but no WIREs
are attached to the
BODY directly.
; mixed-body? ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Determine if the block is a mixed body. (mixed-body? block1) ;; #f ; Create a wire body. (define wirebody1 (wire-body:points (list (position 20 0 0) (position 50 0 0)))) ;; wirebody1 ; Determine if the wire body is a mixed body. (mixed-body? wirebody1) ;; #f ; Unite the entities. (define mixed (bool:nonreg-unite block1 wirebody1)) ;; mixed ; Determine if the resulting body is a mixed body. (mixed-body? mixed) ;; #t |
[Top]
filename | string | boolean |
Description
The monitor file records all text going to the Scheme I/O window in a file.
; monitor:file ; Open a monitor file (monitor:file "record1") ;; record1 |
[Top]
option-string | string |
Description
The command option:list displays the available
options.
; option:get ; List the options available. (option:list) ;; (("abl_c#aps" . #t) ;; ("abl_off_x#curves" . #f) ;; ("abl_rem#ote_ints" . #f) ;; ("abl_require_on#_support" . #t) ;; ("abort_on_illegal_surface" . #t) ;; ("adaptive#_grid" . #f) ;; ("adaptive_t#riangles" . #f) ;; ("add_bl_atts" . #f) ;; ("addr#ess_debug" . #t) ;; ("align_corners" . #t) ;; ("align_first_wire" . #f) ;; ("all_free_edges" . #f) ;; ("angular_control" . #t) ;; ("anno#tations" . #f) ;; ("api_checking" . #t) ;; ("approx#_eval" . #t) ;; ("approx-vbl_off#set" . #t) ;; ("auto_disp#lay" . #t) ;; ("backup_boxes" . #t) ;; ("bb_immediate_close" . #f) ;; ("bend_debug_file" . ) ;; ("bend_self_int" . #f) ;; ("bhl_smooth_edges" . #t) ;; ("bhl_smooth_surfaces" . #t) ;; ("bhl-use_ds_patch" . #f) ;; ("bhl-use_iso_approx" . #f) ;; ("bhl-use_iso_patch" . #f) ;; ("binary_format" . #f) ; . ; . ; . ; Get the value of an option. (option:get "addr") ;; #t |
[Top]
None |
Description
The extension returns a list of pairs of option names and values. The list
displayed is bound by the variable print-length. It may be insufficient to
display the whole list. If the whole list is not printed, try increasing the
print length to 200 using the following:
; option:list ; Get a list of some of the options and their values. ; If not all of the options are displayed using ; the list command try the following command ; which increases the print-length ; (fluid-let ((print-length 200)) ; (print (option:list))) (option:list) ;; (("abl_c#aps" . #t) ;; ("abl_off_x#curves" . #f) ;; ("abl_rem#ote_ints" . #f) ;; ("abl_require_on#_support" . #t) ;; ("abort_on_illegal_surface" . #t) ;; ("adaptive#_grid" . #f) ;; ("adaptive_t#riangles" . #f) ;; ("add_bl_atts" . #f) ;; ("addr#ess_debug" . #t) ;; ("align_corners" . #t) ;; ("align_first_wire" . #f) ;; ("all_free_edges" . #f) ;; ("angular_control" . #t) ;; ("anno#tations" . #f) ;; ("api_checking" . #t) ;; ("approx#_eval" . #t) ;; ("approx-vbl_off#set" . #t) ;; ("auto_disp#lay" . #t) ;; ("backup_boxes" . #t) ;; ("bb_immediate_close" . #f) ;; ("bend_debug_file" . "") ;; ("bend_self_int" . #f) ;; ("bhl_smooth_edges" . #t) ;; ("bhl_smooth_surfaces" . #t) ;; ("bhl-use_ds_patch" . #f) ;; ("bhl-use_iso_approx" . #f) ;; ("bhl-use_iso_patch" . #f) ;; ("binary_format" . #f) ; . ; . ; . |
[Top]
None |
Description
The default values for the options are presented in the option templates.
; option:reset ; List the options available. (option:list) ;; ;; (("abl_c#aps" . #t) ;; ("abl_off_x#curves" . #f) ;; ("abl_rem#ote_ints" . #f) ;; ("abl_require_on#_support" . #t) ;; ("abort_on_illegal_surface" . #t) ;; ("adaptive#_grid" . #f) ;; ("adaptive_t#riangles" . #f) ;; ("add_bl_atts" . #f) ;; ("addr#ess_debug" . #t) ;; ("align_corners" . #t) ;; ("align_first_wire" . #f) ;; ("all_free_edges" . #f) ;; ("angular_control" . #t) ;; ("anno#tations" . #f) ;; ("api_checking" . #t) ;; ("approx#_eval" . #t) ;; ("approx-vbl_off#set" . #t) ;; ("auto_disp#lay" . #t) ;; ("backup_boxes" . #t) ;; ("bb_immediate_close" . #f) ;; ("bend_debug_file" . "") ;; ("bend_self_int" . #f) ;; ("bhl_smooth_edges" . #t) ;; ("bhl_smooth_surfaces" . #t) ;; ("bhl-use_ds_patch" . #f) ;; ("bhl-use_iso_approx" . #f) ;; ("bhl-use_iso_patch" . #f) ;; ("binary_format" . #f) ;; ("bl_ana#lytic_spine" . #t) ; . ; . ; . ; Set the value of an option. (option:set "sphere_silhouettes" "on") ;; #t ; Reset the option to its previous value. (option:reset) ;; #t |
[Top]
option-string | string |
value | real | integer | boolean | position | string |
Description
The return value is the previous option value. If option-string is not a
valid option, an error message returns.
Refer to the option reference sections for information on each specific options. Availability of the options is based on the products that have been included in your executable.
; option:set ; List the options available. (option:list) ;; ;; (("abl_c#aps" . #t) ;; ("abl_off_x#curves" . #f) ;; ("abl_rem#ote_ints" . #f) ;; ("abl_require_on#_support" . #t) ;; ("abort_on_illegal_surface" . #t) ;; ("adaptive#_grid" . #f) ;; ("adaptive_t#riangles" . #f) ;; ("add_bl_atts" . #f) ;; ("addr#ess_debug" . #t) ;; ("align_corners" . #t) ;; ("align_first_wire" . #f) ;; ("all_free_edges" . #f) ;; ("angular_control" . #t) ;; ("anno#tations" . #f) ;; ("api_checking" . #t) ;; ("approx#_eval" . #t) ;; ("approx-vbl_off#set" . #t) ;; ("auto_disp#lay" . #t) ;; ("avoid_box_backups" . #f) ;; ("backup_boxes" . #t) ;; ("bb_immediate_close" . #f) ;; ("bend_debug_file" . "") ;; ("bend_self_int" . #f) ;; ("bhl_smooth_edges" . #t) ;; ("bhl_smooth_surfaces" . #t) ;; ("bhl-use_ds_patch" . #f) ;; ("bhl-use_iso_approx" . #f) ;; ("bhl-use_iso_patch" . #f) ;; ("bin#ary_format" . #f) ;; ("bl_ana#lytic_spine" . #t) ; . ; . ; . ; Set the value of an option. (option:set "sphere_silhouettes" "on") ;; #t |
[Top]
file_name | string |
run_mode | string |
Description
The paging system must be initialized before any geometric entities can be
paged to disk.
The page:init command may be used to change the run_mode at any time. However, attempting to reinitialize the name of the page file results in an error. For terminate the paging system before attempting to change the page file path and name, use page:term command.
Use page:init to reactivate the paging system after it has been suspended.
Example
; page:init (part:clear) ;; #t ; Create two bezier curves (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 ; Initialize the paging system (page:init) ;; #t ; Set up minimize_options object to page geometry to file and delete the ; approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo ; Minimize all entities in the active part (minimize:entities (part:entities) mo) ;; #t ; Display paging statistics after performing the minimize operation (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) |
[Top]
None |
Description
Displays the total number and size of items paged and umpaged, details of the
page file and the paging system state. The "page-bytes" and "page-count" values
track items as they are written to the page file. Note that subsequent pages of
the same (unmodified) geometric entities simply involve deletion of the object
from memory without rewriting the information to the file and thus are not
reflected in these statistics.
The "unpage-bytes" and "unpage-count" values relate to the process of restoring geometric information from the page file to memory. The statistics are updated each time the geometric information must be retrieved, so these statistics can reflect multiple access to the same entities.
The "trash-bytes" and "trash-count" values track items as they are permanently
removed from the page file. When geometric entities which have been paged are
deleted in the model, all the associated page data is removed from the file,
and the corresponding statistics are updated.
The "biggest-entry" and "smallest-entry" values list the sizes of the biggest
and smallest chunks of data stored in the page file. The "file-size" quantity
refers to the size of the page file.
The paging system state is the last item displayed. If the paging system is initialized with the (page:init) command, the state changes from "uninitialized" to "active". The (page:term) command causes the state to change to "suspended" or "uninitialized" depending on whether or not the page file is still needed for unpaging.
Example
; page:stats (part:clear) ;; #t ; Initialize the paging system (page:init) ;; #t ; Create two bezier curves (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 ; Set up minimize-options object to page geometry and delete approximations (define mo (minimize-options:set 'geometry_action 1 'approx_action 1)) ;; mo ; Display paging statistics before performing minimize operation (page:stats) ;; (("page-bytes" . 0) ("page-count" . 0) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 0) ("smallest-entry" . 0) ("page-file" . "acis.swp") ;; ("file-size" . 0) ("state" . 1)) ; Minimize everything outside of a box which contains c1 (minimize:box (position 0 0 0) (position 1 1 1) mo) ;; #t ; Display paging statistics after performing minimize operation (page:stats) ;; (("page-bytes" . 512) ("page-count" . 1) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 527) ("state" . 1)) |
[Top]
None |
Description
The (page:term) command essentially turns off the paging system. The
(page:term) command causes the state to change to "suspended" or
"uninitialized" depending on whether or not the page file is still needed for
unpaging.
If the page system is active and the page file is empty, the (page:term) command puts the page system in the uninitialized state. If the page system is active and the page file contains paged geometric data, then (page:term) suspends the page system in the sense that entities may be unpaged from the page file as needed, but no additional entities are saved to the file.
If the paging system is suspended and the page file contains paged data when (page:term) is issued, an error message is returned. If the page system is in suspended mode, use the (part:clear) command to clear the page file. The state of the page system is automatically changed from suspended to uninitialized.
Attempting to terminate the paging system when it is in an uninitialized state results in an error.
Please note that any existing minimization strategies (defined using the (minimize:strategy) command) are automatically deleted if the paging system is suspended or terminated.
Example
; page:term (part:clear) ;; #t ; Create two bezier curves (define c1 (edge:bezier-ndeg (list (position 0 0 0) (position 0 1 0) (position 0 1 1) (position 1 1 1)))) ;; c1 (define c2 (edge:bezier-ndeg (list (position 2 2 2) (position 2 3 2) (position 2 3 3) (position 3 3 3)))) ;; c2 ; Initialize and then suspend the paging system (page:init) ;; #t ; Minimize all entities in the active part (minimize:entities (part:entities)) ;; #t ; Display paging statistics (page:stats) ;; (("page-bytes" . 1024) ("page-count" . 2) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 1039) ("state" . 1)) ; Put the paging system in suspended mode (page:term) ;; #f ; Display paging statistics (page:stats) ;; (("page-bytes" . 1024) ("page-count" . 2) ("unpage-bytes" . 0) ;; ("unpage-count" . 0) ("trash-bytes" . 0) ("trash-count" . 0) ;; ("biggest-entry" . 344) ("smallest-entry" . 344) ("page-file" . "acis.swp") ;; ("file-size" . 1039) ("state" . 2)) ; Clear the page file (and terminate the page system) (part:clear) ;; #t ; Try to minimize all entities in the active part (minimize:entities (part:entities)) ;; #f |
[Top]
u | real |
v | real |
Description
Builds and returns a par-pos object for parametric location uv.
; par-pos ; Create a par-pos object. (par-pos 3 3) ;; #[par-pos 3 3] |
[Top]
par-pos | par-pos |
; par-pos:copy ; Create a par-pos object. (define par1 (par-pos 3 3)) ;; par1 ; Create a new par-pos by copying an ; existing par-pos. (par-pos:copy par1) ;; #[par-pos 3 3] |
[Top]
par-pos1 | par-pos |
par-pos2 | par-pos |
; par-pos:distance ; Determine the distance between two par-pos. (par-pos:distance (par-pos 0 1) (par-pos 0 20)) ;; 19 |
[Top]
par-pos | par-pos |
u | real |
v | real |
; par-pos:set! ; Set new u- and v-coordinates for an ; existing par-pos. (define par1 (par-pos 0 0)) ;; par1 (par-pos:set! par1 3 5) ;; #[par-pos 3 5] |
[Top]
par-pos | par-pos |
u | real |
Description
The u-coordinate is returned as a real.
; par-pos:set-u! ; Create a par-pos object. (define par1 (par-pos 0 0)) ;; par1 ; Set a new u-coordinate for an existing par-pos. (par-pos:set-u! par1 5) ;; 5 |
[Top]
par-pos | par-pos |
v | real |
Description
The v-coordinate is returned as a real.
; par-pos:set-v! ; Create a par-pos object. (define par1 (par-pos 0 0)) ;; par1 ; Set a new v-coordinate for an existing par-pos. (par-pos:set-v! par1 8) ;; 8 |
[Top]
par-pos | par-pos |
; par-pos:u ; Create a par-pos object. (define par1 (par-pos 3 7)) ;; par1 ; Get a par-poss u-coordinate. (par-pos:u par1) ;; 3 |
[Top]
par-pos | par-pos |
; par-pos:v ; Create a par-pos object. (define par1 (par-pos 3 7)) ;; par1 ; Get a par-poss v-coordinate (par-pos:v par1) ;; 7 |
[Top]
object | scheme-object |
Description
Returns #t for
par-pos objects, otherwise returns #f.
; par-pos? ; Create a par-pos object. (define par1 (par-pos 3 7)) ;; par1 ; Determine if an object is a par-pos. (par-pos? par1) ;; #t (par-pos? (gvector 0 0 0)) ;; #f (par-pos? -4) ;; #f |
[Top]
TBD |
; part:model |
[Top]
trans-vec | law |
x-vec | law |
y-vec | law |
scale | law |
z-vec | law |
keep | boolean |
root-transf | transform |
in-pat | pattern |
positions | position | (position ...) |
root | position |
Description
This extension constructs a pattern based upon the supplied arguments. The
pattern may be based upon laws or upon a list of positions. (The latter type
may only be used to generate translational patterns. For more general kinds of
list-based patterns, use the pattern:from-list extension).
In the case of law-based patterns, the user need only provide laws necessary
for the creation of the pattern.
; pattern ; Create a translation law and attach a domain. (define trans-vec (law "DOMAIN (VEC (10*X, 5*Y, 0), 0, 5, 0, 4)")) ;; trans-vec ; Create orientation laws. (define x-vec (law "VEC (COS (X*PI/4), SIN (X*PI/4), 0)")) ;; x-vec (define y-vec (law "VEC (0,0,1)")) ;; y-vec ; Create a pattern from the laws. (define pat (pattern trans-vec x-vec y-vec)) ;; pat |
[Top]
entity | entity |
type-list | string | (string ...) |
color | boolean |
Description
Checks for the presence of patterns on the
BODY,
LUMPs,
SHELLs,
FACEs, and
LOOPs of an entity and generates a list of the elements with
patterns. Returns #t when elements with patterns exist and #f when there are no
elements with patterns.
; pattern:check ; Create a sphere at the origin to demonstrate ; command. (define s (solid:sphere (position 0 0 0) 10)) ;; s ; Define a 2x2 hex pattern. (define p (pattern:hex (gvector 0 1 1) (gvector 40 0 0) 2 2)) ;; p ; Create an entity using sphere in the pattern. (define hexpat (entity:pattern s p)) ;; hexpat ; Check that hexpat is a pattern. (pattern:check hexpat) ; entities with patterns: ; 1 bodies ; 4 lumps ; 4 shells ; 0 wires ; 4 faces ; 4 surfaces ; 1 loops ; 0 coedges ; 0 pcurves ; 0 edges ; 0 curves ; 0 vertices ; 0 points ; All entities examined have patterns ;; #t ; Check faces only. (pattern:check hexpat 'faces) ; face: (entity 11 1) ; face: (entity 12 1) ; face: (entity 13 1) ; face: (entity 14 1) ; entities with patterns: ; 4 faces ; All entities examined have patterns ;; #t |
[Top]
pat | pattern |
face | face |
center | position |
axis | gvector |
Description
This extension is limited in that the pattern must be defined.
This extension returns #t if a pattern lies on the circular surface associated with the face or, alternately, with the combination of center and axis. Otherwise, it returns #f.
; pattern:circular? ; choose an axis and a center defining a circle (define center (position 5 6 3)) ;; center (define normal (gvector 0 0 1)) ;; normal ; make a pattern (define pat (pattern:cylindrical center normal 4 10 3)) ;; pat ; does the result have circular symmetry about center ; and normal? (pattern:circular? pat center normal) ;; #f ; what about this pattern? (set! pat (pattern:elliptical center normal 5)) ;; trans-vec: "DOMAIN(VEC(5,6,3)+VEC(0,0,1) ;; *3*X2,0,3,0,9)" ;; x-vec: "VEC(-1,0,0)*COS ;; (1.570796326794897*X+0) ;; +VEC(0,1,0)*SIN(1.570796326794897*X+0)" ;; y-vec: "VEC(0,0,1)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] (pattern:circular? pat center normal) ;; #t |
[Top]
pat | pattern |
coords | pair |
; pattern:coords-to-index ; make a pattern (define center (position 1 2 3)) ;; center (define normal (gvector 0 0 1)) ;; normal (define num-radial 4) ;; num-radial (define num-angular 5) ;; num-angular (define spacing 3) ;; spacing (define pat (pattern:radial center normal num-radial num-angular spacing)) ;; pat ; find the pattern index of a specific element (define coords (list 3 2)) ;; coords (define index (pattern:coords-to-index pat coords)) ;; index |
[Top]
pat | pattern |
; pattern:copy ; make a pattern (define center (position 1 2 3)) ;; center (define normal (gvector 0 0 1)) ;; normal (define num-radial 4) ;; num-radial (define num-angular 5) ;; num-angular (define spacing 3) ;; spacing (define pat (pattern:radial center normal num-radial num-angular spacing)) ;; pat ; copy the pattern (define pat_copy (pattern:copy pat)) ;; pat_copy |
[Top]
center | position |
normal | gvector |
face | face |
num-angular | integer |
num-axial | integer |
distance | real |
alternating | boolean |
; pattern:cylindrical ; Create a cylindrical pattern using defaults only. (define s (solid:sphere (position -15 -10 0) 3)) ;; s (define p (pattern:cylindrical (position -10 -10 -10) (gvector 1 0 1) 5 10 5)) ;; p ; Attach the defined pattern to the sphere. (define attach (entity:pattern s p)) ;; attach ; Create an alternating cylindrical pattern. ; Roll back 1 step and redefine the pattern. (roll) ;; -1 (define p (pattern:cylindrical (position 0 0 0) (gvector 0 0 1) 15 5 10 #t)) ;; p ; Attach the defined pattern to the sphere. (define attach (entity:pattern s p)) ;; attach ; Create an alternating cylindrical pattern. ; Roll back 1 step and redefine the pattern. (roll) ;; -1 (define p (pattern:cylindrical (position 0 0 0) (gvector 1 1 0) 5 7 10)) ;; p ; Attach the defined pattern to the sphere. (define attach (entity:pattern s p)) ;; attach |
[Top]
pat | pattern |
face | face |
center | position |
axis | gvector |
Description
This extension returns #t if a pattern lies on the cylindrical surface.
Otherwise, it returns #f.
; pattern:cylindrical? ; Choose an axis and a center defining a cylinder. (define center (position 5 6 3)) ;; center (define normal (gvector 0 0 1)) ;; normal ; Make a pattern. (define pat (pattern:cylindrical center normal 4 10 3)) ;; pat ; Does the result have cylindrical symmetry about ; the center and normal? (pattern:cylindrical? pat center normal) ;; #t ; Try another pattern. (set! pat (pattern:elliptical center normal 5)) ;; #[pattern ;; trans-vec: "DOMAIN(VEC(5,6,3)+VEC ;; (0,0,1)*3*X2,0,3,0,9)" ;; x-vec: "VEC(-1,0,0)*COS ;; (1.570796326794897*X+0) ;; +VEC(0,1,0)*SIN ;; (1.570796326794897*X+0)" ;; y-vec: "VEC(0,0,1)" ;; z-vec: "null_law" ;; sale: "null_law" ;; keep: "null_law" ;; no list] (pattern:cylindrical? pat center normal) ;; #t ; Try yet another pattern. (set! pat (pattern:elliptical center (gvector 1 0 0) 5)) ;; #[pattern ;; trans-vec: "VEC(5,6,3)" ;; x-vec: "DOMAIN(VEC(-1,0,0) ;; *COS(1.256637061435917*X) ;; +VEC(0,-1,0)*SIN ;; (1.256637061435917*X),0,4)" ;; y-vec: "VEC(0,0,1)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] (pattern:cylindrical? pat center normal) ;; #f |
[Top]
entity-list | entity | (entity ...) |
number | integer |
root | position |
on-endpoints | boolean |
normal-dir | gvector |
tangent-dir | gvector |
Description
Creates a one-dimensional pattern of number elements, equally spaced in
parameter space, parallel to an edge.
; pattern:edge ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define axis_start (position 0 -25 0)) ;; axis_start (define axis_end (position 0 25 0)) ;; axis_end (define start-dir (gvector 1 0 0)) ;; start-dir (define radius 5) ;; radius (define thread_distance 10) ;; thread_distance (define edge (edge:helix axis_start axis_end start-dir radius thread_distance)) ;; edge (define num 50) ;; num (define root origin) ;; root (define on-endpoints #f) ;; on-endpoints (define rail-dir (gvector 1 0 0)) ;; rail-dir (define tangent-dir (gvector 0 1 0)) ;; tangent-dir (define pat (pattern:edge edge num root on-endpoints rail-dir tangent-dir)) ;; pat (entity:delete edge) ;; () ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
center | position |
normal | gvector |
num | integer |
not-rotate | boolean |
root | position |
angle | real |
ratio | real |
major-axis | gvector |
Description
Creates a one-dimensional elliptical pattern defined by an axis of rotation.
; pattern:elliptical ; Make a prism to demonstrate command. (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; Output Original ; Redefine position of origin. (define origin (position 1 2 3)) ;; origin ; Reposition prism. (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; Make a pattern. (define center (position 11 2 3)) ;; center (define normal (gvector 0 0 1)) ;; normal (define num 24) ;; num (define not-rotate #f) ;; not-rotate (define root origin) ;; root (define ang 360) ;; ang (define ratio 0.5) ;; ratio (define major-axis (gvector 2 1 0)) ;; major-axis (define pat (pattern:elliptical center normal num not-rotate root ang ratio major-axis)) ;; pat ; Apply the pattern to the prism. (define body (entity:pattern prism pat)) ;; body ; Output Result Figure. pattern:elliptical |
[Top]
position-list | position | (position ...) |
root | position |
transf-list | transform | (transform ...) |
root-transf | transform |
Description
Creates a pattern from either the positions list or the transfs list. The
optional arguments root and root-transf specify the transformation to the first
pattern site.
; pattern:from-list ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (entity:set-color (point origin) RED) ;; () (define trans (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; trans ; make a pattern (define t0 (transform:axes (position 0 0 3) (gvector 1 0 0) (gvector 0 1 0))) ;; t0 (define t1 (transform:axes (position 0 6 3) (gvector 1 0 0) (gvector 0 1 0))) ;; t1 (define t2 (transform:axes (position 6 0 3) (gvector 1 0 0) (gvector 0 1 0))) ;; t2 (define t3 (transform:axes (position 6 6 3) (gvector 1 0 0) (gvector 0 1 0))) ;; t3 (define t4 (transform:axes (position 3 3 0) (gvector 0 1 0) (gvector 1 0 0))) ;; t4 (define t5 (transform:axes (position 0 0 -3) (gvector 0 1 0) (gvector 0 0 1))) ;; t5 (define t6 (transform:axes (position 0 6 -3) (gvector 0 1 0) (gvector 0 0 1))) ;; t6 (define t7 (transform:axes (position 6 0 -3) (gvector 0 1 0) (gvector 0 0 1))) ;; t7 (define t8 (transform:axes (position 6 6 -3) (gvector 0 1 0) (gvector 0 0 1))) ;; t8 (define root (transform:translation (gvector:from-to (position 0 0 0) origin))) ;; root (define pat (pattern:from-list (list t0 t1 t2 t3 t4 t5 t6 t7 t8) root)) ;; pat ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
index1 | integer |
index2 | integer |
Description
This extension returns a transform associated with the pattern specified by pat.
By default, the root transformation is returned.
; pattern:get-transform ; make a pattern (define axis_start (position 0 -25 0)) ;; axis_start (define axis_end (position 0 25 0)) ;; axis_end (define start-dir (gvector 1 0 0)) ;; start-dir (define radius 5) ;; radius (define thread_distance 10) ;; thread_distance (define edge (edge:helix axis_start axis_end start-dir radius thread_distance)) ;; edge (define num 50) ;; num (define root (position 1 2 3)) ;; root (define on-endpoints #f) ;; on-endpoints (define rail-dir (gvector 1 0 0)) ;; rail-dir (define tangent-dir (gvector 0 1 0)) ;; tangent-dir (define pat (pattern:edge edge num root on-endpoints rail-dir tangent-dir)) ;; pat (entity:delete edge) ;; () ; get the root transform (define t_root (pattern:get-transform pat)) ;; t_root ;get the first transform (define t_0 (pattern:get-transform pat 0)) ;; t_0 ; print the two transforms (transform:print t_root) ; rotation no reflection no shear not identity ; translation part: ; 4.111957 -27.965300 -0.288970 ; affine part: ; 0.951057 0.000000 -0.309017 ; -0.294459 0.303314 -0.906253 ; 0.093729 0.952891 0.288469 ; scaling part: ; 1.000000 ;; #[transform 118280584] (transform:print t_0) ; rotation no reflection no shear not identity ; translation part: ; 4.755283 -24.500000 -1.545085 ; affine part: ; -0.294459 0.303314 -0.906253 ; 0.951057 0.000000 -0.309017 ; -0.093729 -0.952891 -0.288469 ; scaling part: ; 1.000000 ;; #[transform 118280584] |
[Top]
normal | gvector |
xvec | gvector |
xnum | integer |
ynum | integer |
Description
Creates a hexagonal pattern in the plane defined by normal.
; pattern:hex ; Create a prism to demonstrate command. (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; Enlarge prism for viewing. (define zoom (zoom 4)) ;; zoom ; OUTPUT Original ; Reposition the prism. (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; Create a pattern. (define normal (gvector 0 0 1)) ;; normal (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 6) ;; num_x (define num_y 6) ;; num_y (define pat (pattern:hex normal x-vec num_x num_y)) ;; pat ; Apply the pattern to the prism. (define body (entity:pattern prism pat)) ;; body ; Adjust picture for better viewing. (view:compute-extrema) ;; () ; OUTPUT Result Figure. pattern:hex |
[Top]
center | position |
normal | gvector |
num-angular | integer |
num-axial | integer |
radius | real |
Description
Creates a two-dimensional hexagonal pattern with cylindrical symmetry.
; pattern:hex-cylindrical ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (entity:set-color (point origin) RED) ;; () (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define center (position 6 2 3)) ;; center (define normal (gvector 0 1 0)) ;; normal (define num-angular 8) ;; num-angular (define num-axial 6) ;; num-axial (define spacing 3) ;; spacing (define pat (pattern:hex-cylindrical center normal num-angular num-axial spacing)) ;; pat ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
index | integer |
; pattern:index-to-coords ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define center origin) ;; center (define normal (gvector 0 0 1)) ;; normal (define num-radial 4) ;; num-radial (define num-angular 5) ;; num-angular (define spacing 3) ;; spacing (define pat1 (pattern:radial center normal num-radial num-angular spacing)) ;; pat1 ; find the pattern coords of a specific element (define index 13) ;; index (define coords (pattern:index-to-coords pat1 index)) ;; coords |
[Top]
xvec | gvector |
xnum | integer |
yvec | gvector |
ynum | integer |
zvec | gvector |
znum | integer |
Description
Creates a linear pattern in one, two, or three dimensions based on the number
of input arguments.
; pattern:linear ; create a sphere at the origin (define s (solid:sphere (position 0 0 0)10)) ;; s ; define the pattern in three dimensions with 3 ; repetitions along each axis (define p (pattern:linear (gvector 30 10 0) 3(gvector 0 30 0)3(gvector 0 0 30)3)) ;; p ; create an entity using sphere in the pattern (define spherepat (entity:pattern s p)) ;; spherepat (entity:check spherepat) ; checked: ; 27 lumps ; 27 shells ; 0 wires ; 27 faces ; 0 loops ; 0 coedges ; 0 edges ; 0 vertices ;; () |
[Top]
pat | pattern |
Description
Creates a pattern entity which can be saved and restored from a SAT file. The
pattern does not have to be attached to model geometry.
; pattern:make-entity ; make a pattern (define normal (gvector 0 0 1)) ;; normal (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 6) ;; num_x (define num_y 6) ;; num_y (define pat (pattern:hex normal x-vec num_x num_y)) ;; pat ; Make the associated APATTERN entity. (define apat (pattern:make-entity pat)) ;; apat ; Save myfile to a SAT file. (part:save-selection apat "myfile.sat") ;; #t |
[Top]
pat | pattern |
keep1 | real |
keep2 | real |
which-dim | integer |
merge | boolean |
Description
Applies an alternating keep filter to an existing pattern, merging with any
existing filter or, optionally (with
merge=#f), replacing it.
; pattern:mod-alternating-keep ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 10) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define keep1 #f) ;; keep1 (define keep2 #t) ;; keep2 (define dim 1) ;; dim (pattern:mod-alternating-keep pat keep1 keep2 dim)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC ;; (0,2,0),0,7,0,9)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
scale1 | real | gvector |
scale2 | real | gvector |
which-dim | integer |
root | position |
merge | boolean |
Description
Applies an alternating scale to an existing pattern, merging with any existing
scaling, or optionally (with
merge=#f), replacing it.
; pattern:mod-alternating-scale ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 10) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define scale1 0.8) ;; scale1 (define scale2 1.2) ;; scale2 (define dim 1) ;; dim (define root origin) ;; root (pattern:mod-alternating-scale pat scale1 scale2 dim root)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC ;; (0,2,0),0,7,0,9)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat1 | pattern |
pat2 | pattern |
; pattern:mod-compose ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 4) ;; num_x (define y-vec (gvector 1 3 0)) ;; y-vec (define num_y 5) ;; num_y (define pat1 (pattern:linear x-vec num_x y-vec num_y)) ;; pat1 ; make another pattern (set! x-vec (gvector 20 0 0)) ;; #[gvector 2 0 0] (set! num_x 3) ;; 4 (set! y-vec (gvector 10 30 0)) ;; #[gvector 1 3 0] (set! num_y 2) ;; 5 (define pat2 (pattern:linear x-vec num_x y-vec num_y)) ;; pat2 ; compose the two patterns (pattern:mod-compose pat1 pat2) ;; pat1 ; apply the pattern to the prism (define body (entity:pattern prism pat1)) ;; body |
[Top]
pat1 | pattern |
pat2 | pattern |
transform | transform |
Description
Modifies an existing pattern by concatenating it with another pattern,
optionally applying a transform to the second.
; pattern:mod-concatenate ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 8) ;; num_x (define pat1 (pattern:linear x-vec num_x)) ;; pat1 ; make another pattern (define center (position -4 2 3)) ;; center (define normal (gvector 0 0 1)) ;; normal (define num 8) ;; num (define pat2 (pattern:elliptical center normal num)) ;; pat2 ; concatenate the patterns (pattern:mod-concatenate pat1 pat2) ;; pat1 ; apply the pattern to the prism (define body (entity:pattern prism pat1)) ;; body |
[Top]
pat | pattern |
keep | law |
merge | boolean |
Description
Applies a keep law to an existing pattern, merging with any existing scaling
or, optionally (with merge=#f), replacing it.
; pattern:mod-keep ; create a linear pattern in two dimensions (define pat (pattern:linear (gvector 10 0 0) 5 (gvector 0 8 4) 4)) ;; pat ; create a keep law that keeps only elements ; for which x + y < 5 (define keep (law "X + Y < 5")) ;; keep ; attach the keep law to the pattern (set! pat (pattern:mod-keep pat keep)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(10,0,0)+X2*VEC ;; (0,8,4),0,4,0,3)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] |
[Top]
pat | pattern |
begin-scale | real | gvector |
end-scale | real | gvector |
which-dim | integer |
root | position |
merge | boolean |
Description
Applies a linear scale, from begin-scale to end-scale, to an
existing pattern, merging with any existing scaling or, optionally (with
merge=#f), replacing it.
; pattern:mod-linear-scale ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 10) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define begin-scale 0.5) ;; begin-scale (define end-scale 2.0) ;; end-scale (define dim 0) ;; dim (define root origin) ;; root (pattern:mod-linear-scale pat begin-scale end-scale dim root)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC ;; (0,2,0),0,7,0,9)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
root | position |
normal | gvector |
Description
Modifies the pattern
pat
by concatenating it with its reflection.
; pattern:mod-mirror ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define t1 (transform:translation (gvector 0 0 0))) ;; t1 (define t2 (transform:translation (gvector 2 2 0))) ;; t2 (define t3 (transform:translation (gvector 4 0 0))) ;; t3 (define t4 (transform:translation (gvector 0 4 0))) ;; t4 (define t5 (transform:translation (gvector 4 4 0))) ;; t5 (define pat (pattern:from-list (list t1 t2 t3 t4 t5))) ;; pat ; mirror the pattern about the origin (define root (position 0 0 0)) ;; root (define normal (gvector 1 1 0)) ;; normal (pattern:mod-mirror pat root normal) ;; #[pattern [list]]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
keep | boolean |
which-dim | integer |
merge | boolean |
Description
Applies a periodic keep filter to an existing pattern, merging with any
existing filter or, optionally (with
merge=#f), replacing it.
; pattern:mod-periodic-keep ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 6) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 12) ;; num_y (define z-vec (gvector 0 0 3)) ;; z-vec (define num_z 4) ;; num_z (define pat (pattern:linear x-vec num_x y-vec num_y z-vec num_z)) ;; pat ; modify the pattern (define keep1 #t) ;; keep1 (define keep2 #t) ;; keep2 (define keep3 #f) ;; keep3 (define dim 1) ;; dim (pattern:mod-periodic-keep pat (list keep1 keep2 keep3) dim)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC(0,2,0) ;; +X3*VEC(0,0,3),0,5,0,11,0,3)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
scales | (real ...) | (gvector ...) |
which-dim | integer |
root | position |
merge | boolean |
Description
Applies a periodic scale to an existing pattern, merging with any existing
scaling or, optionally (with
merge=#f), replacing it.
; pattern:mod-periodic-scale ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 10) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define scale1 0.5) ;; scale1 (define scale2 1.5) ;; scale2 (define scale3 1.0) ;; scale3 (define scale4 2.0) ;; scale4 (define dim 0) ;; dim (define root origin) ;; root (pattern:mod-periodic-scale pat (list scale1 scale2 scale3 scale4) dim root)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC ;; (0,2,0),0,7,0,9)" ;; x-vec "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
amplitude | gvector |
Description
Randomizes the given pattern by adding random offsets at each of the pattern
sites.
; pattern:mod-random-offset ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 12) ;; num_x (define y-vec (gvector 0 4 0)) ;; y-vec (define num_y 12) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define amplitude (gvector 1 0.5 4.0)) ;; amplitude (pattern:mod-random-offset pat amplitude) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC(0,4,0), ;; 0,11,0,11)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; [list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
min-axial | real |
max-axial | real |
axial-dir | gvector |
min-tilt | real |
max-tilt | real |
tilt-dir | gvector |
Description
Randomizes the given pattern by applying random rotations at each of the
pattern sites. The default arguments yield a totally random rotation.
; pattern:mod-random-orient ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 10) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define root origin) ;; root (define min-axial 0) ;; min-axial (define max-axial 360) ;; max-axial (define axial-dir (gvector 1 0 0)) ;; axial-dir (define min-tilt 0) ;; min-tilt (define max-tilt 0) ;; max_tilt (define tilt-dir (gvector 0 0 1)) ;; tilt-dir (pattern:mod-random-orient pat root min-axial max-axial axial-dir min-tilt max-tilt tilt-dir)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC ;; (0,2,0),0,7,0,9)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
fraction | real |
merge | boolean |
Description
Applies a periodic keep filter to an existing pattern, merging with any
existing filter or, optionally (with
merge=#f), replacing it.
; pattern:mod-random-keep ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 12) ;; num_x (define y-vec (gvector 0 4 0)) ;; y-vec (define num_y 12) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define keep_fraction 0.5) ;; keep_fraction (pattern:mod-random-keep pat keep_fraction) ;; #[pattern ;; trans-vec:"DOMAIN(X*VEC(4,0,0)+X2*VEC ;; (0,4,0),0,11,0,11)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; [list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
min_scale | real | gvector |
max_scale | real | gvector |
root | position |
merge | boolean |
Description
Applies a random scale to an existing pattern, merging with any existing
scaling or, optionally (with
merge=#f), replacing it.
; pattern:mod-random-scale ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 4 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 10) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define min_scale 0.5) ;; min_scale (define max_scale 2.0) ;; max_scale (define root origin) ;; root (pattern:mod-random-scale pat min_scale max_scale root)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(4,0,0)+X2*VEC ;; (0,2,0),0,7,0,9)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
root | position |
normal | gvector |
; pattern:mod-reflect ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a copy of the prism (define prismr (entity:copy prism)) ;; prismr ; make a pattern (define t1 (transform:translation (gvector 0 0 0))) ;; t1 (define t2 (transform:translation (gvector 2 2 0))) ;; t2 (define t3 (transform:translation (gvector 4 0 0))) ;; t3 (define t4 (transform:translation (gvector 0 4 0))) ;; t4 (define t5 (transform:translation (gvector 4 4 0))) ;; t5 (define pat (pattern:from-list (list t1 t2 t3 t4 t5))) ;; pat ; reflect the pattern about the origin (define root (position 0 0 0)) ;; root (define normal (gvector 1 1 0)) ;; normal (define patr (pattern:copy pat)) ;; patr (pattern:mod-reflect patr root normal)) ;; ;; patr ; apply the original pattern to the original prism (define apply (entity:pattern prism pat)) ;; apply ; apply the reflected pattern to the copy (define body (entity:pattern prismr patr)) ;; body |
[Top]
pat | pattern |
scale | law |
root | position |
merge | boolean |
Description
Applies a scale law to an existing pattern, merging with any existing scaling
or, optionally (with merge=#f), replacing it.
; pattern:mod-scale ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; position the prism (define origin (position 1 2 3)) ;; origin (define transform2 (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform2 ; make a pattern (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 5) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 5) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; modify the pattern (define scale (law "(Y+1)/5")) ;; scale (define root origin) ;; root (pattern:mod-scale pat scale root) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (0,2,0),0,4,0,4)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; modify the pattern again (set! scale (law "(5 - X)/5")) ;; #[law "(Y+1)/5"] (pattern:mod-scale pat scale root) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (0,2,0),0,4,0,4)+VEC(1,2,3)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "(Y+1)/5" ;; keep: "null_law" ;; no list] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
coords | pair |
transf | transform |
Description
Moves the element specified by coords according to the transformation transf.
; pattern:move-element ; Make a prism. (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; Position the prism. (define origin (position 1 2 3)) ;; origin ; Move the prism. (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; Make a pattern. (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 3 0)) ;; y-vec (define num_y 8) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; OUTPUT Original ;Move one of the pattern elements. (define disp (gvector 0.4 1.2 0.5)) ;; disp (define move (transform:translation disp)) ;; move (set! pat (pattern:move-element pat (list 3 2) move)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (0,3,0),0,7,0,7)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; [list]] ; Apply the pattern to the prism. (define body (entity:pattern prism pat)) ;; body ; OUTPUT Result Figure. Moving Pattern Elements |
[Top]
pat | pattern |
face | face |
root-point | position |
normal | gvector |
Description
This extension returns #t if a pattern lies on the plane. Otherwise, it returns
#f.
; pattern:planar? ; define root position for test (define root (position 0 0 3)) ;; root ; make a linear pattern in the xy plane (define x-vec (gvector 10 0 0)) ;; x-vec (define y-vec (gvector 10 10 0)) ;; y-vec (define pat (pattern:linear x-vec 3 y-vec 5)) ;; pat ; Is it planar with respect to a normal in the ; x direction? (pattern:planar? pat root (gvector:cross x-vec y-vec)) ;; #t ; make a circular pattern in the xy plane (define center (position 5 6 3)) ;; center (define normal (gvector 0 0 1)) ;; normal (set! pat (pattern:elliptical center normal 5)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(10,0,0)+X2*VEC ;; (10,10,0),0,2,0,4)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; Is it planar with respect to a normal in the ; z direction? (pattern:planar? pat root normal) ;; #t |
[Top]
center | position |
normal | gvector |
num | integer |
dist | real |
start | gvector |
not-rotate | boolean |
hex-symmetry | boolean |
start-angle | real |
end-angle | real |
ratio | real |
Description
Creates a two-dimensional polar-grid pattern. The pattern coordinates are
specified in the order (radial, angular).
; pattern:polar-grid ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define center origin) ;; center (define normal (gvector 0 0 1)) ;; normal (define num_rings 5) ;; num_rings (define spacing 4) ;; spacing (define pat (pattern:polar-grid center normal num_rings spacing)) ;; pat ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
index1 | integer |
index2 | integer |
Description
This extension prints a transform associated with the pattern specified by pat.
By default, the root transformation is printed.
; pattern:print-transform ; make a pattern (define axis_start (position 0 -25 0)) ;; axis_start (define axis_end (position 0 25 0)) ;; axis_end (define start-dir (gvector 1 0 0)) ;; start-dir (define radius 5) ;; radius (define thread_distance 10) ;; thread_distance (define edge (edge:helix axis_start axis_end start-dir radius thread_distance)) ;; edge (define num 50) ;; num (define root (position 1 2 3)) ;; root (define on-endpoints #f) ;; on-endpoints (define rail-dir (gvector 1 0 0)) ;; rail-dir (define tangent-dir (gvector 0 1 0)) ;; tangent-dir (define pat (pattern:edge edge num root on-endpoints rail-dir tangent-dir)) ;; pat (entity:delete edge) ;; () ; print the root transform (define result1 (pattern:print-transform pat)) ;; result1 ; print the first transform (define result2 (pattern:print-transform pat 0)) ;; result2 ; check for success (law:equal-test result1 #t) ;; #t (law:equal-test result2 #t) ;; #t |
[Top]
center | position |
normal | gvector |
num-radial | integer |
num-angular | integer |
dist | real |
start | gvector |
not-rotate | boolean |
start-angle | real |
end-angle | real |
ratio | real |
Description
Creates a two-dimensional radial pattern. The pattern coordinates are specified
in the order (radial, angular).
; pattern:radial ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define center origin) ;; center (define normal (gvector 0 0 1)) ;; normal (define num-radial 4) ;; num-radial (define num-angular 5) ;; num-angular (define spacing 3) ;; spacing (define pat (pattern:radial center normal num-radial num-angular spacing)) ;; pat ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
extents | gvector |
number | integer |
dimension | integer |
ellipsoidal | boolean |
x-vec | gvector |
y-vec | gvector |
Description
Creates a random pattern of a specified number of elements, centered at the
location of the pattern seed entity. The distance from center may be extended
by specifying a value for extents.
; pattern:random ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define extents (gvector 50 25 10)) ;; extents (define num 100) ;; num (define dim 3) ;; dim (define pat (pattern:random extents num dim)) ;; pat ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
entity | entity |
; pattern:remove ; create a pattern to be removed (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define t1 (transform:translation (gvector 0 0 0))) ;; t1 (define t2 (transform:translation (gvector 2 2 0))) ;; t2 (define t3 (transform:translation (gvector 4 0 0))) ;; t3 (define t4 (transform:translation (gvector 0 4 0))) ;; t4 (define t5 (transform:translation (gvector 4 4 0))) ;; t5 (define pat (pattern:from-list (list t1 t2 t3 t4 t5))) ;; pat ; mirror the pattern about the origin (define root (position 0 0 0)) ;; root (define normal (gvector 1 1 0)) ;; normal (set! pat (pattern:mod-mirror pat root normal)) ;; #[pattern [list]]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body ; remove the pattern (pattern:remove body) ;; #t |
[Top]
pat | pattern |
coords | pair |
Description
Removes the element specified by coords from an existing pattern.
; pattern:remove-element ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define center origin) ;; center (define normal (gvector 0 0 1)) ;; normal (define num-radial 4) ;; num-radial (define num-angular 5) ;; num-angular (define spacing 3) ;; spacing (define pat (pattern:radial center normal num-radial num-angular spacing)) ;; pat ; remove the center element (set! pat (pattern:remove-element pat (list 0 0))) ;; #[pattern ;; trans-vec: "DOMAIN(VEC(-1,0,0)*COS ;; (1.256637061435917*X2)*3*X+VEC ;; (0,-1,0)*SIN(1.256637061435917*X2) ;; *3*X+VEC(1,2,3),0,3,0,4)" ;; x-vec: "VEC(-1,0,0)*COS ;; (1.256637061435917*X2) ;; +VEC(0,-1,0)*SIN ;; (1.25663706143591?7*X2)" ;; y-vec: "VEC(0,0,1)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "PIECEWISE(X>0,X,X2<1)" ;; [list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
coords | pair |
Description
Restores the element specified by coords to an existing pattern.
; pattern:restore-element ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; position the prism (define origin (position 1 2 3)) ;; origin (define transform2 (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform2 ; make a pattern (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 4) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 4) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; apply a keep law to the pattern (define keep (law "X + Y < 4")) ;; keep (set! pat (pattern:mod-keep pat keep)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (0,2,0),0,3,0,3)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; restore the corner element removed by the keep law (set! pat (pattern:restore-element pat (list 3 3))) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (0,2,0),0,3,0,3)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "X+Y<4" ;; [list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
coords | real |
scale | real | gvector |
root | position |
Description
Scales the element specified by coords of an existing pattern about the
position root by an amount scale.
; pattern:scale-element ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define trans (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; trans ; make a pattern (define center origin) ;; center (define normal (gvector 0 0 1)) ;; normal (define num-radial 4) ;; num-radial (define num-angular 5) ;; num-angular (define spacing 3) ;; spacing (define pat (pattern:radial center normal num-radial num-angular spacing)) ;; pat ; modify the pattern (define scaling 2) ;; scaling (define root origin) ;; root (set! pat (pattern:scale-element pat (list 0 0) scaling root)) ;; #[pattern ;; trans-vec: "DOMAIN(VEC(-1,0,0)*COS ;; (1.256637061435917*X2)*3*X+VEC ;; (0,-1,0)*SIN(1.256637061435917*X2) ;; *3*X+VEC (1,2,3),0,3,0,4)" ;; x-vec:"VEC(-1,0,0)*COS ;; (1.256637061435917*X2)+VEC ;; (0,-1,0)*SIN(1.256637061435917*X2)" ;; y-vec: "VEC(0,0,1)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "PIECEWISE(X>0,X,X2<1)" ;; [list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body (law:equal-test (length (entity:vertices body)) 96) ;; #t |
[Top]
pat | pattern |
root-transf | transform |
Description
Applies a root transformation to an existing pattern, replacing the existing
root transformation, if any.
; pattern:set-root-transf ; make a body and a copy (define body1 (solid:sphere (position 0 0 0) 1)) ;; body1 (define body2 (entity:copy body1)) ;; body2 ; make a linear pattern along the x-axis (define pat1 (pattern:linear (gvector 5 0 0) 5)) ;; pat1 ; apply the pattern to the original body (define apply (entity:pattern body1 pat1)) ;; apply ; make a new pattern from the original, but ; translated four units in the y direction (define root-transf (transform:translation (gvector 0 4 0))) ;; root-transf (define pat2 (pattern:set-root-transf pat1 root-transf)) ;; pat2 ; apply the new pattern to the second body (define apply2 (entity:pattern body2 pat2)) ;; apply2 |
[Top]
pat | pattern |
Description
This extension returns the number of elements in the pattern specified by pat.
; pattern:size ; make a pattern (define center (position 1 2 3)) ;; center (define normal (gvector 0 0 1)) ;; normal (define num-radial 4) ;; num-radial (define num-angular 5) ;; num-angular (define spacing 3) ;; spacing (define pat (pattern:radial center normal num-radial num-angular spacing)) ;; pat ; find the pattern size (define size (pattern:size pat)) ;; size |
[Top]
center | position |
num-latitudes | integer |
root | position |
spacing | real |
Description
Creates a two-dimensional spherical pattern about the center position,
with the seed pattern entity at one pole of the associated sphere. The pattern
coordinates are specified in the order longitude, latitude.
; pattern:spherical ; make a pyramid (define height 0.5) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.1) ;; min_rad (define num_sides 3) ;; num_sides (define pyramid (solid:pyramid height maj_rad min_rad num_sides)) ;; pyramid ;position the pyramid (define origin (position 1 2 3)) ;; origin (define transform (entity:transform pyramid (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform (zoom-all) ;; #[view 1508128] ; output original ; make a pattern (define center (position 1 2 -2)) ;; center (define num-latitudes 10) ;; num-latitudes (define root origin) ;; root (define pat (pattern:spherical center num-latitudes root)) ;; pat ; apply the pattern to the pyramid (define body (entity:pattern pyramid pat)) ;; body ; output Result Figure. Spherical Patterns |
[Top]
pat | pattern |
face | face |
center | position |
Description
This extension returns #t if a pattern lies on the spherical surface associated
with the face or, alternately, with center. Otherwise, it returns #f.
; pattern:spherical? ; make a spherical pattern (define center (position 5 6 3)) ;; center (define root (position 0 0 0)) ;; root (define pat (pattern:spherical center 5 root)) ;; pat ; is it spherical about its center? (pattern:spherical? pat center) ;; #t ; make a circular pattern in the xy plane (define normal (gvector 0 0 1)) ;; normal (set! pat (pattern:elliptical center normal 5)) ;; #[pattern ;; trans-vec: "VEC(5,6,3)" ;; x-vec: "DOMAIN(VEC(0,0.4472135954999579, ;; -0.8944271909999159)*COS ;; (0.89759790102?56552*X)*COS ;; (0.7853981633974483*X2)+VEC ;; (0.801783725737273, ;; -0.5345224838248487, ;; -0.2672612419124243)*SIN ;; (0.8975979010256552*X)*COS ;; (0.7853981633974483*X2)+VEC ;; (0.5976143046671968, ;; 0.7171371656006361, ;; 0.3585685828003181)*SIN ;; (0.7853981633974483*X2),0,6,0,4)" ;; y-vec: "VEC(0,0.4472135954999579, ;; -0.8944271909999159)*-1*SIN ;; (0.897597901025655?2*X)+VEC ;; (0.801783725737273, ;; -0.5345224838248487, ;; -0.2672612419124243)*COS ;; (0.8975979010256552*X)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "X2>0ANDX2<4ORNOT(X2>0ANDX2<4)ANDX=0" ;; no list] ; is it spherical about its center? (pattern:spherical? pat center) ;; #t ; make a circular pattern in the yz plane (set! pat (pattern:elliptical center (gvector 1 0 0) 5)) ;; #[pattern ;; trans-vec: "VEC(5,6,3)" ;; x-vec: "DOMAIN(VEC(-1,0,0)*COS ;; (1.256637061435917*X)+VEC ;; (0,-1,0)*SIN(1.256637061435917*X), ;; 0,4)" ;; y-vec: "VEC(0,0,1)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ;is it spherical about its center? (pattern:spherical? pat center) ;; #t ; make a spherical pattern about a new center (define new_center (position 5 5 3)) ;; new_center (set! pat (pattern:spherical new_center 5 root)) ;; #[pattern ;; trans-vec: "VEC(5,6,3)" ;; x-vec: "DOMAIN(VEC(0,-1,0)*COS ;; (1.256637061435917*X)+VEC ;; (0,0,-1)*SIN(1.25663706?1435917*X), ;; 0,4)" ;; y-vec: "VEC(1,0,0)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; is it spherical about the old center? (pattern:spherical? pat center) ;; #f |
[Top]
entity | entity |
num-u | integer |
num-v | integer |
root | position |
on-boundary | boolean |
dir-u | gvector |
dir-v | gvector |
; pattern:surface ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define pos origin) ;; pos (define radius 20) ;; radius (define long_start 0) ;; long_start (define long_end 90) ;; long_end (define lat_start -360) ;; lat_start (define lat_end 360) ;; lat_end (define normal (gvector 0 0 1)) ;; normal (define face (face:sphere pos radius long_start long_end lat_start lat_end normal)) ;; face (define u_num 8) ;; u_num (define v_num 6) ;; v_num (define root origin) ;; root (define pat (pattern:surface face u_num v_num root)) ;; pat (entity:delete face) ;; () ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
transf | transform |
Description
Applies the transformation transf to an existing pattern pat.
; pattern:transform ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 5) ;; num_x (define y-vec (gvector 1 3 0)) ;; y-vec (define num_y 4) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; transform the pattern (define t (transform:axes (position 4 5 6) (gvector 0 1 0) (gvector 0 0 1))) ;; t (set! pat (pattern:transform pat t)) ;; #[pattern ;; trans-vec: "TRANS(DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (1,3,0),0,4,0,3),TRANS1)" ;; x-vec: "DOMAIN(VEC(0,1,0),0,3)" ;; y-vec: "DOMAIN(VEC(0,0,1),0,3)" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; no list] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
pat | pattern |
coords | pair |
Description
Undoes all moves applied to the pattern element specified by coords,
restoring it to its original position within the pattern.
; pattern:undo-move-element ; make a prism (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism ; position the prism (define origin (position 1 2 3)) ;; origin (define transform (entity:transform prism (transform:axes origin (gvector 1 0 0) (gvector 0 1 0)))) ;; transform ; make a pattern (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 8) ;; num_x (define y-vec (gvector 0 3 0)) ;; y-vec (define num_y 8) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; move one of the pattern elements (define disp (gvector 0.4 1.2 0.5)) ;; disp (define move (transform:translation disp)) ;; move (set! pat (pattern:move-element pat (list 3 2) move)) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (0,3,0),0,7,0,7)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; [list]] ; undo the move (set! pat (pattern:undo-move-element pat (list 3 2))) ;; #[pattern ;; trans-vec: "DOMAIN(X*VEC(2,0,0)+X2*VEC ;; (0,3,0),0,7,0,7)" ;; x-vec: "null_law" ;; y-vec: "null_law" ;; z-vec: "null_law" ;; scale: "null_law" ;; keep: "null_law" ;; [list]] ; apply the pattern to the prism (define body (entity:pattern prism pat)) ;; body |
[Top]
object | scheme-object |
Description
This extension returns #t if the given object is a pattern Scheme data
type. Otherwise, it returns #f.
; pattern? ; Create prism geometry to illustrate command. (define height 1) ;; height (define maj_rad 1) ;; maj_rad (define min_rad 0.5) ;; min_rad (define num_sides 3) ;; num_sides (define prism (solid:prism height maj_rad min_rad num_sides)) ;; prism (zoom-all) ;; [view 13369704] ; Verify prism is not a pattern. (pattern? prism)) ;; #f ; Create a pattern. (define x-vec (gvector 2 0 0)) ;; x-vec (define num_x 5) ;; num_x (define y-vec (gvector 0 2 0)) ;; y-vec (define num_y 5) ;; num_y (define pat (pattern:linear x-vec num_x y-vec num_y)) ;; pat ; Verify pat is a pattern. (pattern? pat) ;; #t |
[Top]
point | point |
Description
This extension accepts an entity of the type point, and it returns the
position of the point.
; point:position ; Create a point. (define point1 (point (position 6 6 7))) ;; point1 ; Get the location of the point. (point:position point1) ;; #[position 6 6 7] |
[Top]
object | scheme-object |
; point? ; Create a point. (define point1 (point (position 6 6 7))) ;; point1 ; Determine if the point is actually a point. (point? point1) ;; #t |
[Top]
x | real |
y | real |
z | real |
space | string |
; position ; Create a position. (define pos1 (position 3 3 3)) ;; pos1 ; Create a position in the ; "cylindrical" coordinate system. (define pos-cyl (position 20 20 0 "cylindrical")) ;; pos-cyl ; Define a solid block using the created position. (define block1 (solid:block pos1 pos-cyl)) ;; block1 |
[Top]
position | position |
position-list | position | (position ...) |
; position:closest ; Determine the closest position in a list ; of positions to a given position. (define pos1 (position:closest (position 30 30 30) (list (position 10 10 0) (position 25 22 0)))) ;; pos1 |
[Top]
position | position |
; position:copy ; Create a new position by copying ; an existing position. (define pos1 (position 20 20 0 "cylindrical")) ;; pos1 (define pos2 (position:copy pos1)) ;; pos2 |
[Top]
position1 | position |
position2 | position |
ray | ray |
; position:distance ; Determine the distance between two positions. (define pos1 (position 20 20 0 "cylindrical")) ;; pos1 (position:distance pos1 (position 0 20 0)) ;; 22.9430574540418 |
[Top]
position1 | position |
position2 | position |
weight | real |
Description
This extension returns the position as determined by weight.
; position:interpolate ; Interpolate new positions between ; two given positions. (position:interpolate (position 3 5 4) (position 3 3 3) 0) ;; #[position 3 5 4] (position:interpolate (position 3 5 4) (position 3 3 3) 1) ;; #[position 3 3 3] (position:interpolate (position 3 5 4) (position 3 3 3) 0.5) ;; #[position 3 4 3.5] |
[Top]
position | position |
gvector | gvector |
; position:offset ; Create a new position, offset by a gvector ; from a given position. (position:offset (position 0 0 0) (gvector 10 10 10)) ;; #[position 10 10 10] ; Define the start position. (define pos-start (position 0 -4 0)) ;; pos-start ; Define the start direction. (define dir-start (gvector 8 -8 0)) ;; dir-start ; Create a new position, offset by a gvector ; from a given position. (position:offset pos-start dir-start) ;; #[position 8 -12 0] |
[Top]
position | position |
line-pos | position |
line-dir | gvector |
Description
line-pos and line-dir together define the line. This extension
returns the position on the line.
; position:project-to-line ; Project a position onto a line. (position:project-to-line (position 10 10 10) (position 0 0 0) (gvector 0 1 0)) ;; #[position 0 10 0] |
[Top]
position | position |
plane-pos | position |
plane-normal | gvector |
Description
plane-pos and plane-normal together specify the plane. This
extension returns the position on the plane.
; position:project-to-plane ; Project a position onto a plane. (position:project-to-plane (position 0 0 0) (position 25 25 25) (gvector 1 0 0)) ;; #[position 25 0 0] |
[Top]
pos1 | position |
x | real |
y | real |
z | real |
pos2 | position |
; position:set! ; Set new x-, y-, and z-coordinates for ; an existing position. (define pos1 (position 0 0 0)) ;; pos1 (position:set! pos1 3 5 4) ;; #[position 3 5 4] |
[Top]
position | position |
x | real |
Description
The coordinates are computed relative to the active coordinate system. This
extension returns the x-coordinate as a real.
; position:set-x! ; Set a new x-coordinate for an existing position. (define pos1 (position 0 0 0)) ;; pos1 (position:set-x! pos1 5) ;; 5 |
[Top]
position | position |
y | real |
Description
The coordinates are computed relative to the active coordinate system. This
extension returns the y-coordinate as a real.
; position:set-y! ; Set a new y-coordinate for an existing position. (define pos1 (position 0 0 0)) ;; pos1 (position:set-y! pos1 8) ;; 8 |
[Top]
position | position |
z | real |
Description
The coordinates are computed relative to the active coordinate system. This
extension returns the z-coordinate as a real.
; position:set-z! ; Set a new z-coordinate for an existing position. (define pos1 (position 0 0 0)) ;; pos1 (position:set-z! pos1 -4) ;; -4 |
[Top]
position | position |
transform | transform |
; position:transform ; Apply a transform to a position. (define pos1 (position 5 10 15)) ;; pos1 (define pos2 (position:transform pos1 (transform:translation (gvector 0 1 0)))) ;; pos2 |
[Top]
position | position |
; position:x ; Get a positions x-coordinate. (define pos1 (position 5 10 15)) ;; pos1 (position:x pos1) ;; 5 |
[Top]
position | position |
; position:y ; Get a positions y-coordinate. (define pos1 (position 5 10 15)) ;; pos1 (position:y pos1) ;; 10 |
[Top]
position | position |
; position:z ; Get a positions z-coordinate. (define pos1 (position 5 10 15)) ;; pos1 (position:z pos1) ;; 15 |
[Top]
object | scheme-object |
; position? ; Determine if a position is a position. (define pos1 (position 5 10 15)) ;; pos1 (position? pos1) ;; #t (position? (position 6 5 8)) ;; #t ; Determine if a gvector is a position. (position? (gvector 0 0 0)) ;; #f ; Determine if a value is a position. (position? -4) ;; #f ; Define a new position. (define pts (position 10 10 10)) ;; pts ; Determine if the new position is a position. (position? pts) ;; #t |
[Top]
run_mode | string |
Description
Sets spl_sur global cache run mode.
Example
; set new spl_sur global cache run mode (sscache:set-mode 'hard_limit') ;; no_limit |
[Top]
new_size | integer |
Description
Sets spl_sur global cache size.
Example
; set new spl_sur global cache size (sscache:set-size 40) ;; 20 |
[Top]
None |
Description
For NT systems, the memory displayed is the total committed memory in the
virtual address space of the current process as returned by the Win32 API
VirtualQuery. For further information on Windows memory management, please
consult the Microsoft documentation.
Limitations
Currently implemented only on NT operating systems.
Example
(part:clear) ;; #t ; Get initial memory usage (system:memory-use) ;; 127128 ; Load a part (part:load "test.sat") ;;(#[entity 1 1]) ; Get new memory usage (system:memory-use) ;; 135712 |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.