ANATOMY OF CAD SYSTEM
MAPPING OF VIEWING
GEOMETRIC ENTITY CREATION
DESIGN DOCUMENT FORMALISM
This is a design document
of the general CAD system.
The following components comprise the basic desktop layout of the main
1. Main title bar
2. Menu bar
3. Tool bar (user-dockable)
4. GUI prompt message
5. Key-in pad / feedback pad
6. Status area (system feedback)
7. Graphical viewport area
The status area is further divided into the following fields.
1. Current mode indicator - shows which mode the user is in.
2. Informative message - displays a confirmation/error message at the end of
each user action.
3. Coordinate value feedback area - echoes what values have been accepted by
4. Mouse motion tracking area - continuously shows the mouse location.
5. Coordinate modes - rectangular/cylindrical/spherical, absolute/relative,
Graphical Display Area
This is the geometry display area. All geometric entities are displayed in a
viewport. The system supports multiple viewports. Each viewport
represents a "camera" to view the scene containing the geometry. Each
viewport has its own properties, such as perspecive/parallel projection,
viewing angle, zooming, etc.
ANATOMY OF CAD SYSTEM
Finite State Machine
Understanding the concept of a "finite state machine" is important for two
reasons. First, the behavior of any interactive program lends itself nicely
to this idea of finite state sequence. At a given moment, the program is in
one state, waiting for some user input. Based on the event caused by the
user action, the program performs some tasks, and then goes to a pre-defined
state and once again waits for another user input. This
user-machine/software interaction and the subsequent state transition
continue forever, until the program is exited. This behavior of state
transitions can be easily depicted on a sheet of paper in a pictorial
fashion. Such a document is very useful during the design phase of the
system as well as it serves as a valuable documentation for the software
product. Secondly, the document in the form of state transition diagrams
provides a clear mapping between the intended design and the actual coding
of the program in a rather effortless manner.
The great strength of menus is their completeness. (Allan Cooper, About
Face) Everything the system provides can be found somewhere on the menus.
Good user interfaces will conscientiously provide multiple idioms for a
given command. (AC) Icons in the toolbar are for frequent users. Menus are
becoming a teaching tool for first-time and infrequent users. (AC) As the
modern GUI evolved, the menus became pedagogic in nature.
In a 3D graphics system, various entities will be created in the 3D space.
To enter a 3D coordinate, the user can key in x, y, z values. In many
interactive situations, however, it is convenient to be able to enter a 3D
coordinate in a more direct fashion - using a mouse. The cursor moves over
the screen by tracking the mouse movement. Since the screen surface is
a 2D space in nature, there must exist some logic to convert this 2D
location onto a corresponding 3D location. It is the main purpose of the
"construction plane" to provide this logical connection. Any 3D graphical
system must have a similar concept in place.
Assume the user clicks the mouse at some location on the viewport. Since the
mouse points somewhere on the 2D surface of the viewport, this has to be
converted to a 3D coordinate. The way to achieve this is to assume an
infinite plane in the 3D space. First, create an infinite line at the mouse
click location, which is perpendicular to the viewport (screen) surface. Let
this infinite line pierce the infinite plane. The resultant pierced point is
the 3D coordinate corresponding to the 2D mouse location on the viewport.
The plane used for this purpose is called a "construction plane." This logic
fails only if the construction plane is perpendicular to the viewport being
The act of mouse-clicking the viewport for the purpose of obtaining a 3D
coordinate is called an "indicate."
The construction plane ahs the following properties/attributes.
1. The origin
2. XYZ axes at the origin (the XY defines the plane)
3. The visual extent of the plane (even if the plane is infinite for
4. Grid size (for visual & grid snap if activated)
5. Grid color
The user should be able to manipulate the construction plane as needed on
1. Rotation about XYZ axes or about any arbitrary axis.
2. Vertical shift or repositioning of the origin point.
3. Arbitrary positioning of the plane.
The user can create and save a construction plane in a list for future use.
There are a few variations of the way the construction palne concept is
implemented in relation to multiple viewports. One idea is to have just one
global construction plane at any given time and all viewports share this
plane. Another idea is to have each viewport possess its own construction
The construction plane can be used for a coordinate key-in as well. That is,
the x, y, z values entered can be interpreted to be a coordinate in
reference to the construction plane in effect - instead of in reference to
the default global coordinate system.
In any interactive system,
in the course of dialog discourse, there are a set number of actions the
user can take at a given moment in the dialog, in order to provide input to
the system. The system reacts to the user action, performs some tasks,
and once again awaits for the next user action. The following is the
list of typical actions.
1. Mouse input
2. Keyboard input
3. Touch screen input
Assuming a three-button mouse, the following actions are possible.
1. L-click / double-click
2. R-click /
3. M-click / double-click
4. Mouse drag (without holding any button)
5. L-hold&drag (hold the button and drag)
6. R-hold&drag (hold the button and drag)
7. M-hold&drag (hold the button and drag)
15. L-release (button just released)
16. R-release (button just released)
17. M-release (button just released)
The "click" means a single
act of pushing a button down and then releasing (up) it again, without
moving the mouse location too much. The system can discern the mouse
motion between "mouse-down" point and "mouse-up" point in terms of pixel distance. The
double-clicking is an act of clicking the same button twice in a rapid
We can also consider a
click or hold&drag of any mouse button while any keyboard key is being held.
1. Key 1 - Key-in of one value
2. Key 2 - Key-in of two values, separated by a comma
3. Key 3 - Key-in of three values, separated by two commas
Key-in of names...
Select / Indicate
The "select" is an act of picking an existing geometry by a mouse button
click. The "indicate", on the other hand, specifies a 3D coordinate by the
same click action while pointing the mouse somewhere in the viewport void of
any geometry. These are two conceptually distinct operations. Nonetheless,
these operations are somewhat related, or similar. Indeed, we can think of
an "indicate" as a selection of the construction plane. Usually, this dual
assignment of the same mouse button for select and indicate presents no
problem - unless some geometry is in front of the construction plane when
the user wishes to "indicate". A solution is to allow a "forced"
indicate by, say, holding the Shift key.
When the user enters three values from the keyboard for a 3D coordinate
specification, the system interprets the values based on the mode settings
in effect at the time.
1. Rectangular Coordinate System (x, y, z)
2. Cylindrical Coordinate System (radius, angle, height)
3. Spherical Coordinate System (radius, angle1, angle2)
1. Absolute Coordinate
2. Relative Coordinate
Reference Coordinate System
1. Global Coordinate System (default)
2. Construction Plane Coordinate System
Anatomy of Viewport
A viewport is a window through which we see the 3D world.
Grid (construction plane)
View setting (view matrix / camera)
Cursor tracking (construction plane / tracking plane)
Plane object creation
Viewport Data Structure
The geometry created can be viewed through multiple viewports...
Axis Location - 3D global origin / screen center / screen corner
A 3D grid plane (construction plane) drawn in the viewport provides a very
useful frame of reference for the eye.
Visible / Invisible
Snap - the cursor snaps to a grid point during an "indicate'
Grid size specification
Grid extent specification
VIewport Data Structure
The viewing facility of a CAD system is of prime importance because of the
frequency of use - and therefore the impact on usability - as well as strong
implications toward overall system design decisions. This section describes
all desired features pertaining to viewing 3D objects through viewports.
These typically comprise panning, zooming and rotation, and some view
viewing operations utilize the same algorithms as geometric manipulations.
For instance, if a view is rotated, an object will rotate. This is, however,
distinct from an object rotation in the 3D space, and viewport manipulations
will never alter the object state or its persistent data.
1. Panning - In a perspective projection, this moves the camera without
changing the camera orientation.
2. Point-panning - Brings the point aimed by the mouse to the center of the
1. Zoom in/out - Zooms in and out. In a perspective projection, move
the camera along the line of sight (not by changing the lens angle).
2. Box-zoom - Specify the box.
3. Fit-all - Fits all geometry in the viewport. Acts on the current viewport.
1. Free-ratate - Allows free 3D rotations about the current rotation origin.
The user can define a new 3D rotation origin, which is brought to the
2. XYZ-rotate - Rotates about x, y, z axis.
3. Define-axis - Rotates about an arbitrary axis define by the user.
The user can set the lens angle (focal length) of the camera.
Each viewport can be set to either a "parallel" or "perspective" projection.
XY (top) YX (bottom)
XZ (front) ZX (back)
YZ (left) ZY (right)
+X+Y+Z -X+Y+Z +X-Y+Z -X-Y+Z
+X+Y-Z -X+Y-Z +X-Y-Z
Set View - Allows the definition of a "head-on: view. The user can provide 3
points, a point and a line, a line for normal, ...
Use Construction Plane -
Use Plane Object -
View Swap - Allows swapping of views between two existing viewports....
Apply View - Retrieves a saved view and assigns it to the current viewport.
Delete View - Delete saved views from the view list.
Rename View - Rename views in the view list.
Save View - Save the current view in the view list.
A mechanism is provided to selectively view a subset of existing objects.
Use a viewing prism to allow for a space-bound constraint.
MAPPING OF VIEWING
GEOMETRIC ENTITY CREATION
Line (multi-segmented / may not be on a plane)
Box (rectangular) - 2 points / 3 points
Circle - center+radius / 2 points / 3 points
Arc - 3 points / center+start pt+end pt / center+start pt+angle /
radius+start pt+end pt
Transition (circle to rectangle)
Level of Detail
GEOMETRIC ENTITY MANIPULATION
Place - arbitrary placement onto a new location w/new orientation
Geometric Modification - Parametric / Deformation
Text / Annotation
Material / Texture
GUI DESIGN DOCUMENT FORMALISM
Menu / Icon
2010-2013 Makoto Honda. All Rights Reserved.