Citation: (c) Schemers Inc, Ft Lauderdale, FL, USA


Contents
Reviewing 3DScheme	Using 3DScheme	Ordering 3DScheme
Schemers Inc.


SunShine

Acknowledgement

This Introduction to 3DScheme was produced using the Help Yourself! Integrated Help File Development System, a product of the

1-800-553-0400


Reviewing 3DScheme
A Seamlessly Integrated Programming Environment Combined With

The Industry Standard ACIS® Solid Modeler

Schemers Inc.	SPATIAL TECHNOLOGY INC.
A Winning Combination!


Reviewing Navigate


Finding Your Way Around
There are four ways to move around in this file:

	• Use the Menu Boards that appear on some pages. Click on any light blue panel or any round red button to move to the corresponding page.
•	Use the Browse buttons [image] on the main menu bar. These take you through all the pages in a predetermined sequence.

•	Use the large red buttons that appear on most pages, usually in the top right corner:

	Jump to the next in a sequence of pages.
	Jump to the main page in the current sequence of pages.
 	•	Use the [image] button on the main menu bar. This brings up a diagram showing all the pages that are closely linked to the one you are reading. Click on any part of the diagram to move to the corresponding page.


What Is 3DScheme?
A Powerful Programming Environment

By embedding one of the most powerful high-level programming languages in an acclaimed programming environment, 3DScheme brings you the best in the software development arena. Scheme, the language taught at all levels in the world's most prestigious schools, colleges, and universities, provides a semantically simple and syntactically clean way to think about and express algorithms. And the renowned WinScheme Editor provides a program development environment second to none.

+ A Complete Geometric Solid Modeler

With more than 450 geometric modeling procedures, 3DScheme adds a new dimension to the International Standard [image] Scheme language. These procedures access the de facto standard ACIS® Solid Modeler, the engine that drives so many of today's top-end solid modeling and visualization applications.

= A Winning Combination!

Together, these elements bring computing power to educators, students, CAD users, and hobbyists that is unprecedented at such a low price. Whether your interests lie in mathematics, engineering, computer science, design, or recreational graphics, 3DScheme takes you into the next dimension!


Next page 1


The ACIS 3D Modeling Kernel
The ACIS Solid Modeler
ACIS: The Standard
SPATIAL TECHNOLOGY INC. introduced the ACIS® Geometric Modeling Kernel in 1989 as the world's first commercial, object-oriented, 3D geometric modeling toolkit.  ACIS supports wireframe, 3D-surface and solid modeling using a common, unified data structure.  It is developed in conjunction with the world's leading solid modeling experts, Dr. Ian Braid of Cambridge, UK, and his colleagues, and represents an [image] investment of over $12 million.  It has emerged as the de facto standard 3D modeling technology.

ACIS is a proven solid modeler, being licensed by more that 200 of the world's leading 3D modeling suppliers, developers, and researchers, including such notable companies as Allied Signal, Applicon, Aries, Autodesk, Bentley Systems, CADCentre, Cognition, Ford Motor Company, Hewlett-Packard, Hitachi Zosen Systems, MICROCADAM, Mercedes, Point Control, Sharp Strässle and Toshiba.


Next page 2


Curve Creation
The ACIS Solid Modeler
Curve Creation

Lines, arcs, circles, ellipses, conic edges, bezier curves, splines, and other types of curves are easily manipulated thanks to the powerful ACIS® engine.

In addition, you may use 3DScheme to create a curve by isolating the edge of a solid.  Even parametrize it, and evaluate points along the resulting curve!

Moreover, curves may be extruded along vectors to form prisms, or rotated about axes to form solids of revolution.


Next page 3


Solid Creation
The ACIS Solid Modeler
Solid Creation

If you've ever enjoyed playing with Lego™, then you're about to experience the ultimate in building satisfaction.

Choose your bricks, blocks, cylinders, cones, toruses, extruded curves, solids of rotation.

And away you go!


Next page 4


Views
The ACIS Solid Modeler
Views

You may never have the opportunity to hold your creations in your hand ... even so you can use the ACIS® engine to put your models through their paces.

Perspective view?
No problem.

From the inside out?
A snap.

That is, as long as you know where you are, where it is, and which way is up!


Next page 5


Transformations
The ACIS Solid Modeler
Transformations

Once created, solid and wireframe entities may, individually or in groups, be translated, rotated, scaled, and reflected.  In fact, ACIS® provides comprehensive facilities for defining and manipulating transform entities, including composing them and inverting them.

You may even use 3DScheme to define transforms in terms of the transformation required to move between different coordinate systems.


Next page 6


Boolean Operations
The ACIS Solid Modeler
Boolean Operations
3DScheme allows you to create various types of regular solids—  blocks, cylinders, cones, spheres, and toruses, for example.

But often, the more interesting solids are those, like the one whose construction is shown on the right, that are formed by combining regular solids using Boolean operations to form unions, intersections, and differences.

Mass Properties
Want to know more about the solid you have created?  No problem.  The 3DScheme procedure solid:massprop tells you much of what you might need, starting with its volume, and including its center of mass and principal axes and moments of inertia.

