Robustness In Solid Modeling. { A Tolerance Based Intuitionistic Approach. Shiaofen Fang. School of Architecture. The Ohio State University. 190 West 17th ...
Robustness In Solid Modeling { A Tolerance Based Intuitionistic Approach Shiaofen Fang School of Architecture The Ohio State University 190 West 17th Avenue Columbus, OH 43210, USA Beat Bruderlin Xiaohong Zhu Computer Science Department University of Utah Salt Lake City, UT 84112, USA
Abstract: This paper presents a new robustness method for geometric modeling opera-
tions. Geometric relations are computed from the tolerances de ned for geometric objects and the tolerances are dynamically updated to preserve the theoretical properties of the relations. The method is based on an intuitionistic self-validation approach. Geometric algorithms using this method are proved to be robust. We demonstrate the application of the approach for an algorithm computing Boolean set operations on objects bound by planar and natural quadric surfaces. A major advantage of the approach is that it can be applied very generally to obtain a consistent interpretation of geometric data in CAD/CAM systems.
INTRODUCTION The Robustness Problem
Geometric algorithms are usually designed for objects de ned over the domain of real numbers which can only be approximated on a computer, for instance, with oating point numbers. In addition to the oating point arithmetic errors, there often are geometric approximation errors, which are introduced when only approximated solutions can be computed, e. g. using a piecewise linear curve to approximate a higher degree curve within some 1
tolerance. Tolerances are also introduced deliberately, as part of the design speci cation [8]. They may be used for representing inaccuracies in the manufacturing process, or wear, etc. Future CAD systems need to be capable of handling modeling operations with various tolerance interpretations in a uniform and consistent way. Computing relations between geometric objects (e.g. coincidence of points, collinear lines or coplanar planes) using approximated numerical data is arbitrary and likely to be inconsistent. This causes geometric algorithms to produce invalid geometric representations or even crash. Considering the dierent sources of errors, geometric algorithms are hardly robust without special consideration. An example of what may happen during a modeling algorithm, is given in gure 1. A Boolean union operation is computed for two almost identical approximated cubes with one translated. The algorithm rst nds that planes P and Q are coincident within the de ned tolerance. However, because of a slightly larger deviation of the representation of edge AB , the edge is found to be intersecting plane P of the other cube, instead of being incident on plane P . Theoretically, if a line is incident on a plane Q, it is also incident on all the planes that are coincident with Q. Algorithms based on arbitrary decisions on approximate data may produce invalid solid representations like in gure 1(b), where a dangling edge is created.
Related Work
A number of publications have addressed the geometric robustness problem. An overview can be found, for instance, in [12][13]. In [9], [23], [32] and [33], precise computation is applied. Exact numbers (e.g., bounded or unbounded rational numbers, exact algebraic numbers or space grids) are used. Because no numerical error is introduced, the robustness of the algorithm is guaranteed. The approach is based on the supposition that geometric shapes can be represented and computed using 2
exact numbers. This supposition holds, for instance, for polyhedra, but not in general, for curved surfaces, and geometric and topological changes (e.g., vertex shifting and edge cracking) are often needed[19][20]. The approaches in [4] and [38] use a perturbation method, which means to slightly change the input data to avoid positional degeneracy. Because geometric degeneracy is the main source of the robustness problem, avoiding degenerate cases can solve most of the problems. However, degenerate cases are often assumed intentionally in geometric modeling, therefore avoiding them may not be appropriate for it possibly fails to capture the original design intention. Symbolic reasoning is used in many approaches[14][16][19][20][21][30][31][37] to maintain the consistency among all the decisions made with regards to geometric relations. The success of reasoning seems to largely depend on the availability of powerful and ecient symbolic reasoning approaches. In the extreme, general geometric theorem proving methods[3][15][17] would have to be employed. Currently, these approaches are mostly limited to relatively simple geometric problems, or within some locally speci ed geometric features because of the complexity of the reasoning process. Tolerance-based approaches treat geometric shapes as subsets of a continuum (real numbers), but with limited accuracy. Numeric values are therefore represented as a range, rather than a single value. These approaches partly originate from interval arithmetic[22]. A direct geometric generalization of interval arithmetic is \Epsilon Geometry"[10][28][27]. In this approach geometric relations are computed with an error which is propagated by the logical inferences in an algorithm. In [1][29] the error is associated with the objects, rather than the relations and it is updated for every relation computed. These tolerance-based approaches update the tolerances according to the decisions made in order to maintain the consistency of the decisions, or to possibly detect an inconsistency among them. Yet another approach described, for instance, in [14] and [39] aims at limiting or elim3
inating redundant data and thus avoids inconsistencies among dependent decisions. Some redundancies can also be directly detected an eliminated in a CSG representation[34][26]
Overview
Although geometric modeling algorithms such as those in computational geometry all seem to have similar robustness problems, solid modeling problems tend to have more emphasis on curves, surfaces and three dimensional solid and sculptured solid objects instead of the two dimensional lines and polygons dealt with in computational geometry. In this paper we try to develop a more general approach, dealing with general geometric modeling problems, such as those occurring in complete CAD/CAM systems, capable of handling different error types, such as numerical, arithmetic, approximation, design and manufacturing errors in a uniform way. We try to follow a tolerance-based robustness approach for geometric computation, in general, and solid modeling, in particular. The idea is to compute geometric relations based on tolerances de ned on the geometric objects and to dynamically update them according to some rules which are introduced to preserve the theoretical properties of the geometric relations[6][5]. The paper will also describe an implementation of the robustness approach on a robust Boolean operation algorithm for 3D solids bounded by planes and natural quadric surfaces. In the following, we rst give a formal de nition of geometric robustness and then present a robustness approach that can be used in various geometric algorithms.
TOLERANCE-BASED ROBUSTNESS The Inconsistency Problem and Intuitionistic Logic
A common practice to determine relations with inaccurate data is to apply a tolerance. Assume the tolerance is the computed maximal error for point positions in a representation. When the distance of two points is greater than 2 , the points are considered apart, otherwise 4
they are considered coincident. However, a closer look at this approach reveals that this de nition of the coincidence relation is problematic. For the example points in gure 2, if we rst nd that P1 and P3 are apart (P1 6= P3), and P1 and P2 are coincident (P1 = P2), then we compare P2 and P3 and nd them to be coincident (P2 = P3). However, from P1 = P2 and P2 = P3 it follows that P1 = P3 which contradicts the earlier nding that P1 6= P3, so these coincidence and apartness relations are not consistent. Note that this inconsistency can occur with any precision, as long as there is some error. The problem demonstrated in the above example is actually more general. In[35] it is shown that equality for real numbers is not decidable with constructive means. Coincidence of geometric objects de ned in the real coordinate space is therefore undecidable, as well. Introducing a third relation ambiguity besides coincidence, and apartness for situations such as in gure 2 will make it possible to obtain a consistent de nition of geometric relationships. A theoretical explanation of this three valued relationship is the so called intuitionistic logic[35], in which the refutation of "apartness" is not equivalent to "equality" and therefore the law of the excluded middle does not hold for equality of real numbers. The mathematics based on intuitionistic logic is also called constructive mathematics, meaning that an explicit constructive approach must be taken for the armation of a relation or its converse relation. We take an intuitionistic approach to the robustness problem, i.e. the geometric relations are determined, based on tolerances and can be either coincident, apart, or ambiguous. To preserve the properties the same relations have in Euclidean geometry, and constructive measures, namely updating the tolerances, must be taken.
Robustness of geometric algorithms
In the following we distinguish between simple and complex geometric objects. A simple object, here, is either a point, a curve (line) or a surface (plane). The representation of a 5
simple object is a data structure used to describe the geometric object, consisting of both symbolic data (e.g. the symbolic equation of a plane) and numerical data (e.g. the numeric values for the coecients of the equation). A complex object, such as 3D solid object, is de ned as a set of simple objects connected by a set of geometric relations. An example for a complex object representation is the so called boundary representation. We de ne a model of a simple object to be an instance of an exact simple object in Euclidean space satisfying the symbolic data of its representation and the geometric relations of the complex object with this simple object. When working with inaccurate numerical representations and computation, the numerical data stored in a representation does not generally satisfy the the geometric relations exactly, but as long as there exists a model in Euclidean space { preferably in a close neighborhood of the numerically represented object (which is called the representative) { the representation is considered valid. It should be pointed out that, of course, we cannot usually compute the model itself (this is the very reason why a tolerance based approach becomes necessary). The goal, however, is to guarantee the existence of such a model. In realizations of geometric algorithms, the computation is performed on the representation. We consider an algorithm to be robust if the representation of all the objects occurring in the algorithm, including input, output and those objects created during the execution of the algorithm, have corresponding models. Intuitively, it means that although the computation and representations are not accurate, there are always models to which the inaccurate representations can be mapped, as if all the operations were done with the models in a precise world. In [6] and [5], it is pointed out that the above robustness de nition is often too strong, mainly because of the requirement of the model to be an exact instance of the representation (e.g. a model of a straight line has to be a straight line too). Sticking to this model de nition makes the algorithm very inecient and sometimes it is too dicult to determine 6
the existence of models for a complex object, particularly those with over-constrained and complicated topology. In the following we describe a robustness method based on an approximated model assumption which turns out to be more practical and exible for geometric problems in real applications.
Tolerance based relations
For the remainder of this paper, all the simple objects have nite extension, i.e. with curves we mean curve segments, and with surfaces are trimmed so that they do not extend to in nity. Intrinsically nite surfaces, such as spheres do not have to be trimmed, of course. We de ne the r region of a simple object O as the subset of E3 in which each point has a distance less than r to the representation of O. For instance, the r region of a point P is a sphere with x/y/z-coordinates of the point as center and a radius r. Assume that an initial tolerance is de ned ( > 0). We de ne that a simple object M in Euclidean space is an approximated model of the simple object O, if there exists a one-to-one mapping between M and the representative R of O, M = (O), such that:
M is inside the region of O. M is outside the region of any other object Q that has been determined to be apart from O.
M satis es all the geometric relations de ned on O. M does not necessarily have the same mathematical form of O , however, 8 v 2 R, d(v, (v)) < , and 8 u 2 M , v 2 R : u = (v) 6 9 w in M : (u-v) = (w-v) for real numbers , and a Euclidean distance function d. 2 Intuitively, the approximated model approximates the shape of the original object globally and preserves the topological structure, but locally it may deviate a little from the original shape. More speci cally, the approximated model of a point can only 7
be a point; the approximated model of a curve is a curve with a mathematical form that is not necessarily the same as the one de ned in R, i.e. as shown in in gure 3, the approximated model of a line can be a curve as long as it satis es other requirements (e.g. the models of all the points considered incident on the line must also be on the curve); similarly the approximated model of a surface is a surface with a mathematical form that is not necessarily the same as the one de ned in R.
THE INTUITIONISTIC ROBUSTNESS APPROACH Tolerances and Geometric Relations
In order to achieve the desired properties (and thus robustness) we introduce a tolerance environment for simple objects consisting of three r-regions (the " region, the region, and the region), and de ne geometric relations, based on these regions. The ", and values are initialized as follows: " = ? , = + and = +1, where is the initial tolerance. is a secondary error bound, interpreted as the maximal error created in computing relations among geometric objects (we assume that ). Figure 4 shows the tolerance regions of a point. The " and values can be interpreted as the lower and upper bounds of the initial error with errors generated in the relation computation (by the tolerances of related geometric objects and the secondary error ). The region is used to separate \apart" objects. The basic components of the approach are the following: 1. Geometric relations (e.g. coincidence and apartness) are based on the tolerance environment (", , ) of the geometric objects. 2. The tolerance environment is updated after determining a relation, such that an approximated model always exists for the related simple objects. 8
3. An ambiguity test is de ned for each relation to detect the situation in which the existence of an approximated model cannot be guaranteed anymore. An ambiguity handling process can then be invoked to solve the ambiguity dynamically by adjusting the initial tolerance de nition , before the algorithm can continue. The relations between two simple objects are de ned as either coincidence, incidence, apartness, intersection, or ambiguity. In the following these relations and their tolerance updating operations are de ned (objects are simple and nite).
If the regions of two objects O1 and O2 do not intersect, they are apart (O1 6= O2). The value of each object will be updated to be half of the smallest distance between these two objects if the current value is larger than this distance, otherwise stays unchanged.
If there exists a common approximated model for two objects O1 and O2, the two objects are coincident (O1 = O2). They will then be merged into one single object O. The " and regions of O are the maximal possible regions of O inside the intersections of the previous " and regions of O1 and O2, respectively. The region of O is the minimal region of the O enclosing the union of the previous regions of O1 and O2 (see Figure 5).
For two objects O1 and O2, if there exists an approximated model M1 of O1, and an approximated model M2 of O2, so that M1 is incident on M2 in Euclidean space, then O1 is incident on O2 (O1 O2). The new " and regions of O1 are the maximal regions of O1 inside the intersections of the old " and regions of O1 and O2, respectively. The region of O2 is extended such that it is not completely enclosed by the region of O2. The tolerance environment of O2 stays unchanged. Figure 6 shows a possible tolerance con guration in which several points are incident on a curve (only " and regions are shown). 9
If two objects have neither coincidence nor incidence relations, and their " regions intersect, then the two objects are intersecting. The new tolerances of the intersection objects are de ned in such a way that the intersection objects are incident on both the original objects.
When the tolerance of an object O is updated, all the tolerances of those objects that have been detected to be incident on O also need to be updated so that the incidence relations still hold, i. e. the " and regions of these objects must be shrunk (if necessary) so that they are inside the " and regions of O respectively. This rule is applied recursively to all lower dimensional objects indirectly incident on O.
If the " region becomes empty or the region is no longer totally included in the region for some object, its relation with other objects is ambiguous. An ambiguity handling process (which will be described later) will then be invoked.
Robustness and Properties Theorem 1 For the incidence, coincidence and apartness relations de ned between points, curves and surfaces, if no ambiguity is detected, an approximated model exists for the whole complex object (consisting of these simple objects and their relations).
Proof: The tolerance updating rules, applied after the computation of any relation, ensure that there is always an approximated model for the representation of all the objects presented such that all the previously detected relations as well as the newly detected relation hold, as long as no ambiguity has been found. By induction over the number of relations computed we can conclude that the whole object is consistent. In other words, a geometric algorithm based on these robust geometric relations is robust if it terminates normally (without ambiguity). 10
A detailed proof of the robustness of the approach can be found in [2]. Speci cally, it is not hard to verify that the tolerance-based relations have the following properties.
The coincidence relation is an equivalence relation. the incidence relation is transitive. i. e. if A B and B C , then A C . If A = B and A 6= C , then B 6= C . If A B and B 6= C , then A 6= C . If A B and A = C , then C B . If A B and B = C , then A C . To prove, for instance, that coincidence is an equivalence relation, we can refer to the de nition and update rules for coincidence. Two objects are coincident, if there exists a common model in the intersection of their " regions, which guarantees symmetry and re exivity. The new " region will be a subset of the intersections of the previous " regions, containing a common model. Therefore, if one of the two objects is coincident with a third object, there will be a common model for all three objects, which guarantees the transitivity. However, not all properties of the geometric objects (and their relations) that we would expect from the objects they represent are preserved by the tolerance-based relations. This is due to the fact that only an approximated modelis assumed and guaranteed in this approach. For instance, it is possible that two non-coincident points are both incident on two straight lines without an ambiguity generated. In other words: two straight lines may intersect more than once (because the approximated models may intersect more than once). More tolerance update rules can be introduced to preserve such additional properties, as shown in[5], if these properties are required by the algorithm. 11
Ambiguity Handling
As indicated earlier, if any " region becomes empty or any region is no longer a proper subset of its region ( > ), an ambiguity is detected. In this case we can no longer guarantee that the relations are consistent with each other, i.e. the existence of a model, is not guaranteed. The algorithm cannot continue before the ambiguity is solved. An ambiguity means that the algorithm cannot make a consistent set of decisions with the initial tolerance (the value). To solve the ambiguity, the value would have to be rede ned. One straight forward way of solving ambiguous situations is to rerun the algorithm with a bigger tolerance. The question is whether it is really necessary to rerun the algorithm from its start, or if we can change the value dynamically and resume the algorithm afterwards. It is shown in [5] that increasing or decreasing value by an amount d is equivalent to increasing or decreasing all the current " values and values simultaneously by the same amount d, and that if this simultaneous change of " and values does not create new ambiguities, all the previously detected relations are preserved. In other words, the initial tolerance value can often be dynamically changed by changing all the " and values, without interrupting the algorithm.
ROBUST BOOLEAN OPERATIONS
We have implemented a robust Boolean set operation algorithm in an experimental solid modeler based on our robustness approach, using dynamic ", and regions as de ned above. In this section we will give an outline of our implementation of the algorithm with emphasis on the robustness, and show some experimental results. Solid objects, in this modeler, are represented with a hybrid representation and are bounded by planes and natural quadric surfaces (cylinders, cones and spheres).
A Hybrid Representation
The 3D space can be subdivided by a continuous function f (x; y; z) into three areas, the 12
surface F 0 and two half spaces F + and F ?, where
F + = fp : f (x; y; z) > 0:0g F 0 = fp : f (x; y; z) = 0:0g F ? = fp : f (x; y; z) < 0:0g In the half space representation, a solid is represented as the union of a number of generalized convex bodies (GCBs), which is de ned as the intersection of half spaces[1]. i. e. a solid can be represented in the following normal form:
[\F+
i;j
i
j
where the union and intersection operations are regularized set operations[24]. In a boundary representation (B Rep), a solid is represented by its boundaries. Boundary hierarchies (consisting of faces, rings, edges and vertices) facilitate the access to boundary information[24][18]. The modeler presented here uses a hybrid representation method that combines the half space representation and the boundary representation to take advantage of boundary and volume information.
Geometric Relations and Intersections
The Boolean set operation algorithm, which converts the half space representation of two solids A and B into an equivalent boundary representation, consists of three steps[1]: (1) combining the normal forms of A and B into a single normal form of half-spaces; (2) converting the new normal form to an intermediate representation, i. e. evaluating edges and vertices; (3) creating a complete boundary representation by concatenating edges to loops and faces from the intermediate representation. The last step only needs to be carried out if it is required by the application, such as, for instance, an algorithm for hidden line removal or for calculating volume properties, etc. 13
Most geometric computations and the robustness problems occur in the second step, i.e. during the evaluation of edges from the normal form of the half-spaces. This process involves calculating intersections, or determining relationships between two surfaces or a curves and a surfaces to achieve the so called neighborhood evaluation[24]. These operations are handled by a separate tolerance processing module, which is responsible for calculating and updating the tolerances, and for ambiguity handling. Relations are de ned based on the tolerance environment (", , and ), and the tolerance updating rules as described earlier. The actual set operations algorithm controlling the logic, and the sequence of operations is therefore independent of the implementation of these low level geometric operations (and representations), which are treated as abstract data types by the main algorithm. Intersections between two surfaces or a curve and a surface will be computed if they are detected intersecting. Generally, the intersection of two natural quadrics yields a higher degree curve, which is represented by a piecewise linear approximation in our approach. To use the approximation within our robustness approach, the approximation errors must be explicitly considered in the tolerance updating process. For example in Figure 7, the two linear approximations are used to determine the intersection point of two curves. In calculating the tolerance of the intersection point, the error e de ned for approximating the curve by a piecewise linear curve must be subtracted from " and to guarantee that the point is incident on the two real curves. These approximation tolerances are usually an upper bound on the real errors, and therefore are often too large, which may create more ambiguities in degenerate situations, than necessary. Note, that the approximation error e of the curve must be smaller than the " determined for the curve, in order to guarantee an unambiguous case. Finding algebraic or analytic solutions, if available, improves the robustness of the algorithm. In the Boolean operation algorithm, we therefore nd analytic solutions for special intersections of two natural quadrics, based on Goldman and Miller's work[7]. That pa14
per gives a complete set of all the possible special cases when two natural quadric surfaces intersect in one or more conic sections, using a case by case algebraic analysis. A direct application of these results is shown in gure 8 (a union of a cone and two cylinders); three quadric surfaces intersect in a single ellipse. In practice, it turns out that degenerate intersections, where three surfaces intersect in a single curve, occur when these surfaces intersect in a planar curve (e.g. a conic section). It seems highly unlikely that three general free-form surfaces intersect in a single spatial curve. It makes therefore sense to treat special cases in a special way, in order to make the set operations for these cases very robust. Next we describe how tolerance based incidence and coincidence is de ned for natural quadrics and conic sections.
Inside/Outside/On Test
First we de ne the inside/outside/on test of a point with respect to a regularized solid object. This test is a key operation for volume-based representations. We rst need to determine whether a point is incident on a surface or apart from it. For this purpose a point-surface distance function (which can be easily derived from the surface equation) is used. If the distance between point and surface is less than half of the sum of the " diameters of the point and the surface the " regions intersect, and the point is incident on the surface, if however the distance is greater than half of the sum of the diameters of the point and the surface the regions don't intersect, and the point is apart from on the surface. The tolerance regions will have to be updated according to the previous rules. In case of an incidence, the point is on the half space. In case of an apartness relation the point is inside or outside the half space (see below). Otherwise, an ambiguity is detected;
De nition 1 (inside/outside/on a regularized solid) Assume a solid S is represented as a normal form (a regularized union of regularized intersections) of half-spaces, and no ambiguity was detected:
15
A point P is inside a half space F + i P and F are apart and P is on the positive side of F . A point P is outside a half space F + i P and F are apart and P is on the negative side of F . A point P is inside a GCB i P is inside all the half spaces of the GCB. A point P is outside a GCB i P is outside one of the half spaces of the GCB. A point P is on the boundary of a GCB i P is neither inside nor outside the GCB. A point P is inside S i P is inside one of the GCBs of S , or P is incident on two surfaces in two dierent GCBs and the two surfaces are coincident but have opposite normal directions. A point P is outside a solid i P is outside all the GCBs of the solid. A point P is on the boundary of a solid i P is neither inside nor outside the solid.
2 Incidence of conic section curves on quadric surfaces, and coincidence of curves is derived from the point surface coincidence as follows: The incidence of a conic section on a third surface is determined by comparing 5 non-coincident points on the curve. If all 5 points are incident on the surface then the conic section as a whole is incident on the surface. Two conic sections are coincident, if 5 non-coincident points on one curve are incident on both surfaces, intersecting at the other curve. Thus, curve-curve coincidence can be derived from curve-surface coincidence which, in turn is derived from point surface coincidence. The 5 points are chosen so that they are evenly distributed over the parameter range of the curve.
Test Results
Next, some experiments we made with a solid modeler (which implements the robustness ideas described in this paper) are described. Ambiguous situations usually occur in the transition zone between clearly intersecting cases and degenerate cases where surfaces are 16
coincident. If we take two identical objects, and rotate one of them by a small angle , and compute the union of the two objects, for very small values of the two objects are considered coincident within the tolerance, and the union is equal to one of the two objects. For larger values of the two objects intersect, and the intersection curves will be calculated, and a new, more complicated topology will be generated for the union. For some intermediate values of the independently calculated relations will partly go one way (intersection), and partly the other way (coincidence), and likely result in an inconsistent topology, with dangling edges, as shown in gure 1. To test the behavior of our implementation we nd this transition by scanning the range of with a binary search. Table 1 shows some test results for the boolean union of two identical cubes of dimensions 100 100 100, one rotated about all three axis with a small angle . The initial tolerance assumed for the objects is = 10?3 We found that for a 0:9 10?6 the cubes are considered coincident, and merged into one. For a 1:85 10?6 . The cubes are clearly intersecting. In the range 1:0 10?6 < < 1:8 10?6 ambiguities are detected when calculating some relations. By dynamically increasing the tolerance according to the table, these ambiguities disappear and a coincident situation is assumed. This tolerance adaption is carried out automatically by the Boolean set operation algorithm, without user intervention. The range within which ambiguities are detected and resolved by the algorithm covers only a factor of two (i.e. the maximal value of divided by the minimal value of ). This is an improvement of more than a factor of 1000 over a previous experiment with the same example[1]. In the earlier implementation an analytic (exact) model approach was taken (rather than the approximated model approach, followed here) which caused unnecessarily many ambiguities. In another test example, we took two identical cylinders with radius 50 and height 400, one rotated about the x-axis by an angle , and then carry out a Boolean union with them. 17
The values for and are de ned to be the same as in the last example. When the angle 0:000001, ambiguities are created. Increasing the tolerance solves all the ambiguities, and results in two coincident cylinders. Figure 9 shows another degenerate case (two cylinders are subtracted from a cube). The two cylinders intersect with the top surface of the cube in a single ellipse.
CONCLUSIONS
A new tolerance-based robustness method is introduced here, and applied to Boolean set operations on 3D objects bounded by planes and natural quadric surfaces. The algebraic methods for detecting conic section intersections for natural quadric surfaces, together with our tolerance based, intuitionistic robustness approach generate very reliable and ecient geometric algorithms. The robustness method used in this paper is very general and can be applied to other geometric algorithms without major changes. In our implementation we completely abstracted away the low level geometric operations (computing intersections and geometric relations) from the high level, application speci c algorithms. In our eyes, this advantage makes the approach better suitable as an underlying abstract data type for CAD/CAM systems (where dierent algorithms access the same model data) than approaches using reasoning or exact number representations. It seems to allow for a more uniform handling of errors and tolerances, occurring in design, manufacturing, reverse engineering, as well as errors of geometric and numeric computation, or those caused by approximation techniques. The extra computational cost of the robustness method is probably also smaller than for approaches using symbolic reasoning or precise computation. An average increase in computing time of about 50% was observed for most examples (due to the overhead of computing and updating tolerances). This can be considered a reasonable price for such a general robustness approach. 18
More ecient results can be achieved by taking advantage of the knowledge of the data dependencies in the algorithm. In [39] we describe how robustness can be achieved for a Boolean set operation algorithm by avoiding or eliminating redundancy in the data. Future research will include extending the approach to more general (free form) surfaces[25] and integrating it in a CAD/CAM system. Handling tolerances in CAD/CAM has been generally recognized as an important research area (see, for instance [11, 8, 36]). Speci cally, we will have to address such questions, how design tolerances and constraint based speci cations with tolerances relate to the data structures applied in this approach.
ACKNOWLEDGEMENTS
This work has been supported, in part, by NSF grants DDM-89 10229 and ASC-89 20219, and a grant from the Hewlett-Packard Laboratories. All opinions, ndings, conclusions, or recommendations expressed in this document are those of the authors and do not necessarily re ect the view of the sponsoring agencies.
References [1] Bruderlin, B. Robust regularized set operations on polyhedra. In Proc. of Hawaii International Conference on System Science (January 1991). [2] Bruderlin, B., and Fang, S. Intuitionistic geometry: A new approach for handling geometric robustness. submitted to: International Journal of Computational Geometry and Applications . [3] Chou, S. C. Mechanical Geometry Theorem Proving. D. Reidel Publ., Doordrecht, Holland, 1988. [4] Edelsbrunner, H., and Mucke, E. Simulation of simlicity: A technique to cope with degenerate cases in geometric algorithms. In Proc. of 4th ACM Symposium on 19
Comp. Geometry (June 1988), pp. 118{133.
[5] Fang, S. Robustness in geometric modeling { an intuitionistic and toleranced-based approach. Ph.D dissertation, University of Utah, Computer Science Department, 1992. [6] Fang, S., and Bruderlin, B. Robustness in geometric modeling { tolerance based methods. In Computational Geometry { Methods, Algorithms and Applications, International Workshop on Computational Geometry CG'91 (March 1991), Springer Verlag, Lecture Notes in Computer Science 553, Bern, Switzerland. [7] Goldman, R. N., and Miller, J. R. Combining algebraic rigor with geometric robustness for the detection and calculation of conic sections in the intersection of two natural quadric surfaces. In Proc. of the ACM/SIGGRAPH Symposium on Solid Modeling Foundations and CAD/CAM Applications (June 1991), Austin Texas. [8] Gossard, D. C., Zuffante, R. P., and Sakurai, H. Representing dimensions, tolerances, and features in mcae systems. IEEE Computer Graphics and Applications (March 1988), 51{59. [9] Greene, D., and Yao, F. Finite resolution computational geometry. In Proc. 27th IEEE Symp. Fundations of Computer Science (1986), pp. 143{152. [10] Guibas, L., Salesin, D., and Stolfi, J. Epsilon geometry: Building robust algorithms from imprecise computations. In Proc. of 5th ACM Symposium on Computational Geometry (1989). [11] Hillyard, R., and Braid, I. Analysis of dimensions and tolerances in computeraided mechanical design. Computer-Aided Design (1978), 161 { 166. [12] Hoffmann, C. M. Geometric and Solid Modeling: An Introduction. Morgan Kaufmann Publishers, 1989, ch. 4. 20
[13] Hoffmann, C. M. The problems of accuracy and robustness in geometric computation. IEEE Computer 22, 3 (March 1989), 31{41. [14] Hoffmann, C. M., Hopcroft, J. E., and Karasick, M. S. Robust set operations on polyhedral solids. IEEE Computer Graphics and Application 9 (November 1989). [15] Kapur, D. Using grobner bases to reason about geometry. J. Symbolic Comp. 2 (1986), 399{408. [16] Karasick, M. On the representation and manipulations of rigid solids. Ph.D thesis, McGill University, 1989. [17] Kutzler, B. Algebraic approaches to automated geometry proving. Ph.D Diss., Report 88-74.0, Research Institute for Symbolic Comp., Kepler University, Linz, Austria, 1988. [18] Mantyla, M. Boolean opeartions of 2-manifolds through vertex neighbourhood classi cation. ACM Trans. on Graphics 5, 1 (January 1986), 45{60. [19] Milenkovic, V. Veri able implementations of geometric algorithm using nite precision arithmetic. Arti cial Intelligence 37 (1988), 377{401. [20] Milenkovic, V. Veri able implementations of geometric algorithm using nite precision arithmetic. Ph.D thesis, Carnegie Mellon University, 1988. [21] Milenkovic, V. Calculating approximate curve arrangement using rounded arithmetic. In ACM Annual Symposium on Computational Geometry (1989), pp. 197{207. [22] Moore, R. E. Interval Analysis. Prentice-Hall, 1966.
21
[23] Ottmann, T., Thiemt, G., and Ullrich, C. Numerical stability of geometric algorithms. In ACM Annual Symposium on Computational Geometry (June 1987), pp. 119{125. [24] Requicha, A. A. G. Representation for rigid solids: Theory, methods and systems. Computing Surveys 12, 4 (December 1980). [25] Riesenfeld, R. F. A view of spline based solid modeling. In Proc. of Autofact 5, Detroit (November 1983), pp. 2.75{2.83. [26] Rossignac, J. R., and Voelcker, H. B. Active zones in csg for accelerating boundary evaluation, redundancy elimination, interference detection and shading algorithms. ACM Transactions on Graphics (January 1989), 51{87. [27] Salesin, D. Epsilon geometry: Building robust algorithms from imprecise computations. Ph.D thesis, Stanford University, 1991. [28] Salesin, D., Stolfi, J., and Guibas, L. Epsilon geometry: Building robust algorithms from imprecise calculations. In ACM Annual Symposium on Computational Geometry (1989), pp. 208{217. [29] Segal, M. Using tolerances to guarantee valid polyhedral modeling results. Computer Graphics 24, 4 (1990), 105{114. [30] Stewart, A. J. Robust point location in approximate polygons. In 1991 Canadian Conference on Computational Geometry (August 1991), pp. 179{182. [31] Stewart, A. J. The theory and practice of robust geometric computation, or, how to build robust solid modelers. Ph.D Thesis 91-1229, Department of Computer Science, Cornell University, 1991. 22
[32] Sugihara, K., and Iri, M. Geometric algorithms in nite precision arithmetic. Res. Mem. 88-14, Math. Eng. and Information Physicas, University of Tokyo, 1988. [33] Sugihara, K., and Iri, M. A solid modeling system free from topological inconsistency. Journal of Information Processing 12, 4 (1989), 380{393. [34] Tilove, R. B. A null-object detection algorithm for constructive solid geometry. Comm. of the ACM 27 (1984), 684{694. [35] Troelstra, A. S. Constructivism in Mathematics : An Introduction. Elsevier Science Pub. Co., 1988. [36] Turner, J. U. Exploiting solid sodels for tolerance computations. Geometric Modeling for Product Engineering (1989). [37] Vanecek, G. Brep-index: A multidimensional space partitioning tree. Int. J. of Computational Geometry & Applications 1 (1991), 243{261. [38] Yap, C. K. A geometric consistency theorem for a symbolic perturbation theorem. In Proc. of 4th ACM Symposium on Comp. Geometry (June 1988), pp. 134{142. [39] Zhu, X., Bruderlin, B., and Fang, S. Robust boolean set operations for manifold solids bounded by planar and natural quadric surfaces. In Proc. Solid Modeling 93 (1993).
23
Figure 1: (a) Computing the union of two objects; (b) Invalid result with dangling edge Figure 2: Comparing three points Figure 3: approximated models of a line Figure 4: Initial tolerance de nition of a point Figure 5: Tolerance update of two coincident points Figure 6: Point-curve incidence relations Figure 7: intersecting two curves with tolerances Figure 8: Three quadric surfaces intersect a single ellipse Figure 9: Subtracting two cylinders from a cube. The three objects intersect at a single ellipse
24
Table 1: Results of union of two cubes with = 10?3 ; = 10?4 angle result after ambiguity handling ?6 > 1:85 10 intersecting n/a = 1:8 10?6 ambiguous coincident with 4 10?3 = 1:15 10?6 ambiguous coincident with 3 10?3 = 1:0 10?6 ambiguous coincident with 2 10?3 < 0:910?6 coincident n/a
25
A P
B
Q
26
P1
P2
27
P3
approximated model
2"
2"
point
points on the line
28
= +1
"
29
1
1
2 "
"1
"2
30
2
2"
Approximated Model
31
2
"?e
"
e: approximation error
32
Common Ellipse Intersection
33