Comput & Graphtt~ Vol. 13. No. t, pp. 71-76, 1989
0097-8493/89 $3.00 + .00 ;c~ 1989 Pergamon Press plc
Printed in Great Britain.
E u r o g r a p h i c s '88 A w a r d P a p e r
CREATION AND MODIFICATION OF PARAMETRIZED SOLID MODELS BY GRAPHICAL INTERACTION MAARTEN J. G. M. VAN EMMERIK Delft University of Technology, Faculty of Industrial Design, Jaffalaan 9, 2628 BX Delft, The Netherlands Abstract--A system that enables the definition of parametrized sofid models by means of graphical interaction is presented. The position, orientation and dimensions of primitive volumes for Constructive Solid Geometry (CSG) are determined by a number of control points. All control points are linked to nodes in a tree of local coordinate systems. The relations between control points is therefore determined by the relations of the nodes in this geometric tree. The user can create nodes and define geometric relations between them by graphical interaction on the geometric tree. With the system described in this paper, it is possible to define relations between geometric properties of CSG primitives without alphanumeric interaction. fined as a set of relations that define dimensions and tolerances between surfaces. The problem of satisfying the constraints is solved by using an AI-technique for finding the sequence of constraint evaluation. Rocheleau[3 ] defines the relations between components of an assembly by 'against' and 'fits' conditions. He uses the concept of a 'virtual link' [4 ] to group all mating conditions in one entity, so that an assembly of objects can be represented in a hierarchical tree. A user-defined constraint evaluation sequencing is proposed by Rossignac [ 5 ]. In his system, the constraint evaluation results in the activation of methods that compute rigid motions of solids from surface information of other solids. The user can enter and evaluate constraints by statements that are processed by an object-oriented interpreter. Besides techniques for representing parametrized object descriptions, we require a user interface for interaction with the system. This user interface should enable the user to define the object, and should give feedback about the structure and relations with the object. With many systems for defining parametrized models, the usefulness for a designer is often restricted by a poor user interface. Relations are entered by alphanumeric expressions and the hierarchy in the relations is not always clear to the user. In this paper, a system is presented that enables the definition of parametrized models based on Constructive Solid Geometry by graphical interaction. The system uses a graphical user interface for the definition, manipulation and representation of the geometric relations in the model. The system is based on three principles: (i) graphical interaction on the 3D object representation, (2) parametrization without alphanumeric expressions, (3) separate definition of the geometric and CSG hierarchy between objects. After a discussion of the representation of objects in this system, a method for defining geometric relations between objects by a geometric tree will be explained. This is followed by a more specific description of the nodes in the geometric tree and the operations
I. INTRODUCTION
The effectiveness of Computer Aided Design depends on the facilities available for fast creation and modification of geometric models. For this purpose a parametrized object description that can be created and edited through user-friendly interaction is required. A parametrized object description makes it possible to change the dimensions and position of a geometric model as a whole, without changing the object description. This allows the designer to evaluate more alternatives, since the effort required for creating these alternatives is reduced. Recently, several systems for defining parametrized models, based on the specification of mating conditions between components of the object, have been presented. The general idea of these systems is to define geometric relations between components rather than specifying individual dimensions and positions. The relations are entered as constraints for dimensioning and positioning of objects. Constraints can for example be used to specify parallelism or tangency between two components. After providing the system with specific parameters, these constraints are evaluated, and a specific instance of the model that matches the set of constraints is created. With multiple constraints that must be met simultaneously, the hierarchy between the constraints and the sequence of constraint evaluation is often of major importance. In Light and Gossard [ 1], dimensions are treated as constraints limiting the location of characteristic points that describe the geometry of objects. All geometric constraints are converted into a set of linear equations, that are solved simultaneously by iterative numerical methods. An object-oriented approach is presented by KJmura and Suzuki[2], in which constraints are deThis paper is one of the award winning papers from EUROGRAPHICS '88, the annual Conference of the European Association for Computer Graphics. The paper is published here in a revised form, with permission of North Holland Publishing Company (Amsterdam), the Publisher of EUROGRAPHICS '88 Conference Proceedings.
71
72
MAARTEN J. G. M. VAN EMMERIK
that can be applied on them. Finally, the user interface and directions for further development of the system are discussed.
a
at) c d e
c r
d
2. OBJECT REPRESENTATION
With Constructive Solid Geometry, the user is provided with a set of elementary volumes and transformations that can be applied to them. A CSG object is defined by taking unions, differences or intersections of transformed instances of such elementary volumes. The user can define the model by specifying type, dimension and position of its component primitives by entering a sequence of commands. Alternatively, the model can be defined by an interactive graphics interface. After a primitive is selected from a menu, geometric data can be entered by graphical manipulation of points that determine the object's shape. Manipulation of these control points is used in many 2Ddrawing programs. The control points are the handles for interaction; after a control point is selected, it can be moved to another position and the object is redrawn. In our system, we use a similar technique for 3D objects[6]. CSG primitives, such as cube, rotational sweep and sphere, are defined by a number of control points for dimensioning and positioning in 3D space (Fig. l). One control point is used to select an origin coordinate system for fixing the position and orientation of the primitive. This coordinate system is required as a reference frame for the other control points. The dimensions of the primitive can be derived from the coordinates of the position vector for a control point in this coordinate system. The number of control points required for defining all geometric properties depends on the primitive, for instance two for a cylinder and a user-defined number for a sweep object. With sweep objects, an object is described by a contour that is rotated or translated along a trajectory. In this case, both the contour and the trajectory are described by a number of control points. Although graphical interaction on control points can improve the user interface, no extra functionality with respect to the definition of the model is obtained. For creating a parametrized model, we need to define relations between dimensions and positions ofobjects. In our system, these relations can be defined by relations between control points. The relations can refer both to the internal organization of control points in
~ ~ieet~
tree
Cs<}
geometrictree
Fig. 2. CSG tree and geometric tree.
an object and the relation between control points of different objects. Manipulation of one control point can also affect the position of another control point. For instance, if the control point that determines the coordinate system of a primitive is moved, we expect the other control points of that primitive to move also, since the manipulation should refer to the position of the object and not to its dimension. Between objects, the position of an object can be influenced by the dimension or position of another object. In general, all geometric relations in an assembly of objects are defined by the relations between their control points. For defining a parametrized model, we require a method for specifying and representing these relations. 3. THE GEOMETRIC TREE
A suitable method for storing geometric information is by locating transformations at the nodes of the CSG tree. The transformations in a node are applied to its subtrees. Instead of hiding this information in the CSG tree, it can be displayed on the screen as a tree of local coordinate systems that is offered to the user for manipulation. However, since one coordinate system can be shared with other primitives not in that particular CSG subtree, we use a separate tree for defining geometric relations (Fig. 2). In this system, the control points of objects are linked to a geometric tree of local coordinate systems. Initially, this geometric tree has a root coordinate system, relative to which multiple local coordinate systems can be defined. These local coordinate systems are the nodes in the geometric tree, which are in turn coordinate systems for other branches of the tree. Each node represents a transformation for a coordinate system relative to its parent node in the hierarchy. The absolute position of a node is obtained by concatenating all transformations down to the root of the tree. Transformations applied to nodes refer to all branches connected to this node; the geometric relations between nodes are therefore defined by the position of the nodes in the geometric tree. The geometric tree is displayed on the screen. The user can select nodes in the tree by pointing at them ~xo.yo.zo) ~l.yt,z)) (xo.yo.zol with a cursor. After a node is selected, it can for example be moved, rotated or deleted by mouse controlled interaction. More details about operations and interaction on the nodes will be provided later. To cre2"yo rl . sq,'llxi'xi*yi'yi) r =aqrtlxo'~o~.yo'yo~zo'¢o) ate an object in the geometric tree, the required primh=zo hi.zi itive is selected from a menu. The control points are par(t.O,h) rsw(rl .hl .rZ,h2.,..) sph(r) defined by selecting a number of nodes in the tree; the Fig. 1. Example of primitives. first node defines the local coordinate system for the I = 2"xo
b o
73
Creation and modification of parametrized solid models primitive, and one or more additional nodes define its dimensions ( Fig. 3 ). The relations between the control points of objects are determined by the structure of the geometric tree. To update the model after manipulation of the geometric tree, the position of all nodes are recalculated and the objects linked to these nodes are redrawn. For defining the CSG composition, all objects are also represented in a separate window. The user can interactively define the CSG tree in this window by selecting the objects and appending them as new nodes to the CSG tree. The separate definition of the geometric tree and the objects linked to it enables the creation of parametrized assemblies. Geometric relations between the components of an assembly are defined by relations between their control points. Control points of different objects can be linked to the same node in the geometric tree. Manipulation of a node in the geometric tree will affect all control points of objects that are linked to this node. Therefore, nodes in the geometric tree can be regarded as handles for manipulation of an assembly of primitives.
4. RELATIONS BETWEEN NODES As we have seen above, the nodes are defined by a parent node plus an incremental transformation relative to this node. However, these simple rigid relations restrict the modelling functionality, since dimensions and positions of objects often have several interrelations. Therefore, the functionality of the geometric tree has to be expanded with nodes that can have more complex relations with another. For example, the position of an object can be dependent on the X-position of one node and the Y-position of other nodes. Also, the X-position of a node can be defined as a ratio of the distance between two nodes, for instance a position that is defined as centered between two nodes. For these nodes, there is no rigid relation to their parent node. Therefore, the definition of a node is enhanced with a part that can have references to several other nodes. The coordinates of these reference nodes are used in linear equations (constraints) for positioning and orientation. The equation for positioning and orientation of the node is built up of a rigid part i and a variant part r. b(a) (Fig. 4). Both parts are defined relative to the parent node. The rigid part represents the direct incremental movements and rotations as entered by the
Node b eetmivoto t NOcle¢ ,'~atlve to b
01~--kde~ln~ by n~4o • I~d ¢ Cygtnderdeflf~ld by ~de b and c
Move node c m new ~¢~o.
[3efltlition of geometrY: Vee
Linking control points tO nodes
After moving no~e c
Fig. 3. Assembly of primitives.
CAG
13:I-E
t(ty).b(a)(y)
r(ty).b'(a)(y} L Y
b
~b' b'(al(y) I"
e = a ~ i ~ r.b(a)
I I absolute coordinates Of new node
absolute coordinates of parent node
1
I
1
coordinates of new node relative to oarent node
linear ratio
coordinates of reference node relative to parent node
Fig. 4. Node.
user. The term r. b(a) enables the positioning of the node as a linear function of the position of another node. For each positioning direction in a 3D Cartesian coordinate system, a separate node b, which may be part of an arbitrary branch in the geometric tree, can be selected. The position of this node is converted to coordinates relative to the parent node a and multiplied by a ratio r, which is a real defined by the user. The ratio for a movement direction is implicitly defined by selecting a second node b for relative positioning. The initial ratio is calculated from the position of node b and the current position of node c relative to a. The movement of the mouse is now used to change the ratio r for the movement direction instead of a direct increment i. After each incremental mouse movement, the position of the node is recalculated and the numerical value of the ratio is displayed. The use of linear constraints for positioning can be explained by a simple example. In Fig. 3, two nodes for dimensioning the object are required: node b for Y-direction and node c for X- and Z-direction. The use of nodes with references to other nodes will enable the manipulation of all three dimensioning directions by a single node. Further, the object is expanded with a second cylinder (Fig. 5 ). This cylinder is concentric with the first cylinder and with half its radius. A method for defining the object is displayed in Fig. 5. After creating node b, node c is created and moved along the Y-axis. Instead of entering this movement as an absolute increment, its Y-position is defined relative to the position of node b with a ratio of 1.0. So, if node b is moved along the Y-axis, the Y-position of node c changes equally. A third node d is created relative to its parent node b. The X-position of this node is specified with a ratio of 0.5 relative to node c. All geometric relations for the definition of the object are now represented in the geometric tree. The primitives are linked in this tree by selecting the kind of primitive and, in this case, two nodes for the position of their control points: nodes a and b for the block, nodes c and b for the largest cylinder and nodes c and d for the inner cylinder. The assembly of primitives can now be dimensioned by node b. If b is moved to another position, the positions of nodes c and d are recalculated by the system.
MAARTEN J. G. M. VAN EMMERIK
74
b
a rlty)=1.0
create node b
link primitives to nodes
create node o
create node d
hide internal nodes
manipulate object
Fig. 5. Assembly.
After the object is defined, the visualization of the internal structure between the nodes may be of minor importance. To avoid a complex object representation on the screen, the user can hide the geometric tree and the control points that are not used for the manipulation of the whole object. The use of the geometric tree enables a fast and user-friendly definition of the relations between dimensions and positions of primitives. In Fig. 6, the geometric constraints for dimensioning and positioning that correspond with the geometric tree in Fig. 5 are displayed. Instead of entering these constraints as alphanumeric statements, they are implicitly defined by the geometric tree. The geometric tree can also be regarded as a graph in which the relations between the nodes are specified. 5. DATA STRUCTURE In Fig. 7, an overview of the entities used in this system is displayed. Each object is defined by two trees, the geometric tree and the CSG tree. Each primitive has a reference to a node in the CSG tree and to two or more nodes in the geometric tree. The geometric properties of objects are determined by the position of the control points of their primitives in the geometric tree. In order to obtain the dimensions and position of objects, all absolute positions of the nodes have to be
cylt .X=pet.x CyJ1.y=par.y+par.b/2 cyll .z=par.z cyl2.x=cyll .x cyl2.y=cylJ .y cyl2.z=cyll .Z
calculated. The calculation must be carried out in a correctly ordered sequence determined by the following considerations. First, this sequence is determined by the parent-child relations of nodes in the geometric tree, since all child nodes are defined relative to the position and orientation of the parent nodes. Second, for positioning a node relative to other nodes, the latter nodes have to be evaluated first. Since all nodes are created relative to existing nodes, the sequence ofevaluation is determined by the order in which the nodes are created. 6. USER INTERFACE All objects and relations described in this paper are defined and manipulated by mouse- and menu-controlled interaction. We can divide the interaction with the system into operations for creation and manipulation of the geometric tree, operations for linking and unlinking control points of objects to the geometric tree, and operations for linking objects to nodes in the CSG tree. The first set of operations requires the user to enter data for positioning and orientation by graphical interaction. However, a three-dimensional position and orientation has to be entered with two-dimensional mouse movements.
r(ty)=1.o
111
cylt.r=par.ll2 ¢yl1 .h=par.h
cyl2,r.O.5"par.I/2 cyt2.h=par.h geometric constraints
geometric tree [ I
specification graph
Fig. 6. Representation of constraints.
Fig. 7. Data structure.
Creation and modification of parametrized solid models
I~oeltt~ t ~rlentat~cm
-3g.O0 O.H
Irtle OOO
75
: o~jecte/egO0e
0 ~tO
[par~ I"
Fig. 8. User interface,
A common solution for this problem is the use of 2D orthogonal views. After manipulation in one of these views, the result is displayed in perspective. Forrest[7] discusses the use of orthogonal versus perspective display of 3D objects. The use of a perspective view is preferred for fast global evaluation. However, for accurate shape definition an orthogonal view is suggested. In our system, we try to combine the advantages of interaction on a perspective view with the accuracy of orthogonal views for precise shape definition. The interaction refers to both manipulation and evaluation of the geometric model in a perspective (or isometric) view. The manipulation is enabled by linking the 2D mouse movements alternately to one of the positioning directions (X, Y, Z) or rotation directions (X, Y, Z) in a Cartesian coordinate system. After selecting a node and the required direction, the 2D mouse movements are immediately converted to the 3D position and orientation changes in the perspective view. For accurate positioning, additional numerical information about the 3D position and orientation is displayed and updated after each mouse movement. An optional three-dimensional grid for positioning and orientation of nodes enables a fast and accurate shape definition. Once the geometric tree has been defined, primitives are linked to the tree by selecting the appropriate primitive from a pop-up menu, and pointing at a node in the tree for each control point of the primitive. The first node is the coordinate system for the primitive. Each time a primitive is defined, it is also represented as an icon in a separate window for CSG composition. This icon can be selected and appended to the CSG tree.
7.
CONCLUSIONS
With the system presented in this paper, it is possible to create and manipulate parametrized object descriptions by graphical interaction on a 3D representation. The concept of a geometric tree with nodes that can have several relations with other nodes is presented. In the current version we have implemented linear relations between nodes. Although complex relations can be defined, they are restricted in the sense that the system cannot handle multiple constraints for one geometric variable; each positioning- or orientation direction can only be defined by one relation. In many CAD applications, dimensions are related to a number of components. A more flexible approach would offer facilities for defining general geometric constraints between arbitrary nodes. Higher level constraints about an object could be inherited by lower level constraints about relations between parts[8]. In this case, additional techniques to solve the problems of conflicting constraints are required. Besides the techniques for more complex geometric relations, the system should offer facilities for specifying functional constraints. The user must be able to enter general constraints such as volume, size and parallelism, without the need to convert these constraints to low level geometric relations. Future developments of this system will therefore also include higher level (procedural) functionality for mapping this information on a constraint-based data structure.
Acknowledgements--l'd like to thank Erik Jansen and Wire Bronsvoort for the discussionsand ideas that ha~e led to the
76
MA-XRTEN J. G. M. v~N EMMERIK
development of this system and Denis McConalogue for the final review of this paper. This research project is sponsored by TNO-IBBC on grant no. 04.79737. REFERENCES 1. R. Light and D. Gossard, Modification of geometric models thorugh variational geometry. Computer-Aided Design 14(4 ), 209-214 (1982). 2. F. Kimura and H. Suzuki, A uniform approach to dimensioning and tolerancing in product modelling, Proceedings CAPE '86, pp. 165-178 (1986). 3. D. Rocheleau, System for interactive assembly modelling. Cornputer-Aided Design 19(2), 65-72 ( 1987 ). 4. K. Lee and D. C. Gossard, A hierarchical data structure for representing assemblies. Computer-Aided Design 17(1), 15-19 (1985). 5. J. Rossignac, Constraints in constructive solid geometry. ACM Workshop on Interactive 3D Graphics, Chapel Hill, October 1986.
6. E. Cordonnier, C. Bouville, J. L. Dubois and I. Marchal. Creating CSG modelled pictures for ray-casting display, Proceedings Eurographics '85. Elsevier Science Publishers B. V., North Holland, pp. 171-182 (1985). 7. A. R. Forrest, User interfaces for three-dimensional geometric modelling, ACM Workshop on Interactive 3D Graphics. Chapel Hill, October 1986. 8. H. Yoshikawa and K. Uehara. Design theory, for CAD/ CAM integration. Annals of the CIRP 34(1). 237-249 (1985). 9. I. Faux, Reconciliation of design and manufacturing requirements for product description data using functional primitive part features, CAM-I, Texas. 1986. 10. V. C. Lin, V. Gossard and R. A. Light. Variational geometry in computer aided design. ACM Computer Graphics 15(3), 171-177 (1981). I1. T. Sata, F. Kimura, H. Suzuki and T. Fujita. Designing machine assembly structure using geometric constraints in product modelling. Annals of the CIRP 34(1), 169172 (1985).