In addition, the procedure solid:area tells you the surface area.


Next page 7


Rendering
The ACIS Solid Modeler
Rendering

ACIS® provides the very latest in visualization technology, allowing you to depict your creations in a variety of ways.

Solids may be covered with any of a range of provided materials, each of which has various properties—such as its color, displacement, transparency, and reflectivity.

Specify the material for each of the solids in your "part". Tell ACIS what types of render lights to use and where to place them.  Adjust their properties, if desired. And don't forget to mention where you are in relation to the part you are viewing!

Choose the rendering algorithm from the list of available modes including flat and Gouraud.  Finally choose a suitable background, and Presto!


Next page 8


Graphical Interaction
The ACIS Solid Modeler
Graphical Interaction
One of the common needs in solid modeling programs is for "rubber banding" and "dragging" procedures.

In rubber banding, the graphical image modifies itself dynamically as the mouse moves. On the right, for example, the height of a rectangular block shrinks and grows in response to the up and down movement of the mouse. Depending on which rubber banding method you are using, one or more defining characteristics of the geometrical object you are building are registered in response to mouse clicks while rubber banding is in progress.

Rubber banding and dragging are supported by the ACIS® Solid Modeler and accessed directly through 3DScheme.  In fact, 3DScheme lets you tap directly into the underlying Microsoft Windows messaging system to write event-based programs that make use of dynamic interaction with the program by means of events such as mouse clicks.


Next page 9


The Scheme Programming Language
Scheme: A Modern Programming Language

Scheme is a dialect of the Lisp programming language that was invented by Guy Lewis Steele Jr. and Gerald Jay Sussman of the Artificial Intelligence Laboratory at the [image] Massachusetts Institute of Technology.  It demonstrates that a clear and simple language with few syntactic rules is sufficient to form the basis of a practical, efficient, and extremely powerful programming language, flexible enough to support the major programming paradigms such as object-oriented programming.

The Scheme programming language is powerful enough for the professional, yet its structure is so consistent and conceptually simple that even computer novices can pick up the language and write significant programs.

Best of all, Scheme is easily extended to give you access to powerful underlying technology . . . such as the ACIS® Solid Modeler!


Next page 10


Scheme code example
The Scheme Programming Language
A Solid Modeling Scheme Example

Scheme's functional basis is perfect for "capturing" solid and wire-body entities, while its tolerance for imperative programming allows for in-place manipulation of top-level entities and their dependent entities.

Here is an example of some actual 3DScheme code as it puts the ACIS® Solid Modeler through its paces.  On the left is the Scheme code that creates the abstract solids, and on the right is the Scheme code that causes these solids to be visualized as shown in the figures.

;; create an equilateral triangular prism ;; (define wedge   (solid:sweep-wire     (wire-body       (list         (linear-edge (position 0 0 -20) (position 30 0 -20))         (linear-edge (position 30 0 -20) (position 30 60 -20 "polar"))         (linear-edge (position 30 60 -20 "polar") (position 0 0 -20))))     40))	(entity:paint wedge YELLOW) (render)
;; create a hexagonal collar by uniting six copies of the equilateral ;; triangular prism and drilling a large cylindrical hole along the axis. ;; (define hex-collar   (solid:subtract     (apply solid:unite (cons wedge (map   (lambda (angle)     (entity:transform     (entity:copy wedge)     (transform:rotation       (position 0 0 0) (gvector 0 0 1) angle))   '(60 120 180 240 300))))     (solid:cylinder       (position 0 0 -20) (position 0 0 20) 20)))	(entity:paint hex-collar GREEN) (render)
;; turn the collar through 90 degrees and punch six holes in it. ;; (entity:transform   (solid:subtract     hex-collar     (solid:cylinder       (position 30 -30 0 "polar") (position 30 150 0 "polar") 10)     (solid:cylinder       (position 35 -90 7.5 "polar") (position 35 90 7.5 "polar") 10)     (solid:cylinder       (position 35 30 -7.5 "polar") (position 35 210 -7.5 "polar") 10))   (transform:rotation (position 0 0 0) (gvector 1 0 0) 90))	(render)
;; create a ball in the center of the hexagonal collar. ;; (define ball   (solid:sphere (position 0 0 0) 10)) ;; create a cone lying on its side at one end of the collar's axis. ;; (define cone   (solid:cone (position 0 60 0) (position 0 30 0) 10 0)) ;; create a tilted cube at the other end of the collar's axis. ;; (define block   (entity:transform     (solid:block (position 10 -40 -10) (position -10 -60 10))     (transform:rotation (position -10 -40 10) (gvector 1 1 1) 60)))	(entity:paint ball RED) (entity:paint cone YELLOW) (entity:paint block MAGENTA) (render)


Next page 11


The WinScheme Editor
A Powerful Programming Environment

3DScheme incorporates the acclaimed WinScheme Editor.   Programs are written and executed right out of the editor itself, giving you the best of all possible worlds.  But this is no ordinary editor, as the following features show:


Next page 12


Automatic indentation
Automatic Indentation of Expressions

You can set up the WinScheme Editor so that it automatically typesets your programs, indenting them like this:

This control over the layout of your programs is independent of whether you are using a fixed-pitch font (such as Courier) or a variable-pitch font (such as Arial).


Parenthesis Matching

Whenever you type a parenthesis or move the insertion point next to one, the WinScheme Editor checks to see whether the parenthesis opens or closes a valid Scheme expression. If it does, the editor draws a box around the expression, or highlights its opening and closing parentheses, or both, or neither—it's your choice.


Context-sensitive Jumps

What kind of argument does the primitive procedure magnitude take? Is it guaranteed to be present in every Scheme? Just type "magnitude" in a document and press Ctrl+F1, or simply click the right mouse button on the word, and you will be taken directly to the relevant topic in the 3DScheme knowledge base.


Colored programs
Coloring of Syntactic Elements

Displaying a program in color is not a gimmick. It is an effective way to improve the program's readability and, with it, your productivity. Do you suspect that a definition has too many right parentheses? Are you concerned that your code might contain invalid forms?  The WinScheme Editor's program-coloring capabilities can help you identify or avoid these typical programming problems.


Indexing of Scheme Files

At all times, the WinScheme Editor keeps all the definitions in your file of Scheme code at your fingertips. Click once on the filename button in the status bar and a menu pops up with an alphabetical listing of all the procedures you have defined. Choose the one you want, and the editor selects the whole of the corresponding definition and takes you directly there.


MDI Features
Features of the Multiple Document Interface

The WinScheme Editor's MDI Features

    Speed bar                                                                            Menu bar

    Status bar                                                                Document       Workspace


Getting Started with 3DScheme
Getting Started
Getting Started With 3DScheme

If you're new to Scheme or to solid modeling, you can get some serious leverage by reading the new Getting Started text book by Edward C. Martin (pp. 250, paperbound).  The book begins by leading you through the basics of solid modeling.  What is a solid?  A face?  A lump?  An edge?  A view?  How do you specify positions and vectors in three-space?  How can solids be united, intersected, and subtracted?  Each concept is illustrated with diagrams, together with code that you can actually run using 3DScheme.

The book then takes you through the Scheme programming language and on to the techniques for manipulating and visualizing entities.  Throughout, you are encouraged to tackle solid modeling projects ranging from short, simple tasks (such as the barbell above) to longer, more challenging tasks such as simulating the bending of wires (the paper clip on the left, for example).


Next page 13


The 3DScheme Knowledge Base
The 3DScheme Knowledge Base

3DScheme comes loaded with a vast repository of knowledge concerning 3DScheme, Scheme in general, and the ACIS® Solid Modeler.

Over 1000 help topics, professionally laid out and written by experienced technical authors, incorporate more than 5000 hypertext hot links and 150 annotated figures to lead you to the information you need with a minimum of fuss.  Topics cover all aspects of the programming environment, the R4RS Scheme Standard, and the ACIS Scheme extensions.

Click on the plaque to access a sampling of the help topics in the 3DScheme knowledge base.


Next page 15


Examples
The 3DScheme Knowledge Base
Examples

The topics listed on this menu board are chosen from over a thousand that [image] form the 3DScheme knowledge base. Each topic describes just one of the more than 450 primitive procedures that make up 3DScheme's solid modeling extension.

In addition to covering the solid modeling extension in its entirety, whole sections of the knowledge base are dedicated to explaining and describing Scheme, as well as 3DScheme's powerful development environment.


Next page 14


Argument: ...
Argument Information

... (an ellipsis)

In the syntax template of an entry in the WinScheme Help System, an ellipsis  following some number, n, of arguments of the same type signifies that n – 1 or more arguments of that type are acceptable at that point. For example,

•	the syntax template (+ z1 ...) indicates that + accepts zero or more complex number arguments;

•	the syntax template (map proc list1 list2 ...) indicates that map takes two or more arguments, the first being a procedure and the second and any later arguments being lists.


Argument: ent
Argument Information

ent, ent1, ent2, ...

Arguments of this form are entities.


Argument: entlist
Argument Information

entlist

Arguments of this form are lists of entities.


Argument: gvec
Argument Information

gvec, gvec1, gvec2, ...

Arguments of this form are three-dimensional gvectors. They are always represented externally in rectangular Cartesian form relative to the active coordinate system by a symbol of the form #[gvector x y z].


Argument: pos
Argument Information

pos, pos1, pos2, ...

Arguments of this form are positions in three-dimensional space. They are always represented externally in rectangular Cartesian form relative to the active coordinate system by a symbol of the form #[position x y z].


Argument: x
Argument Information

a, a1, a2,  ...

r, r1, r2,  ...

x, x1, x2,  ...

y, y1, y2,  ...

Arguments of this form are real numbers.


Active coordinate system

The active coordinate system is either the active working coordinate system, if there is one, or the model coordinate system, if not.


Active part

A part is a grouping of top-level entities. The active part is the part to which newly-created entities are added by default, and it is the part that is accessed when an optional part argument is omitted in a procedure call. To discover which part is the active part, use the procedure part:active, and to make some specified part the active part, use the procedure part:set-active.

Parts are always represented externally in the form #[part n], where n is a system-generated non-negative integer that serves as the part's identification number.


Active view

The active view is the view object in the context of which all the view:... procedures operate when no view argument is specified. Its identity may be discovered by using the procedure env:active-view, and a given view object may be made the active view by using the procedure env:set-active-view.


Auto-display

By default, a representation of each new entity is displayed in all views as the entity is created. Thus, by default, the auto-display feature is on. To determine the current state of this feature, use the procedure env:auto-display. To change its state, use the procedure env:set-auto-display.


Cartesian coordinates

Cartesian coordinates describe positions in relation to an origin and three axes (the x-axis, the y-axis, and the z-axis) that pass through the origin.

The position with Cartesian coordinate (a,b,c), where a, b, and c are real numbers, is situated a units in the direction of the positive x-axis, b units in the direction of the positive y-axis, and c units in the direction of the positive z-axis away from the origin. (A negative number of units in a positive direction is equivalent to the corresponding positive number of units in the opposite direction.)

If the axes are mutually perpendicular, then the coordinate system is said to be rectangular. If the positive directions of the x-, y-, and z-axes obey the right-hand rule, then the coordinate system is said to be regular.


Dependency hierarchy

Geometrical entities that share a common owner fit into one of the branches of the dependency hierarchy shown on the right.

For example, a solid block is a top-level body that owns a number of dependent entities. In order of precedence, these are: one lump, one shell, six faces, six loops (one for each face), twelve edges (four for each loop, with each edge being a dependent of two loops), and eight vertices (two for each edge, with each vertex being a dependent of three edges).

Bodies and points can never be anything but top-level entities. Faces, edges, and vertices can be top-level entities, but often are not. Lumps, wires, shells, and loops (whose names are printed in blue in the diagram) can never be top-level entities.


Entity, defined
Entity

An entity is an abstract data structure that incorporates all the essential defining information relating to some permanent object within the ACIS® Solid Modeler.

It is not the object itself, nor does it represent the object in any way. However, a geometrical entity (such as an edge) includes everything the system needs to know in order to represent the associated object visually in a view window or in coded form in a file-associated view, situating it correctly in relation to any other represented objects.

Each entity has an owner, which may be identified by using the procedure entity:owner. Owners are entities too, and they have the additional property that they own themselves. This property makes them top-level entities. If an entity is distinct from its owner, then it is said to be a dependent entity of that owner. In addition, whenever geometrical entities share a single owner, they may be organized within a more refined dependency hierarchy.

Entities are always represented externally in the form #[entity m n], where the positive integer m is a system-generated entity identification number and the non-negative integer n is the identification number of the part to which the entity belongs.


Model coordinate system

The coordinate system to which all positional referencing involved in 3DScheme's geometrical activities may ultimately be traced back. The positioning of any view coordinate system or working coordinate system is at all times describable in terms of the model coordinate system.

Initially, when 3DScheme is first started, and whenever there is no active working coordinate system, the model coordinate system serves as the active coordinate system.


Polar coordinates
Polar coordinates; Cylindrical coordinates

Polar coordinates (also known as cylindrical coordinates) describe positions in relation to an origin, a polar axis (which is a ray with the origin as its endpoint), and a z-axis (which passes through the origin and is perpendicular to the polar axis).

The position with polar coordinate (r,a,c), where r, a, and c are real numbers, is situated at a perpendicular distance of r units from the z-axis, in a plane that contains the z-axis and is rotated about the z-axis through an angle of a degrees from the XZ plane in the sense determined by the right-hand rule in relation to the positive z-axis, and at a distance of c units away from the origin in the direction of the positive z-axis.


Side effect

Some Scheme expressions are evaluated with a view to causing some outcome to occur rather than for the purpose of obtaining a value. In fact, it is considered poor style—and a generally unwise practice—to make any use at all of the value returned by an expression of this type.

The outcomes in question are known as side effects, and broadly speaking they fall into two categories: mutation (in which a Scheme object is modified, for example by having its value or some other aspect of its current state altered) and input/output (including video display, processing keyboard and mouse activity, file handling, and communication with peripheral devices such as printers).

The order in which side-effect-producing expressions are evaluated can be crucial. To sequence the evaluation of such expressions, include them in begin-expressions. In addition to explicit begin-expressions, there are a small number of contexts—for example, the bodies of let-expressions and lambda-expressions and the consequents of cond-clauses—that include an implied begin.


Spherical coordinates

Spherical coordinates describe positions in relation to an origin, a polar axis (which is a ray with the origin as its endpoint), and a z-axis (which passes through the origin and is perpendicular to the polar axis).

The position with spherical coordinate (r,a,b), where r, a, and b are real numbers, is situated at a distance of r units from the origin, in a plane that contains the z-axis and is rotated about the z-axis through an angle of b degrees from the XZ plane in the sense determined by the right-hand rule in relation to the positive z-axis, and on a ray from the origin that makes an angle of a degrees with the positive z-axis.


The right-hand rule

A coordinate system is said to obey the right-hand rule if, when you hold your right hand in such a way that the thumb and the first two fingers are mutually perpendicular, and you align your thumb with the positive x-axis and your index finger with the positive y-axis, then your middle finger is aligned with the positive z-axis.

The rotational sense determined according to the right-hand rule in relation to a gvector that specifies an axis of rotation is the direction in which the fingers of your right hand are pointing when you curl them in toward your palm while sticking your thumb out in the direction of the gvector.


Value

Every Scheme expression returns some Scheme object as its value.

Despite this, there are certain expressions whose intent is more imperative in nature. Such expressions are evaluated not so much for the value returned as for the side effect produced during the evaluation process.


View coordinate system

Each view has a permanent and unchangeable coordinate system, whose z-axis comes perpendicularly out of the associated view window toward the user, whose x-axis goes horizontally across the view window, and whose y-axis goes vertically up the view window.

Until a view's characteristics are modified by using procedures such as view:set, view:set-eye, view:set-target, and view:set-up, its coordinate system coincides with the coordinate system that was active when it was created.


Working coordinate system
Working coordinate system; WCS

A working coordinate system (or WCS) is an entity, consisting of an origin, an x-axis, a y-axis, and a z-axis, that together form a  regular, rectangular Cartesian coordinate system. Positions and gvectors may be specified relative to a working coordinate system using Cartesian, polar (also known as cylindrical), or spherical coordinatizing methods.

Working coordinate systems may be created using the procedures wcs and wcs:from-transform, and they may be distinguished from other Scheme objects using the predicate wcs?.

The constituent parts of a working coordinate system may be extracted using the procedures wcs:origin, wcs:x-axis, wcs:y-axis, and wcs:z-axis.

A working coordinate system is active if it is the system relative to which positions and gvectors are specified. To determine which WCS (if any) is active, use the procedure wcs:active. To designate a WCS as the active WCS, use the procedure wcs:set-active.


solid:area
(solid:area ent) (solid:area ent x)	Procedure
A pair, whose car component reports the total surface area of the input entity and whose cdr component estimates the maximum relative error achieved in the area calculation (that is, the maximum difference between the calculated value and the true value as a fraction of the true value).

•	The entity argument must be a solid body.

•	The optional second argument must be a real number between 0 and 1 that specifies the desired tolerance of the calculation as a maximum relative error. If this argument is omitted, a tolerance of 0.01 (that is, 1%) is used.

•	A reported maximum relative error of 0 indicates that the area has been determined analytically to within the limits of accuracy of the computer. Among the faces whose areas are evaluated analytically are the following:

◊	a planar face bounded by linear and/or elliptical edges;

◊	a conical face that is a connected part of the curved surface of a circular cross-section cone and that is bounded by linear and/or circular edges;

◊	a cylindrical face that is a connected part of the curved surface of a circular cross-section cylinder and that is bounded by linear and/or elliptical edges;

◊	a spherical face that is either the full surface of a sphere or a connected part of such a surface that is bounded by circular edges that all lie in longitudinal or latitudinal planes relative to the same diameter of the sphere.

Example:

(define S (solid:sphere (position 0 0 0) 40))
(define T (solid:torus (position 0 0 0) 25 5))
(solid:unite
  S (entity:transform
       T (transform:translation (gvector 30 0 0))))
(solid:subtract
  S (solid:block
       (position 20 -40 -40) (position -40 40 40)))
(solid:area S) [image] (11131.8839366993 . 0.00531887246513953)


Next page 18


solid:blend-edges
(solid:blend-edges ent r) (solid:blend-edges entlist r)	Procedure
A list of entities, namely, the owner(s) of the input edge(s).

Replaces the input edge or each edge in the input list by a face that blends tangentially with the faces of the edge's owner that share the edge. Each replacement face is curved in such a way that its intersection with any plane perpendicular to the edge being replaced is a circular arc of radius r. In the case of a linear-edge, the replacement face is cylindrical, and in the case of a circular-edge, it is toroidal.

Makes all necessary adjustments to the display list and the data structure(s) associated with the owner(s) of the input edge(s), updating information about faces, edges, and vertices. Refreshes the display in all views.

The input entity or each entity in the input list must be an edge of a solid body.

Example:

(define B
  (solid:block
    (position -20 -20 -20)
    (position 20 20 20)))
(define E (entity:edges B))
(define E1 (car E))
(define E2 (list-ref E 9))
(solid:blend-edges
  (list E1 E2) 10)


Next page 19


solid:block
(solid:block pos1 pos2)	Procedure
A new entity, namely, the rectangular block that has diagonally opposite corners at the input positions and edges parallel to the axes of the active coordinate system.

Adds the newly-created entity to the active part and, if the auto-display feature is on, adds the new entity to the display list and represents it in all views.

The two input positions must not agree in any component of their coordinates relative to the active coordinate system.

Example:

(solid:block
  (position 0 0 0)
  (position 20 20 20))
     #[entity 1 0]
(solid:block
  (position 10 10 0)
  (position 20 20 40))
     #[entity 2 0]
(solid:block
  (position 0 0 0)
  (position -30 -20 -5))
     #[entity 3 0]


Next page 20


solid:cone
(solid:cone pos1 pos2 r1 r2) (solid:cone pos1 pos2 r1 r2 x) (solid:cone pos1 pos2 r1 r2 x pos3)	Procedure
A new entity, namely, the cone or cone frustum whose characteristics are determined by the arguments in the manner described below.

Adds the newly-created entity to the active part and, if the auto-display feature is on, adds the new entity to the display list and represents it in all views.

The first two numerical arguments, r1 and r2, must be non-negative and they cannot both be zero. The third numerical argument, x, must be positive. The three positions pos1, pos2, and pos3 must not be collinear.

The cone or cone frustum that is created has as its central axis the line segment with endpoints at positions pos1 and pos2.

The following comments deal with pos1 and the corresponding real number argument r1. Similar remarks are in order for the other pair of corresponding arguments, pos2 and r2.

If r1 is 0, then the entity that is created is a cone that comes to a point at position pos1. If r1 is positive, then the entity that is created is a cone or cone frustum that has a planar face with pos1 at its center and perpendicular to the central axis (described above). The nature of this planar face depends on whether any optional arguments are provided.

If no optional arguments are provided, then the planar face is bounded by a circular edge with radius r1.

Example:

(solid:cone
  (position 0 0 -25)
  (position 0 0 25)
  15 0)

If two optional arguments, x and pos3, are supplied—and supposing, as noted above, that pos3 is not collinear with pos1 and pos2—then the planar face is bounded by an elliptical edge whose axes are determined as follows:

•	Draw the perpendicular to the cone's central axis that passes through the position pos3.

•	One axis of the ellipse has an endpoint at pos1, is parallel to the line just drawn through pos3, and has length r1.

•	The other axis of the ellipse also has an endpoint at pos1, is perpendicular to the first axis, and has length x multiplied by r1.

Example:

(solid:cone
  (position -10 -10 -10)
  (position -10 -10 30)
  15 5 3
  (position 30 0 15))

If only one optional argument, x, is provided, then the planar face is bounded by an elliptical edge whose axes are determined as follows:

•	If the cone's central axis is not parallel to the x-axis of the active coordinate system, then draw the line parallel to the x-axis that passes through pos1.

•	If the cone's central axis is parallel to the x-axis of the active coordinate system, then draw the line parallel to the z-axis that passes through pos1.

•	Choose any position (except pos1) on the line just drawn.

•	Using the chosen position as the second optional argument, find the axes of the ellipse by the method described above in the two-optional-argument case.

Examples:

(solid:cone
  (position 0 20 -30)
  (position -20 -20 30)
  40 20 0.25)

(In this example, the cone's central axis is not parallel to the x-axis.)

(solid:cone
  (position -20 0 0)
  (position 20 0 0)
  15 5 4)

(In this example, the cone's central axis is parallel to the x-axis.)


Next page 21


solid:cylinder
(solid:cylinder pos1 pos2 r) (solid:cylinder pos1 pos2 r x) (solid:cylinder pos1 pos2 r x pos3)	Procedure
A new entity, namely, the cylinder whose characteristics are determined by the arguments in the manner described below.

Adds the newly-created entity to the active part and, if the auto-display feature is on, adds the new entity to the display list and represents it in all views.

Both numerical arguments, r and x, must be positive, and the three positions pos1, pos2, and pos3 must not be collinear.

The cylinder that is created has as its central axis the line segment with endpoints at positions pos1 and pos2. Centered at each end of this axis and perpendicular to it, there are congruent planar faces the nature of which depends on whether any optional arguments are supplied.

If no optional arguments are provided, then the planar face is bounded by a circular edge with radius r.

Example:

(solid:cylinder
  (position 0 0 -25)
  (position 0 0 25)
  15)

If two optional arguments, x and pos3, are supplied—and supposing, as noted above, that pos3 is not collinear with pos1 and pos2—then the planar face is bounded by an elliptical edge whose axes are determined as follows:

•	Draw the perpendicular to the cylinder's central axis that passes through the position pos3.

•	One axis of the ellipse has an endpoint at pos1, is parallel to the line just drawn through pos3, and has length r1.

•	The other axis of the ellipse also has an endpoint at pos1, is perpendicular to the first axis, and has length x multiplied by r1.

Example:

(solid:cylinder
  (position 0 -10 -10)
  (position 0 -10 30)
  15 3
  (position 40 0 15))

If only one optional argument, x, is provided, then the planar face is bounded by an elliptical edge whose axes are determined as follows:

•	If the cylinder's central axis is not parallel to the x-axis of the active coordinate system, then draw the line parallel to the x-axis that passes through pos1.

•	If the cylinder's central axis is parallel to the x-axis of the active coordinate system, then draw the line parallel to the z-axis that passes through pos1.

•	Choose any position (except pos1) on the line just drawn.

•	Using the chosen position as the second optional argument, find the axes of the ellipse by the method described above in the two-optional-argument case.

Examples:

(solid:cylinder
  (position 10 20 -30)
  (position -10 -20 30)
  40 0.25)

(In this example, the cylinder's central axis is not parallel to the x-axis.)

(solid:cylinder
  (position -20 0 0)
  (position 20 0 0)
  15 4)

(In this example, the cylinder's central axis is parallel to the x-axis.)


Next page 22


solid:intersect
(solid:intersect ent1 ent2 ...)	Procedure
An entity, namely, the first argument, modified as explained below.

Modifies the first input entity so that only those parts of space that it shares with all the other inputs are retained. Updates the first entity's data structure, deletes all the other entities by removing them from the part(s) to which they belong and—if they are displayed—from the display list, and refreshes the relevant representations in all views.

•	All the input entities must be solid bodies.

•	The boolean intersection operation is regularized in that, once the first input entity has been trimmed so as to include no points other than those that it shares with the second and subsequent input entities, any dangling faces, edges, and/or vertices are removed from what remains prior to the resulting entity being returned.

Example:

(define B
  (solid:block
    (position 0 0 0)
    (position 20 20 20)))
(define C
  (solid:cylinder
    (position 0 0 -10)
    (position 0 0 30) 10))
(define S
  (solid:sphere
    (position 0 0 10) 20))
B [image] #[entity 1 0]
(solid:intersect B C S)
   #[entity 1 0]


Next page 23


solid:revolve-wire
(solid:revolve-wire ent pos gvec a)	Procedure
An entity, namely, the input entity, modified as explained below.

Modifies the input entity so that it becomes the solid formed when the region enclosed by the input entity's wire revolves through an angle of a degrees about the axis specified by the position and gvector arguments, the sense of rotation being determined by the right-hand rule relative to the input gvector. (If the wire in question is open, then perpendiculars are dropped from its "loose ends" onto the axis of revolution, and the region that is revolved is the one that is bounded by the wire, the perpendiculars, and the axis.) Updates the display list as necessary and, if the input wire-body is displayed, refreshes the representation of the resulting solid body in all views.

•	The input entity must be a wire-body containing only a single wire, which may be either open or closed but which must be planar. Furthermore, the wire (extended—in the case of an open wire—by any "closing" perpendiculars to the axis of revolution) must not intersect itself.

•	The input position and gvector must determine a line that is coplanar with the input wire-body's wire, but without actually intersecting the region enclosed by the wire (together—in the case of an open wire—with any "closing" perpendiculars and the axis itself) anywhere except at a vertex or on an edge.

•	The real number input, a—known as the sweep angle—must lie within the range from –360 to 360.

Example:

(define W
  (wire-body
    (list
      (circular-edge
        (position -20 -10 0) 10 -180 0)
      (circular-edge
        (position -30 0 0) 10 -90 90)
      (circular-edge
        (position -20 10 0) 10 0 180))))

(solid:revolve-wire
  W (position 0 0 0)
  (gvector 0 1 0) 225)


Next page 24


solid:sphere
(solid:sphere pos r)	Procedure
A new entity, namely, the sphere with its center located at the input position and its radius equal to the input real number.

Adds the newly-created entity to the active part and, if the auto-display feature is on, adds the new entity to the display list and represents it in all views.

The input real number must be positive.


Next page 25


solid:subtract
(solid:subtract ent1 ent2 ...)	Procedure
An entity, namely, the first argument, modified as explained below.

Modifies the first input entity so that only those parts of space not included in any of the other inputs are retained. Updates the first entity's data structure, deletes all the other entities by removing them from the part(s) to which they belong and—if they are displayed—from the display list, and refreshes the relevant representations in all views.

•	All the input entities must be solid bodies.

•	The boolean subtraction operation is regularized in that, once the space occupied by the second and subsequent input entities has been removed from the first input entity, any missing faces, edges, and/or vertices are attached to what remains prior to the resulting entity being returned.

Example:

(define B
  (solid:block
    (position 0 0 0)
    (position 20 20 20)))
(define C
  (solid:cylinder
    (position 0 0 -10)
    (position 0 0 30) 10))
(define S
  (solid:sphere
    (position 0 0 10) 20))
B [image] #[entity 1 0]
(solid:subtract B C S)
   #[entity 1 0]


Next page 26


solid:torus
(solid:torus pos r1 r2)	Procedure
A new entity, namely, the torus centered at the input position, with major radius r1 and minor radius r2. (See the notes below for an explanation of these terms.)

Adds the newly-created entity to the active part and, if the auto-display feature is on, adds the new entity to the display list and represents it in all views.

The torus is formed by sweeping a circle (or circular arc) whose radius is the absolute value of r2 along a circular path whose radius is the absolute value of r1 and whose center is at position pos. The circular path is called the spine curve of the torus, and it lies in a plane that is parallel to the XY plane of the active coordinate system. During the sweep, the sweeping circle (or arc) is at all times perpendicular to the spine curve.

When r1 and r2 are both positive with r1 greater than r2, the torus produced looks like a ring doughnut:

When r1 and r2 are both positive with r2 greater than r1, the torus produced looks more like an apple. It has two isolated vertices which are located where the sweeping arc meets the axis of revolution.

When r1 is negative and r2 is positive with r2 greater than the absolute value of r1, the torus produced looks like a football or a lemon. It has two isolated vertices which are located where the sweeping arc meets the axis of revolution.

Examples:

The three tori illustrated above are generated (in unrendered form) by evaluating  the following expressions:

(solid:torus (position 0 0 0) 30 10)
(solid:torus (position 0 0 0) 20 30)
(solid:torus (position 0 0 0) -20 30)


Next page 27


solid:unite
(solid:unite ent1 ent2 ...)	Procedure
An entity, namely, the first argument, modified as explained below.

Modifies the first input entity so that it acquires all the space occupied by one or more of the other inputs. Updates the first entity's data structure, deletes all the other entities by removing them from the part(s) to which they belong and—if they are displayed—from the display list, and refreshes the relevant representations in all views.

•	All the input entities must be solid bodies.

•	The boolean union operation is regularized in that all internal faces, parts of faces, edges, parts of edges, or vertices are removed from the resulting solid before it is returned.

Example:

(define B
  (solid:block
    (position 0 0 0)
    (position 20 20 20)))
(define C
  (solid:cylinder
    (position 0 0 -10)
    (position 0 0 30) 10))
(define S
  (solid:sphere
    (position 0 0 10) 20))
B [image] #[entity 1 0]
(solid:unite B C S)
   #[entity 1 0]


Next page 28


Uses

Unlock the Door to the Next Dimension of Inspiring Uses


Next page 29


Mathematics Education
Using 3DScheme
A Slice Off the Old Block?

If your students are interested in elementary geometry, then a five-minute 3DScheme program is all it takes to make a tool for visualizing conic sections.

Or, if your focus is on radians and vectors, why not encourage your students to tackle the wire-bending project described in the Getting Started textbook that accompanies 3DScheme?

With careful application of a little vector geometry, your students will be able to bend wires at the click of a mouse.


Next page 16


Engineering Education
Using 3DScheme
The World's A Part

Already well-received by engineers for its impressive number-manipulation abilities (including unlimited precision "bignum" integers, for example) and recognized as a powerful tool for the rapid development of working prototypes, Scheme becomes [image] even more attractive when coupled with a solid modeling interface.

The sound theoretical and educational foundation of 3DScheme means that students can learn to use solid modeling technologies with a minumum of fuss and bother.

And, when the geometrical engine is none other than the industry standard ACIS® Solid Modeler, your students get firsthand experience of today's most powerful technology.


Next page 30


Computer Science Education
Using 3DScheme
Scheme

If you are not currently using Scheme as part of your computer science courses, then consider the fact that many of the best schools and universities—including MIT, Rice, Yale, and Berkeley—are now doing so. In fact, over 200 of the most widely respected educational institutions around the world now use Scheme to teach paradigms of modern computer science, including functional and object-oriented programming.

And if you're already using Scheme, then consider moving to 3DScheme. By providing an unlimited supply of fascinating projects, from the "build one of these" variety to challenging applications involving OOP design, it's a proven motivator for students of all abilities.

And it's not only your students who will appreciate it. You can be sure your students will make a splash with your colleagues in the Mathematics and Engineering departments too!


Next page 31


CAD User
Using 3DScheme
Working in the CAD Field?

If you are faced with the prospect of making the switch from two-dimensional computer-assisted design to three-dimensional, 3DScheme provides a friendly, easy-to-use environment within which to familiarize yourself with all the new concepts.

Or maybe you're looking for a way to continue work on your current project while you're away from the office workstation. 3DScheme can load and save parts—groups of solid and wireframe entities—in .sat format, so you can sketch out a new idea or polish an old one on your laptop or your home PC.


Next page 32


Computer Graphic Fun
Using 3DScheme
Computer Graphic Fun

If you enjoy making computer graphic designs, 3DScheme gives you the power you need.  Your solid and wireframe inspirations can be visualized in ways that were never before possible for the casual computer user.


Next page 33


LEGO for the Brain?
Using 3DScheme
LEGO for the Brain?

3DScheme is so much fun that it may be just what you're looking for to divert your child's attention from computer games.

It has the pizzazz of a video game and the allure of the ultimate construction puzzle. LEGO™ for the brain.

We think you'll remember what it feels like to be a kid in a toystore.


Next page 34


How to Order
System Requirements: IBM PC 386 or greater MS Windows 3.1 or later 8 Mb or more of RAM	3DScheme is a trademark of Schemers Inc.   ACIS is a registered trademark of SPATIAL TECHNOLOGY INC.
Call for more information: Schemers Inc 2136 NE 68th Street, Suite 401 Fort Lauderdale, FL 33308	Phone: (305) 776-7376 FAX: (305) 776-6174 EMail: 71020.1774@compuserve.com


Next page 17