Close
About
FAQ
Home
Collections
Login
USC Login
Register
0
Selected
Invert selection
Deselect all
Deselect all
Click here to refresh results
Click here to refresh results
USC
/
Digital Library
/
University of Southern California Dissertations and Theses
/
00001.tif
(USC Thesis Other)
00001.tif
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
AUTOM ATIC GEN ERATIO N O F HIGH LEVEL IN SPEC T IO N PLANS FO R CO O RD IN A TE M EASURING M ACHINES by A ntonia J. Spyridi A D issertation Presented to the FACULTY O F TH E GRADUATE SCHOOL U N IV ERSITY O F SOUTHERN CA LIFO RNIA In P artial Fulfillment of the I Requirem ents for the Degree 1 D O C TO R OF PH ILO SO PH Y (C om puter Science) August 1994 Copyright 1994 A ntonia J. Spyridi UMI Number: DP22893 All rights reserved INFORMATION TO ALL USERS The quality of this reproduction is dependent upon the quality of the copy submitted. In the unlikely event that the author did not send a complete manuscript and there are missing pages, these will be noted. Also, if material had to be removed, a note will indicate the deletion. Dissertation Publishing UMI DP22893 Published by ProQuest LLC (2014). Copyright in the Dissertation held by the Author. Microform Edition © ProQuest LLC. All rights reserved. This work is protected against unauthorized copying under Title 17, United States Code ProQuest LLC. 789 East Eisenhower Parkway P.O. Box 1346 Ann Arbor, Ml 48106 - 1346 UNIVERSITY OF SOUTHERN CALIFORNIA THE GRADUATE SCHOOL UNIVERSITY PARK LOS ANGELES, CALIFORNIA 90007 P V i- P - CpS ST12- This dissertation, written by .A.W.XOM.I.A 5.fJKlD..(........ under the direction of h Dissertation Committee, and approved by all its members, has been presented to and accepted by The Graduate School, in partial fulfillment of re quirements for the degree of DOCTOR OF PHILOSOPHY Dean of Graduate Studies Date DISSERTATION COMMITTEE Chairperson os A / * * '" Dedication This dissertation is dedicated to the m em ory of my grandparents M aria and Michalis. I Acknowledgements I would like to thank Professor A ristides Requicha for his advice and guidance throughout th e developm ent of this work. His ability to always keep the big pic- j I tu re in m ind and yet atten d to th e details gave this work definition and direction.) I Perhaps m ore im portantly, he was a m entor, im parting to m e a sense of w hat doing | research is about, and th e high standards by which one’s work m ust be judged. i I would also like to thank the m em bers of the Program m able A utom ation L ab-! oratory at USC, for their suggestions on the thesis. Special thanks go to A m it| . . . 1 Agrawal and Tim W halen for innum erable technical and non-technical discussions,! i Dr. Alfred Inselberg for providing valuable references, and K usum for her help with) the adm inistrative details. I t f I Finally, I would like to thank all m y friends for their support, my fam ily for th e ir1 continuous encouragem ent, and K ireeti for always being there. Contents D e d ic a tio n ii A ck n o w led g em en ts iii A b str a c t x i 1 In tr o d u c tio n 1 1.1 A utom ated inspection and scope of this w o rk ................................................ 2 1.2 A pproach o v e rv ie w ................................................................................................ 4 1.3 W hy this p ro b le m .................................................... 4 1.4 Coordinate M easuring M a c h in e s....................................................................... 6 1.5 Previous w o r k .......................................................................................................... 7 1.5.1 Inspection s y s t e m s ................................................................................... 7 1.5.2 A ccessib ility ................................................................................................. 12 1.6 Thesis o u tlin e ........................................................................................................... 13 2 A c c e ssib ility a n a ly sis 15 2.1 P r o b e s ................................................................................. 17 2.2 Probe r e p re s e n ta tio n ............................................................................................ 18 2.2.1 Straight p r o b e s .......................................................................................... 20 2.2.2 Bent P r o b e s ................................................................................................. 21 2.3 D irection c o n e s ...................................................................................................... 22 3 L ocal a c c e ssib ility 25 3.1 Local accessibility c o n e ........................................................................................ 26 3.2 Reciprocal c o n e ............................................................................. 28 3.2.1 Properties of the reciprocal c o n e .......................................................... 29 3.3 R estricted local accessibility c o n e ..................................................................... 32 3.4 Feature s e g m e n ta tio n ............................................................................................ 34 4 G lob al a c c e ssib ility 38 4.1 Global accessibility c o n e ..................................................................................... 39 4.1.1 M em bership in G A C ............................................................................... 42 IV 4.2 Com puting th e global accessibility c o n e ............................................................. 44 4.3 Feature s e g m e n ta tio n ............................................................................................ 46 4.4 F inite length probes ............................................................................................ 47 4.5 Bent p r o b e s ............................................................................................................. 50 4.5.1 Convex G A C and bent p r o b e s .............................................................. 53 4.5.2 B ent probes, accessibility condition, and i W © F ' ....................... 54 4.5.3 Com puting bent probes ........................................................................ 57 4.5.4 Second com ponent directions .............................................................. 57 4.5.4.1 Second com ponent directions and weak accessibility . 57 4.5.4.2 Second com ponent directions and global accessibility 61 4.5.5 Approach c o n d itio n ................................................................................... 62 4.5.6 Sum m ary of algorithm s for bent probe analysis .......................... 64 4.6 Global accessibility and probe geom etry ...................................................... 66 4.7 Global accessibility and s e t u p ................................................................... 68 4.7.1 Setup r e p re s e n ta tio n ............................................................................... 69 4.7.2 Setups for aligned ram and p r o b e ....................................................... 71 4.7.3 Setups for non-aligned ram and p r o b e ............................................... 72 4.7.4 R am w idth ................................................................................................. 74 4.7.5 M inim um ram -probe a n g le ..................................................................... 76 4.7.5.1 Supplem entary c o n e .............................................................. 77 4.8 A pplications in vision and m a c h in in g ............................................................ 78 4.9 R elated w o r k .......................................................................................................... 79 4.9.1 Accessibility and visibility r e g i o n ...................................................... 79 4.9.2 Accessibility and assem bly d ir e c tio n s ............................................... 80 5 G lo b a l a c c e s s ib ility fo r p o ly h e d ra l p a r ts 84 5.1 Definitions and theoretical b a c k g r o u n d ........................................................ 85 5.2 A lg o r ith m ................................................................................................................. 89 5.2.1 A lgorithm a n a l y s i s ..................................................... 90 5.3 Experim ental r e s u l t s ........................................................................................... 93 6 R e p r e s e n tin g in s p e c tio n p la n s 95 6.1 M e a su rem e n ts......................................................................................................... 96 6.2 State v ariab les.......................................................................................................... 99 6.2.1 P art to le r a n c e s ............................................................................................ 100 6.2.2 Tolerances, features and m e a s u re m e n ts .............................................. 102 6.2.3 M ultiple occurrences of th e same p art f e a t u r e ................................ 104 6.3 Same c o n s tr a in ts ..................................................................................................... 106 6.4 Tuple r e p r e s e n ta tio n .............................................................................................. 109 6.5 S tate re p resen tatio n ..................................................................................................112 6.6 Low-level operations on state .............................................................................112 7 S ta te tr a n s f o r m a tio n 117 v 7.1 O verview .......................................................................................................................118 7.2 Problem spaces and o p e r a to r s .............................................................................120 7.3 Problem space m e a s-p s ...........................................................................................125 7.3.1 Overview ......................................................................................................125 7.3.2 O perators of m e a s-p s .................................................................................127 7.4 C lu s te rin g ................................................................................................................... 131 7.4.1 C lustering using h e u r is tic s ....................................................................... 132 7.4.1.1 Preferred d ire c tio n s.................................................................135 7.5 An exam ple of inspection p l a n n i n g ..................................................................135 7.6 Control .......................................................................................................................142 7.6.1 H euristics for steepest-ascent hill c lim b in g ........................................ 143 7.6.2 Heuristics for b e s t- f ir s t............................................................................. 145 8 Im p le m e n ta tio n and ex p e r im e n ta l resu lts 147 8.1 Im p le m e n ta tio n .........................................................................................................148 8.1.1 D irection cone im p lem en tatio n ............................................................... 148 8.1.2 P lanner im p le m e n ta tio n ...........................................................................148 8.2 Im plem entation lim ita tio n s................................................................................... 152 8.3 E xperim ental r e s u l t s .............................................................................................. 153 9 C o n clu sio n s 162 9.1 S u m m a r y ................................................................................................................... 163 9.2 C o n trib u tio n s ............................................................................................................ 163 9.3 L im ita tio n s ................................................................................................................165 9.4 F uture w o r k ................................................................................................................165 B ib lio g ra p h y 168 A p p e n d ix A Properties of reciprocal direction c o n e s ....................................................................... 173 A .l N otation and d e f in itio n s .......................................................................................174 A .2 Proofs of reciprocal cone p r o p e r tie s ..................................................................175 A .3 G eneralized reciprocal and supplem entary c o n e s ......................................... 185 A .3.1 Generalized reciprocal cone ................................................................... 185 A .3.2 Generalized supplem entary c o n e ............................................................ 186 A p p e n d ix B Global accessibility: related proofs ..........................................................................187 B .l Proofs related to global accessibility c o n e s ....................................................188 B.1.1 Propositions on G A C ..................................................................................188 B .l.2 Relation between G A C and G A C k ..................................................... 189 B .l.3 G A C s of transparent v o lu m e s ................................................................190 B .l.4 F inite length probes ..................................................................................191 vi B.2 Proofs for polyhedral o b je c ts ............................................................................... 193 B.2.1 Proof of proposition 5.1.1 193 B.2.2 R egular Minkowski s u m ..........................................................................196 A p p e n d ix C B ent probes: related proofs .......................................................................................... 198 C .l Convex GAC and bent probes - P r o o f s .......................................................... 199 A p p e n d ix D C lustering is N P -c o m p le te ...............................................................................................201 D .l Proof th a t clustering is N P -c o m p le te ..............................................................202 vii List Of Figures 1.1 CMM inspection ................................................................................................... 3 1.2 Two types of Coordinate M easuring M a c h in e s .......................................... 7 1.3 H euristics used for m odifying probe p ath in work by Y a u ...................... 10 1.4 M odification of p ath resulting to infinite loop .......................................... 11 2.1 Probe com ponents ............................................................................................... 17 2.2 Exam ple of star p r o b e ........................................................................................ 19 2.3 Straight probe r e p r e s e n ta tio n .......................................................................... 20 2.4 P a rt enclosing C M M ............................................................................................ 21 2.5 A half-line can inspect th e feature, but a real probe c a n n o t ......................22 2.6 B ent probes w ith two c o m p o n e n ts................................................................... 23 2.7 A direction c o n e ...................................................................................................... 24 3.1 Probes th a t can locally inspect A F ............................................................... 26 3.2 Local accessibility cone of a surface f e a tu r e ................................................. 28 3.3 T he use of restricted local accessibility cone can give sharper results th an the local accessibility c o n e ..................... 32 3.4 Convex edges do not indicate potential o b s t r u c t i o n ................................ 33 3.5 Features w ith em pty local accessibility c o n e .............................................. 35 3.6 Using to tal num ber of probe directions as a criterion for evaluating feature s e g m e n ta tio n ............................................................................................ 36 4.1 Global accessibility c o n e .................................................................................... 39 4.2 G A C (F ) for th e bottom face of th e s l o t ........................................................ 41 4.3 Com puting G A C (F ) using sw e ep s................................................................... 44 4.4 Segm entation for global accessibility............................................................... 46 4.5 G A C for finite length p ro b e s ............................................................................. 49 4.6 Tw o-com ponent bent probe re p re s e n ta tio n ................................................. 51 4.7 A pproach c o n d itio n ............................................................................................... 52 4.8 D ependency of second com ponent direction on first com ponent length 53 4.9 Bent probes th a t do not intersect iW © F ' ................................................. 54 4.10 Bent probes and m a n ip u la to rs .......................................................................... 55 4.11 Com puting directions for th e second c o m p o n e n t...................................... 58 4.12 A pproach direction for single bent p r o b e .................................................... 63 4.13 Checking th e approach condition for sets of bent p ro b e s ........................ 64 viii 4.14 Effective working length of p r o b e .................................................................. 66 4.15 R am directions and setup orientations ........................................................ 69 4.16 P ro b e/ram assembly as a straight p r o b e .................................................... 71 4.17 P ro b e/ram assembly as a bent p r o b e ........................................................... 73 4.18 R am represented as a cylinder/sphere com bination ............................... 75 4.19 M inim um angle and ram o r ie n ta tio n s ........................................................... 76 4.20 Supplem entary and reciprocal c o n e s ............................................................... 77 4.21 Global accessibility cone and visibility region: (a) (G AC (F )(& F) — 0 and V(F) ± 0, (b) V(F) C (G A C (F ) © F ) .................................................. 79 4.22 'Separating plane betw een feature F and obstacle 0 ................................. 80 4.23 Disassem bly d ir e c tio n s ....................................................................................... 81 5.1 Difficulties in inspecting boundary points of a f e a t u r e ........................... 86 5.2 GGIs for a convex edge (a), and for a vertex (b ).......................................... 88 5.3 GGIs for th e bounding entities of a surface featu re.................................... 88 5.4 Experim ental results....................................................................................... 94 6.1 A m easurem ent consisting of two tu p le s ........................................................ 98 6.2 P art t o l e r a n c e s .........................................................................................................100 6.3 S tate variables for one to le ra n c e .........................................................................103 6.4 P art w ith the sam e feature appearing in two to le r a n c e s ............................ 105 6.5 Same t r e e ................................................................................................................... 108 6.6 Tuple t r e e ....................................................................................................................109 6.7 Com bining same and tuple t r e e s .........................................................................I l l 6.8 O peration m e a s-u p d a te ().......................................................................................114 6.9 O peration sam e-constraints() ............................................................................ 116 7.1 Problem space hierarchy for inspection p la n n in g .........................................121 7.2 Problem space m e a s-p s .......................................................................................... 126 7.3 O perator co m p -p d -su ..............................................................................................129 7.4 O perator co m p -ra m -p d .......................................................................................... 130 7.5 Clustering three s e t s ..............................................................................................133 7.6 O rder of exam ining the facets is im p o r ta n t....................................................135 7.7 Toleranced p a r t .........................................................................................................136 7.8 Input tolerances and initial state .................................................................. 137 7.9 A pplication of operator e q u iv -s f.........................................................................139 7.10 Applying the operators (a) g-acc-sf and (b) probe-geom and meas-su to m easurem ent T 0 .F 0 .M 0 .................................................................................... 140 7.11 Inspection plans for all m e a su re m en ts.............................................................. 141 7.12 S tate after c lu s te r in g ..............................................................................................142 8.1 Im plem entation of problem spaces and o p e ra to rs .........................................150 8.2 Toleranced p a r t ........................................................................................................ 154 8.3 Final inspection plan for p art w ith seven tolerances and w ith same-su constraint active ...................................................................................................... 156 8.4 Collision of the probe head w ith th e CMM table causes backtracking 158 8.5 Final inspection plan for p art w ith seven tolerances and same-pg con strain t a c t i v e 159 8.6 Final inspection plan for p art w ith eight tolerances and same-su con strain t a c t i v e 160 A .l N o ta tio n ....................................................................................................................... 174 A .2 Illustration of proof of property 5 ....................................................................... 178 A .3 A and B closed and u n b o u n d e d ......................................................................... 180 A .4 Illustration of proof of Lem m a A .2.4 183 A .5 Circular cone K(Q)\i .............................................................................................. 185 B .l Illustration of proof for proposition 4 . 1 . 2 ....................................................... 189 B.2 G A C of transparent v o lu m es................................................................................ 190 B.3 Illustration of proof for Proposition 5.1.1, P art A ............................................194 B.4 Illustration of proof for Proposition 5.1.1, P art B ............................................195 C .l B ent probe s p e c ific a tio n ....................................................................................... 199 C.2 Bent probes from convex GAC - approach c o n d itio n ..................................200 Abstract T he topic of this thesis is the autom atic generation of high-level inspection plans for m echanical parts, when inspection is perform ed by Coordinate M easuring M a chines (CM M s). CMMs are very accurate C artesian robots equipped w ith tactile probes. A high-level plan is a collection of setups of the p art on th e CMM, features to be inspected in each setup, and the probes and probe orientations to be used for each feature. T he problem is form ulated as search in a space of partially-com pleted plans. Interm ediate states contain a collection of plans, some of which m ight be invalid or too expensive. O perators m ap plans into m ore refined plans, by im posing geom etric and optim ization constraints, until a feasible and nearly optim al plan is reached. T he state is represented as a set of 4-tuples of th e form (setup, probe geom etry, probe direction, surface feature), and constraints of type same on th e tuple variables. O perators are organized into problem spaces according to th e goal they achieve. Some of these spaces group several geom etric m ethods of varying power and execution cost for achieving the same goal. Accessibility is one of th e m ost im portant geom etric constraint for inspection planning. To analyze th e accessibility of a surface feature probes are abstracted by half-lines, and all the half-line directions th a t can inspect th e feature w ithout colliding w ith th e workpiece are com puted. T he set of these directions form the accessibility cone of th e feature. T he half-line abstraction is suitable for straight probes of relative large length w ith respect to th e workpiece dimensions. Accessibi lity analysis however, can be extended to the case of finite length probes, and bent probes (a bent probe has several non-aligned com ponents). A general m ethod for com puting accessibility cones is presented, based on M in kowski (sweep) operations on faces and solids, and on Boolean operations on direc tion cones. T he m ethod is im plem ented for polyhedral objects by an algorithm th a t uses Minkowski operations on 2-D sets. A prototype system im plem entation shows th a t th e approach is feasible. Ex am ples are presented of good-quality plans generated by th e system for realistic parts. Chapter 1 Introduction 1.1 Automated inspection and scope of this work T he goal of C om puter Aided M anufacturing (CAM ) is to autom atically generate de scriptions of all the processes involved in the m anufacturing of a workpiece. Broadly construed, m anufacturing a workpiece includes its inspection, whose role is to check w hether th e workpiece m eets th e tolerance specifications set by the designer. In the past, th e m ajority of autom ation work for CAM was done for m achining. Recently, however, the realization th a t inspection planning is also very expensive (in term s of m anpow er) has resulted in an increase in research in this area. At USC, we are developing a system for autom ating inspection planning, w ith th e architecture shown in Figure 1.1. T he input is a solid m odel of th e part to be inspected, together w ith a set of surface features and associated tolerances. (A surface feature here is sim ply a set of “faces” of the p art.) T he high-level planner produces a collection of setups, and a set of operations for each setup. A setup is characterized by a fixed workpiece orientation w ith respect to a C oordinate M easur ing M achine (CM M ) and by th e associated fixtures and clam ping equipm ent. An operation essentially consists of inspecting a surface feature, and has one or m ore probes and probe directions associated w ith it. T he low-level, operation planner takes into consideration th e available m achines, probes and fixtures, determ ines ap propriate sam pling points to inspect each feature, and produces probe paths and specific part-positioning inform ation. Probe paths are tran slated into actual com m ands for the CMM, and p art positioning inform ation is com m unicated to a hum an operator (or, eventually, to a robot). M easured points are interpreted by a soft gag ing m odule, which determ ines if a p art m eets its tolerance specification. (A dditional outp u t inform ation m ay also be useful to determ ine, for exam ple, why a p art is out of tolerance.) T he scope of th e work presented in this thesis is the design of th e high level planner. This planner should, by its very nature, avoid com m itm ents to specific tools or ways the tools m ust be used; yet, it m ust ensure w ith sufficient certainty th a t “filling in ” details at a lower level, such as replacing abstractions w ith real tools, will not lead to failures at real tim e execution of th e plan. Satisfying these two often contradictory requirem ents is one of the m ain difficulties encountered when designing th e high level planner. 2 High Level Planner Operation Planner Robot Servo Command Generator CMM Soft Gaging Algorithms Workpiece Model + Tolerances Coordinates of Contact Points Results: Feature OK? Deviation Values Specific CMM Probes Fixtures Setup Orientation Surface Features Probe Geometry Probe Directions Sampling Points Operation Sequence Part Positions Probe Paths (DMIS) Figure 1.1: CMM inspection 3 The input to th e high-level planner is a p art defined in th e Parasolids m odeler. T he tolerances specifications are in accordance w ith the Dim ensioning and Toleranc- ing S tandard ANSI Y14.5M-1982 ([ANS82]). T he o u tp u t of th e operation planner is in th e form of DMIS (Dimensional M easuring Interface Specification [CAM88]) com m ands. 1.2 Approach overview O ur approach to high-level planning casts the problem as search in a space of partially-com pleted plans. Plans evolve tow ards com pletion through th e effects of operators th a t m ap plans into plans. T he state is represented by sets of 4-tuples (SU, PG , PD , SF), where SU are the the setup orientations, P G are the acceptable probe geom etries (selected from a given set of physical probes), PD are the accessi ble directions, and SF is a (possibly com pound) surface feature to be inspected. We follow a least-com m itm ent strategy, and attem p t to reason about all th e possible so lutions, gradually narrow ing their range by applying constraints such as accessibility, sam e-setup (for related features), and so on. T he accessibility constraint is a m ajor concern in high-level planning for inspec tion. It strongly influences th e p art orientation in each setup, which features can be inspected in a setup, and the probe orientations. A large portion of this work is about accessibility and its use in inspection planning. We developed an accessibility analysis m odule, whose underlying theory is based on sem i-infinite probes, and on properties of direction cones, which represent the sets of accessible directions. 1.3 Why this problem In this subsection some questions regarding the choice of problem will be answered. W h y is in sp e c tio n im p o rta n t? Inspection is crucial for quality control. De pending on the results of th e inspection process, a p a rt will be approved or not for subsequent use either by itself, or in an assembly. Since one faulty p art m ay result in an assem bly th a t does not function properly, th e detection of parts th a t are out-of-spec before they are assem bled is very im portant. Inspection can also be 4 used in process control for checking w hether the m anufacturing equipm ent is work ing properly. For exam ple, a surface feature out of tolerance m ight indicate a worn out or not calibrated tool, or an unexpected variation of a m anufacturing process param eter. W h y w as t h e C M M c h o se n as th e to o l to p e r fo r m in s p e c tio n ? T he advan tage of CM Ms over hard gages is th a t they are m ore flexible. A CMM can inspect m any types of surface features, while a hard gage can inspect only very specific surface features. T he cost of fabricating hard gages can only be justified for large volum e production. T here are three m ain advantages of CMMs over vision systems: (1) CMMs of today are m ore accurate th an vision system s, (2) inspection by CMM does not require clean surfaces, or special illum ination, whereas a vision system usually does, (3) w ith th e use of orientable probes CMMs can inspect surfaces th a t a light beam cannot reach. T he m ajor disadvantage of a CMM is th a t it can m easure only discrete points or curves. Curves can be m easured by using a special type of probe, called scanning probe, which can trace a surface by continuous contact along a path. To solve the discrete-m easurem ent problem , work m ust be done in the field of sam pling. It would be desirable to relate th e sam pling rate w ith some m easure of confidence about the correctness of th e inspection results. Because a CMM has to m easure m any points, it is slower than, say, a hard gage. However, th e wide acceptance of CM Ms seems to im ply th a t flexibility is a bigger concern th an speed. A nother disadvantage of CMMs is th a t they m easure by contact, which is undesirable in m any cases. Having realized th a t, probe m anufacturers (such as Renishaw) are now offering laser probes. W h y w as t h e h ig h lev el p la n n e r c h o se n as th e p r o b le m to b e s tu d ie d ? High level planning is a very im portant p art of inspection planning, b u t not ad equately addressed in previous work. As w ith m ost planning tasks, hum ans are probably b e tte r at generating high level inspection plans for sim ple inspection tasks (sm all num ber of tolerances, and features per tolerance). However, when th e task becomes sufficiently com plicated, a m anually-generated high level plan has greater probability of error th an one generated autom atically. For exam ple, it is easy for a 5 hum an operator to miss a feature to be inspected when there are 30 tolerances in th e p art, w ith 4 features each. In addition, clustering of a large num ber features (p u ttin g together features inspected in th e same setup, w ith th e sam e probe and probe direction) is m ore error prone for an operator th an a program . This later operation is very im portant since it greatly affects th e speed (hence th e cost) of inspecting a p art. Even for relatively sim ple parts, th e ability to totally autom ate inspection would bring about all the usual benefits of autom ation: reduced labor and cost; increased consistence and quality; shorter tim e to m arket, and so on. 1.4 Coordinate Measuring Machines A C oordinate M easuring M achine (CM M ), is essentially a very accurate C artesian robot, whose end effector is a tactile probe. Because CM Ms are very flexible (in term s of p arts and tolerances they can m easure) they are widely used in m anufacturing. Like a robot, a CMM consists of a collection of m ovable p arts connected by joints. In this work the joints of a CMM are assum ed to be prism atic. T he probe is th e p art of th e CMM th a t comes in contact w ith the workpiece. The probe is rigidly attached to a movable com ponent of the CMM. W hen contact w ith the workpiece occurs, the coordinates of th e contact point are com puted. T he m ost common types of CMM m easure only discrete sequences of points, b u t there exist CMMs th a t can perform m easurem ents by continuously touching th e workpiece. Notice th a t even in this case, a CMM cannot inspect all points of a surface feature. It can only inspect ID subsets of the 2D surface feature. T here exist several types of CMMs. T he classification is done according to how m any m ovable com ponents the CMM has and how they move w ith respect to guide- ways, to which com ponent is the probe attached, and to th e position of th e work piece. Two types of CMMs are shown in Figure 1.2. T he arrows indicate movable com ponents, and th e way they move. T he CMM on th e left is called a CMM w ith “moving ram horizontal arm ” , and the CMM on th e right is of the “gan try ” type. This nom enclature is taken from [ANS85]. 6 Figure 1.2: Two types of C oordinate M easuring M achines 1.5 Previous work 1.5.1 I n sp e c tio n s y ste m s O ne of th e earliest works on inspection planning was reported by H opp and Lau ([Hop84], [HL85]). They developed an inspection system architecture based on ideas from hierarchical control ([ABN81]). T he goal of their system is to generate CMM servo com m ands for the inspection of a toleranced p art. T he m ain idea is to solve th e problem by hierarchical decom position of high-level goals to lower-levels, until th e servo-com m and level (the lowest level in th e hierarchy) is reached. T he proposed hierarchy is: tolerances, com pound features, simple features, probing points, probing paths, m achine m otions and servo com m ands. Not enough details were published about how each level should be im plem ented, and about com m unication between levels. However, th e hierarchical decom position idea is im p o rtan t, and has influenced m ost of th e system s developed afterw ards. A nother im portant idea in this work is sensory feedback during the execution of th e inspection plan. A lthough this idea has not been pursued in th e inspection planning field, there is hope th a t techniques from reactive planning (a field of artificial intelligence) can be used to develop reactive inspection planning system s. In a reactive system , the inspection plan can change during plan execution. For exam ple, if a feature (or point) to be inspected is not 7 present, the system recovers and continues w ith plan execution. As another exam ple of reactivity, th e plan can change as th e results of soft gaging are fed back into the system . In th e sim plest case, a datum out of tolerance causes th e features toleranced w ith respect to this d atu m not to be inspected. Or, a feature out of tolerance triggers a m echanism for perform ing additional m easurem ents to determ ine why the feature is out of tolerance. One of th e first im plem ented inspection system s was developed by ElM araghy and Gu ([EG87]) at M cM aster University. T he system is feature- and rule-based and it produces an inspection plan for a given toleranced p art. T he inspection plan is generated by perform ing a fixed sequence of steps. T he first step is to identify the features th a t cannot be inspected by a CMM. T hen for th e rem aining of the features a setup is chosen, and th e first im portant feature is selected (im portant features are identified by rules, and are features such as datum s). For this feature a probe and probe orientation are then selected. At this point th e feature list is searched in order to find other features th a t can be inspected w ith the sam e probe. This is repeated until all features th a t can be inspected under th e current setup are exhausted. A fter th a t, another setup is chosen and the above process is repeated. It is unclear from [EG87] how setup orientations are determ ined. M ost (if not all) of th e processing is done by special-case rules. For exam ple, accessibility of a conical feature which is adjacent to a cylinder is determ ined by a rule th a t com pares the dim ensions and orientations of th e two features. T he system appears to be restricted to rotational parts. Extending th e rule base (e.g. accessibility rules) to a tru e 3D environm ent of complex prism atic parts does not seem a prom ising approach. IP P E X (Inspection Process Planning E X pert) ([Bro90], [Bro91]) is a rule based system th a t generates inspection plans for a given toleranced p art. Briefly, an in spection plan is generated as follows: F irst th e features to be inspected are identi fied, and ordered according to rules. T he CMM appropriate for m easuring th e part is determ ined. T hen, setup, probe orientations, fixturing and probe geom etry are determ ined (in this order) for each feature. T he probes and probe directions are clustered in order to m inim ize inspection tim e. An inspection technique (sam pling strategy) is selected for each feature, and the probe paths are generated. T he final step is th e generation of th e DMIS code for driving the CMM. A strong point of this system is th a t it perform s both high-level and low-level planning. Also, the system 8 has a nice user interface through which th e user can input d a ta for perform ing any of th e above m entioned steps. T he IP P E X architecture was fully im plem ented but m any of th e m odules for autom atic operation were not. A disadvantage of th e above two system s is th a t th e steps have to be perform ed in a fixed order, and it is not clear w hether this fixed order will always generate a plan, if one exists. Also, a different order m ight generate a b ette r plan. T he two system s are typical rule-based expert system s w ith relatively shallow knowledge. Rules are used for perform ing m ost of th e steps. They quickly produce a good plan if th e appropriate rules are in the knowledge base. B ut they fail if a new situation (not captured by rules) is encountered. In addition, th e M cM aster system was im plem ented only for rotational p arts (apparently) and IP P E X im plem entation lacks m any of th e planned autom atic m odules. A lgorithm s for extending the ElM araghy and Gu system were not discussed, and neither were algorithm s for fully autom ating IP P E X . T he system s described in [KY93] and [Yau91] also perform high level inspection planning, b u t th e focus is on probe p ath and direction generation; setups and probe geom etry considerations are very briefly m entioned. In b o th system s, probe orienta tions are generated for specific probe paths using th e local ([Yau91], [MY91], [YM91]) and global ([KY93]) accessibility ideas developed in [SR90]. O ur planning approach differs in th a t we do not couple a probe p ath w ith a probe direction. R ath er, we fol low th e least com m itm ent principle to generate probe orientations th a t can inspect any feature point w ithout collision w ith th e p art. This ensures th a t any probe p ath such th a t th e probe tip continuously touches th e feature is w ithout collisions. Probe orientations and paths independent of each other has the advantage of being able to change either of th em (for exam ple, if collision is detected during th e verification phase) w ithout affecting th e other. In th e work by Khoshnevis and Yeh, th e p a rt is intersected by a set of parallel planes, producing p art contours. For each contour 2D global accessibility analysis is perform ed, in order to generate probe directions. Using these directions, one 2D probe p ath is generated per contour. T hen, the 2D paths are connected by in ter secting th e p a rt w ith a set of parallel planes perpendicular to th e first planes, and perform ing p ath generation along th e new contours. T he approach has th e advan tage of being fast if th e valid probe paths and directions happen to be parallel to th e plane used for generating th e contours. However, if a p art needs to be inspected 9 Point 2 Point 1 LN4 (a) LN2 1 LN1 LN3 LN5 LN2 P2 PI (c) Figure 1.3: H euristics used for m odifying probe p ath in work by Yau w ith probes not parallel to ju st one plane, th e search for th e set of planes for creat ing th e right contours can be very expensive. For exam ple, suppose th a t a p art is a block w ith a hole at 30° to th e horizontal. A slicing strategy th a t uses horizontal planes will not be able to inspect th e hole. Since all the accessibility analysis is 2D, it does not help decide which cutting planes to use in such cases. Also note th a t th e 2D accessibility analysis described in [KY93] assumes straight probes, whereas th e paths are generated for orientable probes. T here is no guarantee th a t the actual probes will not cause collisions. In th e system developed by Yau, inspection planning starts by generating the points to be m easured (touched by the probe). This is done by statistical analysis th a t determ ines th e sam pling plan for a feature, based on th e accuracy of th e process used for m anufacturing the feature, and on the tolerance specifications. These points are connected to form th e initial paths, w ithout considering possible interference of paths and p art. For each two consecutive points to be m easured, a default p ath segm ent is generated (Figure 1.3a - in th e figure, th e p a rt is indicated by th e bold line). Each default p ath segment is verified in three stages. In th e first stage the probe tip trajecto ry is checked for collision w ith th e p art. If collision occurs, rules are used to locally m odify th e p ath segment depending on which portion of th e path is interfering w ith th e p art. For exam ple, if LN1 intersects th e p art (Figure 1.3b), th en a detour p ath is generated by increasing th e vertical segm ents, as shown in Figure 1.3c. Rules also specify how th e detour p ath is to be modified in case of collision. These rules, however, do not cover all possible m odifications of paths so as to guarantee a solution, if one exists. For exam ple, for th e initial p ath shown 10 LN4 LN4 LN4 LN3 LN5 LN2 (a) (b) (c) Figure 1.4: M odification of p ath resulting to infinite loop in Figure 1.4a th e system will fall into an infinite loop perform ing th e operations: (1) decrease LN5 (Figure 1.4b), and (2) increase LN3 and LN5 (Figure 1.4c). O per ation (1) is perform ed because of a rule th a t specifies th a t LN5 should be decreased w hen both LN4 and LN5 collide w ith the p art. O peration (2) is perform ed because of another rule th a t specifies th a t LN3 and LN5 should be increased when only LN4 collides w ith th e p art. Since the distance for increasing and decreasing p ath por tions is predefined th e system will continuoulsy altern ate betw een decreasing and increasing LN5 while increasing LN3. In th e second stage the probe stylus trajecto ry is checked for collision. This is done by selecting a probe direction from the local accessibility cone (LAC) of the feature. T he LAC of a feature is com puted by intersecting th e half-spaces th a t are defined by th e norm als of th e points to be inspected. (LACs are discussed in detail in C hapter 3.) If the selected probe direction collides w ith the p a rt, then another direction is selected from th e LAC. This is a very inefficient way for com puting accessibility directions. In addition, there are cases w here none of th e directions in th e LAC can inspect th e feature w ithout collision w ith the p art. T he final stage is to check th e CM M arm trajecto ry for collisions; in case of collision, th e probe is su b stitu ted by a longer probe. This heuristic assumes a “nice” setup in th e sense th a t m oving th e CMM arm a little farth er from th e p art will result in no collision. T he underlying system used for th e im plem entation is IBM CA TIA, which supports sculptured surfaces. T he probe p ath verification m odule has produced paths for several parts. T he published exam ples show easily accessible surfaces th a t look like “terrain surfaces” . T he heuristics used seem to be inadequate for com plicated 11 prism atic parts. High-level inspection planning is not th e m ain point of th e system ; rath er, th e em phasis is on using statistical analysis for such things as generating sam pling points, p art alignm ent and surface fitting (for form tolerances). M erat and R adack ([MR92]) reported a feature-based system for perform ing in spection planning. In this system each feature type (a feature here is a set of surfaces w ith tolerances associated to the set) has a default inspection plan associated w ith it. Such a plan (called inspection code fragm ent - IC F ) contains the points of the feature to be m easured, th e p ath th a t traverses these points, and constraints on the p art and probe orientations. It is not clear from th e paper w hat these constraints are. From th e given exam ple, it looks like all acceptable setup and probe direction values are actually listed in each plan fragm ent. In addition to IC F ’s there also exist inspection plan fragm ents (IP F ) th a t are plans for inspecting individual surfaces. Inspection planning starts by assigning an IC F (IC Fs can be in stan tiated for the p articu lar feature being exam ined) to each feature not interacting w ith others, and an IP F to th e surfaces of interacting features. T hen the feature plans are com bined in order to produce th e inspection plan for th e entire p art, m aking an attem p t to generate a m inim al set of p art orientations. T he published inform ation does not contain enough details for a critical assessm ent. An im p o rtan t issue not addressed is how to ensure th a t th e probe directions given in IC Fs and IP F s are com bined so as to achieve global accessibility. In sum m ary, a sm all num ber of projects have tackled inspection planning. A m a jo r deficiency of th e reported system s is the lack of powerful capabilities to establish th e accessibility of surfaces to probes. 1 .5 .2 A c c e ssib ility A ccessibility analysis is used in vision for com puting th e set of points in space from w hich a surface feature is visible. This set is called th e visibility region, V(F), of feature F. Cowan and Kovesi ([CK88]) introduced th e separating plane concept for visibility calculations, and Tarabanis and Tsai ([TT89]) developed algorithm s for com puting V (F ) efficiently using this idea. T he relation betw een accessibility and visibility is presented in Section 4.9.1. 12 | W ork on accessibility for m achining has been done by Professor Tony Woo and”] his students ([CCW 93], [Gan90], [Kim90], [TW89]). T his work deals w ith convexj direction cones from a com putational geom etry point of view. A lgorithm s have been ' ^developed for efficiently perform ing Boolean operations on convex cones, com puting th e convex hull of a cone, clustering of convex cones, and com puting accessibility Jcones for Bezier curves and surfaces. This work and our local accessibility cone ’ concept were developed independently. They both generate th e local accessibility! to n e for a surface from th e local properties of th e surface (in particu lar, th e G aussian ■ I | im age of th e surface). j Accessibility is also used in assembly planning. T here, th e objective is to find th e ; > | ’ directions d such th a t an object A can move along d w ithout colliding w ith another object B. Such directions can th en be used to disassemble th e two objects A and I I B. T he work on disassem bly directions and its relation to accessibility is presented: i _ _ i •in Section 4.9.2. I I j •1.6 Thesis outline i T h e thesis is organized as follows, i 1 T he first four chapters deal w ith th e problem of accessibility. In C hapter 2 th e , jconcept of direction cone is introduced, as a tool for perform ing accessibility analysis1 for a surface feature. In C hapter 3 th e accessibility of a feature is studied w ith o u t; ^considering potential obstacles other th an an infinitely th in p art volum e ad ja c e n t! to the feature. This analysis is called local accessibility analysis, and produces aj Local A ccessibility Cone (LAC). In C hapter 4, all obstacles are considered during | accessibility analysis, and th e resulting cone is the Global A ccessibility Cone (GAC). j T he sam e chapter also presents a general m ethod for com puting G ACs, and discusses th e use of GACs in inspection planning. In C hapter 5, an im plem ented algorithm I i for com puting GACs for polyhedral p arts is presented. i C hapters 6 and 7 deal w ith inspection planning as search. In particular, C hap ter 6 deals w ith the state representation (a state contains a collection of inspection plans), and C hapter 7 w ith th e operators th a t transform th e' state. C hapter 8 presents exam ples of inspection plans generated by our prototype system . Conclusions are presented in C hapter 9. T he proofs of th e propositions and theorem s m entioned in th e thesis are in th e ^appendices. i i i 14 ! Chapter 2 Accessibility analysis Finding a set of probes th a t can inspect a surface feature is one of th e central problem s in inspection planning for CMMs. A surface feature is a subset of th e boundary of th e workpiece. It m ight be ju st a face, or a “sub-face” , or it m ight consist of several disconnected portions of th e workpiece boundary. A probe can inspect a surface feature if th e tip of the probe can reach all th e points of th e feature. Given a surface feature, and a probe (characterized by its geom etry, orientation, and so on, as discussed below) one m ight ask: Can th e probe inspect th e surface feature? T he answer to this question is useful to verify th a t a proposed plan is feasible. However, to generate a plan, a m ore interesting question is th e following: Given a surface feature, which probes can inspect it? If this question can be answered, an inspection planner will have th e flexibility to choose am ong several probes for th e inspection of a feature. Com bining this inform ation from all th e features, the planner can m inim ize th e num ber of probes used, which usually results in lower cost and perhaps greater m easurem ent precision. Finding all possible shapes, sizes and orientations of probes th a t can inspect a feature is a hard problem because of th e num ber of param eters involved. In the approach presented here th e solution is found in two steps which m ay be sum m arized as follows. In th e first step, a probe is approxim ated by a half-line (ray). T he problem becomes: find directions of half-lines along which th e feature is accessible. (Form al definitions are given below.) T he second step introduces th e real probe geom etry by rem oving from th e o u tp u t of th e first step those half-lines th a t cannot be replaced by a real probe, which has non-zero cross-section. T he problem of finding th e probes th a t can inspect a feature will be referred to as accessibility analysis of the feature. This chapter provides basic definitions and prelim inaries for accessibility analysis. C hapters 3 and 4 present approaches for solving this problem . 16 CMM ram ) Probe head Extension Probe Stylus Tip Figure 2.1: Probe com ponents 2.1 Probes According to [ANS85], a probe is “a device which establishes th e location of the movable com ponents of a coordinate m easuring m achine (CM M ) relative to a m ea surem ent p o in t” . A probe can be thought of as a set of bodies, or com ponents, connected in an open chain. In this thesis, a probe is specified by: • its com ponents; • the position and orientation of each com ponent w ith respect to th e others; • th e orientation of th e probe as a whole, w ith respect to some global coordinate system , usually th e workpiece or th e CMM coordinate system . In principle, th e com ponents of th e probe can take any shape; in practice, a probe is com posed of cylindrical, spherical and conical com ponents. A typical probe is shown in Figure 2.1. T he nam e probe in th e figure refers to th e com ponent th a t contains th e m achinery for detecting w hether the stylus is in contact w ith a surface. In this thesis however, th e term probe will be used for th e stylus, probe proper (as 17 in th e figure) and extension, taken together. T he sphere at th e end of th e stylus is called the tip of th e probe and considered p art of th e stylus. T he tip is the com ponent of th e probe th a t contacts th e surface to be inspected. Some probe heads require th a t a probe be attached only in one fixed orientation, w hereas others allow m any orientations. For m anual heads the probe has to be attach ed and oriented m anually, and as a result recalibration is necessary before m easurem ents are m ade in a new orientation. M otorized heads (e.g. R enishaw ’s PH 9) change probe orientations under program control and no recalibration is needed w hen an orientation changes. For m otorized heads, all th e probe orientations to be used for inspecting a p art are calibrated before th e p art inspection starts. Because probe calibration is a tim e consuming process (especially for m anual CM M s), a “good” inspection plan should contain th e m inim um num ber of probe orientation changes for each probe used. O ur approach to m inim izing probe orientations is to com pute all th e orientations th a t can inspect each feature of th e p art, and then group th e features so th a t each group can be inspected w ith one probe orientation. We require th a t a feature be inspected by a single probe, in a fixed orientation. Changes of probes are assum ed to take place far from th e workpiece, hence the problem of collision avoidance while the change happens is not considered. T he probe head is connected to the CMM through th e ram . According to [ANS85], the ram “is the moving com ponent of a m achine th a t carries the probe” . In th e existing CM Ms th e ram can only tran slate w ith respect to th e CM M coordi n ate system (i.e. rotation is not allowed). Since th e probe head is rigidly connected to th e ram , th e probe head retains a fixed orientation w ith respect to the CMM coordinate system . For non-orient able probes this im plies th a t th e orientation of th e entire probe is fixed in m achine coordinates. 2.2 Probe representation A ccessibility analysis deals w ith sets of probes, and therefore th e representation for probes m ust be such th a t these sets can be easily expressed. A probe can be char acterized by a set of param eters such as stylus length and diam eter, tip diam eter, etc. However th e large num ber of param eters and th eir com plex interdependencies 18 Figure 2.2: Exam ple of star probe m akes it difficult to develop algorithm s for sets of probes represented by param eter ized solid objects. One can im pose lim its on th e param eters or give th em specific values. Taking such low level decisions about th e exact geom etry of th e probes at the first steps of inspection planning is likely to result in failure later. T he philosophy of our work is to defer th e low level decisions as m uch as possible so as to avoid costly backtracking. In accordance to this philosophy, the representation chosen for probes is such th a t it can express th e whole spectrum of probes under consideration and it is com putationally tractable. This representation does not describe th e exact geom etry of a probe; rath er, it tries to capture th e im portant properties needed for perform ing accessibility analysis. A probe is represented by an abstraction of th e real 3D object. T he draw back of th e representation is th a t th e solutions found by th e accessibility analysis m ight not be valid when th e abstraction is su b stitu ted by a real probe. Two types of probes are exam ined in this work: straight probes and b ent probes w ith two com ponents. For each type of probe, a different representation is used. A straight probe consists of cylindrical and spherical com ponents whose axes and centers lie on th e sam e line, whereas a bent probe consists of two sets of cylindrical and spherical com ponents whose axes and centers lie on two intersecting lines. A probe ty p e used in practice and not covered in this thesis is th e star probe, where m any probe styli can be grouped together. An exam ple of a star probe is shown in Figure 2.2. 19 V o Probe A Probe B H alf line Vector Figure 2.3: Straight probe representation 2 .2 .1 S tra ig h t p ro b es We study two types of straight probes: probes w ith infinite and finite length. A straight probe of infinite length is abstracted by a half-line. T he half-line repre senting th e probe has th e sam e direction as th e axis of th e probe com ponents. The contact point at th e tip of th e probe corresponds to the endpoint of th e half-line and this endpoint is not included in the probe representation. T he half-line rep resentation is am biguous: a half-line of direction d represents all possible straight probes w ith direction d. For exam ple, in Figure 2.3 th e half-line I represents both probe A and B. Since a half-line can also be represented by a vector, an equivalent representation for a straight probe is a vector. T he vector has th e sam e direction as th e half-line, and its tail denotes th e tip of th e probe (Figure 2.3). B oth of these representations are used, according to th e need of the analysis. A m ajor difference betw een a half-line and a straight probe is th a t th e first has infinite length, while th e second has finite length. T he half-line representation was chosen because it reflects two com m on situations encountered when perform ing inspection using a CMM: • T he probe is long com pared to th e workpiece dim ensions. • T he probe is connected to th e CMM ram through one or m ore parts, whose axes of sym m etry are th e sam e as th e axis of th e stylus of th e probe. T he entire assem bly m ust move w ithout colliding w ith th e workpiece. It is clear th a t if a half-line abstraction intersects th e p art, the p ro b e/ram assem bly also 20 PART — O — CMM Figure 2.4: P a rt enclosing CMM will collide w ith th e workpiece, unless th e p art is larger th a n the CMM and has a reentrance th a t encloses th e m achine entirely - Figure 2.4. This situation occurs rarely and is ignored in this thesis. T he rem aining situations are dealt w ith using finite-length straight probes, and bent probes. Using th e above representation for straight probes m ay result in invalid plans. A probe abstraction m ay be found as a solution to th e accessibility problem , and th e real probes corresponding to this abstraction m ay not be able to inspect th e feature. T his happens because th e exact probe is larger th an (i.e., a superset of) th e line abstraction. O n th e other hand, th e solutions found always express necessary condi tions, in th e sense th a t if a probe abstraction cannot inspect the feature, none of the corresponding real probes can (subject to th e qualifications im plied by Figure 2.4). Consider th e workpiece shown in Figure 2.5. T he half-line w ith direction y can inspect th e entire surface feature A B , b u t th e real probe w ith th e sam e direction cannot, because th e w idth of the probe will not allow it to reach the points close to A and B . Situations like this are detected in our system by a m odule th a t instantiates the real probes and verifies th e accessibility results. Inspection plan failure because a real probe cannot inspect a surface feature is an issue to be exam ined in Section 7.6.2. S traight probes of finite length are abstracted by line segm ents. O ur analysis for infinite probes can be extended to finite probes (Section 4.4). 2 .2 .2 B e n t P r o b e s B ent probes can have several shapes, and several num bers of com ponents. We consider only probes th a t have two com ponents. Two such probes are shoWn in 21 < 3 Z E B O Real probe Half line Figure 2.5: A half-line can inspect th e feature, b u t a real probe cannot Figure 2.6. We call th e com ponent of th e probe which carries th e tip th e first com ponent. A b ent probe abstraction is sim ilar to its straight probe counterpart. The first com ponent is ab stracted by a line segm ent, and th e second by a half-line. Five param eters are needed: two for th e direction of each com ponent and one for the length of th e first com ponent. Figure 2.6 shows th e bent probe abstraction for probe B. Even such a sim ple bent probe representation can lead to expensive algorithm s because of th e five param eters involved. We do not provide in this thesis a general solution for bent probe accessibility. R ather, we use a m odification of the straight probe analysis for some special cases of bent probes. M ore details are presented in Section 4.5. 2.3 Direction cones T he m ain tool for accessibility analysis is the direction cone, w hich captures the notion of a collection of directions. D e fin itio n 2 .3 .1 A direction cone is a set o f half-lines with the end point at the origin. A half-line contains its endpoint. The point where all the half-lines meet is called the apex of the direction cone. 22 second component first component probe A p r < Figure 2.6: B ent probes T he set of points on th e surface of the S 2 = { x e E T h e distance betw een two points A ai betw een two half-lines (the half-lines that convex angle betw een A and B ([Rya86]). 1 {A ,B ) = c W here (A, B ) denotes th e inner product < m etric ([Rya86], [Fen53]). In general, a direction cone is a non-h< 3D sets. For exam ple, th e direction cone s] half-line I (ID cone), a continuous set A c of half-lines th a t form a 3D cone C. W hile we define a cone C to be a set of view a cone as a set of vectors. Thus I £ < w ith th e sam e direction as I. This dual T his aproach m akes it easy to define conv > b e B probe B abstraction i w ith two com ponents un it sphere is denoted by S 2. 13 I 1 * 1 = 1 } id B , A E S'2, B 6 S'2, and consequently go through A and B ), is defined as the os~1{A ,B ) > f A and B . It can be proved th a t L is a unogeneous set consisting of ID , 2D, and town in Figure 2.7 consists of one isolated f coplanar half-lines (2D cone), and a set half-lines, it is occasionally convenient to 7 iff nl € C for (J , > 0, w here I is a vector approach is taken by Fenchel in [Fen53]. 3x cones as follows. 23 c Figure 2.7: A direction cone D e fin itio n 2 .3 .2 ([Fen53]) A set C of vectors is a convex cone if and only if it contains all vectors Xl\ + fj,l2 (A, (j, > 0; l\, I2 € C). A convex cone is a convex set because a convex cone contains all th e convex com binations of its elem ents. A cone is polyhedral if it can be expressed as th e union of a finite num ber of intersections of planar half-spaces whose defining planes go through th e origin. A polyhedral direction cone has planar faces and straight edges. Polyhedral cones are im p o rtan t because they can be used to approxim ate general direction cones and lead to tractab le algorithm s. A m odule of our system im plem ents Boolean operations for polyhedral cones. In this im plem entation (hom ogeneous) cones are treated as 2D regular subsets of the surface of th e unit sphere. For polyhedral cones th e edges of these 2D subsets are segm ents of great circles. 24 Chapter 3 Local accessibility 25 n ifmryj A F LAC(AF) Figure 3.1: Probes th a t can locally inspect A F Local accessibility analysis ignores all p otential obstacles except for th e solid m aterial im m ediately adjacent to th e feature being m easured. It is th e first step tow ards a m ore com plete, global analysis discussed in C hapters 4 and 5. In this chapter we assum e straight probes and ab stract th em as half-lines. We use th e term s probe and half-line interchangeably. 3.1 Local accessibility cone Consider an infinitesim al region A F of a surface feature F, and let n be a ray w ith endpoint in A F , w ith direction parallel to th e surface norm al at A F , and extending tow ards th e exterior of th e workpiece. T he m aterial on one side of A F constrains th e accessibility of th e region. If all other potential obstacles are ignored, th e probes (i.e., half-lines) th a t can inspect A F are those which m ake w ith n an angle less th an or equal to ir/2 - see Figure 3.1. We say th a t such probes can locally inspect A F . T he set of all these probes is a planar half-space, which is denoted by h: h = {I | 1(1, n) < 7 t/ 2 } W here l(a ,b ) denotes th e angle betw een two half-lines a and b w ith com m on end point. For a probe to inspect an entire feature F it m ust inspect all of th e featu re’s elem ental regions A F , and therefore it m ust m ake an angle betw een 0 and 7r/2 w ith 26 th e outw ard-pointing surface norm al at every point of th e feature. T he set of unit norm als at all th e points of a surface is called th e Gaussian image of th e surface: D e fin itio n 3 .1 .1 ([Hor86]) The G aussian im age of surface F , denoted as G I{F ), is a mapping of the points of F onto points of the surface of a unit sphere with center at the origin. A point P on F , maps onto a point Q on the unit sphere iff the surface normal of F at P, equals the normal of the unit sphere surface at point Q. A point on th e surface of the u n it sphere can also be represented by a half-line or a vector. Hence, G I ( F ) can be represented as a set of half-lines or as a set of vectors. In th e following all of these G I representations will be used, according to th e context. Now th a t all th e relevant definitions have been presented, th e form al definition of w hat it m eans for a probe to locally inspect a surface feature can be given. D e fin itio n 3 .1 .2 A probe p can locally inspect a surface feature F iff £(p,n) < 90°, Vn € G I(F ) T he set of all straight probes th a t can locally inspect a surface feature F is called th e local accessibility cone of F . T he form al definition is as follows: D e fin itio n 3 .1 .3 The local accessibility cone o f a surface feature F , denoted as L A C (F ) is: L A C (F ) = {p | p can locally inspect F }, where p is a half-line. Equivalently, th e definition of.L A C can be w ritten as follows: L A C (F ) = {p | l(p ,n ) < 90°, Vn € G I{F )} Figure 3.2 shows th e L A C for the cylindrical feature A B C D . T he Gaussian im age of A B C D is a set of coplanar vectors covering th e first q u arter of a circle on th e x z plane and w ith center at th e origin. If th e sphere is divided into quarters as shown in th e sam e figure, th e local accessibility cone of A B C D is th e q u arter indicated by th e bold lines. 27 D A x GI(ABCD) LAC(F) Figure 3.2: Local accessibility cone of a surface feature 3.2 Reciprocal cone T he concept of reciprocal of a direction cone can be used to relate local accessibility cones and G aussian images. Given a direction cone D, th e reciprocal of D, denoted as R (D ), is also a direction cone which consists of th e half-lines which m ake an angle of less th a n or equal to 90° w ith every line in D. T he form al definition of the reciprocal follows: D e fin itio n 3 .2 .1 The reciprocal of a direction cone D, denoted R (D ), is defined as: R (D ) = {/ | 1(1, q) < 90°, Vq € £>}, where I, q are half-lines with the end point at the origin. Using vectors instead of half-lines, th e above definition can be w ritten as R (D ) = {I \ I ■ q > 0, V<f € D }, w here I and q are the un it vectors w ith direction defined by th e half-lines I and q respectively. It follows im m ediately from the definitions of reciprocal and local accessibility cones of a feature F th a t L A C (F ) = R (G I(F )). T he definition of th e reciprocal cone can be extended to any angle 9 as follows: 28 D e fin itio n 3 .2 .2 The generalized reciprocal cone of a direction cone D for an angle 9, denoted R S(D), is defined as: R \ D ) = {/ | L{l,q) < 9, VqeD} 3 .2 .1 P r o p e r tie s o f th e re c ip r o c a l c o n e This section presents some useful properties of th e reciprocal of a direction cone. Since th e local accessibility cone is the reciprocal of a direction cone, these properties apply directly to local accessibility cones. Some of th e properties hold only for hemi- spatial cones. A cone is hem i-spatial if it is contained in an open planar half-space whose boundary passes through th e apex. M ethods for determ ining w hether a cone is hem i-spatial can be found in [Gan90]. T he proofs of some of these properties appear in [Fen53]. T he rem aining proofs are given in appendix A. P r o p e r t y 1 Let D be a direction cone consisting of a possibly infinite number of half-lines. Then, R (D ) = n ; l€D and R{D ) is closed and convex. T he local accessibility cone for a single point on a surface feature is sim ply th e half-space I associated w ith th e norm al to th e surface at th e point. T he L A C of a feature, by definition, is th e set of probes th a t locally inspect all points of th e feature, and therefore is th e intersection of th e L A C s for all th e points of th e feature, or th e intersection of all th e half-spaces I th a t correspond to th e norm als in th e G aussian im age. A direct consequence of P roperty 1 is th a t th e reciprocal of any cone is convex, because planar half-spaces are convex, and th e intersection of convex sets is a convex set. D e fin itio n 3 .2 .3 Let S be a set of points in space. Plane P is called a supporting plane of S iff P contains at least one boundary point of S and S lies entirely in one of the closed half-spaces bounded by P ([Ben66]). The half-space that contains S is called a support fo r S ([Fen53]). 29 Property 2 The reciprocal o f a direction cone D consists o f the half-lines that define the supports o f D . R (D ) = {/ | I is a support o f D } P r o p e r t y 3 Let A and B be two direction cones. Then: (1) A C . B = > R ( B ) C R{A ) (2) A = B = > R (A ) = R (B ) (3) if B is closed and convex, then A C B R (B ) C R (A ). P r o p e r t y 4 Let A and B be two direction cones. Then: R (A U B ) = R{A) n R (B ) P r o p e r t y 5 Let D be a hemi-spatial, homogeneously 3D cone. Then: R (D ) = R(OD), where dD denotes the topological boundary of D. P r o p e r t y 6 I f D is a closed, hemi-spatial, homogeneously dimensional, polyhedral cone with edges {e%,. .. , en}, then R (D ) = -R(ei) D R (e 2 ) fl... D R (en) P r o p e r t y 7 Let D be a closed direction cone. Then R (R (D )) = C H {D ), where C H {) denotes the convex hull. P r o p e r t y 8 Let D be a closed convex direction cone. Then R (R (D )) = D 30 Property 9 The reciprocal o f a closed cone equals the reciprocal o f its convex hull: R (D ) = R {C H (D )) P r o p e r t y 10 I f A and B are two closed cones, then C H {A ) C C H (B ) R (B ) C R (A ) P r o p e r t y 11 I f A and B are two closed convex cones, then R (A n B ) = C H (R (A ) U R (B )) T he following property expresses th e boundary of th e reciprocal of a convex cone D as th e set of norm als to D ’s supporting planes. A lthough this pro p erty is tru e only for convex cones, it can be used for com puting th e reciprocal of non-convex cones in conjunction w ith property 9. P r o p e r t y 12 I f D is a closed cone, then d R (D ) = {/ j 3 supporting plane II o f D such that I ± D II}, where a plane II is called a supporting plane of a cone D iff II contains at least one boundary half-line o f D and D lies entirely in one o f the closed half-spaces bounded by 11/ and I L D II denotes a half-line I perpendicular to plane II and such that I is on the same half-space defined by II as D is. T he above properties are useful for com puting L A C s. P ro p erty 1 can be used for com puting an approxim ation of L A C (F ) by sam pling F and th en intersecting th e half-spaces th a t correspond to th e G aussian im ages of th e sam pling points of F. This will produce a superset of L A C (F ), since th e definition of L A C im plies th a t we should intersect th e half-spaces for all points of F . P roperties 3, 4, 10 and 11 can be used for com puting L A C s for m ore th a n one surface feature. For exam ple, from properties 3 and 4 it follows th a t if one w ants to com pute th e L A C of th e union of two features F\ and F2, and th e G aussian im age of F2 is a subset of th a t of Fly then only th e L A C (F i) needs to be com puted. From properties 1 and 6 it follows th a t 31 LAC(ABCD) RLAC(ABCD) F igure 3.3: T he use of restricted local accessibility cone can give sharper results th a n th e local accessibility cone th e reciprocal cones for polyhedral G aussian im ages can be com puted by intersecting th e closed half-spaces th a t correspond to th e G aussian im ages’ edges. Solids w ith planar and cylindrical faces have polyhedral G aussian im ages, and therefore have easily com putable L A C s. P roperties 5 and 9 say th a t when com puting L A C (F ) th e only relevant directions are those on th e boundary of th e convex hull of G I(F ). P ro p erty 12 can be used to com pute L A C s for th e geom etric dom ain of solids th a t have planar and “n a tu ra l” quadric faces (i.e., cylindrical, conical or spherical faces), as in th e PADL-2 system [Bro82], because for th a t dom ain closed-form expressions are available for th e norm als of th e supporting planes of G I(F ). 3.3 Restricted local accessibility cone Consider th e workpiece shown in Figure 3.3, and suppose th a t th e surface feature A B C D is to be inspected. T he G aussian im age of A B C D consists of ju st one vector, th e vector z. T he local accessibility cone of A B C D is th e half-space defined by th e vector z. This m eans th a t any vector in this half-space can inspect A B C D . B ut it is obvious th a t, because of th e walls of this rectangular hole, only th e probe w ith direction 2 can inspect A B C D . For this exam ple L A C (A B C D ) does not give a useful set of probe directions. Ju st by exam ining th e surface feature A B C D very little inform ation ab o u t its local accessibility is gained. T he walls of the hole intuitively seem to be “close” enough 32 Figure 3.4: Convex edges do not indicate p o ten tial obstruction to A B C D to take p a rt in th e local accessibility analysis. This inform ation m ust be used so th a t th e local accessibility cone can be restricted to a m ore useful set of directions. T he local accessibility cone is found by taking the reciprocal of a direction cone, which is th e G aussian im age of th e surface feature. Suppose now th a t we take th e G aussian im age of th e adjacent surfaces of th e feature into consideration. Since only local accessibility is of interest, only th e G aussian im age of th e adjacent surfaces in th e neighborhood of th e com m on edge betw een the feature and th e adjacent surfaces should be considered. Intuitively, this is equivalent to considering a slightly larger feature, obtained by adding to th e original feature an infinitesim al portion of each of its adjacent faces. Figure 3.3 shows on th e right th e resulting accessibility cone, w hich is ju st th e vector z. Now consider th e workpiece of Figure 3.4. T he surface feature to be inspected is A B C D , b u t now it does not m ake sense to include th e G aussian im ages of th e adja cent surfaces of th e feature w hen calculating th e local accessibility cone of A B C D . T he adjacent surfaces of A B C D are not potential obstacles for th e probes th a t can inspect A B C D . T he difference from th e previous exam ple is th a t th e edges now are convex, instead of concave. W hen two surfaces intersect in a concave edge, one is a p otential obstacle for th e other. In case an edge is not uniform ly concave, only the concave portions of th e edge should be considered. 33 This seems a reasonable extension to the local accessibility cone. T he new cone is called th e restricted local accessibility cone, denoted by R L A C (F ) and defined as follows. Let Ei denote th e convex subset of an edge th a t results from th e intersection of a surface feature F w ith an adjacent face Ft. Define th e G aussian im age for an edge (or edge subset) E w ith respect to a face G on which it lies as th e set of norm als to G a t every point of E . i.e., G I E g ( E ) = {n ( P ) | n{P) E G , VP e E } T he definition of th e restricted local accessibility cone is as follows: R L A C (F ) = {P I Z (p,n) < 90°, Vn e G I ( F ) \ j G I E Fi(Ei)}. % For curved surfaces finding th e concave edge portions and th eir norm als m ight be com plicated, depending on th e surface representation. For p lan ar surfaces however, com puting R L A C is straightforw ard because th e edges are uniform ly concave or convex and th e norm als have a fixed direction for each face. 3.4 Feature segmentation U ntil now it has been im plicitly assum ed th a t th e local accessibility cone of a feature F is not em pty. This is not always th e case, as shown by th e 2D exam ples of Figure 3.5a. T he first exam ple shows a circular arc to be inspected and th e second, a pocket w ith non orthogonal walls. In b o th cases th ere does not exist a straight probe th a t can locally inspect th e entire features; th a t is, L A C (F ) = 0. W hen L A C (F ) is em pty, F has to be p artitio n ed in subfeatures th a t have non-em pty L A C s. This p artitio n in g is called feature segmentation for local accessibility. Figures 3.5b and 3.5c show possible segm entations for the features of Figure 3.5a. D etecting w hether a feature needs segm entation is equivalent to detecting whe th er th e L A C of th e feature is em pty, which can be done by using th e following property of R (D ): P r o p e r t y 13 Let D be a direction cone. Then (R (D ) 7 ^ 0) iff (3 closed planar half-space h such that D C h) 34 GI(Fa ) (a) (b) (c) GI(Fb) (d) Figure 3.5: Features w ith em pty local accessibility cone For exam ple, b o th of th e G aussian images of Fa and Fb in Figure 3.5d are such th a t th ere does not exist a half-space th a t contains them , so th e reciprocal cones of these G Is (L A C s of features) are em pty. A fter detecting th a t L A C (F ) is em pty, a segm entation of F m ust be generated. T here are infinitely m any ways of segm enting a feature, and therefore we need cri te ria for assessing th e quality of a segm entation. A sim ple criterion is a m inim al num ber of subfeatures. T he following observation can be used for finding a m inim al segm entation: Given a feature F any two antipodal directions, for exam ple x and —x, can locally inspect th e entire feature. T his is a consequence of th e fact th a t for any direction d G G I ( F ), d creates an angle of less th a n or equal to 90° w ith at least one of x or — x. As a result, a segm entation of F in two subfeatures each w ith G Is contained in a half-space and therefore w ith non-em pty L A C can always be found. N ote, however, th a t a subfeature generated th is way need not be a connected set. E valuating a segm entation by th e num ber of subfeatures considers th e feature in isolation from th e rest of th e workpiece. A lthough this has th e advantage of sim plicity it m ight lead to segm entations th a t are undesirable. Consider, for exam ple, th e situ atio n shown in Figure 3.6. Because of th e features Fb , Fc and Fu th e three 35 (b) (a) Figure 3.6: Using to ta l num ber of probe directions as a criterion for evaluating feature segm entation probe directions dl5 d2 and d3 m ust be used in th e final inspection plan. In order to have m inim um num ber of subfeatures for Fa a fourth probe direction m ust be in tro duced. (This happens because there does not exist a pairw ise com bination of dif d2, dz th a t can locally inspect Fa ) However, if Fa is segm ented into th ree subfeatures as shown in Figure 3.6b th ere is no need for the fourth direction. T his la tte r seg m entation is globally b e tte r th an th e earlier segm entation of Fa in two subfeatures, because it results in an inspection plan th a t uses only th ree probe directions instead of four. H ere we are using an optim ality criterion th a t im plies a m inim um num ber of probe directions in th e final inspection plan. T he problem is th a t th ere are several and som etim es contradicting criteria for evaluating a segm entation. Furtherm ore, th e knowledge for using these criteria m ay not be available at th e tim e of segm entation. For exam ple, in Figure 3.6, it is essential to know th e R L A C s of Fb , Fc and Fb before segm enting F a in order to use th e second criterion presented above. E xhaustive search for finding th e best segm entation is im possible because of th e infinite num ber of possible segm entations. B ut even when using a finite num ber of segm entations this kind of search is extrem ely expensive. H euristics, therefore, seem to be a reasonable choice for generating a segm entation th a t is “close” to th e optim al one. For exam ple, a heuristic th a t can 36 be used for th e situation of Figure 3.6 involves perform ing th e following sequence of actions: F irst com pute th e R L A C of all features th a t do not need segm entation; th en cluster th e R L A C found in th e previous step; and finally use th e result of this clustering (probe directions) to generate segm entation of features w ith em pty L A C s. From th e above exam ple it can be seen th a t for inspection planning it is not enough to decide how to generate a segm entation, b u t also when to generate it. In th e current system th e feature representation was chosen so as to allow segm entation representation, b u t segm entation is not perform ed autom atically. T he system archi tectu re is such th a t segm entation can be perform ed at any point during inspection planning, as long as th e appropriate preconditions are satisfied. 37 Chapter 4 Global accessibility 38 LAC(F) (a) ( b ) GAC(F) (c) Figure 4.1: G lobal accessibility cone Local accessibility ignores workpiece m aterial not im m ediately adjacent to th e fea tu re as well as o th er obstacles. It gives reliable results only in very uncluttered environm ents. T he study of accessibility in th e presence of obstacles is called global accessibility analysis. T he goal is to generate probe directions th a t can inspect a fea tu re w ithout colliding w ith other portions of th e p art or any of th e o th er objects in th e environm ent. T he set of all such directions is called th e global accessibility cone (GAC) of a feature. T his chapter presents properties of G A C s th a t can be used for th eir com putation. It also discusses how G A C s can be used for other aspects of the inspection process, for exam ple, for proposing setup orientations for th e workpiece. 4.1 Global accessibility cone Consider th e workpiece shown in Figure 4.1a. Let F be th e feature to be inspected. If th e only criterion for testing w hether a half-line (i.e., probe abstraction) can inspect a surface feature F is th a t this half-line is inside L A C (F ), th en I will be accepted as valid for th e inspection of F . B ut I collides w ith th e w orkpiece w hen inspecting point Q of F. Local accessibility analysis does not provide enough inform ation to avoid these situations. U ntil now a surface feature F was considered in isolation from th e rest of th e workpiece. W hen F is viewed as a p art of a workpiece W , finding a half-line for 39 inspecting F involves considerations about th e interaction of W w ith this half-line. A half-line can globally inspect a surface feature if it can inspect any point of the featu re w ithout colliding w ith th e workpiece. Hence: D e fin itio n 4 .1 .1 A half-line I can globally inspect a surface feature F iff I Iq H iW = 0, V points Q E F where i W denotes the interior of W , and I |q denotes a half-line parallel to I and with endpoint at Q. T he above definition can also be expressed as follows. A half-line I can globally inspect F iff th e intersection of th e interior of W w ith th e sweep of F over I is em pty, or m ore form ally, iff i w n (Iq f ) = 0 w here th e operator © denotes th e sweep (or M inkowski sum ) of two sets ([M at75], [Ser82]): A © B — (<z © b | a £ A, b € Figure 4.1b shows a half-line I th a t can globally inspect F , and th e sweep of F over I. (T he sweep extends to infinity; in th e figure it is shown only for a finite length of /.) T he set of all half-lines th a t can globally inspect F is called th e global accessibility cone of F. D e fin itio n 4 .1 .2 The global accessibility cone o f a surface feature F with respect to the workpiece W , denoted as G A C W (F), is the set of half-lines that can globally inspect F : G A C W(F ) = {I | l\Q n iW = 0, V points Q e F }. T he superscript W in G A C W (F) will be dropped in th e sequel w hen th e associ ated workpiece W is clear from th e context. T he global accessibility cone for feature F of Figure 4.1a is shown in Figure 4.1c. 40 GAC(F) F ’ F P W GAC(F) F'© iW | i (a) (b) Figure 4.2: G A C (F ) for th e b o tto m face of th e slot We use i W instead of W because th e cones produced include directions parallel to th e feature (for planar features), and these directions are used in practice. In some cases, using W instead of i W will produce an em pty G A C , although there exist probe directions th a t can inspect th e feature. For exam ple, if th e feature is a cylindrical through hole, th en th e two directions parallel to th e hole axis can be used to inspect th e feature. A G A C definition th a t uses W gives, in this case, an em pty G A C , whereas th e definition w ith i W gives th e two directions. T he cone of directions th a t can inspect th e feature and also can intersect w ith th e boundary of th e workpiece is th e restricted global accessibility cone. D e fin itio n 4 .1 .3 The restricted global accessibility cone of a surface feature F with respect to the workpiece W , denoted as R G A C W(F), is defined as follows: R G A C (F ) = {/ | l\P fi W = 0, V P € P } , where l\p = l\p — P. A half-line in G A C (F ) can touch th e boundary of W w hereas a half-line of R G A C (F ) cannot. Clearly the restricted global accessibility cone is a subset of its u n restricted counterpart. Figure 4.2 shows th a t th e distinction betw een G A C (F) and R G A C (F ) is im p o rtan t. All th e points of th e feature F are accessible along a vertical direction, and G A C (F ) is a vertical half-line, b u t R G A C (F ) is em pty. 41 In th e following we present a few propositions about G A C s. In th e propositions th e concept of GA C of a point is used, which is defined as th e set of half-lines th a t can inspect th e point w ithout intersecting i W . D efin ition 4.1.4 The global accessibility cone of a point Q with respect to the work piece W , denoted as G A C W{Q) , is the set of half-lines that can globally inspect Q: G A C W(Q) = {I | l\Q n i W = 0} P r o p o sitio n 4.1.1 Let F be a surface feature of a workpiece W . GAC(F) is the set of all half-lines I such that the sweep of I over F does not intersect the interior o fW : GAC(F) = {I | (I ® F) n iW = 0} T his proposition follows directly from th e definition of GAC(F). Proofs for th e next two propositions can be found in A ppendix B. P r o p o sitio n 4.1.2 Let F be a surface feature of a workpiece W . Then G A C W(F) = G A C iW9F'(0), where O denotes the origin, and F ' denotes the symmetric of F with respect to the origin. P roposition 4.1.2 says th a t G AC(F) is th e largest direction cone w ith apex at the origin th a t does not intersect th e M inkowski sum iW © F'. P r o p o sitio n 4 .1.3 Let F be a surface feature of a workpiece W . Then GAC(F) C LAC(F). 4 .1 .1 M e m b e r sh ip in G A C Testing a direction or set of directions for m em bership in a (im plicitly defined) G AC is useful for a t least two reasons. 42 • O ften a surface feature is unencum bered by global obstacles, and therefore its L A C and G A C are equal. T his can be found by testin g th e L A C for inclusion in th e GAC. If th e L A C is not to tally enclosed by th e G A C , we m ay be able to determ ine th e global obstacles th a t restrict th e accessibility. • We m ay be unable or unwilling to com pute a G A C exactly, b u t be able to sam ple th e L A C , i.e., to generate a few isolated directions known to belong to th e L A C . Testing these directions for m em bership in a G A C m ay pro vide enough inform ation about global accessibility for a planner to produce reasonable results. By definition of G A C , a half-line I belongs to G A C (F ) if th e sweep of I over F does not intersect th e workpiece interior. Therefore we m ust be able to determ ine w hether ( F © 0 CMW = 0 Boolean operations and set m em bership classification procedures are provided in m ost solid m odeling system s ([RV85]), and sweeping a half-line over a surface is easy for polyhedral surfaces, and is doable for m any curved surfaces. Testing a direction cone D for m em bership in a G A C is a direct generalization of single-direction m em bership classification. We need to sweep th e entire cone over th e feature, and find if (F@D)H i W = 0. C om putationally, this is considerably m ore difficult th a n testing a single direction. T he m ain problem is th e com putation of M inkowski sums. A lgorithm s are known for polyhedral sets, b u t we are unaw are of algorithm s for general geom etric dom ains. Therefore we m ay be forced to use approxim ations. It is easy to m odify stan d ard intersection algorithm s so as to identify th e o b ject’s faces th a t cause a non-null intersection. Thus, provided we can com pute F © D, we can find w hether a cone D is entirely w ithin G A C (F ), and we can determ ine which faces of th e workpiece co n stitu te th e obstructions if D extends outside th e G A C . 43 Figure 4.3: C om puting G AC(F) using sweeps 4.2 Computing the global accessibility cone P roposition 4.1.2 in Section 4.1 expresses th e G AC of a surface featu re F of W in term s of th e M inkowski sum F' © iW . Let O be th e origin. T hen G AC(F) is a direction cone such th at: • th e apex of G AC(F) is O; • I € GAC(F) < = > / fl (F ' © iW ) = 0 or / C c(F' 0 iW ), w here c denotes com plem ent. Figure 4.3 illustrates these relations in a a 2D exam ple. T he feature under consideration is F. T he origin is at th e m idpoint of F, so F = F'. T h e M inkowski sum F' © W is indicated by th e shaded shape. N ote th a t F' © iW is an open set, w hereas GAC(F) is a closed cone. (In the robotics literatu re, F' © iW is called th e configuration space obstacle of F w ith respect to i W .) T he G AC is a cone th a t has apex O and does not intersect th e shaded area. T he above analysis leads to th e following algorithm for com puting th e G AC of a surface feature F of a workpiece W : S tep 1: C om pute F 1, th e sym m etric of F w ith respect to th e origin. S tep 2: C om pute th e M inkowski sum F' © iW. S tep 3: C om pute th e m axim al cone th a t has apex 0 and is contained in th e 44 com plem ent of F' 0 iW . This cone is G AC (F). Steps 2 and 3 of this algorithm require fu rth er explanation. T here are no algo rith m s for com puting th e exact M inkowski sum of a rb itrary objects. W ork on th e M inkowski sum for curved convex 3D objects has been presented in [BK90]. For polyhedral objects, there exist algorithm s for com puting M inkowski sum s ([Gho86], [GS86], [Kau93]). Hence one solution, for th e general case, is to approxim ate th e object by a polyhedron and th en com pute an approxim ation of th e M inkowski sum. Step 3 is essentially th e sam e as com puting th e silhouette of a set as seen from th e apex of th e cone. C om puter graphics techniques can be used for solving this problem . T here are several im provem ents th a t can be m ade to this algorithm , especially w hen com puting th e M inkowski sum F ' 0 iW . M uch of com putational effort is spent to find th e correct topological boundary of th e M inkowski sum. T his happens because th e M inkowski sum algorithm s work in two stages. In th e first stage a collection of surfaces is generated. P ortions of these surfaces lie on the boundary of th e M inkowski sum , and other portions in th e interior of it. In th e second stage, th e subsets in th e interior are identified and elim inated, and th e rem aining surface subsets are assigned th e correct adjacency inform ation. Since we are interested only in th e silhouette of th e M inkowski sum , extraneous surfaces generated in th e first stage do not m atte r, because they are in th e interior of F' © i W . H ence th e entire second stage of th e M inkowski sum com putation can be om itted. T h e algorithm can be im proved fu rth er by noticing th a t not all faces of W have to be considered, because some faces cannot be obstacles for F. A sim ple test for finding th e p o ten tial obstacle faces for a planar feature F , is to intersect W w ith th e planar half-space defined by F and th e outw ard norm al to th e workpiece at F . Only th e faces in th e intersection can be obstacle faces, and they are th e only ones th a t need to be swept over F'. M ore generally, one could sweep th e L A C (F ) over F and identify as potential obstacles th e faces th a t intersect w ith this sweep. C h ap ter 5 presents an im plem ented algorithm th a t com putes G A C s for polyhe dral p arts and incorporates some of these im provem ents. 45 $8 Figure 4.4: Segm entation for global accessibility 4.3 Feature segmentation T here are situations w here th e G A C of a feature is em pty; for exam ple, in Figure 4.4 G A C (F ) — 0 because of th e th ree obstacles 0 \, O 2 and O 3 . O ne approach for solving this problem is to p artitio n th e feature into subfeatures, each w ith a non em pty G A C . A p artitio n satisfying this property is called a segmentation for global accessibility. In Figure 4.4 such a segm entation of F into two subfeatures Fx and F 2 is shown. We discussed in Section 3.4 feature segm entation w hen a L A C is em pty. There is always a segm entation for local accessibility, b u t a segm entation for global acces sibility m ay of m ay not exist. For exam ple, if O 2 is bigger in Figure 4.4, as shown by th e dashed line, th e points near th e left vertex of F cannot be inspected at all, and therefore no segm entation for global accessibility exists. G lobal accessibility depends on th e positions and shapes of all th e objects in the environm ent, w hereas local accessibility depends only on th e feature shape. This m akes segm entation m uch h ard er for global th an for local accessibility. B ut several o th er problem s are shared betw een th e two segm entation operations: (a) represent ing an infinite num ber of segm entations, (b) establishing criteria for com paring seg m entations, (c) conflicting criteria, and (d) placem ent of th e segm entation operation in th e overall plan. 46 A sim ple approach to feature segm entation is to recursively subdivide th e feature F (e.g. in quadtree fashion) u n til all th e segm ents of F have a non-em pty G A C , or a given resolution is reached. A t th a t point, if th ere exists a subfeature w ith em pty G A C th e algorithm fails. If a successful feature subdivision is found, th e G A C s of th e subfeatures are intersected and subfeatures th a t can be inspected w ith th e sam e directions are grouped together. In addition, th e num ber of these subfeature groups is m inim ized. G rouping subfeatures is an instance of th e minimum clustering problem discussed in Section 7.4. This subdivision and clustering m ethod has th e advantage of using two existing algorithm s, for global accessibility and for clustering. A utom atic feature segm entation has not been im plem ented in our experim ental system , b u t th e inspection plan representation has been chosen so as to allow feature segm entation. 4.4 Finite length probes In this section we exam ine probes w ith finite length. A probe of length d is rep resented by a line-segm ent of length d. Such a probe can also be expressed as th e points of a half-line I whose distance from th e endpoint of th e half-line is less th an or equal to d. As in th e case of sem i-infinite probes, th e endpoint of th e half-line is not included in th e probe abstraction. A straight probe of length d is denoted by Id- T he form al definition of Id is as follows. h = {P I P & I and \0P\ < d}, w here / is a half-line, 0 denotes th e origin, and \0P\ denotes th e distance betw een O and P. Let F be a surface feature of a workpiece W , and assum e th a t th ere are no other obstacles in th e environm ent except for W . T he G A C of th e featu re F for a probe of length d is analogous to th e G A C for half-lines. D e fin itio n 4 .4 .1 The global accessibility cone of a surface feature F with respect to the workpiece W for a straight probe with length d, denoted as G A C f^iF ), is the 47 set of directions of a finite length probe Id that can inspect all points of F without colliding with the interior o fW , i.e., G A C Y {F ) = {/ I ld|g n iW = 0, VQ € F} T he superscript W in G A C W(F) will be dropped w hen th e associated workpiece W is clear from th e context. Definitions for th e restricted GACd> and for GACd of a point Q also are sim ilar to th eir co u n terp arts for sem i-infinite probes: R G A C f ( F ) = {I | ld\Q n \ V = Q,VQe F}, w here ld\Q = ld ~ Q G A C f (Q ) = {l | /j|Qn tW = 0 } T he next two propositions for G A C s for finite length probes are sim ilar to the propositions 4.1.1 and 4.1.2 for infinite probe G A C s. P r o p o sitio n 4.4.1 Let F be a surface feature of a workpiece W . G A C Y (F) is the set of all half-lines I such that the sweep of Id over F does not intersect the interior of W : GACd(F) = {I | (ld ® F) n iW = 0} This proposition follows directly from th e definition of G A C Y (F ). Proofs for the propositions th a t follow can be found in A ppendix B.1.4. P r o p o sitio n 4.4.2 Let F be a surface feature of a workpiece W . Then G A C Y (F ) = G A C l dWeF'(0), where O denotes the origin, and F' denotes the symmetric of F with respect to the origin. T he following propositions relate GACd to G A C for infinite probes. P r o p o sitio n 4.4.3 Let F be a surface feature of a workpiece W . Then G A C W(F) C G A C Y (F ) 48 (iW ® F ’) C\B (O, d) B(Ot d) iW © F' Figure 4.5: GAC for finite length, probes P roposition 4.4.3 can be easily derived from th e definitions of GA C and GACd as follows. Let / be a half-line in G A C W(F). From th e definition of GAC, 1\ q H iW = 0, for all points Q of F. Since ld\Q is a subset of /|q , it follows th a t ld\Q L\iW = 0, for all points Q of F, and therefore I belongs to G A C Y (F ). P roposition 4.4.3 is useful for certain applications w here one can (pessim istically) replace GACd by GAC, which is easier to com pute. P r o p o s itio n 4 .4 .4 Let F be a surface feature of a workpiece W . Then G A C Y (F ) = R G A C (iW®F')nB(°’d)( 0 ), where 0 denotes the origin, F' is the symmetric of F with respect to the origin, and B (0 , d) is a sphere with center at O and radius d. P roposition 4.4.4 says th a t G A C Y (F) equals th e R G A C of th e origin, when th e obstacle is th e intersection of iW ® F' and a sphere of radius d centered at th e origin (Figure 4.5). A direct consequence of this proposition is th a t even if W is a polyhedron, G A C Y (F) need not be a polyhedral cone, because, in general, (iW © F') D B ( 0 , d) is not a polyhedron. P roposition 4.4.4 can be directly tra n slated into an algorithm for com puting G A C Y (F ). T he algorithm is sim ilar to th a t for com puting G A C s, presented in Section 4.2, and can be briefly described as follows. S te p 1: C om pute F', th e sym m etric of F w ith respect to th e origin O. S te p 2: C om pute th e M inkowski sum F' © i W . 49 S te p 3: Intersect F' © iW w ith B (0 , d), w here B ( 0 , d) is a sphere w ith radius d and center th e origin. S te p 4: C om pute th e m axim al cone w ith apex at th e origin th a t is contained in (iW © F') fl B (0 , d). T he com plem ent of this cone is G A C Y(F ). T h e m ain difference betw een th e above algorithm and th e algorithm of Section 4.2 is th a t w hen com puting GACd an additional step is required for intersecting F' © iW w ith B (0 , d). M ore im portantly, in order to com pute this intersection, the exact boundary of F' ® i W m ust be available. However, as explained in Section 4.2, m ost of th e M inkowski sum algorithm s work by first com puting a superset S of the boundary of F' © i W , and th en elim inate th e portions of S not in d{F' © iW). This set S is th e sam e set used for com puting th e G A C . Therefore, we can reuse th e set S from th e G A C com putation, and perform th e additional m anipulations needed for com puting GACd- If only polyhedral cone operations are available, th en B ( 0 , d) can be approxi m ated by a polyhedron. If th e approxim ation polyhedron entirely contains B ( 0 , d), th e cone generated is a subset of th e actu al G A C Y(F). Accessible directions com p u ted by such a pessim istic approxim ation are valid, b u t not all accessible directions m ay be found by this approach. 4.5 Bent probes A b en t probe consists of several com ponents connected in an open chain. Each com ponent is axially sym m etric and th e axes are pairw ise non-collinear. T he first probe com ponent is th e com ponent th a t carries th e tip. In this work only probes w ith two com ponents are studied (Figure 4.6a). T he assum ptions m ade for th e com ponent geom etry are th e following: (a) a com ponent can be either cylindrical, conical or spherical, (b) th e length of th e first com ponent is finite, (c) th e length of th e second com ponent is infinite. T he com bination of th e ram and a probe w ith stylus not aligned w ith th e ram , as in an orientable probe, can also be considered a b en t probe, w ith th e ram being th e second com ponent. T he infinite length assum ption is analogous to its co unterpart for straig h t probes and has a sim ilar justification. 50 probe representation second component first component real probe Figure 4.6: Tw o-com ponent bent probe representation A tw o-com ponent b ent probe can be represented by th e length of th e first com po n en t, denoted by d , and by th e angle betw een th e two com ponents, denoted by 9. To express th e orientation of th e probe relative to th e p art th ree param eters are needed th a t correspond to th e th ree rotational degrees of freedom of th e probe. Therefore, th e to tal num ber of param eters needed is five. An altern ativ e representation for a ben t probe which includes the probe orientation w ith respect to th e p a rt and which is m ore sim ilar to th a t used for straight probes is th e trip le (h,d, l2), w here l\ and I2 are th e half-lines th a t correspond to th e directions of th e two com ponents, and d is th e length of th e first com ponent (Figure 4.6b). Since l\ and I2 are half-lines, two param eters are needed for each of them , hence th e to ta l num ber of param eters needed for th is representation is again five. To inspect a surface featu re F, a bent probe p m ust reach all points of F w ithout colliding w ith th e workpiece interior. This is a necessary condition, called accessibil ity condition, sim ilar to its straig h t probe co unterpart, and which can be expressed as follows. (A probe p is assum ed to have constant length d and fixed directions U and l2 on th e G aussian sphere.) D efin itio n 4.5.1 A probe p satisfies the accessibility condition for a feature F of a workpiece W if and only if (p © F) n iW = 0, where p 0 F is obtained by positioning the tip of the probe p at all points of F. 51 w Figure 4.7: A pproach condition T his condition is not enough, as shown by th e exam ple of Figure 4.7. A lthough th e accessibility condition is satisfied, F cannot be inspected by p because th ere is no way to tran slate p from a position far from W to a position w here p touches F. To be able to inspect F by p, th e approach condition m ust be satisfied. This condition states th a t th ere exists a p a th along w hich th e probe can move so th a t it reaches F from some point far from th e workpiece. To form alize this condition we use th e bounding sphere of a workpiece W , denoted as Sw, and defined as th e solid spherical ball w ith th e m inim um diam eter th a t contains W. Now th e approach condition can be stated as follows. D efin itio n 4.5.2 A probe p satisfies the approach condition for a feature F of a workpiece W if and only if there exists a curve c, connecting point Q in F and point R not in Sw> such that for all points A in c p \ a n i w = 0. C om puting all th e bent probes th a t can inspect a surface feature is m uch harder th a n th e corresponding problem for straight probes. N ot only th e accessibility prob lem m ust be solved for a larger num ber of param eters (5 for bent probes, 2 for straig h t), b u t also the additional approach condition m ust be satisfied. T he ap proach condition is always satisfied autom atically for straig h t probes, since a p ro b e’s approach along a globally accessible direction is collision free. O n th e o th er hand, it is clear from Figure 4.7 th a t m otion along th e direction of th e second com ponent of a ben t probe th a t satisfies th e accessibility condition m ay cause collisions w ith th e workpiece. To take a tru ly least com m itm ent approach to bent probes would 52 X Figure 4.8: D ependency of second com ponent direction on first com ponent length require replacing dim ensional cones w ith 5D entities th a t cap tu re th e orientation and geom etry of th e probes. O ur exploratory investigation of such an approach had unprom ising results. 4 .5 .1 C o n v e x G A C an d b e n t p r o b e s If th e G A C of a feature F is a convex cone, th en it can be proven th a t a bent probe w ith first and second com ponent directions taken from th e G A C (F ) satisfies b o th th e accessibility and approach conditions for th e feature F (for proofs see A ppendix C). N ote th a t this is tru e for a first com ponent of any length. T his construction does not cover th e entire spectrum of th e b ent probes th a t can inspect th e feature. T he second probe com ponent can have o ther directions th a t do not belong to G AC (F). These directions depend on th e length of th e first com ponent. For exam ple, in Figure 4.8 G A C (F ) is convex and consists of ju st th e direction y. For th e th ree lengths of th e first com ponent, efi, d2 and d3, th e directions of th e second probe com ponent are given by th e th ree cones D \ , Z)2 and Z)3 respectively. For th e case of a G A C th a t is not convex, one can com pute a convex subset of the G A C and th en use this subset for determ ining directions of th e probe com ponents. T his m ethod produces correct results b u t doesn’t com pute all th e possible solutions. 53 iW © F ' P Pi P3 (C) F’ (b) (a) Figure 4.9: B ent probes th a t do not intersect iW © F' 4 .5 .2 B e n t p r o b e s, a c c e s s ib ility c o n d itio n , a n d i W © F ' In th is section we only discuss ben t probes th a t satisfy th e accessibility condition (i.e., we ignore th e approach condition), and we show th a t such probes are com pletely specified by th e sweep iW © F'. P r o p o sitio n 4.5.1 A probe p satisfies the accessibility condition for a feature F of a workpiece W , if and only if p\o does not intersect F' ® i W , where p\o denotes the probe p positioned so that its tip coincides with the origin. P roposition 4.5.1 is tru e for probes of any shape (not ju st ben t probes w ith two com ponents). A proof of this proposition follows; Figure 4.9 illu strates th e proof. Let p be a probe th a t satisfies th e accessibility condition for th e surface feature F . This m eans th a t as p tran slates along F , p does not intersect i W , i.e., (p © F) fl iW = 0. A lternatively, when p is a t th e origin, F positioned at any point x of p does not intersect iW (Figure 4.9b). Using properties of sweeps, this la tte r relation im plies th a t x does not belong to iW © F ‘, w here F' is th e sym m etric of F w ith respect to th e origin. Therefore, when p is positioned at th e origin, it does not intersect i W © F'. (A sim ilar form al proof is given for straight probes in A ppendix B.1.1.) For sim plicity, in Figure 4.9b th e origin is a point of F; in general, th e origin does not need to be on F. 54 o spherical joint prismatic joint d!2 A B (a) (b) (c) Figure 4.10: B ent probes and m anipulators Figure 4.9c shows th ree bent probes, p i, p2, and p3, (w ith tw o com ponents each) th a t satisfy th e accessibility condition for F and W as in Figure 4.9a. A ben t probe can be represented by th e length d of th e first com ponent plus four orien tatio n angles, two for each com ponent. T hese param eters define a 5- D configuration space for th e probe. By proposition 4.5.1 a probe p satisfies th e accessibility condition w ith respect to a face F if p does not intersect i W © F ' when th e probe tip is positioned at th e origin. T he set of all probes th a t satisfy the accessibility condition for F is a region of th e 5-D configuration space introduced above. T his region can be com puted, at least in principle, by recasting th e problem in term s of robot m anipulation. A ssum e, initially, th a t th e length of th e p ro b e’s first com ponent is fixed and equals d. A b ent probe can be associated w ith an articu lated m anipulator, w ith two links, Li and L 2, th a t correspond to th e first and second probe com ponents (Figure 4.10a). T h e link L x is a line segm ent of length d, and L 2 is a half-line. Each link has tw o ro tatio n al degrees of freedom . L x and L 2 are connected by a spherical joint. T he base of th e robot is attach ed to th e origin by a spherical jo in t, and th e obstacles are i W © F f. Each configuration of this robot corresponds to a specific bent probe. By P roposition 4.5.1 a probe p satisfies th e accessibility condition for F iff its associated robot in th e corresponding configuration does not intersect th e obstacle i W © F f. Therefore, th e en tire set of probes th a t satisfy th e accessibility condition is 55 precisely th e free space of th e associated 2-link, spherical-joint m anipulator, i.e., th e set of all robot configurations for which th ere does not exist collision w ith i W © F'. To capture th e variable length of th e first com ponent we need to introduce addi tional degrees of freedom in th e robot above. One way to do th is is to divide the first link Li, into two links, L[ and L ", of length d /2 each, w ith a prism atic joint betw een th e two new links (Figure 4.10b). This robot represents all b en t probes whose first probe com ponent has length betw een d /2 and d. To get a larger range of lengths, th e links could be divided further. W hen introducing new degrees of freedom , p articu lar care has to be taken to cap tu re th e fact th a t th e first probe com ponent “collapses” onto itself. T h a t is, th ere should not be p arts of th e robot th a t do not correspond to th e probe. For exam ple, if a prism atic link is added to th e endpoint of th e second link, as in Figure 4.10c, th en th e segm ent A B of th e robot does not correspond to any p art of th e probe. This parallel to robotics is im p o rtan t because it allows us to use th e classical m otion planning techniques for generating bent probes. In principle, we could w rite th e equations of th e boundary of th e configuration obstacle for th e robot, com pute an explicit representation for its free space, and use these free spaces for planning, instead of ju st GACs. T he advantage of this approach is th a t it works directly on th e 5D space of th e probe and captures all solutions. T h e disadvantages are th a t it is expensive because of th e high dim ensionality of th e space, and th a t it needs approxim ations and a special representation for th e obstacles. For exam ple, in [Hwa90] th e obstacles are represented as trian g u lar faces. In th e following we present a different approach for com puting bent probes. Essentially, we divide th e problem into subproblem s th a t can be solved in spaces of lower dim ensions, and then com bine th e p artial solutions to get th e entire space. T he disadvantage of this approach is th a t it does not produce th e entire spectrum of solutions. T he advantages are th a t it works in th e 2D space of cones, it does not need a specialized representation (we use th e fam iliar boundary representation - B rep), and it reuses results from th e G A C com putation. 56 4 .5 .3 C o m p u tin g b e n t p ro b es In th e following sections we describe a few m ethods for com puting b ent probes. T he approach is as follows. We fix th e length of th e first probe com ponent and com pute directions for th e two com ponents th a t satisfy th e accessibility condition. T hen we te st these directions for th e approach condition. T his approach can be rep eated for discrete values of th e first com ponent length to generate b ent probes w ith different first com ponent length. This is reasonable for practical situations w here th ere is only a finite set of probes. O ur approach has th ree steps: (a) com putation of th e first com ponent directions th a t satisfy th e accessibility condition, (b) generation of th e second com ponent di rections th a t satisfy th e accessibility condition, (c) testing th e directions generated by th e previous steps for th e approach condition. T he cone D x of directions of th e first com ponent can be com puted using th e algorithm for com puting G A C s for fi n ite length probes (Section 4.4). This can be done because th e length of th e first com ponent is fixed. We avoid working on th e 4D space of pairs (lx, 1 2), w here l\ and I2 are directions of th e first and second com ponent, respectively. Instead, we generate th e directions h and I2 independently, so th a t we can work on th e 2D space of direction cones. In th e sequel we use S to denote th e superset of th e boundary of i W © F ' , o u tp u t by th e first stage of th e M inkowski sum com putation (Section 4.2). If W is a polyhedron, S' is a collection of polygons (Section 5.2). 4 .5 .4 S e c o n d c o m p o n e n t d ir e c tio n s Two m ethods for com puting th e directions of th e second com ponent are described below. T h e first m ethod generates all possible directions, and th e second a subset of these directions. 4 .5.4.1 S econ d co m p o n en t d irection s and w eak accessib ility T h e directions of th e second com ponent are com puted after the directions of th e first com ponent have been generated by the techniques of Section 4.4. Let F be the feature under consideration, d th e length of th e first com ponent, and D x th e cone 57 £ > „ = WGAC1 D n = GAC F' sphDj W F’ F (a) (b) (c) Figure 4.11: C om puting directions for th e second com ponent of first com ponent directions. Consider th e exam ple of Figure 4.11a. As th e first com ponent (or th e first link of th e associated robot) traverses D\, th e endpoint of th e second com ponent traverses sphD \ , th e spherical portion of th e tru n c ated D\ for length d. Form ally, sphDi = D i fl d B ( 0 , d), w here B ( 0 , d) is th e closed 3D ball w ith center at O and radius d. Let Di be th e set of directions h of th e second com ponent such th a t a probe (hid, h ) satisfies th e accessibility condition for some direction h of th e first com po nent in D\. A ccording to th e analysis of Section 4.5.2, I2 does not intersect i W ©i*1 '. Therefore, to com pute D 2 we have to com pute all half-lines th a t do not intersect i W © F ' w hen th eir endpoint is on sphDi. In o ther words, D 2 is a direction cone such th a t for any half-line h in D 2 there exists a point Q of sphD\ such th a t h\q does not intersect i W © F ‘, i.e., D 2 = {/ I 3Q e sphDi : l\Q n (iW © F') - 0} (a) Z>2 can be expressed by using th e concept of weak G A C , defined as follows. D e fin itio n 4 .5 .3 Let O and G be two sets of points (G stands for goal, and O for obstacle). The weak global accessibility cone of G for obstacle O, denoted by W G A C °(G ) is the set of all half-lines I such that for each I there exists a point Q of G for which 1\ q does not intersect the interior of 0 . W G A C °(G ) = {l \ 3 Q z G : /|Q n iO = 0} 58 N ote th a t if G is a single point Q th en W G A C ° (Q ) = G A C °(Q ). Also W G A C °{G ) = U vQ€GG A C °(Q ). This relation can be derived from th e definitions of W G A C and G A C as follows. Let I be a half-line in W G A C °{Q ). I £ W G A C ° (Q ) if and only if th ere exists a point Q of G such th a t 1 \ q DiO = 0, or, equivalently, if and only if th ere exists point Q of G such th a t I £ G A C °(Q ). B ut this is tru e if and only if I belongs to th e union of G A C °(Q ), for all Q £ G. T he cone D 2 can now be expressed as th e weak G A C of sphD\ w ith respect to th e obstacle i W © F': D 2 = W G A C iWeF’(sphD i) = {l\3Q £ sphD1 : l\Q n i{iW © F') = 0} Figure 4.11a shows th e cone D 2. N ote th a t th e expression above differs from the definition (a) of D 2, in th a t it requires an additional interior operation applied to {iW © F'). However, this is not a problem because i W © F' — i(iW © F'). This la tte r relation follows from P ro p erty 111-17 in [Ser82], which states th a t if A is open and B is com pact th en A © B is open, and from P ro p erty 2.6.4 in [RT78] which states th a t a set A is open iff A = iA. In our case, iW is open and F' is com pact, therefore i W ffi F' is open, and consequently, i W © F ' — i(iW © F'). T he concept of weak accessibility is related to th a t of weak visibility region. T he weak visibility region of a goal G in th e presence of obstacle O is th e set of all points from which at least one point of G is visible ( [ 0 ’R87]). Therefore, W G A C ° (G ) is th e set directions th a t correspond to th e points at infinity th a t belong to th e weak visibility region of G. T he weak visibility problem has been solved for polygons in 2D ( [ 0 ’R87]). In 3D th e problem has been solved for th e special case w here th e goal is a convex polygon o b stru cted by a sequence of planes th a t have convex holes ([TeI92]). Also related to th e weak accessibility problem is th e concept of backprojections. Given a goal G and an obstacle 0 th e backprojection problem is to com pute a cone C for each point P in the weak visibility region of G in th e presence of O, w here C is th e cone of directions along which at least one point of G is visible from P. 59 Therefore, W G A C °(G ) is th e union of all such cones for points a t infinity. An algorithm for th e backprojection problem for 2D polygonal scenes is presented in [BD94]. To th e best of our knowledge, th ere is no known algorithm for solving th e backprojection problem for th e general 3D case. In stead of solving th e general weak accessibility problem we can sam ple th e goal, sphDi in our case, and com pute th e G A C of discrete points w ith respect to i W © F '. T he union of all these G A C s is a low er-bound (pessim istic) approxim ation of th e W G A C of th e goal sphD\. Let Q be a point of sphDi and S be th e superset of th e boundary of i W 0 F ', as described in Section 4.5.3. T hen, G A C tW®F'{Q) is th e com plem ent of th e silhouette of S as seen from Q. Therefore, to com pute an approxim ation of Z)2, we can use th e results of th e sweep com putations perform ed for G A C W(F). T h e disadvantage of this approach is th a t it does not generate th e pairs (/1 } /2), l\ £ D\, l2 € D 2 , th a t satisfy th e accessibility condition. T h a t is, it does not specify th e coupling betw een D\ and D2. However, if one direction is chosen eith er from Di or Z)2, th en th e com patible directions for th e other com ponent can be generated. Suppose th a t a direction l\ is picked from D\ to be th e direction of th e first probe com ponent. T h e directions of th e second com ponent th a t are com patible w ith li are given by th e G A C of th e point w here /1 intersects sphDi (the obstacle for com puting this G A C is i W © F'). If one direction /2 is chosen from D 2, we can find th e set of directions of D\ com p atib le w ith l2 as follows (Figure 4.11b). P ro ject sphD\ on a plane n perpendicular to I2 a t some distance “far enough” from i W © F '. T he portion of sphD\ th a t is projected on th a t plane w ithout being o b structed by iW © F ', defines th e subset D[ of D\ th a t is com patible w ith /2- T h a t is, every b ent probe (h,d, /2), l\ € satisfies th e accessibility condition for F. This sim ple algorithm is based on th e observation th a t as /2 traverses sphDi, /2 should not collide w ith i W © F' in order for th e accessibility condition to be satisfied. In our inspection planning system th e directions of th e first com ponent corre spond to probe directions used for inspecting features, and th e directions of th e second com ponent correspond to setup orientations. Therefore, choosing /1 or /2 reflects considerations of m inim izing probe and setup changes, and depends on th e planning algorithm (C hapter 7). 60 4.5 .4 .2 Second com p on en t d irection s and global a ccessib ility Let Di and D 2 be two direction cones. D 2) denotes th e set of b en t probes whose first com ponent length equals d , and whose first com ponent direction is in Di, and second com ponent in D 2. (D \ , d, D 2) = {p = (/1 , d, h) I h € D x, l2 6 D 2} T he goal in th e previous section was to com pute a cone D 2 such such th a t there exists a b en t probe p in (Di,d, D 2) th a t satisfies th e accessibility condition. In this section we present a different approach, w here D\ is com puted as before and the goal is to com pute a D 2 such th a t for all probes p in (D^, d, D 2), p satisfies th e accessibility condition. This is a w orst case analysis th a t generates a subset of all possible directions of th e second probe com ponent. T he cone D 2 in this case is the G A C of sphDi, w hen th e obstacle is iW 0 F'. T h a t is, D 2 = G A C 1 ™®*"(sphDi). Figure 4.11c shows D 2 for this case and some of th e positions of th e sym m etric of sphDi th a t specify th e lim iting rays of D 2. To com pute th e above G A C th e surface feature sphD 1 m ust be tre a ted as a tra n sp aren t feature, th a t is, points of sphD\ are not obstacles to o th er points of sphDi. T he algorithm th a t com putes th e G A C of a feature F by sweeping the sym m etric of F over th e obstacle m akes no assum ptions on w hether th ere is m aterial associated w ith F, and therefore can be used for com puting th e G A C of a tran sp aren t feature. G A C s of tran sp aren t features need not be contained in a closed half-space. T h e im plem ented G A C algorithm , described in C hapter 5, can deal w ith such G A C s and w ith tran sp aren t features. If sweep com putations are only available for polyhedra, th en sphD\ can be ap proxim ated by a polygonal feature. A lternatively, sphDi can be approxim ated by a polyhedron. If this polyhedron com pletely encloses sphDx , th e n th e G A C com puted is a subset of th e actual GAC. T he approxim ating solid is viewed as a tra n sp a r ent volum e, th a t is, points in it are not considered as obstacles. It can be shown (A ppendix B.1.3) th a t th e G A C of a tra n sp aren t volum e equals th e G A C of the volum e’s boundary, w hen this boundary is tre a te d as a tran sp aren t surface. T here fore th e G A C of a tra n sp aren t volum e can be com puted by evaluating th e G A C for each face of its boundary and intersecting th e results. 61 A problem w ith this approach is th a t it requires th e com putation of th e sweep of sphDi over i W ® F '. This com putation can be perform ed by sweeping sphDi over 5 , w here S is th e superset of d{iW@ F'), used for com puting G A C s for infinite probes - Section 4.2. In this case we generate a superset of th e boundary of sphDi ® (i W ® F '). T his does not affect th e cones com puted, because as in th e case of infinite straight probes, we are only interested in th e silhouette of th e sweep, ra th e r th a n th e exact sweep boundary. 4 .5 .5 A p p r o a c h c o n d itio n In th is section we discuss how th e approach condition can be tested for b ent probes th a t satisfy th e accessibility condition. We s ta rt w ith th e sim ple case of a single bent probe p = (h-idih) to be tested , and extend th e approach to th e case w here £ and £ are cones. T he m ost general approach is to use m otion planning techniques for checking w hether th ere exists a p a th th a t takes p from some point P “far from ” W , to some point of F. These techniques, however, are very expensive. In th e following we present som e m ethods th a t use G A C com putations to check th e approach condition for special types of paths. We fix a point Q of F and assum e th a t th e final probe position is such th a t th e probe tip is positioned at Q. N ote th a t it suffices to prove th a t a single point Q of F can be approached, because th e accessibility condition ensures th a t all th e other points of F can be reached by m oving th e probe in contact w ith F. T h e sim plest ty p e of p a th is a straight line. A probe will be able to reach p \ q by m oving along a direction I iff p \ q ® I doesn’t intersect i W , i.e., if I € G A C W { p \q ) (Figure 4.12a). T he sweep calculations involved for com puting G A C W { p \q ) are sim ple, because p consists of ID sets. A nother ty p e of p a th consists of two straight line m otions; we call such paths tw o-step p aths. O bserve th a t in a tw o-step p a th defined by a segm ent Li and a half-line L 2 each point P of p \ q will follow a tra je cto ry th a t consists of a tran slated version of ( £ 1 , £ 2 ) positioned such th a t th e free end point of £ x is at P. T he m otion is collision free if this swept volum e does not intersect i W . B u t th e swept volum e is precisely th e sam e as th a t swept by a fictitious probe c w ith com ponents £ 1 , £ 2 as it inspects p\q. Therefore p ’s approach is collision free if th e bent probe 62 ] p\ 0 ® / n iW = 0 I (a) (b) (c) Figure 4.12: A pproach direction for single b ent probe c — (Li, L 2) can inspect p \ q (Figure 4.12b). N ote th a t th e ben t probe c m ust satisfy th e accessibility condition only, and collisions w ith p \ q itself are ignored. Therefore we can use th e m ethods presented in th e previous sections to com pute c. A special ty p e of tw o-step p ath is th a t given by th e probe itself, described as follows. F irst tra n sla te p along l\ by a distance d, and th en along l2. As p traverses li, its second com ponent traverses th e 2D shape A (Figure 4.12c). N ote th a t A is also traversed by th e first probe com ponent as th e probe moves along l2. Therefore, we only have to check w hether A intersects W , or, equivalently w hether l2 belongs to th e G A C w (lt(d,2d)), w here li(d,2d) is th e portion of l\ w ith length betw een d and 2d - th e line segm ent R T in Figure 4.12c. This m ethod can also be used for distances other th a n d for th e first probe translation. It is usually cheaper to com pute A fl W th a n G A C w (h{d,2d)). Now consider th e case w here a set of bent probes is to be tested for th e approach condition. Let th is set be B = (D j, d,l2), w here D i is a direction cone. Also assum e th a t any probe in B satisfies th e accessibility condition. (If this is not th e case, th en we can use th e m ethod of Section 4.5.4.1 to elim inate th e invalid directions.) A straig h t line p a th I is collision free for every probe in B iff th e sweep G ® / does not intersect i W , w here G is th e union of all th e probes in B (Figure 4.13a). B ut this is equivalent to / G G A C W{G). (G is th e union of D\ tru n c ated at d , and th e sweep of l2 over sphD\.) Sim ilarly, th e tw o-step p ath s are given by th e b en t probes th a t can inspect G w hen th e obstacle is W . N ote th a t G m ust be tre ate d as a tran sp aren t volum e. 63 Dj(d, 2d) (a) (b) (c) (d) Figure 4.13: Checking th e approach condition for sets of b ent probes T he special case tw o-step p ath , w here th e probe first moves along /i by d and th en along l2 can also be extended to B = (D i,d ,l2). In this case we have to check w hether l2 belongs to G A C W (Di(d, 2d)), w here Di(d,2d) is th e portion of th e ball defined by D\ for radius betw een d and 2d (Figure 4.13b). N ote th a t if D\(d,2d) intersects W , th en we can elim inate th e directions of Di th a t cause th e intersection to produce a new cone and proceed w ith th e above analysis using th e new cone D[ (Figure 4.13c). T he above analysis can also be applied w hen b o th th e first and th e second probe com ponent are sets. Let B = (D\, d, D 2), w here Di and D 2 are direction cones. G is again th e union of all probes in B , th a t is, G is th e union of D\ tru n c a te d at d, and th e sweep of D 2 over sphD\ (Figure 4.13d). T h e analysis proceeds as in th e previous cases. 4 .5 .6 S u m m a r y o f a lg o r ith m s for b e n t p r o b e a n a ly sis In th is section we discuss how one can chose am ong th e b en t probe algorithm s of th e previous sections w hen perform ing inspection planning. For each algorithm we present situations (or heuristics) under which th e algorithm is m ost likely to produce useful results. T hese heuristics are necessary from a practical point of view, because we do not have a single “b est” bent probe algorithm . N ote th a t “b e st” in th e context of inspection planning m eans an algorithm th a t produces a large num ber of solutions in a sm all am ount of tim e (two typically contradictory requirem ents). 64 Let F be th e surface feature for which we w ant to com pute ben t probes. D\ and Z>2 denote th e cones for th e directions of th e first and second probe com ponent, respectively. T h e sim plest algorithm for com puting b ent probes for F is to com pute th e m axim um convex subset C of GAC(F), and set D\ = C and D 2 = C . As seen in Section 4.5.1 b ent probes whose com ponents are tak en from D\ and D 2 satisfy b o th th e accessibility and approach condition. This is a reasonable approach w hen C is sufficiently large. (P lan ar datum s typically have large convex GAC s.) O therw ise (i.e., if C is a sm all cone), th e bent probes generated from C are likely to be probes whose angle betw een th e first and th e second com ponent is close to 180°, th a t is, alm ost straig h t probes. A possible m easure for th e size of a cone is th e area of th e subset of th e u n it sphere th a t corresponds to th e cone. If th e cone C is too sm all, th e next least expensive algorithm is to choose a length d and a direction li for th e first probe com ponent and com pute th e cone D 2. In th is case D 2 is th e GAC of a single point (Section 4.5.4). /j can be sim ply chosen according to th e feature ty p e (e.g., hole, slot), or by a m ore com plicated process such as clustering th e cones D\ of all th e features. A nother approach for bent probe com putation is to choose d and l2 (w here l2 is th e direction of th e second probe com ponent) before choosing l\. Typically, this is done w hen D 2 represents th e setups of th e workpiece, and a good choice of l2 is critical because it results in few setups. T he algorithm in this case is as follows: (a) com pute D i, (b) com pute D 2, (c) choose I2 from D 2, and (d) com pute D[, th e subset of D\ th a t is com patible w ith l2 (Section 4.5.4.1). In step (a) two possible cones for D\ are GAC(F) and GACd(F). Using GAC(F) is less expensive, b u t GACd(F) is usually a superset of GAC(F), and th u s results in larger D 2 cones. T he cone D 2 in step (b) can be com puted either as a WGAC or a GAC of a spherical surface (Sections 4.5.4.1 and 4.5.4.2, respectively). U sing WGAC has th e advantage of producing a larger cone* and using GAC has th e advantage of being less expensive because we do not need to perform step (d). Step (c.) can be perform ed by clustering th e cones D 2 for all th e features of th e workpiece, thus generating a sm all num ber of l2’s for th e entire workpiece. T h e m ost general approach for com puting b en t probes is to work w ith D\ and j0 2 as cones, ra th er th an choosing one direction from each of them . T his is th e m ost expensive m ethod, b u t it will probably produce th e best plan in term s of th e to tal 65 GAC(F) GACrfF) Figure 4.14: Effective working length of probe num ber of probe directions and setups required to inspect th e workpiece. N ote th a t none of th e approaches presented produces exact results because cone and obstacle approxim ations are used. All approaches, however, can produce results guaranteed to satisfy th e ap p ro p riate conditions. 4.6 Global accessibility and probe geometry P ro b e geom etries used in practice often are as shown in Figure 4.14a, w ith a large variation betw een th e w idths of th e probe com ponents. (2D exam ples are shown for sim plicity.) U sually th e w idth of th e p a rt of th e probe th a t carries th e tip is th e sm allest, and th e w idth increases for com ponents farth er from th e tip . Let I be th e distance from th e tip center to th e first probe p art whose d iam eter is bigger th a n th a t of th e tip (S in F igure 4.14a). In probe m anuals this distance is called th e effective working length (ewl) of th e probe. It is usually defined inform ally w ith statem en ts such as: “Effective working length is th e p en etratio n achieved by the ball before its stem fouls on th e com ponent” ([Ren88]). For com puting th e G A C , th e probe of Figure 4.14a is approxim ated by th e half-line p. T his approxim ation ignores th e ewl of th e probe, and as a result, th e G A C m ight include directions such th a t S or o th er p arts of th e probe collide w ith th e workpiece. For exam ple, in Figure 4.14b a probe w ith direction y collides w ith W w hen inspecting point Q of F . In this section we consider only p o ten tial collisions of S and W . T h e probe 66 tip itself - a sphere of non-zero radius - m ight collide w ith th e workpiece when the half-line abstractio n does not. T his is taken in consideration, to some ex ten t, by th e algorithm discussed in C hapter 5. This algorithm com putes th e G A C by using a slightly sm aller feature th an th e original one. T h e interactio n of W and 5 m ay be cap tu red by approxim ating th e probe w ith a shape th a t is close to its actual geom etry and perform ing accessibility analysis for this approxim ate shape. A pproxim ation by a circular cone K , as shown in Figure 4.14a, is advantageous because th ere is a direct relation betw een G A C (F ) and th e configurations (orientations) of K th a t can be used to inspect a feature F. T h e orientation of K is defined as th e orientation of its axis; since K is circular, rotations around its axis do not affect A T’s shape. We define G A C k (F), th e G A C for th e case th a t th e probe is represented by a circular cone K , as th e set of all orientations of K such th a t K swept over th e featu re does not intersect th e interior of th e workpiece. G A C k (F) = {p I K \ p,q n iW = 0, V Q € F } w here K \ p>q denotes th e cone K at orientation p and w ith its apex at point Q . It can be shown (A ppendix B.1.2) th a t G A C k equals th e set of all orientations of K such th a t K is contained in GAC(F): G A C k (F ) = {/ | K\i c G A C (F )}, w here K\i denotes th e cone K a t an o rientation such th a t A T’s axis coincides w ith I. T he set of containm ent configurations of a set w ith respect to another set is analogous to th e M inkowski decom position (or negative offset) of a set A by a set B defined in [Gho86] (relation 3.1) as A Q B = p| A|_i = {t I B\t C A}. b£B O ffsetting operations for 3D solid objects are exam ined in [Ros85]. T his approach has th e following disadvantages. 67 • R epresenting a probe by K m ay rem ove valid directions from th e G A C . For exam ple, GACk (F ) in Figure 4.14b, does not include th e direction x, although this is a valid direction because th e length of F is sm aller th a n th e p robe’s ewl. • T h e geom etry of th e probe m ust be know n for selecting th e angle at th e apex o i K . A worst case approxim ation can be used, by choosing th e angle of K so as to enclose th e largest probe available. • N egative offsetting of polyhedral cones by K does not result in polyhedral cones. Shrinking th e G A C to obtain GACk is useful in situations w here p lan ar features are large (com pared to ewl) and th ere are few obstacles in front of them . This is often th e case w ith system s of planar datum s. In the im plem ented system heuristics are used to decide w hether GACk should be used instead of GAC. In p articu lar, we use GACk {F) w hen th e feature F is planar and GACk {F) is not em pty. Intuitively this m eans th e G A C is “large enough” so th a t we can afford to rem ove directions from it, to decrease th e likelihood of inspection plan failure. Cone offsetting is perform ed by approxim ating G A C © K by polyhedral cones, for a fixed angle of K. 4.7 Global accessibility and setup A workpiece W can be setup on th e CM M in an infinite num ber of ways, b u t certain crite ria can be used to narrow down th e setup choices. Exam ples of such criteria are stab ility of th e workpiece, and accessibility of th e features in th e given setup. T h e inform ation in th e G A C (F ) can be used to suggest good setups for inspecting th e feature F. Of course, G A C (F ) in itself is not enough for finding good setups for all criteria (for exam ple, stability); th e G A C (F ) inform ation should be used in conjunction w ith o ther criteria in order to produce a good overall setup. In this section we study th e problem of generating setups for a feature F so th a t F can be inspected w hen th e w orkpiece is in any of these setups. We say th a t F can be inspected in a setup s , if th e p ro b e /ra m assem bly can inspect th e en tire feature F, satisfying b o th th e accessibility and approach conditions, w hen th e obstacle is th e union of th e workpiece and th e CM M table. 68 ram direction ram direction (a) (b) Figure 4.15: R am directions and setup orientations 4 .7 .1 S e tu p r e p r e s e n ta tio n T he setup of a workpiece W on th e CM M can be fully characterized by th e 6 de grees of freedom (3 tran slatio n al and 3 rotational) of th e workpiece w ith respect to th e CM M coordinate system . This is a com plicated representation and leads to expensive algorithm s for com puting setups. H ere we propose an alternative repre sentation th a t relates th e orientation of th e workpiece to th a t of th e CM M ram , and we show how th is representation is used for expressing setups in which a feature can be inspected. T h e ram direction is defined as th e vector parallel to th e axis of th e ram and directed tow ards th e point w here th e ram is attach ed to th e CM M (Figure 4.15a). T he setup representation is of th e form (D, constraint), w here D is a cone th a t specifies th e ram direction w ith respect to th e w orkpiece, and constraint specifies th e m inim um distance betw een th e CM M tab le and W or betw een th e CM M table and F. T he cone D is expressed in th e coordinate system of th e workpiece. An exam ple of constraint is d(W,tbl) > 0, which specifies th a t th e distance betw een W and th e CM M tab le (denoted by tbl) should be g reater th a n 0, or, equivalently, th a t th e workpiece should not touch th e CM M table. A setup of th e form (D , constraint) will be referred to as ram-setup, and a 6 -dof setup, as sim ply setup. A single ram - setup corresponds to m any setups. For exam ple, th e ram -setup (z , d( W, tbl) > 0) corresponds to an infinite num ber of setups, th ree of which are shown for th e cuboid 69 w orkpiece of F igure 4.15a; 2 is th e 2 axis in th e coordinate system of th e workpiece. SU (R) denotes th e collection of setups th a t correspond to a ram -setup R. Let F be a surface feature of a workpiece W . In th e following sections we generate ram -setups, i?, such th a t F can be inspected w hen th e w orkpiece is in any of the setups in SU(R). T he setups are generated under th e following assum ptions. • T h e assem bly of th e ram and th e physical probe can be ab stracted either as a straig h t probe (when th e ram and physical probe are aligned), or a ben t probe (w hen th e ram and physical probe are not aligned or w hen th e physical probe is orientable). • T he CM M tab le is m uch bigger th a n th e workpiece. T his allows us to represent th e CM M tab le as a p lan ar closed half-space whose outw ard pointing norm al coincides w ith th e outw ard norm al of th e CM M table. • T h e ram can only be perpendicular or parallel to th e CM M table. T he CMMs available to d ay satisfy this requirem ent. A CM M w ith ram parallel to the tab le is shown in Figure 4.15b. • T h e ram w idth is ignored. (R am s w ith positive w idth are discussed in Section 4.7.4). A fter th e ram -setups have been com puted for all th e features of th e p a rt, th e ram direction cones specified by these ram -setups can be clustered (assum ing th a t th e corresponding constraints are non-conflicting) to produce a m inim al set of ram directions, which is equivalent to a m inim al num ber of setups for th e p a rt. B ut this approach ignores issues such as p a rt stab ility and fixturing, w hich are very im p o rtan t in practice. For exam ple, a p a rt orientation generated by this approach m ay require fixturing th e p art in such a way th a t features are ob stru cted . S tability analysis and o ther m odules m ust be allowed to affect th e setups chosen. This can be achieved if analysis m odules attach weights to th e setup directions (high weight m eans preferable setup) and clustering not only m inim izes th e num ber of setups, b u t also m axim izes th e sum of th e weights of th e setups. 70 t I: ram/probe assembly direction ^ \ \ \ \ \ \ \ \ \ \ \ w |C M M table ^ (a) ram/probe assembly direction CMM table ^ (b) Figure 4.16: P ro b e /ra m assem bly as a straight probe 4 .7 .2 S e tu p s for a lig n e d ra m an d p ro b e Let F be a surface feature of a workpiece W . In this section we assum e th a t the probe and th e ram are aligned, thus form ing a straig h t probe represented by a half line. Let U be th e set of all setups s, such th a t F can be inspected w hen W is in setup s. In th e following we look at th e problem of generating U, or a subset of U, using th e inform ation in G AC (F). F irst we consider th e case w here th e ram is perpendicular to th e CM M table (Figure 4.16a). In th e following we argue th a t th a t in this case U = S U (G A C (F ), 0), w here 0 m eans th a t no constraint is im posed. Let s be a setup in U , and I th e half line representing th e p ro b e /ram assem bly in s. In order for / to b e able to inspect F, I m ust belong to G A C (F ), therefore s m ust belong to SU{GAC{F),ty) and U C SU(GAC{F),%). Now let s be a setup in SU (G A C (F ), 0), and / th e p ro b e /ram assem bly for s. Since s belongs to SU (G A C (F ), 0), I belongs to G A C (F ) (from the definition of SU), and therefore I does not collide w ith W as it inspects F. Since th e ram is perpendicular to th e CM M table, and w ith th e sam e direction as th e outw ard point norm al of th e table, I does not intersect the CM M tab le either. Therefore, s belongs to U, i.e., SU (G A C (F ), 0) C U. It follows th a t U = S U (G A C (F ),0 ), w hen th e probe and th e ram are aligned and th e ram is perpendicular to th e CM M table. T h a t is, th e setups in which F can be inspected are those for which th e ram direction is a m em ber of G A C (F). T hree such setups are shown in Figure 4.16a for a rectangular workpiece. 71 A sim ilar analysis can be perform ed for th e case w herein th e ram is parallel to th e CM M table. It is easy to verify th a t for this case U C SU (G A C (F ),d(F ,tbl) > 0). T he constraint d{F,tbl) > 0 is needed because w hen F touches th e table, th e p ro b e /ra m assem bly m ight not reach F anym ore - Figure 4.16b, setup s i. As soon as F is lifted off th e table, F becom es accessible - Figure 4.16b, setup s2. N ote, however, th a t th ere exist setups in which F can be inspected although F touches th e table, as shown in Figure 4.16b, setup 6 3 . In th a t exam ple, s3 belongs to U b u t not to SU (G A C (F ), d(F, tbl) > 0), because d(F,tbl) = 0. 4 .7 .3 S e tu p s for n o n -a lig n e d ra m a n d p r o b e W hen th e ram and th e probe are not aligned, th e p ro b e /ra m assem bly can be viewed as a ben t probe (Section 4.5). In th e sequel we assum e th a t th e length of th e first com ponent of th e bent probe is fixed and equals d. Let F be a surface featu re of a w orkpiece W , and U be th e set of all setups of W in w hich F can be inspected. Let D 2 be th e directions of th e second com ponent of a b en t probe th a t satisfy th e accessibility and approach conditions for a probe of length d. In this section we show th a t U C SU (D 2,d(W,tbl) > d). T h a t is, if W is in a setup s such th a t th e ram direction is in D 2, and th e distance betw een W and th e CM M tab le is g reater th an d, th en F can be inspected. This is tru e for b o th th e ram being perpendicular, or parallel to th e CM M table. Let th e p ro b e /ra m assem bly be represented by a b en t probe p = ( h ,d ,l2) th a t satisfies b o th th e accessibility and approach conditions for F (F igure 4.17a). Let s be a setup in SU (l2, d(W , tbl) > d). T h a t is, when W is in setup s, th e ram direction equals l2 and th e distance betw een th e CM M table and W is g reater th a n or equal to d (Figure 4.17b). W e claim th a t w hen th e workpiece is in setup s, p can inspect all points of F w ithout intersecting %W Ui(tbl), w here tbl denotes th e CM M table. We now present an inform al proof of this claim . F irst we need to show th a t p satisfies th e accessibility condition for F w hen th e obstacle is tbl - i.e., p does not intersect w ith i(tbl) as p moves along F. (By assum ption, p can inspect F w ithout colliding w ith W , hence th e accessibility condition is satisfied for obstacle W .) T he probe does not intersect i(tbl) because th e distance betw een W and tbl is at least d, and th e probe length is 72 d(W, tbl) CMM table M probe ram Figure 4.17: P ro b e /ra m assem bly as a b en t probe d. Since th e probe length is d, th e point w here th e probe and th e ram m eet (point A in Figure 4.17b) is never in th e interior of tbl. Therefore, since th e ram is either perpendicular or parallel to th e CM M table, th e ram never intersects i(tbl). We also have to show th a t th e approach condition is satisfied w hen th e obstacle is tbl. T h e idea is th a t any p a th along which p intersects i(tbP) (b u t not i W ), can be su b stitu ted by another p a th th a t does not involve collisions w ith eith er i(tbl) or iW . F irst, observe th a t if p satisfies th e approach condition th ere exists a p a th th a t does not intersect i W and such th a t at its end p is in contact w ith W , and th a t at th e in itial point p is far from th e workpiece. If th e in itial point is such th a t p collides w ith i(tbl) th en we can add a segm ent to th e p a th so th a t th e collision at th e new in itial point no longer exists and th e segm ent is a t a large distance from W and is not colliding w ith it. At th e endpoint p can n ot collide w ith tbl because it is in contact w ith F and we already saw th a t th e accessibility condition for tbl is also m et. T herefore we can segm ent any p a th so th a t th e endpoints are collision free and th ere are at m ost a finite num ber of segm ents w here th ere is collision. Let c be a continuous p ath , such th a t p has a non-em pty intersection w ith i{tbl), when p is positioned at any point of c other th a n th e two endpoints of c, a and b (Figure 4.17c). W hen p is at a or b, p ju st touches th e CM M table. Let [ab] denote th e straig h t line p a th betw een th e points a and b (dashed line segm ent in Figure 4.17c). [a& ] is parallel to th e CM M tab le at distance at m ost d form th e table. As p moves along [ab], th e probe po rtio n of th e p ro b e /ra m assem bly moves inside a “slab” of w idth at m ost d , defined by [a& ] and th e CM M table, and by assum ption, this 73 slab does not intersect i W U i(tbl). T he region R! traversed by th e ram as it moves along [ab] is a subset of th e region R traversed by ram as th e ram m oves along c, because of th e infinite length of th e ram and because of th e assum ptions ab o u t c. A nd since R does not intersect iW , th e ram does not collide w ith i W as p moves along [ab]. Also, it is easy to see th a t th e ram does not collide w ith i(tbl) as p moves along [ab]. T h e m ethods of Section 4.5.4 can be used for generating th e set D 2 of ram directions, w hen th e length d of th e probe is known. N ote th a t th e set of setups S U (D 2,d(W,tbl) > d) is a subset of all possible setups, because th ere m ight exist valid setups for which th e distance betw een W and th e CM M tab le is less th a n d. T he advantage of using th e setups in S U (D 2,d(W,tbl) > d) is th a t we do not need to m ake any assum ptions about th e directions of the probe, o ther th a n th a t the p ro b e /ra m assem bly is able to inspect th e featu re under consideration. 4 .7 .4 R a m w id th Up to now we assum ed th a t th e ram can be represented by a half-line. T he problem w ith this representation is th a t th e ram m ight collide w ith th e workpiece, even though th e half-line th a t corresponds to th e ram does not. T his happens because th e w idth of a half-line is 0 , while th e w idth of th e real ram is g reater th a n 0 . In this section we introduce a ram representation th a t captures th e ram w idth. T he ram is represented by th e union of a sem i-infinite cylinder of radius w, and a sphere of radius w. T he center of th e sphere coincides w ith th e center of th e planar circular face of th e cylinder (Figure 4.18a). T he half-sphere at one end of th e ram captures th e geom etry of th e device used for attach in g th e probe to th e ram . Let R be th e ram , represented as above, and W th e workpiece. T he free space of R w ith respect to W is th e sam e as th e free space of th e ram shrunk by a ball of radius w, denoted by R X w, w ith respect to W grown by th e sam e ball, denoted by W | w (F igure 4.18b). (T he shrinking and growing of solids by a ball is studied in [Ros85].) T h e advantage of th e new ram representation is th a t R j w is a half-line. T he techniques introduced in th e previous sections can therefore be used for com puting ram directions by viewing th e ram as a half-line, and by growing th e workpiece by 74 w (a) R \ w R ( b ) iW®F' (/W©F')^w sphD (c) Figure 4.18: R am represented as a cy lin d er/sp h ere com bination th e ap p ro p riate ball. In th e rem aining of th e section we exam ine how some of these techniques can be m odified to accom m odate th e new ram representation. W e sta rt w ith th e case in w hich th e probe and th e ram are aligned, and th e probe has fixed length d. Let F be a surface feature of a workpiece W . T he p ro b e /ram directions th a t can inspect F are given by th e G A C of th e origin w ith respect to th e obstacle i W © F ' (Proposition 4.1.2). Let th e center of th e half-sphere at th e end of th e ram be th e reference point of th e ram (point A in Figure 4.18a). As th e probe changes orientations in D = G A C ^ ^ ' i W ) , th e reference point of th e ram traverses sphD, w here sphD denotes th e spherical po rtio n of D for radius d (Figure 4.18c). A ccording to th e previous analysis, th e points of (iW © F') f w , are points w here th e ram intersects i W © F '. Therefore, th e valid ram directions are given by a cone D ', w here D' is a cone such th a t its spherical portion for radius d does not intersect (i W © F') | w (Figure 4.18c). W hen th e ra m /p ro b e assem bly is in any direction in D \ this assem bly does not intersect W . Sim ilar analysis can be perform ed for th e case th a t th e ram and th e probe are not aligned. F irst th e invalid directions m ust be elim inated from th e cone of directions for th e probe, using th e sam e m ethod as for aligned ram and probe. T hen th e directions of th e ram can be com puted by th e m ethods of Section 4.5.4, for obstacle (iW © F') T W hen com puting setups, as in Sections 4.7.2, and 4.7.3, th e w idth of th e ram can be taken into consideration by m odifying th e constraint th a t specifies th e m inim um 75 invalid probe orientation 0 = 75‘ valid probe orientation (a) (b) Figure 4.19: M inim um angle and ram orientations distance betw een th e CM M tab le and W or F. This distance m ust be increased by w, to cap tu re th e growing of th e CM M tab le by a sphere of radius w. 4 .7 .5 M in im u m r a m -p r o b e a n g le In th is section we assum e a probe of finite length, attach ed to th e ram to form a b ent probe. T h e m inim um allowable angle betw een probe and ram (angle 9 = 75° in Figure 4.19a) is an additional constraint on ram directions. T his angle is usually given in th e specifications of th e probe head. Let 9 be th e m inim um allowable angle betw een probe and ram , and r, p th e vectors defining th e ram and probe orientations respectively. T hen for probe p to be valid, th e following relation m ust be tru e (Figure 4.19b): £ ( -p ,r ) > 9 L{p,r) < 180° - 9 T h e above relation can be used for generating th e valid ram directions, given a direction cone P D ( F ) for th e probe. T hese ram directions form a cone, denoted by Q(F). (Q stands for m achine quill - another nam e for ram .) We propose two approaches for com puting Q. T he first is a worst-case analysis th a t ensures th a t each direction in Q satisfies th e angle constraint for all probe orientations in P D (F ). T he second is less restrictive. It ensures th a t for each ram direction in Q th ere exist at least one probe direction in P D th a t satisfies th e angle condition. T he ram direction 76 S(D) F igure 4.20: S upplem entary and reciprocal cones cones for th e two approaches, denoted by QR and Q s respectively, are defined as follows: QR(F) = {x | l(x , d) < 180° - 0, V d e P D ( F )} Q S(F) = {x\3d£ P D (F ) : l(x , d) < 180° - 9} N ote th a t Q R( F ) is th e generalized reciprocal of P D ( F ) (Section 3.2): Qr (F) = R l80°-9(P D ( F )) 4 .7 .5 .1 S u p p le m e n ta r y co n e T h e cone Q S(F ) can be expressed by using th e concept of generalized supplementary cone: D e fin itio n 4 .7 .1 The generalized supplem entary cone of a direction cone D for an angle 9, denoted S e{D), is defined as: S 6(D) = {I | 3 d € D : 1(1, d) < 9} Figure 4.20 shows th e reciprocal and th e supplem entary cones for th e 2D cone D, w ith 9 = 90°. It is proven in A ppendix A .3 th a t th e supplem entary cone equals th e union of all circular cones w ith angle 6 (betw een th e axis and a boundary ray) whose axes are in D. T his operation is analogous to positive offsetting ([Ros85]) for sets on th e surface of th e un it sphere. 77 Having defined the supplementary cone, QS(F) can be written as: Q S( F ) = S 180°-e(PD (F)). 4.8 Applications in vision and machining A ccessibility of a surface feature to a half-line probe ab stractio n I, as defined in th is section, is equivalent to visibility o f th e feature from a view point a t infinity in th e direction of I. A ccessibility analysis in conjunction w ith th e m inim um clustering problem (presented in Section 7.4) is directly applicable to th e following (equivalent) problem s of in terest in com puter vision: G iven a solid w ith surface features .F ,-, find th e m inim al set of ( 1 ) d istan t view points th a t suffice to see all of th e features of th e o bject, (2 ) d istan t light sources sufficient to illum inate th e o b je c t’s features com pletely, or (3) orthographic projections th a t show all of th e o b je c t’s features. A ccessibility analysis can also be used for visual inspection using laser range finders. T here, two rays are needed for inspecting a point. If th e angle betw een these two rays is known, instead of a half-line probe we consider a circular cone w ith angle equal to th e ray angle. T he analysis can th en proceed as described in Section 4.6 to generate cone directions th a t do not collide w ith W . Since b o th rays are com pletely contained in th e circular cone, none of th e rays can intersect W . N ote however, th a t abstractin g th e laser beam by a circular cone is a w orst case scenario, since th e two actu al rays define ju st a 2D (flat) cone. T he analysis presented in this section is also relevant to th e stu d y of accessibility of surface features to m achine-tool cu tters. O bviously a surface featu re cannot be cut unless th e c u tte r can reach all th e points of th e feature. Therefore, a G A C provides an u pper bound on th e accessible directions. B ut accessibility problem s for m achining are m ore com plex th a n for inspection, because c u tte r orien tatio n need not be constant (for exam ple in 5-axis m achining), and th e relative orien tatio n of th e c u tte r and th e feature m ay be constrained by th e ty p e of c u tte r, th e required surface finish, and o ther considerations. 78 (a) G A C (F) G A C (F ) © F (b) Z 7 V(F) F igure 4.21: G lobal accessibility cone and visibility region: (a) (G A C (F ) 0 F) = 0 and V (F ) ^ 0, (b) V (F ) C (G A C (F ) 0 F) 4.9 Related work 4 .9 .1 A c c e s s ib ility a n d v is ib ility r e g io n A ccessibility analysis is used in vision for com puting th e points in space from which a surface featu re is visible. T he set of all these points is called visibility region in th e sequel. Let F be th e feature under consideration and W be th e collection of obstacles for F. T he visibility region of F is denoted by V (F ) and defined as follows: V (F ) = { P \V Qe F : (P Q n iW ) = 0} Since G A C ( F ) is a set of directions along which th e featu re is visible, it would seem G A C (F ) 0 F = V (F ), i.e., sweeping the global accessibility cone over th e featu re w ould produce th e visibility region. N ote however, th a t th is is not tru e, as shown in Figure 4.21. In Figure 4.21a G A C (F ) is em pty and therefore so is G A C 0 F , w hereas V (F ) is not em pty. In 4.21b, F is th e b o tto m of an L-shaped pocket, and V ( F ) is a proper subset of G A C (F ) 0 F. Cowan and Kovesi ([C K 8 8 ]) introduced th e separating plane concept for visibility calculations, and T arabanis and Tsai ([TT89]) developed algorithm s for com puting 79 Figure 4.22: S eparating plane betw een feature F and obstacle O. V (F ) efficiently using this idea. T he separating plane algorithm can be briefly de scribed as follows: Let F be a featu re and O an obstacle for this feature (Figure 4.22), w here F and O are convex polygons. Let II be a plane defining th e two half-spaces III and II 2 such th a t F E II 1 and O € E II 2 . II is a separating plane of F and O. T hen F is visible from any point P of II 1 O F i, w here Ft is th e half-space defined by F and its outw ard pointing norm al. H ence EL n F\ is a subset of V (F ). To com pute V (F ) one has to find all th e lim iting separating planes of F and O (i. e., planes th a t touch F and O ), th en com pute th e union of th e associated half-spaces th a t contain F, and finally intersect this union w ith F\ to yield V(F ). A n additional step is to intersect V ( F ) w ith 0 1 , if th e plane of O does not intersect F , w here 0 \ is th e half-space defined by O and containing F. T he separating plane algorithm could be used to approxim ately com pute G A C s of polyhedral objects. P oints in V (F ) th a t are far from th e o b ject m ay be considered approxim ately as points a t infinity, and define directions along which a feature is accessible. Conversely, our accessibility algorithm provides such points, b u t not th e en tire V (F ). 4 .9 .2 A c c e s s ib ility a n d a sse m b ly d ir e c tio n s A problem often encountered in assem bly planning is how to sep arate (or disassem ble) th e different p arts of an assem bly w ithout collisions am ong th e parts. Consider th e exam ple of Figure 4.23, w here th e assem bly consists of th e p arts A and B , and 80 G (A ,B ) Figure 4.23: D isassem bly directions th e objective is to find th e m otions of A th a t separate A from B. A m otion is said to satisfy th e local geometric feasibility p redicate if it breaks th e surface contacts betw een A and B , and th e global feasibility predicate if takes A to a position “far from ” B ([dMS91]). In th e following we assum e th a t only straight line tran slatio n s of A are allowed, and denote th e set of tran slatio n s th a t satisfy these predicates by L ( A , B ) and G (A ,B ), respectively. (T his is not th e notatio n used in th e current literatu re, b u t we use it to sim plify th e discussion, because different authors use different no tatio n .) L ( A ,B ) and G(A, B ) can be represented as direction cones (Figure 4.23), and are related to th e concepts of L A C and G A C discussed earlier. Let A and B be two polyhedral p arts. L(A, B ) is a polyhedral convex direction cone, equal to th e intersection of th e half-spaces th a t correspond to th e contacts betw een A and B ([dMS91], [KS91], [Wil92]). For th e exam ple of Figure 4.23 th ere are two such contacts, denoted by th e vectors nj and n 2, whose intersection is a q u arter of a circle. L(A, B ) is essentially th e L A C of th e surfaces of B th a t com e in contact w ith A. T h e cone G(A, B ) equals G A C B(A), th a t is, th e global accessibility cone of A w hen th e only obstacle is B. N ote th a t A is tre ate d as a tran sp aren t volum e (Sec tion 4.5.4.2), in th a t points of A are not obstacles to other points of A. Therefore, G (A , B ) can be com puted by using th e algorithm of section 4.2, w here F is substi tu te d by A, and W by B. Lee and Shin ( [LS90]), com pute an approxim ation of G (A ,B ) by testing a finite set of directions (in p articu lar, th e directions along th e 6 principal axes) for collisions. 81 K rishnan and Sanderson ([KS91]), address th e problem of single and m ulti stage tran slatio n of A. They use th e idea of collision cones to cap tu re th e single tra n s lations of A th a t collide w ith B. C om pared to our work, collision cones cap tu re th e sam e directions as th e cones containing th e configuration space obstacle of F w ith respect to W . T he com plem ent of th e collision cone of A w ith respect to B is G (A ,B ). In [KS91J, th e collision cone for two p arts A and B is defined as th e union of all th e collision cones of all th e pairs of faces of th e p arts, w here th e collision cone of two faces is th e union of th e collision cones of (vertex, face) and (edge, edge) pairs from th e two parts. T his is an unnecessarily expensive algorithm , because it com putes cones th a t can be o m itted w ithout affecting th e result. Section 5 presents an algorithm th a t only considers a subset of (w hat corresponds to) collision cones, and guarantees th e correct result. T h e sh o rtest-p ath m ulti-stage tra n slatio n problem is to find a sequence of tra n s lations of A th a t separate A from B , such th a t th e to ta l p a th length is m inim ized. T his problem is sim ilar to th e problem of b ent probes (Section 4.5), w hen th e ap proach condition is ignored. Two algorithm s are proposed in [KS91] for solving this problem . T h e first algorithm requires th a t th e p a rt and th e obstacle be convex polyhedra. It views th e problem as satisfying a num ber of inequalities, w here th e unknow ns are th e positions w here th e p a rt changes direction and a set of vectors th a t constrain these positions so th a t th e non-collision criterion is satisfied for the en tire p ath . T he second algorithm uses th e idea of reachable space, w hich is th e set of all points th a t A can reach from an initial position w ithout colliding w ith B , when th e m otion of A is a single, straight line tran slatio n . T he algorithm works as follows. T h e reachable space, S, is com puted for th e in itial position of A. T h e boundary of S is approxim ated by a finite num ber of points, and th e reachable space for each of these points is com puted. (It is not clear from th e p ap er how th e reachable space com putation is perform ed.) T he algorithm successively expands th e reachable space of th e new points u n til A is far enough from B , or A cannot move to any position not already visited. T his algorithm can be very expensive as th e sam pling ra te for th e bou n d ary of th e reachable space increases. M ore recent research by W ilson ([Wil92]) has resulted in an algorithm for gen eratin g disassem bly directions. B oth his algorithm and ours for generating global accessibility cones (C h ap ter 4) use th e configuration space obstacle ([LP83]) of A 82 w ith respect to B for generating disassem bly/accessible directions. T h e two algo rith m s, however, are different. In our work we com pute th e sweep of object A over object B (required for com puting configuration space obstacles) by sweeping en ti ties of A and B th a t have th e sam e norm als; for each such sweep we generate an obstacle cone and finally we com pute th e union of th e obstacle cones (C h ap ter 5). In [Wil92] th e faces of A and B are trian g u lated and th e sweeps of pairs of triangles are com puted. T h e projection of these sweeps on th e u n it sphere determ ines an arrangem ent of cells on th e surface of th e sphere. O ne cell is random ly selected and a weight is attach ed to it th a t is equal to th e num ber of pairs of triangles from each p a rt th a t collide w hen tran slated along directions in this cell. T h e weight for th e rem aining cells is com puted by using th e initial cell weight and a set of crossing rules th a t determ ine how th e weight changes as one moves betw een adjacent cells. If a cell has weight equal to 0, th en object A tran slatin g along any direction in th e cell does not collide w ith B. B oth algorithm s can be used for generating accessibility and assem bly directions. T he m ain difference betw een th e two algorithm s is th e representation used for cones. In [Wil92] cones are represented as an arrangem ent on th e sphere; in our work cones are represented by th eir boundaries (B rep). C om paring th e two algorithm s, therefore, is essentially th e sam e as com paring representations (arrangem ents vs. B rep ’s), an d to th e best of our knowledge, this subject is not very well studied. T he two algorithm s have th e sam e w orst case com plexity u nder sim ilar assum ptions. (For a detailed discussion of algorithm com plexity see Section 5.2.1.) In p articular, W ilson assum es th a t Y If nv(F) = 0 (nv), and we assum e th a t JDf h e{F) = O (n g ), w here J2f denotes sum m ation over th e faces of an object; nv(F), u e (F ) denote the num ber of vertices/edges of a face F, respectively; and n v, n e denote th e num ber of vertices/edges of th e object, respectively. 83 Chapter 5 Global accessibility for polyhedral parts 84 In th is section an algorithm for com puting GACs for polyhedral p arts is presented, along w ith theoretical results used to design th e algorithm . P olyhedral p arts were chosen because sweep com putation form s a m ajo r step of th e algorithm , and sweeps of polyhedral objects are m uch sim pler to com pute th a n those for curved objects. Proofs for th e propositions of this ch ap ter can be found in A ppendix B.2. 5.1 Definitions and theoretical background P roposition 4.1.2 relates th e GAC of a surface feature F to th e M inkowski sum F' © iW \ th e proposition states th a t G A C W( F ) = G A C tW®F>(O). D irect em bodim ent of this proposition in an algorithm (Section 4.2) is not very a ttra c tiv e because it involves com putations on 3D open sets, and poses difficult accuracy requirem ents. For exam ple, a sm all error in th e M inkowski sum of F igure 4.2 can entirely wipe out th e G A C . H ere we propose a different approach, in w hich we shrink th e surface featu re and sweep it over certain portions of th e workpiece boundary. T he following proposition shows th a t one can work w ith th e interior of th e feature, rath e r th an w ith th e 3D interior of th e workpiece. P r o p o s itio n 5 .1 .1 Let F be a planar surface feature of a solid W , and N the plane normal to F and passing through the apex of its G A C . Then G A C (F ) - N = R G A C {i2F) where R G A C denotes the restricted global accessibility cone and i2 denotes interior in the 2D relative topology of the planar surface on which F lies. Instead of th e interior of th e surface feature, w hich is an open set in th e plane, we consider a shrunk version Fe of F. T h e specific shrinking procedure is not im p o rta n t as long as Fe is a polygonal closed set th a t approxim ates F to any desired accuracy. Shrinking a feature by an am ount com parable to a C M M ’s probe radius can be justified on pragm atic grounds, as shown in Figure 5.1. Trying to inspect points very close to a fe atu re’s boundary m ay result in contact w ith another surface (Figure 5.1a), or m ay be im possible (Figure 5.1b). 85 (a) (b) probe probe tip Figure 5.1: Difficulties in inspecting boundary points of a feature For sm all e, G A C (F ) is approxim ately equal to Gc = R G A C (F e). (D irections in th e norm al plane N m ay be m issing in certain cases th a t occur infrequently. These directions can be found separately by 2D operations, and are ignored in the rem ainder of th is chapter.) Now Ge can be com puted by using th e analog of P ropo sition 4.1.2 for restricted G A C s. Specifically, com pute: 1. F', th e sym m etric of Ft w ith respect to th e origin O. 2. T h e sweep, or M inkowski sum , F' © W . 3. T h e “silhouette” of th e sweep Silh(F) © W ), i.e. th e boundary of th e cone w ith apex O th a t contains all th e directions th a t intersect th e sweep. 4. G t , th e largest direction cone w ith apex O th a t does not intersect th e sweep. Ge is th e com plem ent of th e cone found in th e previous step, and its boundary also equals Silh(F) © W ). T h e M inkowski sum now involves closed sets and also produces a closed set, because of th e following result. P r o p o s itio n 5 .1 .2 If A is a regular set in E 3 (3D Euclidean space) and B a com pact non-empty set (see [Req80] for the definition and properties of regular sets), then A © B is a regular set. O bserve th a t we do not need to know exactly th e boundary d(F( © W ) of th e M inkowski sum . O nly th e sum ’s silhouette m atters. T h e algorithm com putes a 86 superset B of th e boundary such th a t d(F ' © W ) C B C (F' © W ). B is m uch easier to find th a n th e actu al boundary, and generates th e sam e silhouette. To com pute B a sim pler version of B ajaj and K im ’s configuration space algorithm ([BK90]) is used. A few additional definitions are needed in order to describe th e algorithm . A neighborhood of a point P w ith respect to a set X is th e intersection of an open ball of radius r centered at P w ith th e reference set X [RV85]. A local supporting half-space of a point P G d X is a p lan ar half-space H whose boundary contains P, and such th a t H contains a neighborhood of P w ith respect to X for arb itrarily sm all r. For a point P lying in th e interior of a sm ooth face of a solid, th e corresponding local supporting half-space is tan g en t to th e solid at P. T h e Gaussian image for a face of a solid is th e direction cone th a t contains th e outw ard-pointing u n it norm al at every point of th e face. For a polyhedral solid, th e G aussian im age of each face is a single vector, norm al to th e plane of th e face. T he generalized Gaussian image (GGI) for an edge of a m anifold polyhedral solid is th e direction cone th a t contains th e outw ard-pointing norm als of all th e local supporting planes for a point in th e interior of th e edge. Sim ilarly, th e GGI for a vertex of a m anifold polyhedral solid contains th e norm als of all th e supporting planes associated w ith th e vertex. If an edge is concave its G GI is em pty. For a convex edge, th e GGI is a “p lan ar sector” bounded by th e norm al directions to th e edge’s adjacent faces, as shown in Figure 5.2a. T he GGI of a vertex is a “p yram id” w ith edges aligned w ith th e norm als to th e planes th a t bound th e convex hull of a neighborhood of th e vertex - see Figure 5.2b. By convention, th e G G I of a solid’s face equals its stan d ard G aussian image. W e define GGIs for a surface feature F by considering F as a degenerate, lim iting case of a solid w ith two coincident b u t opposing faces - see F igure 5.3. T he GGI of an edge e of F is a half-circle on th e plane norm al to th e edge and bounded by th e two face norm als - Figure 5.3b - and th e GGI of a vertex v of F is a cone bounded by th e GGIs of its incident edges - Figure 5.3c. If v is concave its GGI is em pty. T h e G GI of a surface featu re’s edge e is never em pty. T he GGIs of two entities overlap if th e intersection of th e corresponding direction cones is not em pty. D etection of overlapping GGIs is an im p o rtan t com ponent of M inkow ski-sum and related algorithm s. 87 G G I(E) G I(F ’) GI(F) (a) G I(A B D ) G G I(A ) G I(A C D ) GI(ABC, (b) F igure 5.2: GGIs for a convex edge (a), and for a vertex (b). G I(A B C D E ) rB B E A G G I(A B ) I f G I ( E D C B A ) (a) (b) G G I (A) Figure 5.3: GGIs for th e bounding entities of a surface feature. ¥ * 5.2 Algorithm T h e algorithm described below com putes th e G A C for a face F of a polyhedral solid W . GAGs for all th e surface features of a solid can be used to analyze th e solid’s accessibility. T he solid and th e surface featu re are represented by th eir boundaries (BReps). Each e n tity in these BR eps has an associated GGI, which is a direction cone. A direction cone is represented by its intersection w ith th e u n it sphere. (In th e cur ren t im plem entation we consider only cones th a t are regular sets; th is is restrictive because single-direction cones and o ther “singular” sets of p ractical im portance are excluded.) Subsets of th e u n it sphere are represented also by B R eps, th rough edges, vertices and associated 2D neighborhoods - see [RV85]. T h e bounding edges are subsets of great circles (and therefore are circular arcs), because all our direction cones are polyhedral. T h e following is a sim plified description of th e im plem ented G A G algorithm . We denote by x any face, edge or vertex of F', th e sym m etric of th e shrunk feature, and by X any face edge or vertex of th e solid W . S te p 1: Shrink th e polygon F to get Fe. S te p 2: Reflect Fe w ith respect to th e origin O to o b tain th e sym m etric F[. S te p 3: C om pute th e GGI for each face, edge and vertex of W and F'e. S te p 4: F in d th e set U containing all th e pairs (a;,X ) w ith overlapping GGIs. S te p 5 : For each (x , X ) in U com pute M = x ® X . S te p 6: For each M find th e sm allest cone C w ith apex at 0 th a t contains M . S te p 7: C om pute th e union of all th e C cones. S te p 8: C om plem ent th e result to obtain th e desired G A C . Steps 1 to 3 are straightforw ard. T he Boolean operations on direction cones needed in steps 7 and 8 are im plem ented in term s of th e BR eps of th eir corresponding spherical subsets, by using th e algorithm s in [RV85]. Steps 4 to 6 require fu rth er discussion. 89 It follows from argum ents analogous to those presented in [BK90], [Gho88] and [GS86] th a t th e union B of th e M inkowski sum com puted in Step 6 contains th e b ou n d ary of F[ © W plus some portions of th e interior of this set. T herefore B can be used for th e required silhouette com putations. It is also easy to show th a t ed g e/v ertex or v ertex /v ertex pairs need not be considered, and th a t all th e other M inkowski sum s of pairs w ith overlapping GGIs can be com puted in 2D and produce polygons, ra th er th a n 3D sets. M ore recent work by K aul ([Kau93]) has shown th a t one does not need to generate th e M inkowski sum s of th e face/face and face/edge pairs in th e above algorithm . Therefore only v ertex /face and edge/edge co m p u ta tions are required and these are simple. 5 .2 .1 A lg o r ith m a n a ly sis In th e analysis of th e algorithm presented here it is assum ed th a t th e algorithm in [SBS92], is used for com puting th e union of a set of polygons. In th e current im plem entation, however, cones are unioned pairw ise. In addition we use th e results from [Kau93], w here it is shown th a t for com puting th e M inkowski sum of two polyhedra, only th e pairs v ertex /face, edge/edge have to be considered. Let np, rip, n y be th e num ber of faces, edges and vertices of W , and n f, n e, nv th e num ber of faces, edges and vertices of th e surface feature. N ote th a t n j = 2. Let N be th e m axim um of rip, rip, n v , and n th e m axim um of n j , n e, n v. Shrinking of F is perform ed by tran slatin g each vertex of F so th a t its incident edges are tra n slated by th e offset distance. H ence steps 1 and 2 require 0 ( n e) tim e and produce a feature w ith th e sam e num ber of entities as th e original one. Step 2 is linear in n e. In step 3 we m ust com pute th e GGIs of: • V ertices of W: A vertex V of W has at m ost np edges em anating from it. C om puting G G I (V ) involves convex hull com putations over these edges and it can be perform ed in 0{nplognp ) tim e ([Gan90]). T h e to ta l tim e for all vertices is bounded by 0{n\rnplognp) < 0 ( N 2logN). • Edges of W: A n edge E of W has at m ost np incident faces. C om puting G G I(E ) involves finding th e lim iting rays in a 2D neighborhood of E , and it 90 can be perform ed in 0 (n p ) tim e. T he tim e for com puting th e G G I of all th e edges is 0 ( w e R f ) < 0 { N 2). • V ertices of F': This is sim ilar to th e com p u tatio n for th e edges of W and it requires 0 (nvn e) < 0 ( n 2) tim e. • Edges of F[\ C om puting th e G G I of an edge of F[ can be perform ed in constant tim e, hence th e tim e for all edges is 0 (ne) < 0 (n). T he dom inating com putation for step 3 is th e one for GGIs of vertices of W , which requires 0 ( N 2logN) tim e. For step 4, we have to te st for intersection th e following GGIs. • Face F of W w ith vertex v of F£: T he te st for intersection of G G I(F ) w ith GGI{v) is equivalent to th e classification of a point w ith respect to a polygon w ith a constant num ber of edges, because G G I(F ) is a ray and G G I(v ) a poly hedral cone w ith two faces. Therefore, th e tim e required for each intersection te st is constant, and th e to ta l tim e is 0 {npriy) < 0 (Nn). • V ertex V of W w ith face / of F[\ T he test for intersection of G G I(V ) w ith G G I(f) is equivalent to th e classification of a point w ith respect to a convex polygon, because G G I(f) is a ray and G G I(V ) is a convex polyhedral cone. G G I(V ) can have at m ost t i e edges, hence each test can be perform ed in 0 ( t i e ) tim e. Since n j — 2 , th e tim e for all intersections is 0 (n v n s) < 0 (iV 2). • Edge E o i W w ith edge e of F'c: G G I(E ) is a cone w ith two faces, and GGI(e) is a flat cone. Therefore, th e tim e for each intersection is constant, and th e to ta l tim e is 0 (n E n e) < 0 (Nn). T he tim e required for step 4 is 0 ( M 2), w here M is th e m axim um of N and n. In step 5 we m ust com pute th e M inkowski sum s (sweeps) of entities of W and F'e. In th e analysis below, we give th e tim e required for th e sweeps, and th e num ber of edges in th e resulting sweep. T his la tte r value is needed for step 7. T he following sweeps m ust be com puted in step 5. • Face F of W w ith vertex v of F': Each sweep can be com puted in tim e linear in th e num ber of edges in F, which in th e w orst case is t i e - T he to ta l tim e is 91 O (nvnFTiE) < 0 ( n N 2). T he num ber of edges in each resulting sweep is 0 (tie), hence th e to ta l num ber of edges is 0 { n vnpnE) < 0 ( n N 2). If W is a m anifold, each edge of its boundary is shared precisely by two faces, and th e sum of th e num ber of edges per face over all th e faces is 0 (tie)- T herefore, for th e m anifold case, th e to ta l tim e and num ber of edges becom es 0 (nvriE) < 0 (n N ). In general, under th e assum ption YIf n E(F) = 0 ( u e), th e to ta l num ber of edges generated by this step also becom es O(niV). (H ere tie(F) denotes th e num ber of edges of face F.) • V ertex V of W w ith face / of F': T his is sim ilar to th e previous case, and the to ta l tim e and num ber of edges are 0 ( n v n fn e) — 0 ( n y n e) < 0 (nN). • Edge E of W w ith edge e of F': Each edge/edge sweep has at m ost 4 edges, hence, th e to ta l tim e and num ber of edges are 0 ( n # n e) < 0 (n N ). T he m ost expensive com putation in this step is th e M inkowski sum of faces of W over vertices of F', w hich requires 0 ( n N 2) tim e or 0 ( n N ) if W is a m anifold. Step 6 can be perform ed by casting rays from th e origin through th e vertices of each M inkowski sum , hence th e tim e for th is step is 0 ( n N 2). T h e union of all th e M inkowski sum s can be perform ed by using th e algorithm presented in [SBS92], section V -B, according to w hich th e union of a set of polygons can be perform ed in 0 ( m + k ) tim e, w here to is th e to ta l num ber of edges of th e polygons and k th e num ber of edge intersections. For w orst case analysis k equals to 2. For our case, th e num ber of edges of all th e sweeps is 0 (n N 2), hence step 7 can be com puted in 0 ( n 2iV4) tim e. If IE is a m anifold, step 7 can be perform ed in 0 ( N 2n 2) tim e. Step 8 is linear to th e num ber of edges in th e final union, hence it can b e perform ed in 0 ( n 2iV4) tim e, for non-m anifolds, and 0 ( N 2n 2) tim e for m anifolds. T h e w orst case com plexity of th e algorithm is 0 ( n 2iV4), since step 7 is th e dom in atin g com putation. If IE is a m anifold, or m ore generally, if J2f ue {F) = 0 (tie), th e com plexity of th e algorithm becom es 0 ( N 2n 2). T his is a w orst-case result. S tan d ard speed ups th a t exploit locality can bring th e average-case com plexity close to linear. 92 5.3 Experimental results T he algorithm described above is im plem ented in C on Sun S parcS tations. Figure 5.4 shows th e G A C for th e labelled faces of a polyhedral object. For th e program running on a Sun SP A R C station 10 th e com puting tim e for each G A C is less th a n 2 seconds. T h e current im plem entation is far from optim al. For exam ple, only th e faces lying w ithin th e p lan ar half-space defined by th e surface featu re and its outw ard pointing norm al are p o ten tial obstacles, and th ere should be b e tte r ways to com p u te silhouettes th a n through Boolean operations on cones. In addition, m any of th e stan d a rd speed ups used in com putational geom etry are applicable. A pproxi m ate cone representation thro u g h a spatial occupancy enum eration or quadtree-like stru ctu re on th e sphere m ight lead to fast algorithm s. T he union operation would be done sim ply by “raster scanning” th e cones onto a buffer, as in som e graphics algorithm s. B ut m uch space m ight be needed. E xtension to non-polyhedral objects is non-trivial, p rim arily because of th e dif ficulty of com puting M inkowski sum s for curved 3D objects. In our work, we ap proxim ate curved objects by polyhedra and use th e algorithm presented above. 93 E GAC(ADEF) GAC (ABCD) j j B GAC(AEFG) GAC(ABCD) Obstacle GAC(ABCD) without obstacle GAC(ABCD) with obstacle Figure 5.4: E xperim ental results. 94 Chapter 6 Representing inspection plans We now tu rn our atten tio n to th e problem of generating high level inspection plan(s) for a p a rt. A n inspection plan consists of a collection of setups, each associated w ith surface features to be inspected, probes for inspecting each feature, and th e relative orientations of th e p a rt, CM M and probes. T he inspection plan m ust be feasible (for exam ple, probes suggested should not collide w ith th e p a rt) and acceptable w ith respect to th e tim e it takes to execute it. W e seek to satisfice, rath e r th a n to optim ize, w hich we view as a com putationally in trac tab le problem . O ur approach to high-level planning casts th e problem as search in a space of p artially-com pleted plans. P lans evolve tow ards com pletion thro u g h th e efFects of operators th a t m ap plans into plans. T he sta te is represented by sets of 4-tuples (SU, P G , P D , SF), w here SU are th e th e setup orientations, P G are th e acceptable probe geom etries (selected from a given set of physical probes), PD are th e accessible directions represented by cones, and SF is a (possibly com pound) surface featu re to be inspected. We follow a least-com m itm ent strategy, and a tte m p t to reason about all th e possible solutions, gradually narrow ing th eir range by applying constraints such as accessibility, sam e-setup (for related features), and so on. To im plem ent th is approach com putationally we need: (a) a d a ta stru ctu re to represent th e state, (b) a set of operators to m odify th e sta te and (c) a control strategy. S tate representation is th e subject of this chapter, and operators and control strateg y are discussed in C h ap ter 7. T h e two m ost im p o rtan t considerations w hen designing th e d a ta stru c tu re for representing th e sta te are: ( 1 ) stru ctu re size, because th e stru ctu re could be very large, especially at th e beginning when m any inspection plans are stored, and (2 ) speed of u p d atin g th e stru ctu re, because m ost of th e operators m odify th e stru ctu re. T he stru ctu re chosen reflects b o th of these considerations, by not repeating d a ta shared am ong entities, and by representing constraints explicitly, so th a t th ere is no need for checking existing constraints after each o p erato r has been applied. 6.1 Measurements In order to check a tolerance, several features m ay need to be inspected. This suggests a n a tu ra l problem p artitio n : find inspection plans for each featu re and at a later stage com bine these plans to produce th e inspection plan for th e tolerance. 96 Such “m ini” inspection plans for individual features, called m easurem ents, form the basic u n it of th e state. A m easurem ent is a set of tuples of th e form (SU, P G , P D , SF), w here the m eaning of each tu p le field is: SU: setup PG : probe geom etry PD : probe direction SF: surface feature T he sim plest form of a m easurem ent for a feature F of tolerance T , consists of a single tu p le (SU, P G , P D , SF) = (a, b, c, d ) - w ith a, 6 , c, d discrete values - representing an inspection plan for F. T his inspection plan can be read as follows: th e m easurem ents required for feature F of tolerance T can be m ade by inspecting surface d under setup a w ith th e probe b and probe orien tatio n c. M ore generally, th e field values in a tu p le can be sets, w ith th e tu p le representing a collection of inspection plans. For th e previous tu p le exam ple, if c was a cone (set of directions) th e tu p le w ould represent all inspection plans for F w ith SU = a, P G = b, PD € c, and SF = d. In general, a m easurem ent m ay consist of m any tuples, each representing one or m ore inspection plans. Figure 6.1 shows a m easurem ent containing two tuples for th e p a rt face A BCD (F a for short). N ote th a t in th e second tu p le SF is th e CM M table. This m eans th a t w hen W is in th e setup SU2, th e tab le of th e CM M will be inspected instead of Fa. In th e current system , th is su b stitu tio n of a feature F by an o th er featu re S can be applied only w hen F is a p rim ary d atu m , b u t in general, any featu re can be su b stitu te d (by th e CM M tab le, or by a fixture surface) as long as th e soft-gaging algorithm allows it. T he SF en try in a tu p le m ight also correspond to a “sub-feature” th a t results from segm enting a toleranced surface which cannot be inspected as a whole, e.g. because its G A C is em pty. A m ore detailed description of each tu p le field follows. T he setup field (SU) contains inform ation for identifying one or m ore setups. A n SU consists of: • A ram -setup of th e form (D, co n strain t), w here D is a cone th a t gives th e ram directions w ith respect to th e workpiece, and c o n stra in t specifies th e distance 97 Fa= ABCD Tuple 1: (SU1, PG1, PD1, FJ SU1 6 PDl PG1 Tuple 2: (SU2, PG2, PD2, CMM_table) CMM_table SU2 PD2 F igure 6.1: A m easurem ent consisting of two tuples betw een th e CM M tab le and th e workpiece or betw een th e CM M tab le and a featu re of th e workpiece (Section 4.7.1). • F ix tu rin g inform ation. This contains th e geom etric description of th e fixtures and th e relative position and orientation of th e fixtures w ith respect to th e p art. T h e fixturing inform ation is not used in th e current system . In th e current system im plem entation th e SU field also contains th e index of the resting face, if such a face exists. A face F is a resting face if all th e points of F touch th e CM M table. T he resting face inform ation is red u n d an t, in th e sense th a t it can ex tracted from th e m odeler given th e corresponding ram -setup. N ote th a t th e inform ation given by th e cone D does not uniquely specify th e position of th e p art on th e CM M table. Four degrees of freedom are left unspecified, th ree for location and one for a ro tatio n about th e orien tatio n given by D. For a com plete specification one could use a transform ation m atrix th a t describes th e position and orien tatio n of th e p a rt w ith respect to th e CM M table. D and th e on-table flag can be used instead of th e transform ation m atrix because th e four unspecified degrees of freedom do not influence th e o th er sta te p aram eters, PG , PD and SF. (T he relation betw een SU and PD was discussed in Section 4.7.) A 98 com plete specification of th e pose of th e p art w ith respect to th e CM M is necessary only in la te r stages of th e planning process, w hen actu al p ath s and CM M code m ust be generated. Also, using a direction cone D facilitates th e use of accessibility cone inform ation to infer setups (Section 4.7), and lets us exploit our direction-cone co m putational m achinery. P ro b e geom etry (P G ) holds inform ation about th e probe to be used. It is th e nam e of th e probe stylus from th e tool d a ta base. If stylus extensions are used these should also be included in P G . P G represents a single probe ra th e r th a n a set of probes, except for its in itial value, which is all and corresponds to all possible probes. P ro b e direction inform ation (PD ) comes in two form s. For th e case of straight probes P D is a single direction cone. For b ent probes PD consists of a num eric value which is th e length of th e first probe com ponent, plus two direction cones describing th e directions of th e first and second probe com ponents. Finally, th e SF field of a m easurem ent defines a portion of a p a r t’s boundary to be inspected. In th e current im plem entation SF can eith er be th e index of a p art face or of a p a rt face segm ent, or it can have a special value th a t specifies th a t th e SF is th e CM M table. O ften SF is a feature in a tolerance specification and therefore th e SF field is red u n d an t. B ut th e presence of SF m akes it possible to su b stitu te and to segm ent features, b o th very im p o rtan t operations in inspection planning. T h e SF field som etim es holds only a portion of th e original surface featu re to be inspected. T his is useful in situations w here th e probe described by th e m easurem ent can only inspect a portion of th e feature. T his portion can be stored in th e SF field and th en add itio n al knowledge can be used to decide w hether inspecting only th is p o rtio n of th e feature is acceptable (for th e given tolerance requirem ents). SF holds only a single feature, w ith th e exception of th e in itial value w hich is all (i.e., all possible features). 6.2 State variables A sta te consists of a set of m easurem ents and constraints on these m easurem ents. In th is section we discuss th e form at of th e p a rt tolerances and how sta te m easurem ents are derived from th e in p u t p a rt and tolerances. 99 T1 type: parallelism value: 0.002 T1.F0 part feature: Fa role: primary datum T1.F1 part feature: Fb role: feature (c) Figure 6.2: P a rt tolerances 6 .2 .1 P a r t to le r a n c e s A tolerance specification contains inform ation th a t is used for generating th e high level inspection plan. A tolerance directly specifies w hich p a rt features have to be inspected. W h eth er any of these features can be su b stitu ted by others, and even w hat probe or probe orientation should be used can often be inferred from the tolerance specification. For exam ple, a very tig h t tolerance should be verified w ith a probe and probe direction th a t result in m easurem ents of high accuracy. For th e com m on trigger probes, large stylus length and stylus direction perpendicular to th e featu re result in loss of accuracy. In this work we assum e th a t th e p art tolerances are specified in accordance to th e D im ensioning and Tolerancing S tan d ard ANSI Y14.5M-1982 ([ANS82]). T h e two m ain types of tolerances th a t we use in high level planning are size and geom etric tolerances. A size tolerance (or lim its of size, according to [ANS82]), is of th e form n o m in a l s iz e dt lim it, and it is applied on cylindrical or spherical surfaces, or on a set of two parallel planes. In Figure 6 .2 b TO: 5±0.01 specifies a size tolerance betw een th e two parallel p lan ar p art faces F a and Fb. (In F igure 6.2b th e side view of th e p a rt of F igure 6.2a is shown.) Figure 6.2b also shows an exam ple of a geom etric tolerance T l, defined according to [ANS82]. T his is a parallelism tolerance, applied to th e p a rt face Fb. T he m eaning of th e tolerance is th a t all points of Fb m ust lie inside a tolerance zone of w idth 0 .0 0 2 , defined by two planes parallel th e th e p a rt face Fa. Face F a is called a prim ary Fb (a) Tl: / / 0.002 A — T TO : 5±0.01 -A- (b ) 100 d a tu m and it defines a coordinate system w ith respect to w hich th e tolerance zone is expressed. N ote th a t a parallelism tolerance by itself does not specify how far the tolerance zone should be from th e datum ; this is done by th e size tolerance TO. T he geom etric tolerance specifications are given inside a rectan g u lar box, called th e featu re control fram e, p artitio n ed into sm aller boxes. T h e first sm all box inside th e featu re control fram e of Figure 6.2b contains th e parallelism sym bol / / . This sym bol defines th e geom etric characteristic of th e tolerance. T he second such box contains th e tolerance value 0.002, and th e th ird , th e sym bol A, w hich is th e nam e of th e p rim ary datu m . We know th a t A is th e feature Fa, because of th e box containing th e sym bol -A- attach ed to Fa in general, a geom etric tolerance specification contains th e following. • T h e featu re to be toleranced, w here th e feature control fram e is attached. • T h e geom etric characteristic of th e tolerance. Some of th e tolerance character istics from [ANS82] are flatness, circularity, p erp en d icu larity and parallelism . • T h e value of th e tolerance. (In [ANS82], w hat we call value is called tolerance.) • A num ber of datum s whose function is to define a coordinate system ; tolerance zones are expressed w ith respect to this coordinate system . D atum s are not always necessary. For exam ple, a flatness tolerance does not need a datu m , because it controls th e form of th e toleranced feature, independently of where th e featu re is located. • O th er m odifiers, specifying things like m aterial condition, diam eter and arc length. A tolerance in our system is represented by a stru ctu re whose fields are: (a) type, th a t can be “size” , or th e geom etric characteristic of th e tolerance, depending on w hether this is a size or geom etric tolerance, (b) value, w here th e tolerance value is stored, and (c) th e features involved in th e tolerance. T he toleranced surface is a featu re and so is each datu m . For size tolerances on tw o planes, each plane is a feature. Each featu re contains th e p a rt surface featu re it corresponds to, and th e role th e featu re plays. T he role can be eith er one of th e d atu m s or sim ply “featu re” . All of these features are called th e features o f the tolerance. F igure 6.2c shows th e rep resen tatio n for th e tolerance T l of Figure 6.2b. 101 6 .2 .2 T o le r a n c e s, fe a tu r e s a n d m e a su r e m e n ts Suppose th a t th e in p u t workpiece W has n + 1 tolerances and each tolerance Ti has fi+ 1 features T i.F j, j = 0, f;. T he state contains each of these tolerances and features, in th e form presented in th e previous section. In addition each sta te featu re consists of m i j + I m easurem ents, and each m easurem ent contains th e four fields: SU, P G , PD and SF. T he entities contained in a sta te are th e following. • TO, ..., T n tolerances • each tolerance T i has f,-+l features: Ti.FO, ..., T i.Ff; • each featu re T i.F j has m ^j+ 1 m easurem ents: Ti.Fj.M O, ..., T i.F j.M m ^j • each state m easurem ent T i.F j.M k contains th e four fields: T i.F j.M k.S U , T i.F j.M k .P G , T i.F j.M k .P D , T i.F j.M k.S F , and also meas-constraints[]: an array holding constraint inform ation. N ote th a t a sta te feature F is precisely th e sam e as a surface featu re refer enced in a tolerance specification, w hereas th e SF field of a m easurem ent m ay correspond to a sta te feature, a segm ent of it, or th e CM M table. In add itio n to th e (SU, P D , P G , SF) d ata, each m easurem ent also carries inform a tion ab o u t th e geom etric constraints th a t are currently satisfied by th e m easurem ent d ata. T his inform ation is stored in a one dim ensional array of flags, called meas- constraints{\, w here each index of th e array corresponds to one geom etric constraint. If m eas-constraints[i] is tru e for a m easurem ent M, th en M satisfies th e geom etric constraint i. For exam ple, m eas-constraints[g-acc] m eans th a t th e global accessi bility constraint is satisfied. This array is necessary because geom etric constraint inform ation is used in th e preconditions of operators (Section 7.3) and one cannot infer solely from th e (SU, P D , P G , SF) values w hether a given constraint has been applied to a m easurem ent. (A lternatively, one could get this inform ation from the op erato r history.) W hen a m easurem ent is created, its four variables (SU, P G , P D , SF) are ini tialized to all, w here all denotes th e en tire dom ain of th e corresponding variable. T h e sta te can be viewed as a collection of state variables of ty p e SU, P G , PD or SF. T h e goal of high-level inspection planning is to find an assignm ent of values to 102 T1.F0.M0.SU SU1 T1.F0.M0.PG PG1 T1.F0.M0.PD PD1 T1.F0.M0.SF CMM_table T1.F1.M0.SU SU1 T1.F1.M0.PG PG1 T1.F1.M0.PD PD1 T1.F1.M0.SF Fb (a) <b) Fb CMM_table ......................... . SU1 o PG1 t PD1 (c) Figure 6.3: S tate variables for one tolerance these variables so th a t geom etric constraints - such as accessibility - are satisfied, and th e num ber of setups, probes and probe directions is sm all so th a t th e overall cost of plan execution is also small. T his is done by applying operators (described in C h ap ter 7), th a t shrink the range of each variable, u n til all geom etric constraints betw een variables are satisfied and th e overall plan is close to optim al. T h e sta te variables for th e tolerance T l of Figure 6.2 are shown in Figure 6.3a. F igure 6.3b shows an assignm ent of values to these variables th a t co n stitu tes a valid inspection plan for T l. T his inspection plan is shown in a p ictorial form in Figure 6.3c. A featu re has m ore th an one m easurem ent when segm entation of th e correspond ing p a rt featu re is necessary, because th e featu re is not accessible entirely by one probe direction (see Sections 3.4 and 4.3). For a featu re T i.F j segm ented into k+ 1 subfeatures, k - fl m easurem ents have to be constructed: Ti.Fj.M O, ..., T i.Fj.M k; each m easurem ent corresponding to one subfeature. 103 6 .2 .3 M u ltip le o c c u r r e n c e s o f th e sa m e p a r t fe a tu r e A t first glance th e sta te representation m ight seem red u n d an t. For exam ple, for th e p a rt of Figure 6.4 w ith tolerances as in 6.4a one has to create tw o m easurem ents, T0.F0.M 0 and T1.F0.M 0, for th e sam e p a rt feature, Fa. It w ould seem m ore rea sonable to represent th e sta te as th e set of p art features appearing in all tolerances, and to associate w ith each such featu re th e four variables, SU, P G , PD and SF, as in Figure 6.4c. This is a feature-based representation in stead of th e tolerance-based representation presented earlier. T h e feature-based approach has serious deficiencies, illu strated in th e following exam ple. Suppose th a t in th e inspection plan for th e p a rt of F igure 6.4 all th e features of each tolerance m ust be inspected using th e sam e probe geom etry and direction. (Such constraints are often im posed for accuracy reasons, as it will be seen in Section 6.3). Using th e stru ctu re of Figure 6.4b an inspection plan can be found th a t uses two different probes, one for each tolerance. Two probes are necessary because Fb is too long to inspect w ith PG 2, and P G l ’s tip is too large for inspecting Fc. (T he underlying assum ption is th a t th ere is no available probe th a t can inspect b o th Fb and Fc\ Fb is a through hole, w hereas Fc is a shallow, blind hole.) In contrast, no inspection plan th a t satisfies th e given co n strain t can be found using th e stru ctu re of F igure 6.4c. T his happens because of th e im plicit constraint im posed by th e state representation th a t a p art feature m ust be inspected only once, even if it belongs to m ore th a n one tolerance. O ne m ight argue th a t th e feature-based approach can be extended to allow a featu re to have m ore th a t one P G , in p articu lar one P G p er tolerance th a t involves th e feature. B ut this is essentially th e sam e as th e tolerance-based approach, th e basic idea being th a t th e representation contains (tolerance, feature) pairs, instead of ju st features. T h e only difference is th a t instead of th e hierarchy tolerance-feature- m easurem ent (tolerance at th e highest level) one w ould have th e hierarchy feature- tolerance-m easurem ent. A n interesting idea is to have b o th hierarchies available and to use whichever is m ore ap p ro p riate for th e operation. A feature-based representation is often used for problem s such as process p lan ning for m achining. B ut th e discussion above shows th a t it is not ap p ro p riate for 104 Fb iiiiiiiiiiiiiiiiiiiiiiniiiiiiiiHitiiiiiiiiiimiiiiiiiiiiiJ SU1 O PG2 t PD1 o PG1 T O type: perpendicularity value: 0.12 T0.F0 part feature: Fa role: primary datum T0.F1 part feature: Fb Tl type: perpendicularity value: 0.12 T1.F0 part feature: Fa role: primary datum T1.F1 part feature: Fc (a) T0.F0.M0 (SU, PG, PD, SF) = (SU1, PG1, PD1, F^ T0.F1M0 (SU, PG, PD, SF) = (SU1, PG1, PD1, Fb) T1.F0.M0 (SU, PG, PD, SF) = (SU1, PG2, PD1, T1.F1M0 (SU, PG, PD, SF) = (SU1.PG2, PD1, Fc) (b) Fa (SU, PG, PD, SF) Fb (SU, PG, PD, SF) Fc (SU, PG, PD, SF) (C) Figure 6.4: P a rt w ith th e sam e feature appearing in two tolerances 105 inspection planning. N ote th a t tolerance-based to feature-based representation con version can be easily perform ed in th e current system by im posing constraints of ty p e sam e on features. T his will be explained in detail in Section 6.3. 6.3 Sam e constraints D uring th e generation of an inspection plan it is often necessary to require th a t m ea surem ents be executed w ith th e sam e values for th eir sta te variables. For exam ple we m ight w ant to sta te th a t all m easurem ents of a tolerance should have th e sam e setup. Since th ere are four fields in a m easurem ent th ere are four sam e constraints: sam e-suy same-pg, sam e-pd and same-sf. T he m ost im p o rtan t reasons for im posing a sam e co n strain t are th e following. 1 . a c c u r a c y o f m e a s u r e m e n t r e s u lts : changing probe directions, probes and setups typically results in loss of accuracy. For exam ple, if a feature and its associated d a tu m of a tolerance are m easured w ith th e sam e setup, probe and probe direction, th e only sources of error are th e inherent inaccuracies of the CM M and th e probe. B ut if we changed th e setup we w ould introduce a new (and often large) error associated w ith th e relationship betw een th e two setups. 2. s p e e d o f in s p e c tio n p ro c e s s : Since changing probe direction, probe and setup are tim e consum ing, im posing sam e constraints can be used to m inim ize changes, th u s m aking th e inspection plan faster. L e t’s now look at th e constraint same-pg. Suppose th a t th is constraint was im posed on two m easurem ents M a and M & for accuracy reasons. Since this is th e only co n strain t, one could inspect M a and under two different setups as long as th e probe used in th e two cases was th e sam e. However, changing setups usually introduces g reater inaccuracies th a n changing probes does, because th e deviation be tw een desired and real workpiece position and o rientation is larger th a n th e deviation betw een desired and real probe position and orientation. T hus, for th e constraint same-pg to be effective, one m ust also im pose sam e-su. A sim ilar relation is tru e for th e accuracy of probe and probe orientation changes, which suggest th a t th e constraint sam e-pd m ust be accom panied by th e constraint same-pg. 106 T he co n strain t relationships ju st discussed also hold w hen a sam e constraint is im posed for m aking th e inspection faster. Changing setup takes m ore tim e th an changing a probe and changing a probe takes m ore tim e th a n changing probe direc tion. T he difference betw een th e tim e for changing a probe and changing a probe o rien tatio n depends on th e ty p e of probe head. For m anual probe heads a change in probe or probe orientation is followed by probe calibration (Section 2.1). Therefore th e tim e for changing a probe exceeds th e tim e for changing th e o rien tatio n by the tim e it takes to locate and store probes. For m otorized heads changing probe ori en tatio n does not require recalibration of th e probe; therefore changing a probe is m uch m ore expensive th a n changing orientation, since it requires th a t th e new probe be a ttach ed to th e CM M and recalibrated. From th e above discussion it follows th a t keeping th e sam e probe direction for two m easurem ents w hen th e probe and the setup change does not give us any significant savings in tim e. T he discussion above suggests th a t one could define two hierarchies of sam e constraints based on: a) th e m agnitude of inaccuracy th a t results from not im posing th e constraints, and b) th e speed up of th e inspection process w hen th e constraints are im posed. F ortu n ately b o th of these hierarchies coincide. T hus we can m ake th e following inferences: • sam e-pg im plies sam e-su-pg, i.e. th e m easurem ents m ust have th e sam e SU and PG . • sam e-pd im plies same-su-pg-pd • sa m e-sf im plies same-su-pg-pd-sf. T h e last constraint m eans th a t th e m easurem ents to w hich it applies are identical. It is used w hen th e sam e p a rt featu re appears in m any tolerances, and it should be inspected only once. By im posing this constraint one can convert a tolerance based rep resen tatio n to a feature based representation (see Section 6.2.3). B ecause of th is hierarchy th e sam e constraints can be represented using a tree, called sam e tree (see Figure 6.5 for an exam ple). It is a 6 -level tree, w ith levels th a t correspond to root, SU, P G , PD , SF and M (m easurem ent). Tw o m easurem ents have th e sam e setup if they have a com m on p aren t at th e SU level; sim ilarly they 107 SU level PG level PD level SF level root F igure 6.5: Sam e tree have th e sam e probe if th ey have a com m on p aren t a t th e P G level, and so on. Some exam ples of sam e constraints for Figure 6.5 are: • M a, Mb, M c, Md'. sam e-su • M e, M f, M g, M u, same-pg • M b ,M c: sam e-pd • sa m e-sf (R ecall th a t a lower-level sam e constraint im plies its upper-level co u n terp art, as noted earlier.) A m easurem ent cannot appear m ore th a n once as a leaf of th e sam e tree. T he children of each node are num bered consecutively startin g w ith 0. N ote th a t each m easurem ent corresponds to th e unique p a tte rn of num bers th a t describes th e p a th from th e root of th e sam e tree to th e leaf th a t contains th is m easurem ent. For exam ple, th e m easurem ent M c corresponds to th e p a tte rn ( 0 0 1 1 ), as indicated by th e bold line. 108 (SU1 PG1 PDl FI) (SU1 PG2 PD3 FI) (SU2 PG3 PD4 FI) (a) (SU1 (PG1 (PDl (FI))) (PG2 (PD3 (FI)))) (SU2 (PG3 (PD4 (FI)))) (b) ("root') (S U 2 ) (P G 2 ) (P G 3 ) ( P D l) (P D 3 ) (P D 4 ) d D d D d O (c) Figure 6 .6 : Tuple tree A sam e-pg (and hence sam e-su) constraint is usually im posed at th e beginning of planning for all th e m easurem ents of each tolerance. T his reflects considerations of accuracy. T he rem aining of th e sam e constraints are usually im posed tow ards th e end of planning w hen it is relatively certain th a t th e inspection plans in th e sta te are feasible. A t th a t point, sam e constraints are im posed for clustering setups, probes and features in order to produce an efficient plan. 6.4 Tuple representation T his section discusses how tuples of th e form (SU, P G , PD , SF) are represented. Since sam e constraints are often im posed on m easurem ents, special care has been taken for developing a representation th a t ( 1 ) does not store m ultiple copies of th e sam e values, and (2 ) m akes it easy to im pose sam e constraints. Tuples are factored in th e following order: SU, P G , P D and SF. T his m ight not be th e best factoring in term s of size b u t it facilitates th e rep resen tatio n w hen sam e constraints are present. Figure 6 .6 a shows th e tu p les for a m easurem ent M a; the factored tuples for M a are shown in F igure 6 .6 b and in F igure 6 .6 c in tree form. 109 Now suppose th a t th e tuples for a second m easurem ent Mb are given, as in Figure 6.7b. In addition, th e constraint sam e-su is im posed betw een Ma and Mb] th e sam e tree for this case is shown in Figure 6.7c. This sam e co n strain t m eans th a t SU1 and SU2 are com m on setup values for Ma and Mb- Suppose th a t at some point it is discovered th a t SU1 cannot be used for Mb, th en th e tu p les containing SU1 m ust be deleted from b o th Ma and Mb. This operation of u p d atin g th e tuples so th a t all existing sam e constraints rem ain valid can be perform ed m ore efficiently if th e com m on setup values are shared by Ma and Mb. T hus, w hen th e setup values change for Mb, th ey will autom atically change for Ma too. T h e rep resen tatio n shown in F igure 6.7d, called tuple tree, has th is property. A tuple tree com bines th e tuples of m any m easurem ents in one tree w ith th e com m on values factored out. A tuple tree contains two types of nodes: index nodes and value nodes - squares and circles, respectively, in Figure 6.7d. T he value nodes contain th e tu p le values of a m easurem ent. T he index nodes are used for distinguishing betw een m easurem ents. T his is done by associating a p a tte rn (i j k 1) w ith each m easurem ent Mx. T h en to get a tu p le for Mx we have to find a p a th from root to leaf in th e tu p le tree, such th a t th e index nodes encountered w hen traversing this p ath create th e p a tte rn (i j k 1). T h e value nodes encountered on th is p ath m ake up a tu p le for Mx. For the exam ple of Figure 6.7, th e p a tte rn for Mb is (0 1 0 0). A p a th of th e tu p le tree th a t has th e sam e index node p a tte rn is shown in Figure 6.7d by th e bold line. T he value nodes along this p a th are (SU1, P G l, PD 5, F2), which is one of th e tuples for M j. In this exam ple th e rightm ost p a th of th e tree has p a tte rn (0 1 0 0) and corresponds to an o th er tu p le of m easurem ent Mb. Below each leaf node a m easurem ent is shown; this m eans th a t a tu p le for th a t m easurem ent can be found by following th e p a th from th a t leaf node to th e root of th e tu p le tree. T his inform ation is not included in th e actu al tu p le tree; it is shown in th e figure for clarity. T he tuple tree can be viewed as an A N D -O R tree. T he index nodes are th e O R nodes and th e value nodes are th e AND nodes. A com plete solution - one tu p le for each m easurem ent - is a subtree of th e tu p le tree w ith a choice m ade at each of the O R (index) nodes. T h e tuple tree representation autom atically m aintains th e sam e constraints. For exam ple, suppose th a t at some point during planning it is discovered th a t SU 1 cannot be used for Mb ~ F igure 6.7d. T hen, th e tu p le tree will be m odified by 110 ♦ (SU1 (PG1 (PDl (FI))) (PG2 (PD3 (FI)))) (SU2 (PG3 (PD4 (FI)))) ^root^) ( s u T ) (S U 2 ) (P G l) (P G 2) (P G 3) (P D l) (P D 3 ) (P D 4) C zD C zD CfD (a) Tuples for Ma same-su(Ma, Mb) (SU1 PGl (SU2 PG5 PD5 PD6 F2) F2) (root") ( s u T ) (S U 2 ) (~D (TO ?) (P D 5) (P D 6) G D CED (b) Tuples for Mb SU PG PD SF CrooT) (P G l) (P G 2) (P G l) (P G 3) (P G 5) 0 0 0 0 0 Ma 0 ( P D l) (P D 3 ) < W ) @ ( W ) GD GD GD GD GD Ma Mh M, M u (c) Same tree (d) Tuple tree Figure 6.7: Com bining sam e and tuple trees 111 deleting th e en tire subtree whose root is SUl, th u s reflecting th e changes in both th e tuples of M a and M&. T h a t is, by using this rep resen tatio n th ere is no need for an additional step to m ake th e existing sam e constraints valid after th e tuples of a m easurem ent have been m odified. Since such tu p le m odifications are very frequent during th e search, th e tim e spent perform ing sam e constraint validity checking is very critical for th e overall planning tim e. 6.5 State representation Now th a t th e individual sta te entities have been presented, th e en tire sta te repre sentation can be discussed. A state contains static and dynam ic inform ation. T he static inform ation is th e geom etric m odel of th e p a rt and th e tolerances on th e p art. T he dynam ic inform ation consists of: • a set of sta te m easurem ents and th e ir associated m eas-constraint arrays • th e p a th of th e sam e tree th a t corresponds to each m easurem ent • a tuple tree for holding th e values of th e m easurem ents In th e current system th e state has been im plem ented as a C + + class. T he in itial sta te is created so th a t th ere is one m easurem ent per tolerance feature. T he user can in p u t in itial sam e constraints specifying up to w hat level of SU, P G , PD or SF th e m easurem ents of a tolerance have th e sam e values. 6.6 Low-level operations on state T his section presents th e low-level operations th a t are needed to m an ip u late th e sta te d a ta stru ctu res. H igher-level sta te transform ations - sta te operators, in th e AI term inology - described in th e next chapter are im plem ented th ro u g h calls to these low-level utilities. T he m ost im p o rtan t of these operations are: 1. m eas-update(M, T -set): u p d ate th e d a ta of m easurem ent M by intersecting th e old tuples of M w ith th e tuples in T -set. 112 2 . sam e-constraints(M -set, type): im pose new sam e constraints on a set of m ea surem ents. 3. extract-ip(n): shrink th e sta te so th a t each m easurem ent has only one tuple. 4. queries on state: database ty p e of queries concerning tolerances, features or m easurem ents T he first operation, m eas-update(M , T -set), takes as in p u t a m easurem ent speci fication M, and a set of (SU, P G , P D , SF) tuples, T -set. A m easurem ent specification is given by th ree integers: i, j and k, th a t denote th e m easurem ent T i.F j.M k. Let Sc be th e current sta te and Tmc be th e tuples of M in Sc• A pplying m eas-update(M , T -set) to Sc produces a new state Sn whose tuples for M, Tmn, are th e intersection of T -set w ith Tmc- O th er tuples are unchanged. Tuple set intersection is defined as follows: Let T a = • • • j ^a) an d Tf, = {2®,..., t b} be two sets of tuples; w here sm all t denotes one tuple. T hen, T a n Tb = {t \ t = t \ n tJ b, i € {0,..., n), j € {0,..., k }} A nd intersection of two tuples, t a and t b is defined as: ta n t b = (ta. s u n t b.su, ta.PG n t b.PG , ta.PD n tb.PD, ta. S F n t b.SF) M eas-update() modifies only th e tuple tree. A n exam ple is shown in Figure 6 .8 . T h e t j ’s at th e b o tto m of th e tuple tree denote tuples, for exam ple ti is th e tuple (SU1, P G 1, PD 1, F I). Now apply m eas-update(M a , {(all, PG 1, all, all)}). This causes th e entire sub tree w ith root SU2 to be rem oved because: (a) th e tu p le t 4 of M a is deleted (PG holds only discrete values, so PG1 D PG 3 = null); and (b) th e existing constraint: sam e-su(M a, M b) essentially m eans th a t if th ere is no tu p le for M a w ith SU equal to SU2 th en th ere is no such tu p le for M b. T his exam ple shows how th e explicit representation of th e sam e constraints in th e tuple tree avoids costly constraint satisfaction/checking after each tu p le up d ate. In tuple tree term s, sam e constraints are m aintained by applying th e rule: if one child of a value node is deleted, th en th e en tire value (A N D ) node and its subtree m ust be rem oved. 113 ^ r o o t meas-update(Ma, {(all, PG1, all, all)}) ( P G l) (P G 2 ) ( P G l) (P G 3 ) (P G 5 ) ( P D l) (P D 3 ) (P D 5 ) ( p p T ) (P D 6 ) Q D Q D C E ) G D G D Ma Mb h Ma U Mb t5 (su T ) ( P G l) ( P G l) & D (5D G D G D Ma Mb *1 l 3 Figure 6 .8 : O peration m eas-update() 114 C onstraints of ty p e sam e are often im posed on th e sta te to force features to be inspected in th e sam e setup, or using th e sam e probe. Since such constraints are dynam ically generated, i.e., one does not know beforehand w hat constraints will be applied, it is necessary to provide an operation th a t im poses new sam e constraints on th e state. T he operation sam e-constraints(M -set, var-type) takes as in p u t a set of m easurem ents (M -set) and a var-type (SU, P G , P D or SF) and m odifies th e state so th a t th e m easurem ents in M -set have sam e var-type. T his operation changes b o th th e sam e and tuple trees. T he sam e tree is m odified by finding th e parents of all m easurem ents in M -set a t level var-type and th en m erging th ese p aren ts into one node. In th e tuple tree th e index nodes are m erged to reflect th e new sam e tree stru c tu re and th e value nodes are intersected to create th e new tu p le values for th e m erged nodes. T his is an operation very sim ilar to jo in in d atab ase term inology. A n exam ple of sam e-constraints() application is shown in F igure 6.9. T h e op eration sam e-constraint({M a, Afi,}, P D ) is im posed on th e sta te of Figure 6.9a to produce th e result shown in Figure 6.9b. N ote th a t because of th e sam e constraint hierarchy, sam e-pd im plies sam e-pg-su; thus th e m erging of nodes a t th e P D level is p ro p ag ated upw ards to th e SU level. For this exam ple th e en tire subtree w ith root SU2 is elim inated because it does not satisfy th e constraint sam e-pg(M a, M\,) (PG 3 fl PG 5 = null). In th e subtree w ith root SU1 only th e tu p le w ith P G equal to P G l is left. T he operation ex tract-ip (n ) ex tracts one inspection plan from th e tuple tree. This is done by deleting all tuples b u t one from each m easurem ent, in such a way th a t the final assignm ent of tuples to m easurem ents satisfies th e existing sam e constraints. In addition, if a tu p le value is a set (as it m ight be th e case for SU and PD ) this operation chooses one value from th e set. If this is done in a system atic way, one can ask for th e n_th such inspection plan, w here n is th e p aram eter passed to ex tract- ip(). N ote th a t if th e sets are continuous, then th ey m ust be discretized in order to be able to get th e n_th inspection plan in a system atic way. 115 same-constraints({Ma, Mb}, PD) (ro o t) ( s u i ) ( P G l ) ( P G 2 ) ( P G l ) (P G 3 ) (P G S ) ( P D l ) ( P D 3 ) (P D 5 ) ( P D 4 ) ( P D 6 ) ( FI ) ( F2 ) ( FI ) ( F2 ) root root Ma Ma Mb (a) Ma Mb Ma Mb (b) Figure 6.9: O peration sam e-constraints() 116 Chapter 7 State transformation 117 T his ch ap ter discusses th e operators th a t transform th e state, from th e in itial state which corresponds to an unknow n inspection plan, to th e goal sta te th a t contains a com plete inspection plan. T he process of going from th e initial sta te to th e goal sta te through th e applica tion of operators will be referred to as inspection planning or sim ply planning. 7.1 Overview T he system arch itectu re is based on th e SO A R system [LNR 8 6 ], w hich em bodies a general arch itectu re for problem solving. In SO A R, as in th e state-space ap proach, problem solving is perform ed by applying operators to states. A dditionally, in SO A R, instead of keeping all operators and states in one com m on stru ctu re, one can organize th e m w ith respect to th e goal th ey atta in . All th e operators and states th a t can be used to achieve a goal are kept in a problem space. A n exam ple of prob lem space for th e inspection planning dom ain is m eas-su-ps, w here all th e operators th a t can be used to com pute setups for a m easurem ent are stored. U sually an o p erato r is im plem ented by a rule th a t changes th e state. B ut th ere are cases in which th e o p erato r is com plex enough to ju stify a new problem space, w ithin w hich th e o p erato r is im plem ented. For exam ple, consider th e o p erato r gac-sf, w hich com putes th e G A C of a feature. If th ere was only one algorithm for com puting th e G A C , th en gac-sf could be im plem ented by sim ply running th a t algorithm . B ut several such algorithm s are available for com puting G A C s, necessitating the fu rth e r step of choosing an algorithm . In this case a new problem space, gac-sf-ps, is needed th a t knows: (a) which algorithm s are available for com puting G A C , (b) th e preconditions for using each G A C algorithm , (c) how to recognize w hen th e goal for th e problem space gac-sf-ps has been achieved. In our cu rren t system a goal uniquely specifies th e problem space w ithin which one should work to achieve th e goal. For exam ple, to achieve th e goal compute-GAC- (F), one has to go to th e gac-sf-ps problem space. O nce in gac-sf-ps, th ere m ight be several operators th a t are applicable for achieving th e goal. To choose am ong these operators, th e subgoal c h o o s e - b e s t- o p e r a to r can be created. Now suppose th a t th e best o p erato r can be found only if some pro p erty of F is known. T hen, w ithin th e subgoal of c h o o s e - b e s t- o p e r a to r another subgoal g e t - p r o p e r t y - o f - F can be set. 118 T his p ro p erty of SO A R, called universal subgoaling, allows invoking new subgoals w ithin existing subgoals, thus creating a tree of subgoals and problem spaces. T h e inspection planning system was designed so as to offer a range of m ethods for perform ing each required geom etric com putation. Typically, these m ethods reflect a tra d e off betw een “goodness” of results and cost. For exam ple, th e m ethod th a t com putes th e exact G A C produces m ore accurate results and is m ore expensive th an an altern ativ e m ethod th a t com putes th e G A C by discretizing th e surface of th e un it sphere. In stead of forcing th e system to always use th e sam e m eth o d , we w anted to have th e flexibility to choose a m ethod m ost suitable for each current situation. T his was achieved by establishing problem spaces whose operators are th e different m ethods th a t can be used for th e given geom etric com putation. T he ability to choose betw een operators th a t com pute th e sam e q u a n tity reflects our concerns ab o u t planning tim e, th a t is, th e tim e required for finding th e final inspection plan. If planning tim e was unlim ited, th en one w ould alw ays use th e m ost accu rate m ethod, in an effort to find th e best inspection plan. However, in practice, planning tim e is a resource whose m inim ization is required. T hus, th e ideal high level goal of inspection planning is: find th e best inspection p lan for th e p art in th e m inim um am ount of tim e. A lthough we cannot g uarantee m inim um planning tim e, we try to achieve “acceptable” planning tim e through m ethods selection. A cheap m ethod will be preferred over a m ore expensive and m ore accu rate one, if th e resu lt of th e first m ethod is “close” to correct. Since th e result of a m ethod is not know n before th e m ethod is executed, heuristics have to be used for choosing th e best m ethod, w here best refers b o th to result quality and execution tim e of the m ethod. These heuristics are presented in Section 7.6. R esult range, i.e., th e range of solutions a m ethod can produce is another crite rion for evaluating a m ethod. This criterion is im p o rtan t because of th e inspection planning strateg y adopted, w hich consists of decom posing th e problem of finding an inspection plan for a p a rt into th e problem s of finding inspection plans for each p art tolerance, and th en com bining these tolerance plans to find th e final p lan for the p a rt. A large num ber of inspection plans per tolerance, corresponds to a high prob ability of plan overlap across tolerances, thus producing a “good” overall plan, w ith close to m inim al probe and setup changes. U sing th is heuristic and tak in g planning tim e in to consideration, th e goal can be reform ulated as: find th e m axim um num ber 119 of plans p er tolerance in th e m inim um am ount of tim e. A tolerance is decom posed into features, w hich in tu rn are decom posed into m easurem ents. A gain we seek to m axim ize th e num ber of plans and m inim ize planning tim e and use heuristics to choose th e best operators for achieving such goals. M axim izing th e num ber of plans is itself a heuristic th a t helps us a tta in th e goal of finding a plan such th a t (a) th ere is m axim um overlap am ong plans for all th e p a rt tolerances, and (b) tolerance plans are found in a m inim um am ount of tim e. T his goal is very hard to achieve, m ainly because it considers th e interaction betw een individual tolerance plans. In essence, it defeats th e idea behind th e de com position, which was to m ake th e problem sim pler by considering each tolerance by itself. Introducing th e idea of com puting m any plans for each tolerance keeps th e decom position still m eaningful, while m aking it easy to com bine these plans in th e end. T h e following sections present th e problem space hierarchy developed for in spection planning. T he goal associated w ith each problem space and th e operators available for achieving this goal are described. T he goal of m inim izing planning tim e is always present, even if not explicitly m entioned. T he sta te representation presented in ch ap ter 6 is used for all th e problem spaces. 7.2 Problem spaces and operators F igure 7.1 shows th e hierarchy of problem spaces used for inspection planning. (P roblem spaces used for selecting am ong operators are not shown.) A problem space is indicated by th e suffix p s and it is enclosed in a rectangle, w hereas an oper ato r is enclosed in an oval. P roblem spaces are connected w ith arcs, and these arcs are labelled by operators. An arc from problem space a - p s to problem space b -p s labelled by th e o p erato r o p -x , m eans th a t o p -x belongs to a - p s b u t o p -x cannot be im plem ented (applied) w ithin a -p s . To apply o p -x one has to go to b - p s , w here know ledge ab o u t th e application of th is operator is available. If b -p s is null, th en o p -x is im plem ented w ithin a - p s . A detailed discussion of th e problem spaces and operators of Figure 7.1 follows. T h e high level goal is to find an inspection plan for a given p art. Ideally, this inspection plan should be optim al w ith respect to execution tim e. B ut finding th e 120 best-ip Cwrify-ig^) Ccluster-sf-ite?> C^best-ip-iter^) part-su-ml (duster-sf cluster-sf-ps mspecuon-ps cluster-pd cluster-pd-ps 5 cluster-pg C^part-su^) _ Ccluster-pdite?) CtSerance^m^) (cluster-liu) Ickilta^p^^sT — * ^ ------- clus^ p s j IT part-su-m^) | tolerance-ps part-su-m2 C^uster-su-iter> Cfeature^ip) ------ — -l— (Verify-t-jpj) feature-ps Cj^ify-f-jg> (create-meas) Cmeas-jg^ > verify-m^p) -►Ccopy-vaT) equiv-sf meas-ps meas-su (comp-sf-su 1-acc-sf acc- comp-ewl-pcT> C p^e-geom > 5 — ,—-v, (^Mnp-ram^pdV Ccomp-pd-sip v ^ Figure 7.1: P roblem space hierarchy for inspection planning 121 best inspection plan is extrem ely costly; it conflicts w ith th e im plicit goal of m ini m izing planning tim e. Therefore, instead of an o ptim al plan, we seek a satisfactory one, w hich is feasible and has low cost. Feasibility is ensured by verifying th e inspec tion plan (m ore on plan verification later in this section). T he cost of an inspection plan is th e tim e it takes to execute it. A cost estim ate can be com puted by a t taching a cost to each of th e operations: setup, probe, probe direction change, and featu re inspection. T he sum of these costs is th e cost of th e entire inspection plan. If th e com puted cost is less th an a given u p p er lim it, th en th e inspection plan is deem ed acceptable w ith respect to cost. If th e tests for feasibility and cost are b o th successful, th e goal has been achieved and term in atio n is signaled. T he problem space th a t has knowledge for achieving th e goal “find an inspection plan for th e p a rt” is inspection-ps. T he operators in inspection-ps are: • part-su: com pute setups for th e p art. • four clustering operators: cluster-su, cluster-pg, cluster-pd, cluster-sf • best-ip: ex trac t one plan, possibly th e best one, from th e state. • verify-ip: verify a set of inspection plans. • tolerance-ip: generate inspection plans for a tolerance. M ost of these operators are not im plem ented w ithin inspection-ps, th a t is, to apply th em one has to go to a different problem space. A precondition for each o p erato r is th a t th e goal it is try in g to achieve is not tru e . Checking w hether a goal (or equivalently, a precondition) is tru e can be ju st a sim ple query on th e state, or it can be com plicated enough to require a problem space in w hich th e test is perform ed. In th e current im plem entation preconditions are tested th ro u g h sim ple queries on th e sta te (Section 8.1). T h e o p erato r part-su com putes setups for th e given p a rt. (N ote th a t setups can also be derived by using accessibility analysis in problem space m eas-ps, as discussed below.) Since th ere are several m ethods th a t can generate setups for a p a rt, a new problem space is defined, part-su-ps, th a t has knowledge ab o u t th e available m ethods. In Figure 7.1 th ree such m ethods are shown: 122 • p a rt-su -m l: th is is th e sim plest m ethod; it proposes th e six coordinate system axes of th e p a rt as th e setup directions • part-su-m 2: th e setups found by this m ethod correspond to th e faces of the convex hull of W • part-su-m 3: th is could be a very com plicated algorithm for com puting setups, or even a call to another package th a t generates setups according to criteria such as stab ility analysis. F ix tu rin g could also be produced by th is operator. A lthough this o p erato r is not im plem ented in th e current system , it is included here to show th e ease w ith which new m ethods can be in corporated in th e existing fram ew ork. A clustering operator perform s optim ization of th e inspection plan w ith respect to th e variable specified. For exam ple, cluster-su m inim izes th e to ta l num ber of setups in th e state. T his is done by grouping together m easurem ents th a t have non em p ty SU intersection an d by constraining these m easurem ents to have th e sam e SU values. In o th er words, cluster-su generates new sam e constraints on variables of ty p e SU. C lustering can be perform ed a t any tim e during planning, even at th e very beginning w hen variables have value all. B u t this does not m ake sense, since the resu lt will be one big cluster containing all th e variables. In th e current approach clustering is perform ed after values for th e m easurem ents are generated. Since clustering essentially produces com binations of m easurem ents, a clustering algorithm can po ten tially produce all such com binations. Usually, we work w ith one clustering result a t a tim e, hence th e clustering is im plem ented by lazy evaluation in th e problem space cluster-su-ps. T h e operator cluster-iter is in sta n tia te d w ith an integer th a t specifies th e desired iteratio n num ber. Sim ilar problem spaces are needed for th e rest of th e clustering operators. C lustering will be discussed fu rth er in Section 7.4. T he o p erato r best-ip ex tracts one inspection plan from a sta te th a t contains m any inspection plans. It tries to pick th e best inspection plan am ong all th e plans in the state. B est-ip is proposed w hen th e sta te still contains m any inspection plans after applying all th e geom etric constraints and optim izations. T his is necessary since th e o u tp u t to th e CM M is only one inspection plan. Because th ere m ight be several 123 “good” inspection plans in th e state, best-ip is im plem ented by lazy evaluation, retu rn in g one inspection plan at a tim e. T h e o p erato r verify-ip checks a given inspection plan for feasibility. T his is done thro u g h sim ulation. V erification can be though of as th e m ost global constraint because it takes into consideration all th e variables in th e state. An inspection plan th a t passes verification can be used by a CM M . T h e o p erato r tolerance-ip generates inspection plan(s) for a tolerance, th a t is, it generates th e tuples of all th e sta te variables associated w ith this tolerance. This o p erato r m ust be in stan tiated w ith a tolerance index. T hus for n sta te tolerances, n such operators - one per tolerance - can be proposed. T h e application of tolerance- ip(T) is perform ed in th e problem space tolerance-ps. T he goal associated w ith tolerance-ps was discussed in th e in troduction of this chapter: find a large num ber of feasible inspection plans for T. A tolerance is decom posed into its individual features in tolerance-ps, by th e operator feature-ip which com putes inspection plans for a feature. T his operator m ust be in sta n tiated w ith a feature of th e current tolerance. T h e second operator of tolerance-ps is verify-t-ip, which tests th e inspection plans of th e current tolerance for feasibility. V erification of tolerance plans is logically unnecessary since th e final (p art) inspection plan verification will discover infeasibilities. T he issue is planning tim e, specifically, th e tim e to backtrack all th e way to an infeasible tolerance inspec tio n plan and redo it, versus th e additional tim e to verify every tolerance inspection plan. T he choice m ade here is to verify tolerance inspection plans only w hen there is reason to suspect th a t th ey are invalid, for exam ple, w hen th ere are doubts about th e results of geom etric com putations. T h e final decom position in th e sequence tolerance-feature-m easurem ent happens at th e problem space feature-ps. T he goal at this problem space is to find inspection plans for a feature, and this is achieved by finding inspection plans for th e m easure m ents of this feature. T he o perator th a t com putes inspection plans for a m easure m ent is meas-ip. However, before com puting inspection plans for m easurem ents, th e m easurem ents m ust be created. T his is th e task of th e o p erato r create-m eas, which decides how m any m easurem ents th e featu re needs, creates these m easurem ents, and initializes th e m easurem ent variables to all T he final operator of feature-ps is 124 verify-f-ip w hich elim inates non-feasible inspection plans of th e feature. As in th e case of verify-t-ip, verification a t this stage is done for efficiency. T h e goal of finding inspection plans for a m easurem ent is achieved in meas-ps. T his is w here m ost of th e geom etric com putations th a t affect th e fields SU, PG , PD and SF tak e place. For exam ple, th e operator g-acc-sf com putes a value for PD such th a t th e global accessibility constraint is satisfied for th e given m easure m ent. Figure 7.1 shows th e operators of meas-ps w ithout th e problem spaces needed for im plem enting them . T hese operators are th e core of th e system , and th ey are presented in detail in Section 7.3. T h e application of operators to th e sta te (i.e., sta te transform ation) is achieved by applying th e ap p ro p riate low level operations on th e sta te (Section 6 .6 ). T he part-su and verification operators and all th e geom etric constraints m odify th e state by intersecting th e old w ith th e new tuples. This operation is perform ed by meas- update. T h e clustering operators, im pose new sam e constraints by calling th e low level operation sam e-constraints. T he o perator best-ip is im plem ented through a call to th e low-level operation extract-ip, which ex tracts one inspection plan from th e state. T he queries on sta te ex tract inform ation needed for checking operator preconditions, and perform ing geom etric com putations. 7.3 Problem space meas-ps 7 .3 .1 O v e r v ie w Inspection plans for each of th e m easurem ents of a featu re are first generated and th en com bined to o b tain th e inspection plans for th e feature. A gain, we w ant to generate m any feasible inspection plans w ithout spending a large am ount of planning tim e. T he problem space m eas-ps has th e knowledge available to achieve th e goal g e n e r a te - in s p e c tio n - p la n s - f o r - m e a s u r e m e n t. Figure 7.2 shows th e hierarchy of problem spaces w ith root meas-ps. (As in F igure 7.1 rectangle denotes a problem space, and oval an operator). A n inspection plan for a m easurem ent is feasible if it can be executed by a CM M . T his m eans th a t conditions such as setup stab ility and probe accessibility m ust be satisfied. Inspection plans for a m easurem ent are generated by startin g w ith a 125 comp-ewl-pcT^> copy-val venfy-m-i (Tequiv-sf meas-su meas-ps (comp-sf-su)^ probe-geonT^) comp-ram-pcP) g-acc-sT> Cjomp-pd-su^ C r-lac-sQ r-lac-sf-ml <^jac-sf-m2 ^) ^Mac-sf-m2^ ) C^nt-pd-sf-m2^> C ]bent-pd-sf-m Figure 7.2: P roblem space meas-ps 126 large in itial set of p o ten tial plans and th en im posing various feasibility conditions associated w ith geom etric constraints on th e state variables. W hen a constraint is im posed, the plans th a t do not satisfy it are elim inated. T hus, th e set of in spection plans shrinks. W hen a “good” set of inspection plans is found, th e goal g e n e r a t e - i n s p e c t io n -p la n s -fo r-m e a s u re m e n t is term in ated . Ideally, this goal should be term in ated w hen th e m axim um num ber of feasible inspection plans have been generated in m inim al tim e. T his is very h ard to achieve. Instead, we seek a “good” set of inspection plans for th e m easurem ent, w here “good ness” is a function of (a) th e likelihood of each plan being feasible and (b) th e size of th e set. Since it is not obvious how to com pute th e likelihood of feasibility of an inspection plan, we sim ply require th a t all th e feasibility conditions be satisfied. T h e size of th e set is not m easured in th e current im plem entation. A pplying a constraint never increases th e num ber of plans in th e state. T his has im p o rtan t im plications for constraint satisfaction. Suppose th a t we apply constraint 1. As a result, all th e plans th a t violate constraint 1 are rem oved from th e state. Now apply constraint 2. No new plans are introduced, and therefore th e resulting state still satisfies constraint 1. N ote th a t in a general co n strain t satisfaction problem , th e constraints m ay in teract and th eir sequential application does n o t g uarantee success. A fter a constraint has been applied a flag is set to tru e (in array m eas-constraints, Section 6.2); only constraints whose flag is false can be im posed subsequently. 7 .3 .2 O p e r a to r s o f meas-ps W hen a m easurem ent is created all of its fields are initialized to all, including the field SF. B ut w hen S F ’s value is all, one cannot apply geom etric constraints to SF. H ence an operator is needed for proposing SF values; th is operator is equiv- sf. In th e current im plem entation equiv-sf proposes eith er th e original p a rt feature associated w ith th e current m easurem ent, or a portion of th a t p a rt featu re in case of segm entation, or, if th e tolerance specifies th a t th e p a rt featu re is a p rim ary datu m , th e CM M . Conceivably o ther features could also be proposed, b u t this w ould require advanced tolerance analysis algorithm s, not available in th e current system . 127 T h e o p erato r m eas-su proposes setups for a m easurem ent as described in Sec tio n 4.7. N ote th a t th e o p erato r part-su in problem space inspection-ps generates se tu p s as well, b u t these setups are not “tailo red ” for th e given m easurem ent. R ath er, th ey reflect global considerations about th e en tire workpiece. U sing part-su instead of m eas-su has th e advantage of being fast because th e setup co m p u tatio n is p er form ed once for all th e m easurem ents ra th er th a n each m easurem ent individually. T h e disadvantage is th a t decisions ab o u t setups have to be taken high in th e decision tree, and th e probability of failure in la te r steps increases. T h e o p erato r com p-sf-su m akes sure th a t only valid com binations of (SF, SU) are present in th e cu rren t m easurem ent {comp stands for com patible). For exam ple, let A be th e p art feature th a t corresponds to th e current m easurem ent M. A ssum e th a t th e values for M .SF are A and C M M -table; and th e values for M .SU are S i and S2. If S i is th e setup in which A rests on th e CM M tab le, th en th e valid com binations for (M .SF, M .SU) are (C M M -table, S i) and (A, S2 ) because A cannot be m easured w hile resting on th e table. T h e tw o types of accessibility analysis, local and global, presented in th e previous chapters have corresponding operators l-acc-sf and g-acc-sf. T h e o p erato r l-acc-sf is im plem ented in th e problem space l-acc-sf-ps, w here one can choose to apply th e LAC or th e restricted LAC algorithm (or b o th ). T h e o p erato r lac-sf com putes th e LAC of each featu re of th e current m easurem ent. T he o p erato r r-lac-sf takes in to consideration th e adjacent faces of th e feature, th u s com puting th e restricted LAC (Section 3.3). lac-sf is im plem ented in th e problem space lac-sf-ps, w here two m ethods for com puting LAC are available: lac-sf-m l th a t com putes th e exact LAC, and lac-sf-m 2 th a t com putes th e LAC by sam pling th e surface of th e u n it sphere. Sim ilarly, th e two m ethods for r-lac-sf correspond to th e exact and sam pling m ethods for com puting restricted LAC. G lobal accessibility analysis is perform ed by th e o p erato r g-acc-sf Two m ethods are available for global accessibility analysis: gac-sf and bent-pd-sf As th e nam es indicate, th e first m ethod com putes th e G A C of a feature, while th e second deals w ith b en t probes. T h e fu rth er decom position of th e gac-sf and bent-pd-sf is sim ilar to cases seen before, w here th e suffixes -m l and -m 2 denote th e exact and sam pling m ethods, respectively. 128 SU1 CMM_table GAC(F) GAC’(F) F igure 7.3: O perator comp-pd-su T h e values for SU and PD for a m easurem ent depend on each other. Hence, w hen these values are generated independently, an additional step is needed for com patibility. T h e operator th a t perform s this com patibility check is comp-pd-su. A n exam ple of comp-pd-su application is shown in F igure 7.3. H ere, th e feature under consideration is F; setup analysis generated some SU values am ong which is SU1; and global accessibility analysis produced th e cone G A C (F ). B ut w hen th e p a rt is in setup SU1, th e CM M tab le is an obstacle for F, thus reducing th e PD from G A C (F ) to G A C '(F ). T his u p d ate of P D to G A C '(F ) is done by th e operator comp-pd-su. In order to apply comp-pd-su w hen th e value for SU is a continuous set of directions, th is set is discretized, and th en comp-pd-su is applied to each of th e discrete values. T his provides an approxim ation of th e desired resu lt, b u t is an expensive com putation. H ence it is b e tte r to postpone it u n til SU has been restricted as m uch as possible. T h e operator com p-ram -pd is another com patibility checking operator. It m akes sure th a t th e CM M ram direction and th e PD values are com patible, as described in Section 4.7.5. If th e CM M ram is as shown in Figure 7.4a and a straig h t probe of finite length is used, th en th e probe direction cannot be z . , because th e probe collides w ith th e CM M ram . If th e m otorized probe head PH 9 is used, as shown in Figure 129 1 9 1 1 CMM ram probe (a) PH9 motorized probe head (b) Figure 7.4: O p erato r com p-ram-pd 7.4b, th en th e probe direction is restricted to be w ithin cone C. Hence, applying com p-ram -pd involves th e intersection of PD and C. W hen th e CM M ty p e is such th a t th e ram is perpendicular to th e table, th e setup direction specifies th e CM M ram direction, th u s, com p-ram-pd effectively checks com patibility betw een PD and SU. T h e o p erato r probe-geom proposes probes th a t are ap p ro p riate for inspecting a feature. T his o perator basically determ ines th e probe tip diam eter, and stylus length, and it does so by using th e featu re size as an indication for th e tip d iam eter size. As a m easure for th e feature size we use: (a) th e m axim um w idth of th e convex hull ([Str82]), for p lan ar features, and (b) diam eter and length for cylindrical features. T h e w idth of a p lan ar feature in th e direction of a u n it vector v is defined as th e distance betw een two tan g en t lines to th e feature, one on each side of th e featu re, w hich are perpendicular to v ([Str82]). In Section 4.6 it was seen th a t not all of th e G A C (F ) directions can be used by real probes because G A C is com puted assum ing probes of zero w idth. T he effective w orking length (ewl) of th e probe plays a role in determ ining w hat portions of th e G A C are not com patible w ith th e probe geom etry. T he o p erato r comp-ewl-pd shrinks th e G A C so th a t it is com patible w ith th e probe geom etry. V erification is done through sim ulation and it can be very expensive, especially w hen th e num ber of inspection plans is large. V erification a t th is stage is not strictly 130 necessary, since a global verify-ip o perator is available in th e inspection-ps space. B ut verify-ip is even m ore expensive th a n verify-m -ip. T h e final operator of th e problem space meas-ps is copy-val, w hich, in contrast w ith th e previous operators, does not im pose geom etric constraints. It copies th e values of its argum ent m easurem ent Mi to th e current m easurem ent. T his o perator is typically used for copying values betw een m easurem ents th a t refer to th e same feature, th u s saving tim e by not repeating geom etric com putations. N ote th a t copy- val does not im ply constraints of type sam e am ong m easurem ents. 7.4 Clustering T he search for an inspection plan for a p a rt is perform ed as follows: first inspection plans for individual m easurem ents are generated, and th e n these inspection plans are grouped to g eth er so th a t: (a) th e to ta l num ber of setups in th e p a rt inspection p lan is m inim ized, (b) for each setup th e num ber of probes is m inim ized, and (c) for each probe th e num ber of probe directions is m inim ized. T hese th ree m inim izations can be tre a te d as th e sam e problem ; th e general form ulation follows. F irst we define th e notion of cluster of sets. D efin itio n 7.4.1 Given a collection o fn sets {A.j, A 2, ..., A n}, they fo rm a cluster iff n A i ^ 0 . i = \ D efin itio n 7.4.2 M inim um clustering problem : Given n sets {A t , A 2, ..., A n}, find k clusters {C i, C 2, • • ■, CaJ such that: Ui=i Ci = {A i, A 2 , . . ., A n}, and k is m inim um . T he m inim um clustering problem is N P -hard. T his follows from th e fact th a t th e clustering problem , which is a decision problem , is N P-com plete. T he answer to th e clustering problem is “yes” if th ere exist k-clusters for n sets, and “no” otherw ise. If th e m inim um clustering problem could be solved in polynom ial tim e, th en th e clustering problem could also be solved in polynom ial tim e, because if th e m inim im um num ber m of clusters is known, th en we know th a t th ere exist k-clusters 131 for k in {m, . . n} and none for k < m . For a proof th a t clustering is N P-com plete, by reduction to th e vertex cover problem see A ppendix D. Suppose th a t we are at th e inspection planning stage w here plans for all toler ances have been generated, and now we w ant to m inim ize th e num ber of setups in th e final inspection plan. Each tolerance has a collection of setups th a t can be used for inspecting it. T h e tolerances should be grouped so th a t groups contain tolerances th a t can be inspected in th e sam e setup and th e to ta l group num ber is m inim ized. M inim izing th e to ta l setup num ber is now equivalent to solving th e m inim um clus tering problem for th e setup values. In th e sequel, we often drop th e “m inim um ” qualifier and refer to this problem sim ply as th e clustering problem . A naive solution to th e clustering problem for n sets is to intersect th e sets in all possible ways and th en choose th e com bination th a t results in a m inim um num ber of clusters. This is obviously a very expensive solution, especially w hen th e sets to be clustered are direction cones whose intersections involve non-trivial co m p u ta tions. Instead, heuristics can be used as in th e clustering algorithm presented in th e following section. This is a sim ple “greedy” algorithm th a t finds th e largest cluster first and th e n rep eats th e process for th e sets not already clustered. 7 .4 .1 C lu ste r in g u sin g h e u r is tic s Let A = {A i, A 2, ..., A n ) be a collection of sets for w hich th e m inim um clustering problem m ust be solved. T he approach described below p artitio n s th e space of A w ith som e grid, and then classifies each of th e A ;’s p artitio n s w ith respect to the grid. T h e num ber of sets th a t intersect a grid cell (or facet) indicates w here to look for a “good” cluster. Figure 7.5 shows an exam ple of th ree sets classified w ith respect to a square grid. (A lthough clustering of direction cones m ust be perform ed on th e surface of th e unit sphere, in this section planar 2D exam ples will be given for sim plicity of exposition.) T h e algorithm presented below, relies on tw o operations. T h e first is th e clas sification of each A* w ith respect to th e grid, th a t is, finding w hich squares of th e grid A i intersects. For th e exam ple of Figure 7.5, th e resu lt is given in tab le A. (S ophisticated indexing schemes could be b u ilt to ex tract o ther inform ation easily, for exam ple, to find w hich squares have a non-em pty intersection w ith a given A t .) 132 1 2 3 4 1 2 3 4 Ai Ai,A 2 a 2 ,a 3 a 3 Ai a i,A 2 A2 .A3 a 3 Ai Ai a 3 a 3 Table A r A 2 ^ 1 I V 7 *) J ___J Figure 7.5: C lustering th ree sets T he second operation, called detect-cluster, can be described as follows. G iven a grid cell, find a collection of sets th a t form a cluster (i.e., whose intersection is not em pty), such th a t th e num ber of sets is maximum* and th e intersection of th e cell w ith each set is not em pty. T his is a m ore difficult operation th a n set classification and it is perform ed only for certain cells, in th e algorithm described by th e pseudo code below. T his is a “greedy” algorithm th a t looks for facets th a t intersect a m axim um num ber of sets in A . T h e algorithm works as follows. Each facet has an associated triple, consisting of th e facet itself, a list of sets th a t intersect it, and th e num ber of such sets. F irst th e facet triples are sorted in decreasing order, according to th e num ber of sets th a t intersect each facet. This is done by th e function sort-facets. T hen th e operation detect-cluster is perform ed on th e first facet of th e ordered list. If all th e sets th a t intersect th is facet form a cluster, those sets are rem oved from A , and a cluster is added to th e result. T he above process is th en rep eated for th e new A . If th e cluster found by detect-cluster is a proper subset of th e sets th a t intersect th e facet, th e facet is rem oved from th e beginning of th e list, its trip le is u p d ated by rem oving those sets not in cluster C and setting th e num ber of sets to th e cardinality of C. T he new trip le is inserted again, b u t now in a position th a t corresponds to th e num ber of sets in th e cluster. T he process continues by perform ing detect-cluster on th e new first facet in th e list, u ntil A is em pty. 133 procedure clustering(A, G) { /* A: collection of sets to be clustered */ /* G: array of parameters that specify the grid */ result = -Q /* result: list of clusters */ repeat until A=-Q • { L = sort-facets(A, G) /* L: list of triples <f, S, n>, sorted according to n; */ /* f: facet, */ /* S: sets whose intersection with f is non-empty, */ /* n: cardinality of S */ t = first element of L <C, k> = detect-cluster(t) /* C: sets that form the cluster, k: cardinality of C */ if t.n != k then insert <t.f, C, k> in L else {. A = A - C result = result + t > > return result > This algorithm is sequential and order dependent. It is far from optim al, b u t it is easy to im plem ent. An exam ple w here it fails to find th e m inim um clustering is shown in Figure 7.6. Suppose th a t th e grid is exam ined by stepping along th e cells in th e first colum n, th en th e second, and so on. T he algorithm first will find th a t A i, A 2 form a cluster, and th en th a t A 3 and A 4 form cluster. T h e result is two clusters, w hich is th e actual m inim um . Now assum e th a t th e grid is exam ined by stepping along its rows. T he p air A 2, A 3 form s th e first cluster. T h en A 4 and A 4 are found to form two different single-set clusters. Now th e result is th ree non-optim al clusters. 134 1 2 3 4 1 2 3 Figure 7.6: O rder of exam ining th e facets is im p o rtan t 7 .4 .1 .1 P r e f e r r e d d ir e c tio n s All of th e directions in a G A C are equivalent from th e point of view of accessibility. B u t some of these directions m ay be preferable to others because accessibility is not th e only issue th a t m ust be considered. For exam ple, if a trigger probe is used, th e directions norm al to th e surface produce less accurate results, and therefore oblique directions are preferable. T h e clustering algorithm ju st described assigns to each facet a value th a t equals th e num ber of sets intersecting th a t facet. T his algorithm can be easily m odified to incorporate sets w ith weights, by settin g th e value of each facet to be th e sum of th e w eights of th e sets intersecting th e facet. In th is way, a cluster containing preferred sets will be favored over an o th er cluster w hich contains a bigger num ber of “less preferred” sets. 7.5 An example of inspection planning In this section we will illu strate how th e planner works by m eans of a sim ple ex am ple, using only straig h t, non-orientable probes. T h e toleranced p a rt is shown in F igure 7.7. T h e task is to generate an inspection plan for verifying th e positional tolerance of th e slot walls. T he operators used by th is exam ple are proposed and selected autom atically. T he application of operators th a t involve direction cones 135 slot walls face B -c- face C face A -B- -A- F igure 7.7: Toleranced p a rt needs a preprocessing step w here th e cones are w ritten in files. A fter th is step, the application (w hich essentially is tu p le m anipulation) is perform ed by th e planner for all operators except verify-ip w here th e user has to in p u t w hether th e plan is successful or not. T he sta te (Figure 7.8b) contains four m easurem ents, T0.F0.M 0, TO.FI.MO, TO.- F2.M 0 and T0.F3.M 0 th a t correspond to th e in p u t tolerance features (Figure 7.8a). In add itio n to th e m easurem ents, th e sta te contains th e co n strain t same-pg(TO), which specifies th a t th e m easurem ents of th e tolerance TO should be inspected in th e sam e setup and w ith th e sam e probe geom etry. Inspection planning sta rts by initializing th e state, so th a t all tu p le variables have value all (in F igure 7.8b U stands for “universe” , or all). T he trace below shows th e o p erato r tree up to th e point w here th e o p erato r EQUIV_SF(TO .FO .MO) is selected. O perators th a t have been selected, are indicated by a num ber th a t gives th e order of selection (i.e., operator history). A sta r indicates th a t th e o p erato r is still open. 136 Input tolerance Initial state TO : TO : SU PG PD SF type: position value: 0.1 F0.M0: (U , u, u, U ) F0:part face: face A FI .MO: (U , u, u, U ) role: primary datum FI: part face: face B F2.M0: (U , u, u, U ) role: secondary datum F3.M0: (U , u, u, U ) F2: F3: part face: face C role: tertiary datum part face: slot walls role: feature same-pg(TO) (a) (b) F igure 7.8: In p u t tolerances and in itial state * PART.SU [ 0] TOLERANCE.IP(TO) [ 1] FEATURE_IP(T0.F0) [ 2] MEAS_IP(T0.F0.M0) [ 3] EQUIV.SF(TO.F0.MO) * FEATURE.IP(TO.F1) * FEATURE.IP(TO.F2) * FEATURE.IP(TO.F3) * CLUSTER.SU * CLUSTER.PG * CLUSTER.PD * CLUSTER.SF T he operators applicable to th e initial sta te are: part-su, tolerance-ip(TO), clu- ster-su, cluster-pg, cluster-pd, cluster-sf. T he two operators verify-ip and best-ip are not proposed because th eir preconditions are not satisfied. T he precondition 137 for verify-ip and best-ip is th a t none of th e sta te variables has value all. For this exam ple, th e preference for th e o p erato r part-su is set to th e lowest am ong the operators of its problem space, and th e preference for tolerance-ip to th e highest. H ence, th e o p erato r selected is tolerance-ip(TO). In order to apply th is operator we m ust go to th e tolerance-ps, w here th e operator feature-ip is proposed for each of th e tolerance features. T h a t is, th e operators proposed are: feature-ip(TO.FO), feature-ip(TO .FI), feature-ip{T0.F2) and feature-ip(T0.F 3). All these operators have th e sam e preference, so any of th em can be selected. Feature-ip(TO.FO) is selected because it is th e first in th e list of operators. T his o perator is applied in th e feature- ps w here th e operator m eas-«p(T0.F0.M 0) is th e only one to be proposed. In the current system create-meas has not been im plem ented, and verify-f-ip cannot be proposed because its precondition (none of th e featu re’s variables is all) is not true. T h e application of meas-ip(TO.FO.MO) is perform ed in th e m eas-ps problem space. W hen th e variables of a m easurem ent have value all th e only operators th a t can be applied are equiv-sf and copy-val. T he rem aining operators are not applicable because th ey need variable values o ther th a n all. In th e current system copy-val is not im plem ented, hence th e only o p erato r th a t is proposed in equiv-sf. Since equiv-sf is th e only operator proposed, it is selected as th e best available operator. T h e application of equiv-sf is perform ed directly, w ithout th e need to go to a lower problem space. T his is done by calling a function th a t com putes values for th e SF field of th e tuple. In th e resulting sta te (Figure 7.9a), th e SF for TO.FO.MO can be eith er th e featu re itself - face A - or th e CM M table. (S u b stitu tin g a feature by th e CM M tab le can only be done for a p rim ary d atu m .) For sim plicity, th e state of F igure 7.9a shows th e tuples unfactored. T he in tern al sta te representation is th e tuple tree shown in Figure 7.9b, w ith th e m easurem ents sharing th e values for SU and P G , because of th e same-pg constraint. Subsequent operators m odify th e values of PD and PG . A pplying th e operator <7-acc-.s/(T0.F0.M0) to th e sta te of Figure 7.9a results in th e PD field being filled in w ith th e global accessibility cone of th e corresponding featu re (Figure 7.10a). T h e o p erato r probe-geom(TO.FO.MO) fills in th e P G field w ith th e nam e of a real probe, P15 in this case. T he operator m eas-s«(T0.F0.M 0) fills in th e SU field w ith a direction cone. Since straight probes are used, th e SU is th e sam e as P D , except in th e case w here th e CM M tab le is used. In th a t case th e SU is specified by th e 138 (root) su Q p PG T0.F0.M0 T0.F1.M0 T0.F2.M0 T0.F3.M0 (b) T0.F0.M0: (U, U, U, face A) (U, U, u . cmm table) T0.F1.M0: (U, U, U, U) T0.F2.M0: (U, u , u . U) T0.F3.M0: (U,U ,U , U) Figure 7.9: A pplication of operator equiv-sf 139 SU PG PD SF face A ) cmm table ) (a) face A ) P15 TO.FO.MO: ( cmm table ) P15 □ O P15 (b) Figure 7.10: A pplying th e operators (a) g-acc-sf and (b) probe-geom and m eas-su to m easurem ent TO.FO.MO 140 su PG SF PD TO.FO.MO: P15 cm m table TO.F1.MO: P15 face B T0.F2.M 0: face C P15 slot walls P15 T0.F3.M 0: Figure 7.11: Inspection plans for all m easurem ents inw ard norm al of th e face th e p a rt is resting on. Figure 7.10b shows th e state after th e application of pro6e-^eom (T0.F0.M 0) and meas-stt(TO.FO.MO). A fter applying sim ilar operators for th e rem aining m easurem ents, we reach the sta te shown in Figure 7.11. T here is only one SU direction because th e intersection of all SUs (SUs are th e sam e as th e PD cones) is th is direction, and because th e SUs are intersected w hen entered into th e sta te in order to keep th e constraint same-pg valid. A t this point, inspection plans for all m easurem ents have been generated. This causes th e planner to go up one problem space, to feature-ps. T h e o p erato r verify-f-ip can be applied now, b u t unless th ere is a failure, this o p erato r is not selected. Simi larly, th e planner moves upw ards to th e tolerance-ps and finally to th e inspection-ps. T h e clustering operators are proposed again, and this tim e th ey are selected be cause th ere are no m ore tolerance-ip operators (which get higher preference th an clustering). T h e o p erato r cluster-su has th e highest preference, th en comes cluster- pg, cluster-pd and cluster-sf in this order. C lustering of SU and P G does not change th e sta te because of th e active constraint same-pg and because th ere is only one 141 SU PG PD SF TO .FO .M O : 4 P15 cmm table T0.F1.M0: face B T0.F2.M0: face C T0.F3.M0: slot walls setup 4 Figure 7.12: S tate after clustering tolerance in th e state. T he operator cluster-pd, however, changes th e sta te by in ter secting all th e P D cones, as shown in Figure 7.12 (tuples in Figure 7.12 are shown in factored form ). C luster-sf does not change th e sta te because th ere are no p art faces shared by m easurem ents. T he planning is com pleted by selecting an inspection plan from th e sta te of Figure 7.12 and verifying it. V erification can be perform ed thro u g h sim ulation, b u t it requires com m unication betw een th e planner and a geo m etric m odeler, which has not been im plem ented in th e current system . A successful verification signals th a t th e top-level goal of finding an inspection plan for th e p art has been achieved, and th e planner stops retu rn in g th e final inspection plan. 7.6 Control T h e control strateg y used is a com bination of steepest-ascent hill clim bing and best- first search. U sually one uses these m ethods by applying operators to produce new states, and th en choosing th e best sta te am ong th e new states. A pplying operators, however, is very expensive in our case, since it often involves geom etric co m p u ta tions and tu p le m anipulations. For this reason, we select operators on th e basis of expected plan im provem ent. These expectations are cap tu red by assigning prefer ences to operators. Different search strategies could, in principle, be im plem ented by m an ip u latin g these preferences. T he control strateg y can be briefly described as follows. Suppose th a t during th e search a sta te S is reached. If all th e sta te variables 142 have values o th er th a n th e em pty set, th en all th e operators w hose preconditions are satisfied are proposed to be applied to th e state. T h e b est o p erato r am ong those is chosen. This is th e steepest-ascent p a rt of th e search, since only th e operators applicable to th e current sta te , S , are considered. If at least one sta te variable has as value th e em pty set, th en we have reached a failure, and no new operators are proposed for application in th e sta te S . In this case th e best o p erato r is chosen from th e entire o p erato r tree (best-first). H euristics are used for selecting th e best operator for b o th search m ethods. T hese heuristics are presented in th e following two sections. T he im plem entation of these heuristics is discussed in Section 8.1. 7 .6 .1 H e u r istic s for s te e p e s t-a s c e n t h ill c lim b in g T h e heuristics for steepest-ascent hill clim bing need only to com pare operators of one problem space. In th e following som e of th e heuristics th a t can be used for each problem space will be presented. N ot all of these heuristics have been im plem ented. T he top problem space, inspection-ps has th e following operators (Section 7.2): part-su, tolerance-ip, cluster-su, cluster-pg, cluster-pd, clu ster-sf best-ip and verify- ip. T he first six operators can be proposed (have th eir preconditions satisfied) at th e sam e tim e. In order to propose best-ip and verify-ip none of th e sta te variables should have value all, and to propose tolerance-ip at least one sta te variable should be all. H ence tolerance-ip and best-ip, verify-ip cannot be proposed a t th e sam e tim e. However, if tolerance-ip is excluded, th en all operators can be proposed concurrently. C hanging th e preference of th e part-su o perator results in th e system working in different m odes. H ere two of these m odes are discussed. In th e first m ode part-su is given th e highest priority am ong th e operators of inspection-ps. By doing th a t, one avoids th e com putation of setup for individual m easurem ents by th e operator meas-su. In th e second m ode, part-su is given th e lowest preference, th u s allowing th e com putation of setups by th e operator meas-su. T he o p erato r tolerance-ip has th e highest preference am ong th e clustering, verify- ip and best-ip operators. T he relation betw een th e preferences of tolerance-ip and part-su depends on which m ode th e system works in, as explained above. T he high preference for tolerance-ip forces th e clustering to be perform ed after th e plans for all tolerances have been generated. T he rationale for th is is th a t by clustering 143 early th ere is a possibility of forcing two tolerances to be inspected in th e sam e setup w hen this is not possible. By postponing clustering for w hen m ore inform ation about th e individual tolerance plans is present, th ere is a bigger probability of clustering producing valid plans. In th e case th a t m ore th a n one tolerance-ip operators are proposed, we try to s ta rt w ith th e tolerance whose inspection plan is th e hardest to generate. This serves tw o purposes. F irst, th e probability of failure w hen generating a plan for such a tolerance is large, and early failure is preferable since it saves planning tim e. Second, such a tolerance is likely to have few inspection plans. T his is useful in case clustering is to be perform ed before all tolerance-ip operators are applied, because it will probably result in few inspection plans for th e rem aining tolerances. (O f course, th is has th e disadvantage of clustering early, m entioned above.) Tolerances th a t have em pty inspection plans usually have large num ber of features, large num ber of non-planar features, and large variation in featu re size. A w eighted sum of these th re e characteristics can be used for ordering tolerance-ip operators. T he o p erato r best-ip is given th e highest priority only after all clustering operators have been applied. This can be done because th e sta te keeps th e inform ation about w hat operators have already been applied. Sim ilarly, verify-ip is given th e highest priority after best-ip has been applied. T his is done because plan verification is tim e consum ing, hence it is b e tte r to perform it only for one inspection plan. In th e tolerance-ps problem space, if m ore th a n one featnre-ip operators is pro posed, th en th e operators for cylindrical features are preferred over those for planar features. T he reason for this is th a t cylindrical features usually can be inspected w ith a sm all num ber of probes and few directions. Suppose th a t th e constraint sam e-pd is im posed, im plying th a t features in a tolerance m ust have sam e SU, P G and P D on a tolerance th a t includes a cylindrical feature th a t has only two accessi ble directions. T hen all th e features of th e tolerance have to be inspected by probes oriented along these two directions. S etting th e com m on PD of th e tolerance to th e two directions early in planning saves tim e because costly cone intersections (needed for u p d atin g th e PD values of th e state) can be avoided. T h e operator verify-t-ip is only selected during th e best-first search because verification is an expensive opera tion and it is used only w hen th ere is a failure th a t specifies which is th e tolerance whose inspection plans caused th e failure, and should be verified. 144 For th e m eas-ps problem space, th e preconditions of th e operators im pose a sequencing. For exam ple, one cannot apply any of th e operators (except copy-val) u n til equiv-sf has been applied. If several operators are proposed, th en th e first one is chosen. In th e current system only one m ethod has been im plem ented for each geom etric task. However, w hen several such m ethods are available for th e sam e geom etric task, an evaluation function can be used for choosing am ong them . A reasonable function is th e w eighted sum of th e following th re e q uantities, w hich m ust be supplied for each m ethod: • accuracy: w hat is th e likelihood of th e result being correct? • result range: how m any solutions does th e m ethod retu rn ? • cost: how long does it tak e to execute th e m ethod? T he weight associated w ith each q u an tity controls th e ty p e of solution obtained. For exam ple, high weight for cost and low weight for accuracy m eans th a t th e result has to be found quickly and need not be accurate. Specialized rules can also be used for m ethod com parison; these rules overw rite th e result of th e evaluation function. 7 .6 .2 H e u r istic s for b e s t-fir st Inspection planning fails w hen a t least one state variable has as value th e em p ty set. T his can happen w hen a w rong m ethod is chosen. For exam ple, if a feature F can be inspected only w ith bent probes, th en com puting G A C (F ) will result in failure. T his is a sim ple case w here chronological backtracking will solve th e problem . B ut a failure can result from choosing th e w rong m ethod several steps before it is detected, or m ore pernicioulsy, from an accum ulation of w rong choices. D om ain specific knowledge - in th e form of rules - is used to diagnose th e failure and recover from it. A rule indicates possible culprits for th e failure, usually in order, so th a t th e choice m ost likely to be responsible for th e failure is first. In th e current im plem entation, th ere is only one such rule, w hich is used w hen the operator verify-ip fails. A n inspection plan fails because of collisions betw een probe and CM M or probe and p a rt (or b oth). It is assum ed th a t th e verification m odule 145 retu rn s th e m easurem ent th a t was being perform ed w hen th e collision occurred (now th is m easurem ent is given by th e user). T he heuristic used suggests th a t th e best o p erato r to apply next is verify-m -ip for th e m easurem ent th a t caused th e failure. If m ore th a n one verify-m -ip exists for th is m easurem ent, th en th e latest one is selected. T h e idea behind this heuristic is th a t if a collision occurs in th e final plan, one should go back and elim inate this collision at th e m easurem ent level. Trying som ething else, for exam ple a different clustering, m ight still result in a plan w ith th e sam e collision in it. For any o ther type of failure th e system perform s chronological backtracking. T his is reasonable for failures of operators th a t perform geom etric tasks. T here, a failure can usually be resolved locally. For exam ple, if th ere are no sam e constraints am ong th e m easurem ents of a tolerance, an em pty G A C for m easurem ent M a proba bly resulted from th e wrong choice of m ethod for com puting it, ra th e r th a n from the m ethod used for com puting th e probe geom etry for a different m easurem ent. If sam e constraints are im posed am ong th e m easurem ents of a tolerance th en th e reason for th e failure can be isolated w ithin th e choices m ad e for th e tolerance containing the em pty-valued variable. T his analysis is useful only before clustering. A fter cluster ing, th e interdependencies am ong state variables becom e so com plicated th a t alm ost any choice from th e very beginning of planning could be responsible for th e failure. In this case, heuristics like th e one presented in th e previous parag rap h are used for selecting th e operators likely to resolve th e failure. 146 Chapter 8 Implementation and experimental results 147 8.1 Implementation T he im plem ented system consists of two m ajor m odules. T he first is th e direction cone m odule, and th e second th e planner. T he design and capabilities of each m odule will be briefly described in th e following two sections. 8 .1 .1 D ir e c tio n c o n e im p le m e n ta tio n T he direction cone m odule is w ritten in C, and it consists of approxim ately 18,000 lines of code. Its m ain function is to com pute G A C s for polyhedral parts. T he algorithm for this com putation was described in Section 5. T he 3D p art is defined in th e Parasolids m odeler and th e Parasolids representation is th en converted to the B -rep used by th e program . T he p a rt definition and ex tractio n of inform ation from Parasolids is done thro u g h adaptors developed in our lab by J.-H . H an ([Han92]). T he conversion from Parasolids representation to th e B-rep used for th e G A C com p u tatio n s is p art of th e m odule. A large portion of th e m odule perform s Boolean operations on polyhedral direction cones. Cones are represented as subsets of th e surface of th e u n it sphere and th eir Boolean operations are im plem ented by using stan d a rd algorithm s ([RV85]) which rely on set m em bership classification functions. O th er im p o rtan t portions of th e program are those for com puting sweeps of poly gons, G eneralized G ausssian Im ages of entities and cone tesselations. D isplay is perform ed through PH IG S. 8 .1 .2 P la n n e r im p le m e n ta tio n T he planner is im plem ented in C + + and it consists of approxim ately 13,000 lines of code. T h e class planner is a d a ta stru ctu re th a t contains static inform ation ab o u t th e in p u t tolerances and th e p a rt, and dynam ic inform ation th a t includes th e current state, th e current problem space and th e o p erato r tree. O nly one sta te (th e current one) is kept in th e planner. E arlier states are w ritten in files so th a t th ey can be retrieved if needed for backtracking. Each operator has a num ber th a t indicates th e sta te it corresponds to. T hree im p o rtan t planner m ethods are: operator expansion, o perator evaluation, and operator application. 148 T he o p erato r expansion m ethod generates all th e operators of th e cu rren t prob lem space whose preconditions are satisfied by th e current state, and adds th em to th e o p erato r tree. T h e problem spaces and operators available in th e current system are shown in Figure 8.1. T h e preconditions can be tested by th e inform ation stored in th e state. Exam ples of preconditions are given below. • part-su: part-su has not been applied to current state. • clustering operators: no preconditions. • best-ip, verify-ip: none of th e sta te variables has value all. • tolerance-ip, feature-ip: at least one of th e associated sta te variables has value all. • meas-ip: a t least one of th e geom etric constraints not satisfied for th e m ea surem ent. • geom etric operators: if we w ant to com pute th e value of a variable X, then none of th e variables on which th e com putation of X depends should have value all. For exam ple, th e precondition of g-acc-sf is th a t SF should not have value all. T h e operator evaluation m ethod selects th e best o p erato r for th e cu rren t situation from a set of operators. W hen no backtracking is required, th e sim plest form of o p erato r evaluation consists of a sequence of calls to a function th a t checks w hether an o p erato r exists or not am ong th e operators proposed for th e current state. For exam ple, th e following pseudo-code essentially m eans th a t part-su is preferred over tolerance-ip. ( o p e r a t o r - s e t is th e set of proposed operators for th e cu rren t state.) By exchanging th e position of th e two lines, th en tolerance-ip is preferred over part- su. if (exists-op(part-su, operator-set)) then return(part-su); if (exists-op(tolerance-ip, operator-set)) then return(tolerance-ip); By adding o th er conditions to th e i f statem en t above th e o p erato r preferences are m ade to depend to these conditions as well, instead of ju st th e o p erato r presence. 149 verify-ijO # best-ip best-ip-ps inspection-ps lolerance-ii cluster-pd part-su cluster-pg cluster-su tolerance-ps part-su-ps # Cpart-su-ml feature-ps verify-f-ip meas-ip verify-m-ii equiv-sf meas-ps meas-su probe-geom comp-sf-su) v^e-acc-sfp comp-ram-] g-acc-ps gac-sf gac-sf-ps ;ac-sf-ml Figure 8.1: Im plem entation of problem spaces and operators 150 T hese conditions can be any query th a t can be resolved by looking at th e inform ation kept in th e state. For backtracking, each reason for failure has an associated list of o p erato r nam es th a t are likely to be responsible for th e failure. These operators can be in stan tiated w ith a tolerance, feature or m easurem ent. T h e function th a t proposes w here to b acktrack searches th e entire operator tree for an o p erato r th a t m atches th e one given in th e reason for failure and retu rn s th e first one found. T h a t is, th e e x i s t s - o p is called w ith o p e r a t o r - s e t being th e entire operator tree. O ne can specify w hether chronological backtracking should be used w hen searching for th e given operator, or any operator found to m atch th e given one will do. O p erato r application changes th e sta te so th a t it reflects th e o p erato r applied. M ost of th e work for sta te transform ation is done by th e functions of th e tuple-tree class, discussed below. In Figure 8.1 th e operators not m arked are applied a u to m at ically. For exam ple, cluster-pd gets th e cones to be clustered from th e o p erato r tree, calls th e cone m odule to tesselate these cones, clusters th e tesselated cones, and th en changes th e tu p le tree by intersecting nodes to reflect this clustering. T he operators m arked by or “+ ” need a preprocessing step, w here th e cones involved are w rit ten in appropriately nam ed files so th a t th e planner can retrieve th em from there. A m eans th a t th e underlying geom etric algorithm s have been im plem ented in th e direction cone m odule; a “+ ” m eans th a t th e algorithm s have not been im ple m ented, b u t th ey can be im plem ented by sim ple extensions of th e cone m odule as discussed in previous sections of this thesis. ( Gac-sf-m2 is discussed in Section 4.1.1, meas-su in Section 4.7, and comp-ram-pd in Section 4.7.5.) A n o p erato r m arked by needs to com m unicate w ith an ex tern al m odule. For exam ple, all th e verifica tion operators can get th eir d a ta from a sim ulation m odule. Since these external m odules are not available, we use files w here th e results needed for these operators are w ritten . T he planner uses these results as if th ey were produced by th e external m odules. T he d a ta representation for th e class state includes th e sta te tolerances (as a dynam ic array), th e same tree, and th e tuple tree. Each tolerance contains the features of th e tolerance, and each feature th e m easurem ents of th e feature. A m easurem ent contains inform ation ab o u t th e constraints th a t have been applied to th e m easurem ent, in array form . In addition, a m easurem ent holds th e same 151 tree p a th th a t corresponds to th e m easurem ent; recall th a t this p a th is used to e x trac t th e tuples of th e m easurem ent from th e tuple tree (Section 6.5). This p ath inform ation is red u n d an t, because it can be retrieved from th e same tree, b u t it is used for efficiency. T he lowest level node of th e same tree is a m easurem ent in th e form of th e th ree indices (for T , F, and M) th a t uniquely specify th e m easurem ent in th e tolerance array. T here is no explicit m easurem ent inform ation stored in th e tuple tree. T h e class state has a m ethod for creating th e in itial sta te from th e p art tolerances. T he m ajo rity of th e sta te m ethods are queries about w hich constraints have been applied, or values of a vai'iable. T he class tuple tree perform s th e operations for m anipulating tuple trees. T he basic d a ta representation is a node th a t can be eith er an index or value node (Sec tion 6.4). A value node can be of ty p e SU, P G , PD or SF and holds th e corresponding inform ation. T he tw o m ost im p o rtan t m ethods of tuple tree are: (a) u p d atin g th e tree w hen new tuples are given, and (b) clustering. Tuple tree u p d ate takes as input th e new tuples and th e tolerance, featu re or m easurem ent these tuples are for, and it intersects th e old tuples for th a t en tity w ith th e new tuples. C lustering is perform ed by ex tractin g th e nodes at th e clustering level, clustering them , and th en changing th e tuple tree stru ctu re to reflect th e clustering. 8.2 Implementation limitations We will sta rt this section w ith a description of w hat a com plete inspection planning system should look like, and th en com pare it w ith th e current im plem entation. T h e core of a com plete system is a geom etric m odeler. T h e p art and tolerances should be in p u t to th e system through th e m odeler interface. T he inspection planner should be able to propose all th e operators shown in Figure 7.1, select operators, and apply operators by com puting th e d a ta needed and th en transform ing th e state accordingly. O perator application should be perform ed through com m unication w ith m odules external to th e inspection planner. T he m ost im p o rtan t of these m odules are accessibility analysis, setup planning, clustering and sim ulation. M odules th a t perform geom etric com putations should get th eir d a ta from th e geom etric m odeler. T he m ost im p o rtan t lim itations of th e existing im plem entation as com pared to th e above system are: (a) geom etric m odeler interface, (b) external m odules for 152 setup planning and sim ulation, and (c) operator selection heuristics. T he first two are out of th e scope of this thesis. T he im plem ented heuristics for selecting opera tors are very few, especially for th e case of failure. However, th e general approach for adding these heuristics has been im plem ented, as a reason-for-failure/possible- culprits stru ctu re. New heuristics can be added as m ore exam ple p arts are studied. U nfortunately, access to realistic in d u strial p arts toleranced according to th e stan dards continues to be difficult, because com panies are very relu ctan t to m ake such inform ation publicly available. In general, th e im plem entation of th e planner in C + + m akes heuristic m anipula tion hard. H euristics can be im plem ented m ore n atu rally in an ex p ert system shell. T h e problem w ith m ost of th e expert system s is th a t th ey represent th e state as attrib u te-v alu e pairs, w hich m akes a stru ctu re such as tuple tree extrem ely h ard to im plem ent. C + + is m uch b e tte r suited for th e high level stru ctu res needed for the sta te representation. T he ideal im plem entation is likely to have th e search portion of th e system im plem ented in an expert system , and th e state m anipulation in a high level language. Since th e stru ctu re of th e problem spaces and operators is given in this thesis, th e ex p ert system im plem entation am ounts m ostly to th e tran slatio n of this stru ctu re to th e ex p ert system language. 8.3 Experimental results In this section we present some of th e inspection plans generated by th e system . T h e p a rt used for th e results below is a sim plified version of th e ANC101 p art. (T his is a test p a rt devised by th e CA M -I consortium .) T he tolerances im posed on th e p a rt are in accordance to th e ANSI Y14.5M form at ([ANS82]) and are shown in Figure 8.2. Also shown in th e figure are th e indices of th e surface features of th e p a rt th a t are toleranced, denoted by PSF_i, w here i is th e surface feature index. For exam ple, d atu m A is th e p a rt surface featu re 0 (PSF_ 0 ). Tolerance 0 (TO in Figure 8.2) is a perpendicularity tolerance of d atu m B w ith respect to d atu m A, w ith value 0.1. T1 and T2 are also perpendicularity tolerances which specify th e relation of d atu m C to d atu m s A and B. T3 is a circularity tolerance referring to surface feature 1 1 (through hole). T 4 is a position tolerance which specifies th e allowable variation in th e position of P S F - ll w ith respect to th e d atu m system (A, B, C). T he 153 PSF_1 TO 0.1 PSF_4 -B- T1 T2 0.1 0.15 -C- T5 PSF 12 0.1 PSF 26 T7 0.05 -A- PSF 0 PSF_11 T4 T3 0.02 -D- T O : (perpendicularity, 0.1) FO : (primary datum, PSF_0) FI: (feature, PSF_1) Tl: (perpendicularity, 0.1) F O : (primary datum, PSF_0) FI: (feature, PSF_4) T2 (perpendicularity, 0.15) F O : (primary datum, PSF_1) FI: (feature, PSF_4) T3: (circularity, 0.02) F O : (feature, PSF_11) T4: (position, 0.05) FO : (primary datum, PSF_0) FI: (secondary datum, PSF1) F2: (tertiary datum, PSF_4) F3: ( feature, PSF_11) T5: (position, 0.05) FO : (primary datum, PSF_0) FI: (secondary datum, PSF1) F2: (tertiary datum, PSF_4) F3: ( feature, PSF_12) T6: (angularity, 0.1) F O : (primary datum, PSF_0) FI: (secondary datum, PSF11) F2: (tertiary datum, PSF_1) F3: ( feature, PSF_26) T7: (flatness, 0.05) F O : (feature, PSF_0) Figure 8.2: Toleranced p art 154 circle w ith th e line through (just before 0.05) says th a t th is tolerance applies to th e diam eter of th e cylinder. T he sym bol S enclosed in a circle specifies th e m aterial condition (regardless of feature size, for T4). T5 is a position tolerance on surface featu re 1 2 (counterbore hole). T 6 is an angularity tolerance of surface feature 26 w ith respect to th e d atu m system (A, D, B). Finally, T7 is a flatness tolerance on d atu m A. In th e following results, th e setups were com puted by th e o perator part-su, which was given higher preference th a n tolerance-ip. T hese setups were read from files, as explained in th e previous section. T he G A C s for sem i-infinite straight probes were com puted for a polyhedral approxim ation of th e p a rt beforehand, by th e G A C m odule, and stored into appropriately nam ed files. T h e figures were draw n m anually from th e planner o u tp u t, which is in tex t form. T he p art shown in th e figures is th e polyhedral approxim ation used by th e G A C m odule. For th e program running on a Sun S P A R C station 10/30, th e to ta l planning tim e was approxim ately lm in , two th ird s of which were spent on com puting th e cones and one th ird on tuple m anipulation. T he o perator tree had a t th e end of planning approxim ately 400 nodes, two th ird s of which (300) were closed. O ut of th e closed nodes one half (150) were nodes th a t m odified th e tu p le tree by intersecting new w ith old tuples. T h e average size of th e tu p le tree was 750 nodes, w hen th e constraint same-su was im posed and 600 nodes w hen same-pg was im posed. T he first inspection plan to be presented is for th e toleranced p a rt of Figure 8.2, w hen only tolerances TO through T 6 are considered (T 7 ignored). In addition, it is assum ed th a t th e features of a tolerance m ust be inspected under th e sam e setup b u t not necessarily w ith th e sam e probe (constraint same-su). This is a reasonable assum ption w hen a tool changer for probes is available. T he final inspection plan is shown in Figure 8.3. T h e plan contains one setup su_5 w ith d atu m A on th e CMM table. Tw o probe geom etries, w ith nam es pg210016 and pgl5005, are needed. This probe change is necessary because th e two holes cannot be inspected by th e same probe. PSF_11 is a deep hole and can only be inspected by pg210016. B u t th e tip diam eter of pg210016 is too large for inspecting P S F J.2 , hence requiring a different probe (pgl5005) which has a sm aller tip diam eter. P robe pg210016 is used in two orientations to inspect all features, except PSF_12. T h e features to be inspected are 155 SF SU su_5 PD i PG pg15005 Figure 8.3: F inal inspection plan for p a rt w ith seven tolerances and w ith same-su constraint active 156 shown in bold. N ote th a t in th e vertical orientation, pg210016 is used to inspect the CM M tab le instead of d atu m A. T h e plan of Figure 8.2 is a graphical representation of th e planner o u tp u t given below. (ROOT) (SU ((0.0, 0.0, 1.0) 1 0 su_5)) (PG 210016) anc/anc .final.-pd/:L_0. su_0 .i_0.pg_0.:L_0.pd_0) (SF cmm..t) TO .F0.M0 Tl.F0.M0 T4.F0 .M0 T5 .F0.M0 T6.F0.M0 (SF 1) TO .FI.M0 T2.F0.M0 T4.F1 .M0 T5. .FI.M0 T6.F2.M0 (SF 4) Tl..FI.M0 T2.F1.M0 T4.F2 .M0 T5. . F2 .M0 (SF 11) T3. .F0.M0 T4.F3.M0 T6.F1 .M0 anc/anc .final. .pd /:L_0. su_0 • i_0.pg_0.:L_1.pd_0) (SF 26) T6. .F3.M0 (PG 15005) (PD anc/anc.final_pd/i_0.su_0.i_l.pg_0.i_0.pd_0) (SF 12) T5.F3.M0 T he planner o u tp u ts th e tu p le tree. (Index nodes are o m itted for clarity.) A tuple node is enclosed in parentheses. T he inform ation p rin ted is th e node ty p e (R O O T , SU, P G , PD or SF), and th e value stored in th e node. For SU nodes th e value is th e description of a setup. For th e SU node above this value is ( (0 . 0, 0.0, 1.0) 1 0 sn_5), w here (0.0, 0.0, 1.0) is a vector defining th e setup o rientation w ith re spect to th e p a rt, 1 is a flag indicating th a t th e p a rt is resting on one of its faces, 0 is th e index of th e face th e p a rt is resting on, and su_5 is th e setup nam e. In th e current im plem entation th e constraint in a ram -setup (Section 4.7.1) specifies w hether th e p a rt touches th e CM M tab le or not. For P G nodes, th e value is th e probe nam e. For P D , th e node value is th e nam e of th e file th a t contains th e cone. T he nam es of th e cones for th e final plan are uniquely defined by th e p a th from the root of th e tu p le tree to th e P D node (index nodes included). For th e last PD node 157 F igure 8.4: Collision of th e probe head w ith th e CM M tab le causes backtracking above, if one num bers all th e tu p le tree nodes so th a t th e first child is num bered 0 , this p a th is: (root, 0, 0, 1, 0, 0, 0). T h e SF node value is either th e CM M table, denoted by cmm_t, or th e index of th e p a rt face to be inspected. In addition to the tu p le nodes, th e planner also o u tp u ts th e set of measurements (T i.F j.M k) associated w ith each SF node. For th e above plan, for exam ple, after inspecting th e CM M tab le we are done w ith th e measurements TO.FO.MO, T1.F0.M0, T4.F0.M0, T5.F0.M0 and T6.F0.M0. This inform ation is useful w hen sending th e m easurem ent results (th e actu al coordinates of m easured points) to th e soft gaging m odule, w hich selects an algorithm depending on th e tolerance ty p e to be verified. In order to generate th e above plan, th e planner has to backtrack once. This happens because th e first com plete plan generated has th e p a rt setup as shown in Figure 8.4. However, w hen this plan is verified, (through th e application of operator verify-ip) th e m otorized probe head collides w ith th e CM M tab le w hen inspecting PSF_12. In Figure 8.4 PSF_12 is shown in bold; th e collision point is A. Inspection plan verification is perform ed m anually, because th e system is not bidirectionally connected to a geom etric m odeler. T he user is asked w hether th e verify-ip operator is successful or not, and if n o t, th en he or she has to in p u t th e reason for th e fail ure and th e m easurem ent th a t caused th e failure (pro b e/C M M -tab le collision and T5.F3.M 0 in this case, respectively). T hen th e planner backtracks to th e last point w here T5.F3.M 0 was involved and verifies th e inspection plan for th is m easurem ent 158 pg15005 Figure 8.5: F inal inspection plan for p a rt w ith seven tolerances and same-pg con strain t active by applying th e o perator verify-m-ip to T5.F3.M 0. This verification is again p er form ed m anually, by having th e user rem ove setup su_4 from th e inspection plan of T5.F3.M 0. As a result, th e only com m on setup rem aining for all th e m easurem ents is su_5, which is selected for th e final inspection plan of F igure 8.3. T he second inspection plan presented is again for th e toleranced p a rt of Figure 8.2 w ith tolerances TO through T7. Now, however, th e constraint im posed is th a t all the features of a tolerance m ust be inspected not only in th e sam e setup, b u t also w ith th e sam e probe (constraint same-pg). In this case, th e inspection plan generated is th e sam e as th e plan of Figure 8.3, except for th e subtree w ith root pgl5005. This subtree is now su b stitu ted by th e tree shown in Figure 8.5. N ote th a t because of th e same-pg constraint all th e features of tolerance T_5 m ust be inspected by the sam e probe. A nd since PSF_12 (T5.F3.M 0) is inspected by pgl5005, th e sam e probe m ust also be used to inspect th e rem aining features of T_5. T he plan o u tp u t by the planner is as follows: (ROOT) (SU ( ( 0 . 0 , 0 . 0 , 1 .0 ) 1 0 su _ 5 )) (PG 210016) (PD a n c . s a m e p g /a n c .fin a l_ p d /i_ 0 . su _ 0 . i_ 0 .p g _ 0 . i_0.pd _0) (SF cm m .t) TO.FO.MO T1.F0.M0 T4.F0.M0 T6.F0.M0 (SF 1) TO.FI.M0 T2.F0.M0 T4.F1.M0 159 su PG PD SF pg210016 su_l F igure 8 .6 : F inal inspection plan for p a rt w ith eight tolerances and same-su con strain t active T6.F2.M0 (SF 4) Tl.FI.MO T2.F1.M0 T4.F2.M0 (SF 11) T3.F0.M0 T4.F3.M0 T6.F1.M0 (PD a n c . sam epg/anc.f i n a l _ p d / i _ 0 . su _ 0 . i_ 0 .p g _ 0 . i_ l.p d _ 0 ) (SF 26) T6.F3.M0 (PG 15005) (PD a n c . samepg/a n c . f i n a l _ p d / i _ 0 . su _ 0 . i _ l . p g _ 0 . i_ 0 .p d _ 0 ) (SF cmm_t) T5.F0.M0 (SF 1) T5.FI.MO (SF 4) T5.F2.M0 (SF 12) T5.F3.M0 T he final inspection plan presented is a plan for th e p a rt w ith all eight toler ances (TO through T 7), when th e constraint im posed is same-su. T7 is a flatness tolerance on d a tu m A, and in order to check this tolerance th e d atu m A itself has to be inspected (th a t is, it cannot be su b stitu ted by th e CM M table). In order to inspect this ex tra feature another setup has to be added to th e plan of Figure 8.3. T h e additional setup and th e probe and probe direction to be used are shown in Figure 8 .6 . T he planner o u tp u t for this case is given below. (ROOT) (SU ( ( 0 . 0 , 0 . 0 , 1 .0 ) 1 0 su _ 5 )) 160 (PG 210016) (PD anc.8/anc.final_pd/i_0.su_0.i_0.pg_0.i_0.pd_0) (SF cmm_t) TO.FO.MO Tl .FO .M O T4..FO .M O T5 .FO.MO T6 .FO .M O (SF 1) TO.FI.MO T2. .FO .M O T4 .FI .M O T5 .FI.MO T6 . F2 .M O (SF 4) Tl .FI.MO T2 .FI .M O T 4. .F2 .M O T5 .F2.M0 (SF 11) T3 .FO.MO T4., F 3. .M O T 6. ,F1 • M O an c.. 8 /a n c .fin al,_ p d /i_ 0 . ST1_(). i. -0-Pg. _0 . : L_ 1 • pd. (SF 26) T6 .F3.M0 (PG 15005) (PD anc.8/anc.final_pd/i_0.su_0.i_l.pg_0.i_0.pd_0) (SF 12) T5.F3.M0 (SU ((1.0, 0.0, 0.0) 1 4 su_l)) (PG 210016) (PD anc.8/anc.final_pd/i_l.su_0.i_0.pg_0.i_0.pd_0) (SF 0) T7.F0.M0 161 Chapter 9 Conclusions 9.1 Summary This thesis describes a system for generating high-level plans for inspecting m echan ical p arts w ith C oordinate M easuring M achines. T he in p u t is a geom etric m odel of th e p art to be inspected, together w ith a set of surface features and associated tol erances. T h e o u tp u t is a a collection of setups, each associated w ith surface features to be inspected, probes for inspecting each feature, and th e relative orientations of th e p a rt, CM M and probes. O ur approach to high-level planning casts th e problem as search in a space of partially-com pleted plans. Plans evolve tow ards com pletion thro u g h th e application of operators th a t m ap plans into plans. T he state is represented by sets of 4-tuples (SU, P G , PD , SF), w here SU are th e setup orientations, P G are th e acceptable probe geom etries (selected from a given set of physical probes), P D are th e accessible directions represented by cones, and SF is a (possibly com pound) surface featu re to be inspected. We follow a least-com m itm ent strategy, and a tte m p t to reason about all th e possible solutions, gradually narrow ing th eir range by applying constraints such as accessibility, sam e-setup (for related features), and so on. A ccessibility analysis plays a very im p o rtan t role in th e system . T he notion of direction cones was developed to characterize th e accessibility of p art faces to sem i infinite probes. An algorithm for com puting global accessibility cones was developed and im plem ented for polyhedral parts. T he o u tp u t of th is algorithm is used to guide th e planner in th e selection of probe directions for each feature. A p ro to ty p e system im plem entation shows th a t th e approach can produce in spection plans for p arts w ith realistic tolerance specifications. 9.2 Contributions T he m ajo r contributions of th is work are in th e form ulation of inspection planning as sta te space search and in accessibility analysis. T h e sta te space form ulation gives us great flexibility in searching for a plan. For exam ple, it provides th e ability to change th e order of operations perform ed, w hich was m issing from previous inspec tio n planners. A fixed order cannot guarantee th a t a plan will be found if one exists, and it m ight produce plans th a t are far from optim al. 163 T h e state-space form ulation has two parts: sta te representation and operator definition. O ur sta te representation, by introducing th e idea th a t th e surface feature itself (SF) is a variable, leads to plans th a t are not constrained to inspect th e original surface feature of th e p art. Instead, th e p art surface feature can be • su b stitu ted by th e CM M tab le (or o ther surfaces of fixtures) • p artitio n ed into subfeatures • su b stitu ted by a subset of th e p a rt feature, according to crite ria th a t define w hat percentage of th e feature m ust be inspected in order for th e m easurem ent results to be acceptable. F urtherm ore, by using a tolerance-based representation (Section 6.2.3) in con ju n ctio n w ith same constraints, we can produce plans th a t tak e into account con strain ts such as “all features of a tolerance m ust be inspected in th e sam e setup” . T his is a very im p o rtan t consideration in practice, b u t it was overlooked by m ost of th e previous planners. Same constraints can also be used for different purposes. For exam ple, one can force all tolerances to have th e sam e setup, essentially looking for a plan w ith only one setup. O r, th e constraint sam e-sf can be im posed on a p a rt face th a t appears in m any tolerances, so th a t this face will be inspected only once. C ritical to th e same constraint im plem entation is th e tuple tree d a ta stru ctu re, w hich allows tu p le m anipulation and same constraint satisfaction sim ultaneously. T h e work on o p erato r definition produced an organization in w hich operators are associated w ith problem spaces. This reduces th e w idth of th e o p erato r tree, because only a subset of th e available operators, those applicable to th e current problem space, is considered at each step. Provision is m ade for operators th a t perform th e sam e task, b u t use different m ethods. This is im p o rtan t for tasks involving geom etric com putations, which can be very expensive. By having th e flexibility to choose am ong operators w ith different costs one can reduce th e overall planning tim e. Trade-offs betw een planning tim e and quality of solution can be explored. O ur work on accessibility analysis is a m ajor advance over th e sta te of th e art. Direction cones were introduced as a tool for expressing local and global accessibil ity of surface features. A lgorithm s for com puting directions cones were developed 164 and an algorithm for com puting G A C for polyhedral p arts was im plem ented. T he accessibility analysis m odule is an integral p a rt of th e inspection planner. A lthough in previous inspection planning system s th e role of accessibility was acknowledged, th e accessibility analysis perform ed was too sim plistic. 9.3 Limitations T h e lim itations of this work can be divided into those intrinsic to th e ideas behind th e system design and those associated w ith th e im plem entation. O ne m ajo r intrinsic lim itation is th a t th e sta te can grow very large, depending on th e num ber of tolerances in th e p art, and on th e num ber of alternatives for SU, P G , PD and SF. A n easy solution to this problem is to have th e system rem ove inspection plans from th e sta te after a m axim um size is reached for th e tu p le tree. T his can be done in th e current system by th e introduction of a new operator, whose task is to elim inate plans (possibly th e least prom ising ones). A nother lim itatio n is th a t the accessibility analysis cannot deal w ith th e general case of b ent probes. As explained in Section 4.5, b ent probes can be com puted w hen th e probe length is digitized. Also, in order to perform accessibility analysis th e p art has to be approxim ated by a polyhedron. T h e m ost im p o rtan t im plem entation lim itations of th e current system are the following: • th e planner is not connected to a geom etric m odeler, setup planning and ver ification m odules • m ore heuristics are needed for backtracking w hen th e p lan n er fails • th ere is only one m ethod for each geom etric task • th e clustering algorithm used is very sim ple. 9.4 Future work In add itio n to research directed to overcom ing th e lim itations listed above, th ere are several interesting issues th a t need to be studied further. 165 A theory m ust be developed for star probes, which have several styli. These probes are used in practice to inspect features w ith large size variation using the sam e probe. B ent probe algorithm s m ust be im plem ented and experim entally assessed to de term ine an effective strateg y for th eir deploym ent in conjunction w ith setup plan ning. F eature segm entation needs to be studied. T his will help w hen a feature is inaccessible either by straig h t or bent probes. Im plem enting th e operator proposal and selection in an expert system environ m ent will result in m ore flexibility w hen changing th e heuristics. This will be very useful for testin g th e system w ith a large set of real d ata, and for having hum an inspection experts suggest th e rules to be used. A lthough our planner architecture is very flexible, th e im plem entation is not, and we have been unable to experim ent w ith altern ativ e strategies. In th e current system old states are saved in files, and retrieved w hen needed during backtracking. This is obviously a very expensive operation. In th e database field, th ere are techniques for storing differences of states (deltas) and th e n retrieving th e sta te from these differences. T he application of these techniques to inspection planning should be investigated. G eom etric com putations are usually expensive, and depending on th e tolerance specifications, some of these com putations have to be rep eated for th e sam e data. For exam ple, if a surface appears in four tolerances, th en th e G A C of this feature is likely to be needed four tim es. Instead of perform ing th e sam e com putation repeatedly, th e results should be stored and reused. In th e current im plem entation th e direction cones are stored in files. However, a m ore general approach is needed, w here results are stored depending on how m uch tim e it took for th e com putation and on th e likelihood of using th e sam e results later. Inspection planning is not restricted to CM M s. In fact, for some p arts or tol erances, inspection has to be perform ed using other types of sensors. It w ould be interesting to stu d y how th e system can be extended to include sensors such as laser range finders and cam eras, surface roughness in strum ents, or even h ard gages. In order to have a com plete inspection planner th e system m ust be able to com m unicate w ith m odules th a t perform sim ulation, setup, fixture design, p a th planning 166 and soft gaging. T he interactions betw een these m odules should be studied. For ex am ple, can accessibility results be used to sim plify p a th planning? (T he answ er is alm ost certainly yes.) In th e current approach, it is assum ed th a t th e controlling m odule is th e inspection planner. It w ould be interesting to see w hether control can be decentralized. For exam ple, th e p a th planning m odule m ight go ahead and pro duce p ath s while th e inspection planner is generating probe directions. T he issues to be studied in this case are things like: (a) how often do th e th e m odules exchange results? (b) w hat language is used for com m unication betw een m odules? (c) how are conflicts resolved? 167 B ibliography [ABN81] J. S. A lbus, A. J. B arbera, and R. N. Nagel. T heory and practice of hierar chical control. In 23rd IE E E Computer Society International Conference, pages 18— 39, Septem ber 1981. [ANS82] ANSI. Dim ensioning and tolerancing. A m erican N ational S tandard ANSI Y14.5M-1982, T he A m erican Society of M echanical Engineers, U nited En gineering C enter, 345 E ast 47 S treet, New York, N.Y. 10017, February 1982. [ANS85] ANSI. M ethods for perform ance evaluation of coordinate m easuring m a chines. A m erican N ational S tan d ard A N S I/A S M E B89.1.12M -1985, T he A m erican Society of M echanical Engineers, U nited E ngineering C enter, 345 E ast 47 S treet, New York, N .Y . 10017, Jan u ary 1985. [BD94] A. J. Briggs and B. R. D onald. A utom atic sensor configuration for task-directed planning. S ubm itted to IE E E In tern atio n al Conference on R obotics and A utom ation, 1994. [Ben6 6 ] R. V. Benson. Euclidean Geometry and Convexity. M cG raw -H ill Book Com pany, 1966. [BK90] C. B ajaj and M. Kim . G eneration of configuration space obstacles: Mov ing algebraic surfaces. The International Journal o f Robotics Research, 9(1):92-112, F ebruary 1990. [Bro82] C. M. Brown. PADL-2: a technical sum m ary. IE E E Computer Graphics and Applications, 2(2):68-84, M arch 1982. [Bro90] C. W . Brown. G enerative inspection process planner for integrated pro duction. In P. H. Cohen and S. B. Joshi, editors, Advances in Integrated Product Design and Manufacturing, PED-Vol. f7 , pages 151-162. 1990. Proceedings of ASM E, W inter A nnual M tg., D allas, T X , N ovem ber 25-30, 1990. [Bro91] C. W . Brown. IP P E X : An au to m ated planning system for dim ensional inspection. Manufacturing System s, 20(2):189-207, 1991. Proceedings of 168 [CAM 8 8 ] [CCW93] [CK 8 8 ] [dMS91] [EG87] [Fen53] [Gan90] [Gho8 6 ] [Gho8 8 ] [GJ79] [GS8 6 ] [Han92] C IR P sem inar in C om puter A ided Process P lanning, Enschede, H olland, Ju n e 11-12, 1990. C AM -I, Inc. C om puter A ided M anufacturing - International. Dimensional Measuring Interface Specification Version 2.0. A pril 1988. L.-L. Chen, S.-Y. Chou, and T . C. Woo. S eparating and intersecting spherical polygons: C om puting m achinability on three-, four-, and five- axis num erically controlled m achines. A C M Transactions on Graphics, 12(4):305-326, O ctober 1993. C. K. Cowan and P. D. Kovesi. A utom atic sensor placem ent from vision task requirem ents. IE E E Transactions on Pattern Analysis and Machine Intelligence, 10(3):407-416, M ay 1988. L. S. H. de Mello and A. C. Sanderson. A correct and com plete algorithm for th e generation of m echanical assem bly sequences. IE E E Transactions on Robotics and Automation, 7(2):228-240, A pril 1991. H. A. ElM araghy and P. H. G u. E xpert system for inspection planning. Annals of the CIRP, 36, Jan u ary 1987. W . Fenchel. Convex cones, sets, and functions. From notes by D. W . B lackett of lectures at P rinceton U niversity, Spring Term , 1951, Septem ber 1953. J. G.-K. G an. Spherical Algorithms fo r Setup Orientation o f Workpieces with Sculptured Surfaces. PhD thesis, D epartm ent of In d u strial and O p erations Engineering, U niversity of M ichigan, A nn A rbor, M I 48109-2117, 1990. P. K. Ghosh. A Computational Theoretic Framework fo r Shape Repre sentation and Analysis Using the Minkowski Addition and Decomposition Operators. PhD thesis, T ata In stitu te for F undam ental R esearch, Bombay, India, 1986. P. K. Ghosh. A m athem atical m odel for shape description using M in kowski operators. Computer Vision, Graphics, and Image Processing, 44(3):239-269, D ecem ber 1988. M. R. G arey and D. S. Johnson. Computers and intractability: A guide to the theory of NP-completness. W . H. Freem an and Com pany, 1979. L. J. G uibas and R. Seidel. C om puting convolutions by reciprocal search. In 2nd A C M Symposium on Computational Geometry, pages 90-99, 1986. J.-H . H an. Personal com m unication, 1992. 169 [HL85] [Hop84] [Hor8 6 ] [Hwa90] [Kau93] [Kim90] [KS91] [KY93] [LNR 8 6 ] [LP83] [LS90] [Mat75] [Men75] T. H. Hopp and K. Lau. A hierarchical m odel-based control system for inspection. Special Technical Testing P ublication 862, A m erican Society for Testing and M aterials, 1916 Race S treet, P hiladelphia, PA 19103, 1985. T. H. Hopp. C A D -directed inspection. Annals o f the C IR P , 33, 1984. B. K. P. Horn. Robot Vision. T he M IT Electrical Engineering and Com p u ter Science Series. T he M IT Press M cGraw -H ill Book Com pany, 1986. Y. K. Hwang. B oundary equations of configuration obstacles for m anip ulators. In IE E E International Conference on Robotics and Autom ation, pages 298-303, C incinnati, Ohio, M ay 13-18 1990. A. K aul. Computing Minkowski Sums. PhD thesis, C olum bia University, 1993. D.-S. Kim . Cones on Bezier Curves and Surfaces. P hD thesis, D epart m ent of Industrial and O perations Engineering, U niversity of M ichigan, A nn A rbor, M I 48109-2117, 1990. S. S. K rishnan and A. C. Sanderson. Reasoning ab o u t geom etric con strain ts for assem bly sequence planning. In IE E E International Confer ence on Robotics and Autom ation, pages 776-782, Sacram ento, CA, April 9-11 1991. B. K hoshnevis and Z. Yeh. An au to m atic m easurem ent planning system for coordinate m easuring m achines. Manufacturing Review, 6(3):221-227, Septem ber 1993. J. E. Laird, A. Newell, and P. S. Rosenbloom . Soar: A n architecture for general intelligence. Technical R eport STAN-CS-86-1140, Stanford U niversity, D ept, of C om puter Science, D ecem ber 1986. Also num bered KSL 86-70. T . Lozano-Perez. S patial planning: A configuration space approach. IE E E Transactions on Computers, 32(2):108-120, F ebruary 1983. S. Lee and Y. G. Shin. A ssem bly planning based on subassem bly ex tractio n . In IE E E International Conference on Robotics and Autom ation, pages 1606-1611, C incinnati, Ohio, M ay 13-18 1990. G. M atheron. Random Sets and Integral Geometry. Jo h n W iley and Sons, 1975. B. M endelson. Introduction to Topology. A llyn and Bacon, Inc., 1975. 170 [MR92] [MY91] [ 0 ’R87] [Ren8 8 ] [Req77] [Req80] [Ros85] [RT78] [RV85] [Rya8 6 ] [SBS92] [Ser82] [SR90] F. L. M erat and G. M. R adack. A utom atic inspection planning w ithin a feature-based CAD system . Robotics and Computer-Integrated M anufac turing, 9 (l):61-69, 1992. C.-H. M enq and H .-T. Yau. A n intelligent, com puter-integrated and self sustained environm ent for au to m ated dim ensional inspection of m anu factu red parts. In N SF Design and Manufacturing Systems Conference, Austin, TX, pages 865-872, Jan u ary 9-11 1991. J. O ’Rourke. A rt Gallery Theorems and Algorithms. Oxford U niversity Press, New York, 1987. P robing for p roductivity on co-ordinate m easuring m achines. Technical R eport H /1000/5050, Renishaw , 1988. A. A. G. Requicha. M athem atical m odels of rigid solid objects. Technical R eport 253, IRIS-USC, 1977. A. A. G. Requicha. R epresentations for rigid solids: theory, m ethods and system s. A C M Computing Surveys, 12(4):437-464, D ecem ber 1980. J. R. Rossignac. Blending and Offsetting Solid Models. PhD thesis, De p artm en t of Electrical Engineering, U niversity of R ochester, Ju ly 1985. A. A. G. R equicha and R. B. Tilove. M athem atical foundations of con structive solid geom etry: G eneral topology of closed regular sets. Techni cal R eport 27a, P roduction A utom ation P ro ject, U niversity of R ochester, 1978. A. A. G. R equicha and H. B. Voelcker. Boolean operations in solid m od elling: boundary evaluation and m erging algorithm s. Proceeding of the IE E E , 73(l):30-44, Jan u ary 1985. P. J. Ryan. Euclidean and non-Euclidean geometry: an analytic approach. C am bridge U niversity Press, 1986. D. L. Souvaine and I. Bjorling-Sachs. T he contour problem for restricted- orientation polygons. Proceedings of the IEEE, 80(9):1449-1470, Septem ber 1992. J. Serra. Image Analysis and Mathematical Morphology. A cadem ic Press, 1982. A. J. Spyridi and A. A. G. R equicha. A ccessibility analysis for th e au to m atic inspection of m echanical p arts by coordinate m easuring m achines. In IE E E International Conference on Robotics and Autom ation, pages 171 [Str82] [Tel92] [TT89] [TW89] [Wil92] [Yau9l] [YM91] 1284-1289, C incinnati, Ohio, M ay 13-18 1990. P ublished also as IRIS R ept. No. 257, In stitu te for Robotics and Intelligent System s, U niversity of Southern California, O ctober 1989. G. Strang. T h e w idth of a chair. American Mathematical Monthly, 89:529-534, O ctober 1982. S. J. Teller. C om puting th e antip en u m b ra of an area light source. Com puter Graphics, 26(2):139-148, Ju ly 1992. Proceedings SIG G R A PH 1992. K. T arabanis and R. Y. Tsai. V iew point planning: th e visibility con strain t. In Image Understanding Workshop, pages 893-903, M ay 1989. K. Tang and T. C. Woo. M axim um intersection of spherical polygons and workpiece orientation for 4- and 5-axis m achining. Technical R eport 89-34, D epartm ent of Industrial and O perations Engineering, U niversity of M ichigan, A nn A rbor, MI 48109-2117, D ecem ber 1989. R. H. W ilson. On Geometric Assembly Planning. PhD thesis, Stanford U niversity, D epartm ent of C om puter Science, 1992. H .-T. Yau. The Development of an Intelligent Dimensional Inspection Environment Using Coordinate Measuring Machines. PhD thesis, T he Ohio S tate U niversity, D ept, of M echanical Engineering, 1991. H .-T . Yau and C.-H. M enq. P a th planning for au to m ated dim ensional inspection using coordinate m easuring m achines. In IE E E International Conference on Robotics and Automation, Sacramento, CA , pages 1934- 1939, Sacram ento, CA, A pril 1991. 172 Appendix A Properties of reciprocal direction cones 173 Figure A .l: N otation T his appendix presents th e proofs of th e properties of th e reciprocal of a direction cone th a t were introduced in Section 3.2.1. A .l Notation and definitions In th e following it is assum ed th a t all half-lines have th eir endpoint at th e origin, and th a t th e boundary of all half-spaces go through th e origin. For additional definitions see Section 2.3. • is th e convex angle form ed by th e half-lines l\ and • Za(fj, I2 ) is th e convex planar sector subtended by th e half-lines and I2 ] the half-lines li and I2 are included in (Figure A .l). • I is th e closed half-space th a t contains th e half-line I and whose boundary plane is th e plane perpendicular to I. • A hom ogeneously ID polyhedral cone consists of a finite num ber of half-lines. A hom ogeneously 2D polyhedral cone D consists of a finite num ber k of sectors Fi = Lai(e1, ef), a; 0, i = 1 , . . . , k, such th a t any two sectors do not intersect at any points o ther th a n th eir lim iting half-lines. T hese sectors are called the faces of D. T he two half-lines ef and ef are called th e edges of Fi. T he set of edges of all faces of D are th e edges of D , denoted by { e i,. . . , en }. A hom ogeneously 3D polyhedral cone is a solid (regular set) bounded by a hom ogeneously polyhedral 2D cone. T he faces and edges of th e 3D cone are those of its 2D polyhedral cone boundary. N ote th a t hom ogeneous 2D and 3D polyhedral cones intersect th e u n it sphere in (spherical) curves and polygons (respectively), whose edges are arcs of great circles. • A cone is called hemi-spatial if th e cone m inus its apex is contained in an open p lan ar half-space whose boundary passes thro u g h th e apex. 174 • A closed half-space h is called a support of a cone D if D is contained in h ([Fen53]). A.2 Proofs of reciprocal cone properties L em m a A .2.1 Let l\, I2 be two half-lines, and r be a third half-line such that Z(r, A) < 90° and L{r,lf) < 90°. I f I is a half-line such that I € La{l\,l2), then Z(r, I) < 90°. P R O O F —♦ —^ — ♦ Let /1 , I2 , F a n d I be th e unit vectors defined by th e corresponding half-lines. — 4 - 4 Because Za(/l71 2) is convex, Z is a linear com bination of l\ and l2 w ith non-negative coefficients: — f - 4 - 4 I — oc\l\ + O L 2 I21 ^ 2 ^ 0 (i) Z(r, ^ 1 ) < 90° = $ * r • l\ > 0 (ii) Z (r,/2) < 90° =* r - Z 2 > 0 (ii) (i), (ii) and (iii) => F- /'> 0 = £ » Z(r, Z ) < 90° □ T h e o r e m A .2.1 ([Fen53], p. 9, Theorem 2) The closure of the convex hull of a cone D equals the intersection of all the supports o f D. P r o p e r t y 1 Let D be a direction cone consisting o f a possibly infinite number of half-lines. Then, r (d ) = n 1 l€D and R{D ) is closed and convex. P R O O F r € R{D ) o V l € D , l ( r , l ) < 90° <&Vl € D ,r e R(l) O r E fiieD R ( 0 fl/e i? '■ > s^ n ce th e reciprocal cone of a single direction is th e half-space defined by a plane perpendicular to th a t direction. Since I are closed and th e intersection of closed sets is closed ([RT78], P ro p erty 2.4.4), R (D ) is closed, for all cones D. 175 Since I are convex and th e intersection of convex sets is convex, R (D ) is convex, for all cones D. □ P r o p e r t y 2 The reciprocal of a direction cone D consists of the half-lines that define the supports of D. R (D ) = {I \ I is a support o f D} P R O O F I e R(D) < = > Vq £ D, l(l, q) < 90° (from definition of R(D)) O D C l O I is a support of D (from definition of support) □ P r o p e r ty 3 Let A and B he two direction cones. Then: (1) A C B => R ( B ) Q R(A) (2) A = B=> R(A) = R (B ) (3) if B is closed and convex, then A C B R (B ) C R(A). P R O O F (1): Prove th a t A C B = > • R (B ) C R(A). A ssum e th a t A C B. W e m ust prove th a t R (B ) C R(A). Let r be a half-line in R(B). Since r € R ( B ), l ( r ,l ) < 90° for all / 6 B\ thus, since A C B , Z(r, I) < 90° for all I £ A. T his m eans th a t r £ R{A). H ence R (B ) C i?(A ). (2): (2) follows from (1). (3): From (1) we know th a t A C B => R (B ) C R(A). H ence it rem ains to be shown th a t if B is closed and convex, then R (B ) C R(A) = 4 * A C B. Proof by contradiction: A ssum e th a t R (B ) C i?(A ) and A % B. A % B im plies th a t th ere exists a half-line I such th a t I £ A and I $ B. Since B is closed and convex, B equals th e intersection of all th e supports of B (T heorem A .2.1). Therefore, since I B , th ere exists a support s of B th a t does not contain I, i.e., th ere exists a half-line s such th a t J is a support of B and I £ s. From pro p erty 2 and since s is a support of B, s £ R{B). Since I £ s and s is a closed half-space, Z(l,s) > 90°. Therefore, th ere exists a half-line I £ A such th a t 1(1, 5 ) > 90°, hence s £ i?(A ). B ut [ 5 £ R (B ) and s ^ R(A)] im plies th a t R (B ) % R(A). We reached a contradiction. 176 Property 4 L et A and B be two direction cones. Then: R (A U B) = R(A) n R (B ) P R O O F r € R (A U B ) & Z(r,7) < 90°,v / e A U B l(r ,l i) < 90°,V /i e A and Z (r,/2) < 90°, W 2 G B R(A) and r e R (B ) r € R (A ) 0 R (I?) □ P r o p e r t y 5 Le£ D be a hemi-spatial, homogeneously 3D cone. Then: R(D ) = R(dD), where dD denotes the topological boundary of D. P R O O F T he proof has two parts: P a rt A: Prove th a t R(D ) C R(dD). Since dD C D , this follows directly from pro p erty 3. P a rt B: Prove th a t R (d D ) C R(D). Let r be an a rb itrary half-line in R (d D ), and / b e a half-line in D. To prove th a t r € R(D), we m ust show th a t Z(r, I) < 90°, v / e D . Case 1: I £ dD. Since r e R(dD ) it directly follows th a t Z(r, I) < 90°. Case 2: / e iD , w here i denotes topological interior. Let II be a plane such th a t / € II (Figure A .2). Let l\ and l2 be th e first intersections of II w ith dD, on either side of I. Since D is a hom ogeneously 3D cone, I G Z“( /i,/2). Since r G R(dD ) and l\ G dD, it follows from th e definition of th e reciprocal cone th a t Z(r, If) < 90°; sim ilarly Z(r, /2) < 90°. Because th e cone is hem i-spatial and closed, L{h, h) < 180°. By applying lem m a A .2.1, it follows th a t Z(r, I) < 90°. □ P r o p e r t y 6 If D is a closed, hemi-spatial, homogeneously dimensional, polyhedral cone with edges {ex,..., enj, then R(D) = R(ei) n R(e2) D ... D R(en) P R O O F T h e proof is given for th e th ree cases of hom ogeneously ID , 2D and 3D cones. 177 /eD Figure A .2: Illustration of proof of property 5 Case 1: D is a hom ogeneously ID direction cone (i.e., th e cone consists of a finite num ber of half-lines), and D = ex U e2 U . . . U en. T he proposition follows from p ro p erty 1, since th e reciprocal cone of a single edge e ,- is th e half-space et. Case 2: D is a hom ogeneously 2D polyhedral cone w ith k faces { F i, F2 ... F&}: D = F \ U F2 U . . . U Fk- Let Fi be a face of D and ef, ef be th e two edges of Fi. F irst we will prove th a t R(Fi) = R(e} U ef) (a.) P roof of R(Fi) = R(ef U ef ). P a rt A: R(F{) C R(ef U ef). It follows from th e fact th a t (ef U ef ) C Fi and from p roperty 3. P a rt B: R(ef U ef) C R(Fi). Let r £ R(ef U ef) and / £ F,. We m ust prove th a t Z(r, /) < 90°. Since r £ R(e] U ef), L(r,e\) < 90° and L(r,ef) < 90°. B ut l(e},ef) < 180° because D is hem i-spatial and closed. Since I £ Fi, I € Lai(e\,ef). From th e above and from lem m a A .2.1, it follows th a t Z(r, I) < 90°. T he proof follows for case 2: R(D ) = R(Fi U F2 U . . . U Fk) = (by definition of D) R(Fx) n R(F2) C . . . fl R(Fk) — (from pro p erty 4) R(e\ U ef) D .. . fl R(e\ U ef) = (from (a)) jR(e|) fl R(e f) n . . . C R(e\) H R(ef) — (from pro p erty 4) R(ei) C R(e2) C l ... D R(e n) (by definition of D) Case 3: D is a hem i-spatial, hom ogeneously 3D polyhedral cone. From property 5, R(D ) = R(dD). B ut dD is a hom ogeneously 2D cone; hence from case 2 it follows directly th a t R(D ) = i?(ex) fl R(e2) H . . . fl R(en) □ 178 Property 7 Let D be a closed direction cone. Then R(R(D )) = C H (D ) P R O O F I < e R(R(D )) -w * / € fl h, h G R(D ) (from pro p erty 1) / € PI h, h is a support of D (from pro p erty 2) ^ / G C H (D ) (from T heorem A .2.1, since D is closed and th e convex hull of a closed cone is closed) □ P r o p e r ty 8 Let D be a closed convex direction cone. Then R(R{D)) = D P R O O F Since D is convex C H (D ) — D, hence this property follows for property 7. P r o p e r ty 9 The reciprocal of a closed cone equals the reciprocal of its convex hull: R(D ) = R (C H (D )) P R O O F R(R (D )) = C H {D ) (from property 7) = * > R(R (R (D ))) = R (C H (D )) (from property 3) < £ > R(D ) = R (C H (D )) (from property 8) □ P r o p e r ty 10 I f A and B are two closed cones, then C H (A ) C C H (B ) R (B ) C R(A) P R O O F Since A and B are closed so are th eir convex hulls. 179 Figure A .3: A and B closed and unbounded C H (A ) C C H (B ) & R ( C H ( B )) C R (C H (A )) (from property 3) R (B ) C jR(A) (from property 9) □ P r o p e r t y 11 If A and B are two closed convex cones, then R (A fl B ) = C H (R (A ) U R(B )) P R O O F R (A Pi B ) = R {R [R (A )] n R[R(B)]} = R{R [R (A) U R(B)]} = R {R [C H (R (A ) U i2 (5 ))]} C H (R (A ) U R (B )) (from property 8) (from property 4) (from property 9) (from property 8) □ L e m m a A .2.2 If A is closed and B is compact (i.e., B is closed and bounded) and \fk 6 E Z + , 3 bk €: B such that d(bk,A ) < ^ then A D B ^ 0. Here Z + stands for the positive integers and d denotes distance. In o th er words, if A is closed, B is com pact and A , B are “arb itrarily ” close to one another, th en A n B ^ N ote th a t if b o th A and B are closed and unbounded, then this lem m a m ay not be true, see Figure A .3 w here b o th A and B extend to infinity. P R O O F Let S = {bk | k > 0}. 180 Case 1 : S is infinite. T hen S is an infinite subset of B. B ut B is com pact, hence S has a lim it point b in B ([Men75], T heorem 5.3, C hapter 5, p. 172). Claim: d(b, A ) = 0. (If we prove this, th en b E A because A is closed. This is property 3.5 in [Ros85].) P roof of claim: A ssum e th e opposite, i.e. d(b, A) = e > 0. Let 8 = | , N = [|"| + 1, n > N , and bn E S. d(bn, A) < ^ < jj < 8 3an E A : d[bn,an) < 8 (A closed) ([Ros85], p. 38) d(b, A) = e = 28 and an E A => d{b, an) > 28 d(b,an) > 28 and d(bn,a n) < 8 => d(b,bn) > 8 Therefore, Vn > N, d(b, bn) > 8. Vn > N, d(b,bn) > 8 Vn > N, bn $ B(b,8 ) (B: open ball) => 15 0 ,6 (6 ,5 )1 < N T h a t is, 5 O B(b, 8) is finite. Since we are in a m etric space (Euclidean 3-space), th e fact th a t 6 is a lim it point of 5 m eans th a t 6 is an accum ulation point of 5 ([Men75], Lem m a 5.2, C h ap ter 5, p. 173). B u t if 6 is an accum ulation point of 5 , th en by definition ([Men75], D efinition 5.1, C h ap ter 5, p. 172), every neighborhood of 6 should contain an infinite num ber of points of 5 , hence contradiction. H ence d ( 6 , A) = 0. B ut ((d ( 6 , A) = 0) and (A closed)) im plies th a t 6 E B O A ^ 0. Case 2: 5 finite Since 5 is finite, some 6 E 5 occurs infinitely often in th e sequence 6 i, 6 2,.... Claim : d ( 6 , A) = 0 Proof of claim: Assum e th e opposite, i.e. d(b, A) = e > 0 T hen, 3N E Z + such th a t e > ~ => d{b,A) > Now, Vn > N, d(bn, A) < < t (from definition of bn) 6 7^ bn,Vn > N => b occurs at m ost N tim es in sequence 6 1 , 6 2,... Hence contradiction, which im plies th a t d(b, A) = 0. ((d ( 6 , A) = 0) and (A closed)) 4 > 6 E f i n A ^ 0 □ L e m m a A . 2 .3 Let D\ and D 2 be two closed cones, and let O denote the origin. If D\ fl D 2 = O, then 3 (j) > 0 : V half-lines x E T h, V half-lines y E D 2- , l(x ,y ) > < f). 181 P R O O F Let D f — Di C \ S 2, and D f = D 2 O S'2, w here S 2 denotes th e surface of th e unit sphere. D f and D f are closed because th ey are th e intersection of two closed sets, and bounded because they are contained in any sphere bigger th a n th e u n it sphere. Let X s = x fl D f , and Y s = y fl D f. N ote th a t if Z( x, y ) < < j> , th en d ( X s , H s ) < because d ( X s , Y S) is less th a n th e arc length betw een X s and Y s . Also note th a t if D f fl D f 7Z 0 . th en D t and D 2 intersect along some half-line, and therefore D 1 n d 2 ^ O. P roof by contradiction: A ssum e th a t D\ and D 2 are closed cones, and th a t V < f> > 0 , 3x < E D u 3y E D 2 : l(x ,y ) < < j> , i.e., V0 > 0, 3 X S 6 D f , 3 F S € D f : d ( X s , Y s ) < (f> . We will show th a t D f fl D f ^ 0, and hence D\ fl D 2 ^ O. Let ak = Vfc G Z +. Since Wk G Z + , ak > 0, 3Xjf G D f , 3Yk s G D f : d(X jf,Yk s ) < ak. Thus V A : G ^ + , 3F15 G D f : d(Yu , Df) < ak = f . Therefore, from Lem m a A .2.2 it follows th a t D f fl D f / 0. □ L e m m a A .2 .4 Let D be a cone, R(D ) the reciprocal of D, and r a half-line in R(D). Then, if there exists a half-line d in D such that l(d ,r) — 90°, the following two statements are true: (1) d G dD, and (2) r G dR(D). P R O O F of (1) A ssum e th a t r is a half-line in R(D), d is a half-line in D such th a t Z(d, r) = 90°, and d dD. T hen it follows th a t d G iD. Consider th e plane II th a t is perpendicular to r. II contains d since l(d,r) = 90°. This configuration is shown in figure A .4. Plane II defines two open half-spaces Hi and H 2. Let H\ be th e half-space containing r. Since d G iD, th e point P — d fl S 2 also belongs to iD. Therefore, 3e > 0 such th a t th e open ball B 3(P , e) is contained in D . Since e > 0 and P G II, B 3(P, e) fl H 2 0. Let Q G B 3(P, e) f)H 2, and let I be th e half-line through Q. Since Q G B 3(P, e) D H 2 and B 3(P,e) C D , Q G D. Therefore, / G D . Because I G H 2, Z(r, /) > 90°. Since there exists a half-line / G D such th a t t{r,l) > 90°, r $ R(D), which contradicts th e original assum ption. P R O O F of (2) A ssum e th a t r is a half-line in R(D), d is a half-line in D such th a t Z(d, r) = 90°, and r ^ dR(D ). Since r G R(D ) and r ^ dR(D), r G i(R(D)). Consider th e plane II th a t contains r and is perpendicular to d. T he plane II defines two half-spaces Hi and H 2. Let Hi be th e half-space containing d. Since r G i(R(D)) and r G II, using a sim ilar argum ent as in th e proof of (1) above, we can conclude th a t th ere exists a half-line I such th a t I G R{D) and I G H 2. Since I G H 2, l(d, I) > 90°, and therefore I R(D). Hence contradiction. □ 182 /€ D Figure A .4: Illustration of proof of Lem m a A .2.4 L e m m a A .2.5 Let D be a closed direction cone, and r be a half-line in the boundary of R(D). Then, there exists d E dD such that Z(d, r) = 90°. P R O O F F irst we will show th a t if r E dR(D ), 3d £ D : Z(d, r) = 90°. Proof by contradiction: A ssum e th a t r E d R (D ), and Vd E D , Z(d, r) 7 ^ 90°. Since r E dR(D ) and R(D) is closed (property 1), r E R(D). Therefore Vd E I?, Z(d, r) < 90°. Since Vd E D , Z(d, r) < 90°, and Z(d, r) 7 ^ 90°, Vd E D , Z(d, r) < 90°. Therefore, 5 rfl£ ) = 0 , because = {/ | Z(/, r) = 90°}. Since drflD = 0 , and L>, dr are closed cones, it follows from lem m a A .2.3 th a t 3 f > 0 : Vd E P , Vi E dr, Z(d, /) > (j> . Therefore, Vd E D , Z(d, r) < 90° — < } > . Let P = rf'lS '2, w here S 2 is th e surface of th e un it sphere. Let N be th e open ball w ith center at P and radius sin<j>. T hen, all th e half-lines th a t intersect N , create w ith r an angle less th a n c j> . Since A is a neighborhood of P and P E dR(D), there exists point Q E N such th a t Q ^ R(D). Let r' be th e half-line w ith endpoint the origin and going through Q. Since Q £ R(D), r' ^ R{D). Since Q E N , Z(r, r') < < j> . B ut Z(r, r') < 4 > and Z(d, r) < 90° — < f> , Vd E D im ply th a t Z(d, r') < 90°, Vd E D , because Z is a m etric. Therefore r' E R(D). We reached a contradiction, hence, if r E dR(D ), 3d E D : Z(d, r) = 90°. Since r E dR(D ), and R(D ) is closed, r E R (D ). Therefore, from A .2.4, p art (1), d E dD. □ 183 Property 12 I f D is a closed cone, then dR(D ) = {/ | 3 supporting plane II o f D such that I i P II}, where a plane II is called a supporting plane of a cone D iff II contains at least one boundary half-line of D and D lies entirely in one of the closed half-spaces bounded by II; and I i P II denotes a half-line I perpendicular to plane II and such that I is on the same half-space defined by Ii as D is. P R O O F Let A = {I | 3 supporting plane H o f D such that I ±.D II}. P a rt A: Prove th a t A C dR(D). Let r be a half-line in A and II th e supporting plane of D such th a t r X D II. Since r is perpendicular to a supporting plane II of D and on th e sam e half-space defined by II as D is, it follows th a t L(d,r) < 90° for all d £ D. From th e definition of th e reciprocal cone, this m eans th a t r £ R(D). Since II is a supporting plane of D , th ere exists a half-line d € dD such th a t d £ II. Since r JLD II and d £ II, it follows th a t l(d, r) = 90°. Hence, from lem m a A .2.4, p a rt (2), and r £ R (D ), it follows th a t r £ dR(D). P a rt B: Prove th a t d R (D ) C A. Let r £ dR(D). Because D is closed, from lem m a A .2.5 it follows th a t th ere exists d £ dD such th a t l(d ,r) = 90°. Consider th e plane n perpendicular to r, th en d £ H. Let H x and H 2 be th e closed half spaces defined by n . Let H 1 be th e half-space containing r. Since R(D ) is closed and r £ dR(D ), r £ R(D). From th e definition of th e reciprocal cone it follows th a t l(r,l) < 90° for all I £ D. Therefore, D belongs entirely to th e half-space H\. Since d £ d D , d £ n , and D is a subset of th e half-space Hi defined by n , n is a supporting plane of D. Furtherm ore, since r X n , r £ Hi and D C Hi, it follows th a t r ±.D n . Hence, n is a supporting plane of D such th a t r ±P n , and therefore, r £ A. P r o p e r t y 13 Let D be a direction cone. Then (R (D ) 7Z 0) iff (3 closed planar half-space h such that D C.h) P R O O F R(D ) ± 0 43- 3 Z such th a t 1(1, x) < 90°, Vx £ D < = i> D C-l 3 closed planar half-space I such th a t D C / □ 184 I F igure A .5: C ircular cone K(0)\i A.3 Generalized reciprocal and supplementary cones In this section th e generalized reciprocal and supplem entary cones of a cone D for an angle 9, are expressed in term s of D and a closed circular cone K (6 ), whose apex angle equals 29. T he apex of K(0) is at th e origin. K{Q)\i denotes th e cone K {9 ) in an orientation such th a t th e cone axis coincides w ith th e half-line I (Figure A .5). A .3.1 G e n e r a liz e d r e c ip r o c a l c o n e T he generalized reciprocal cone of a direction cone D for an angle 6, denoted R 9(D), is defined (Section 3.2) as: R e(D) = {r | l ( r ,q ) < 9 , \/q € D} P r o p o s itio n A .3.1 The generalized reciprocal cone R $(D) equals the intersection of all cones K(9)\i such that I is in D. R \D ) = f | K(0)|, ieD P R O O F r € R 6(D) & \ / l € D , Z(r, I) < 9 &VI ZD , r e K(9)h ^ r e flieD K{9)\i □ 185 A .3 .2 G e n e r a liz e d su p p le m e n ta r y co n e T he generalized supplem entary cone is defined (Section 4.7.5.1) as: S e{D) = { l \ 3 d e D : L{l,d) < 0} P r o p o s itio n A .3 .2 S°{D ) equals the union of all cones K(0)\i with I in D. S ‘(D) = U * (< % l&D P R O O F r € S e(D) < & 3d e D : l(r, d)<0 <&3 d€ D :r € K(0)\d O 3K(0)\d G U e c K{0)\i : r € K(0)\d r € a 186 Appendix B Global accessibility: related proofs B .l Proofs related to global accessibility cones B . l . l P r o p o s itio n s on G A C This section contains th e proofs of propositions listed in Section 4.1. P r o p o s itio n 4 .1 .2 Let F be a surface feature of a workpiece W . Then G A C W(F ) = G A C iW®F'(0), where O denotes the origin, and F ' denotes the symmetric of F with respect to the origin. P R O O F In this proof we use th e following relations: i W ® F ' = {x I F\x n i W ^ 0} (a) i w © F' = i(iW © F') (b) R elation (a) is given in [Ser82] (P ro p erty II-6). R elation (b) follows from P ro p erty 111-17 in [Ser82], which states th a t if A is open and B is com pact th en A © B is open, and from P ro p erty 2.6.4 in [RT78] which states th a t a set A is open iff A = iA. In (b), iW is open and F' is com pact, therefore iW © F ‘ is open, and consequently, i W © F' = i(iW © F*). Figure B .l illustrates th e proof th a t follows. / E G A C W(F ) (by assum ption) i W fl (/ © F) — 0 (from proposition 4.1.1) • < = > \/x £ /, i W D F\x = 0 (since / © F = _F|X ) Va: € /, x {iW © F') (from (a)) O I n (i W © F') = 0 ^4 / n i(iW © F') = 0 (from (b)) I € G A C iW®F'{0) (by definition of G AC ) □ P r o p o s itio n 4 .1 .3 Let F be a surface feature of a workpiece W . Then: G A C (F ) C L A C (F ) P R O O F Proof by contradiction. Assum e th a t I € G A C (F ) and I L A C (F ). Since I (£ L A C (F ) th ere exists at least one point Q € F such th a t I £ fiQ(F), th a t is, I does 188 w Figure B .l: Illustration of proof for proposition 4.1.2 not belong to th e half-space defined by th e outw ard norm al of F at Q. T his is a direct consequence of th e definition of L A C and property 1 of the reciprocal cone. B ut I uq(F) im plies th a t / at Q intersects th e interior of W in th e neighborhood of Q. Therefore, I does not belong to G A C (F ), which contradicts th e original assum ption. □ B . l . 2 R e la tio n b e tw e e n G A C a n d G A C k Let K be a circular cone. Define th e orientation of K as th e orientation of its axis. Let G A C k (F) denote th e global accessibility cone of a surface feature F w ith respect to th e circular cone K , defined as follows: G AC k (F) — {/ I I<\i,q D iW = 0, VQ € F 1 }, w here K \ i,q denotes th e cone K at orientation I and w ith its apex at point Q . P r o p o s itio n B .1 .1 Let F be a surface feature of a workpiece W . Then G ACk (F) = {/ | K h C GAC{F)}. P R O O F I e g a C k ( F ) o K \ iiQ n i W = 0, V Q &F V half-lines p € K \itq , p fl i W = 0, \fQ € F Vp € K \u V € G A C (F ) K\i C G A C (F ) □ 189 / Figure B.2: G A C of tran sp aren t volumes B . l . 3 G A C s o f tr a n sp a r e n t v o lu m e s T he G A C of a 3D set is defined sim ilarly to th e G A C of a surface feature. Let V and O be regular 3D sets. T he G A C of V w ith respect to th e obstacle O is defined as follows. G A C °(V ) = {/ | l\A D iO = 0, V A £ V} Equivalently, G A C °(V ) = f ) G A C °{A ) A ev W here th e G A C of a point A w ith respect to th e obstacle O is defined as G A C °{A ) = {I | l\A D iO = 0} P r o p o s itio n B . l . 2 Let V and 0 be two regular 3D sets. I f O is the only obstacle for V, and the intersection of the interior o f V with the interior of O is empty then G A C °(V ) = G A C °{dV ). P R O O F P a rt A: G A C °(V ) C G A C °{dV ) Follows directly from th e fact th a t d V C V for V regular. P a rt B: G A C °(d V ) C G A C °(V ) A ssum e th e opposite: 3/ G G A C °(d V ) and I G A C °(V ). I G A C ° ( V ) im plies th a t th ere exists a point A £ V such th a t (l\A O iO ) 7 ^ 0. P oint A belongs either to d V or to iV. If A £ d V , th en (l\A O iO ) 0 im plies th a t I 0 G A C ° { d V ), which contradicts th e assum ption. Let A £ i V , and (l\A fl iO ) 7 ^ 0 (Figure B.2). Let C be a point in l\A fl iO. Because iO and iV are disjoint, C $ iV. Since V is regular, l\A intersects d V at least at one point. Let B be th e point in l\A fl d V which is closest 190 to A. Since C £ iO, A B £ iV and iO fl iV — 0, C £ 1\b • Therefore, fl iO ^ 0, and from th e G A C ° definition it follows th a t I £ G A C °(d V ) w hich contradicts th e assum ption. B . l . 4 F in ite le n g th p ro b es P r o p o s itio n 4 .4 .2 Let F be a surface feature of a workpiece W . Then G A C Y (F ) = G A C ^ ® f'(0), where O denotes the origin, and F' denotes the symmetric of F with respect to the origin. P R O O F This proof is sim ilar to th e proof of proposition 4.1.2. In th e proof we use th e following relations (discussed in th e proof of proposition 4.1.2): iW © F' = {x | F\x O iW f 0} iW © F' = i{iW © F') I £ G A C f{F ) o i w n (id © F) = 0 43- Va: £ ld, iW 0 F\x = 0 < 4 4 - Va; £ ld, x $ (iW © F') 4>ld (1 (iW © F') = 0 id n i ( i w ® F ' ) = 0 4* I £ G 4 C f ® F'(0 ) (a) (b) (by assum ption) (from proposition 4.4.1) (since ld © F = \Jx< £ idF \x) (from (a)) (from (b)) (from th e definition of GACf) P r o p o s itio n B . l . 3 Let F be a surface feature of a workpiece W . Then G A C Y (F ) = R G A C (iW(BF’)nB(°’d\ 0 ) , where O denotes the origin, F ' is the symmetric of F with respect to the origin, and B ( 0 , d) is a closed ball with center at O and radius d. P R O O F From proposition 4.4.2, G A C Y (F ) = G A C Y (O). Therefore, we m ust prove th a t G ACdw ®F' (O) = R G A C {iW@F')nB(°'d)(0). In th e proof we use th e following relation (see proof of proposition 4.1.2): 191 ii w © F ' = i(iW 0 F') (a) I P a rt A: Prove th a t I € GAC^®F' (O) = > / € RGAC^w® F n > nB^°'d\0 ). \l € GACf ® F '(0) ^ ld D i(iW © F') = 0 ^ h n (iW 0 F ') = 0 =>id n {{iw © F') n B (0 , d)) = 0 { / - / d} n P ( O ,d ) = 0 {/ - M n ((iw 0 F ') n F (G , d)) 0 (b) and (c) (h u {/ - /*}) n ((iw © F ') n B(0, d)) & l n ((iW 0 F') n B(0, d)) = 0 =* i n i(iW ® f ) n P ( 0 , d)) = 0 / < E R G A C ^ w ®Fn> nB( ° ’d\ 0 ) (by assum ption) (by definition of GAC) (from (a)) (b) (by definition of I and Id) (c) (because / = Id U {/ — Id}) (because I < Z I) (by definition of RGAC) jPart B: Prove th a t I < E RGAC^iW®F^ nB^°'d\ 0 ) = * - I G GAC*dW(BF'(O). F irst we prove th a t / G RG AC^iW®Fn> nB^°'d\ 0 ) ^ I n ((iW 0 F ') D B (0 ,d )) = 0. P roof by contradiction. Assum e th a t I € R G A C ^ w&F'^nB^0,d\ 0 ) and I fl ((i W © P ) n B ( 0 , ( f ) ) / i . I G RG AC^iW®F" > nB^o 'd\ 0 ) 1 n ((i W 0 F 1 ) (" I B ( 0 , d)) = 0 (from th e definition of R G A C ) !(/ = lUO) and (/ n ((iW 0 F ') ft B ( 0 , d)) ± 0) j=» (I U O) n ((iW 0 F') n B ( 0 , d)) ^ 0 / n ((iW 0 F') D B ( 0 , d)) = 0 and (iI U O) (1 ((iW © F') n B ( 0 , d)) ^ 0 => o n ((iw 0 F ') n B ( 0 , d)) / 0 = ► O € (*W © F ') and O € F ( 0 , d) (O € (iW 0 F')) and (iW 0 F ' open - [Ser82], P ro p erty 111-17) => 3a : a > 0 and B °(0 , a) C i W 0 F ', w here B ° ( 0 , a) is an open ball. jLet r = min(a, d). Since d > 0 and a > 0, r > 0. Since r < a, B ° (0 ,r ) C i W 0 F ', jwhere B °(0 , r) is an open ball. Let P be a point such th at: P € I and |0 P | = r f 2. \OP\ = r/2=> P e B °(0 , r) P G B ° ( 0 , r) and B °(0 , r) C i W ® F ' = ^ P e iW © F P G I and |CLP| = r/2 ± 0 = ► P € I \OP\ = r /2 and r < d P G B (Q , d) 192! (P G o and (P <EiW® F ) and (P G 5 ( 0 , d)) =» P G Z n (iW © F) n F (G , d) l n { i w © F) n # ( 0 , d) / 0 ^ Z £ i2G'AC,< ,'w r® F'>nB(o ’‘ t>(0) (from th e definition of R G A C ) We reached a contradiction, therefore, I G i2GAC(*w ® F')nS<°’d>(0) = } ► I D {{iW © F ') D B ( 0 , d)) = 0. (d) Proof of Z G R G A C ^ W9F,^ o ^ { 0 ) ^ l e GAC*dW(BF'(O). I G i2G A C(iT V ® F'> nB(°’‘ i)(C>) (by assum ption) = * ► / n ( ( i W © F /) n J B(0,d)) = 0 (from (d)) = * > / < * n ((* W © F') n B ( 0 , d)) = 0 (because ld C Z ) 44- {Id D B { 0 , d)) n («W © F ') ) = 0 (from properties of fl) 44 ld fl {iW © F ')) = 0 (because ld = ld C> F ( 0 , d))) 44 fl *(«TF © F ') ) = 0 (from (a)) 44 I € G A C ^ ® F'( 0 ) (by definition of G A C d) □ B.2 Proofs for polyhedral objects T his section presents th e proofs of th e propositions listed in C hapter 5. B .2 .1 P r o o f o f p r o p o sitio n 5.1.1 P r o p o s itio n 5 .1 .1 Let F be a planar surface feature of a solid W , and N the plane normal to F and passing through the apex of its G A C . Then G AC{F) - N = R G A C {i2F) | where R G A C denotes the restricted global accessibility cone and i2 denotes interior in the 2D relative topology of the planar surface on which F lies. I I p r o o f Let • Si = R G A C {i2F) = {Z \!\p n w = 0, V P G i2F }, and • S2 = G A C (F ) — N = G A C (F ) — {I \ I J_ up}, w here ftp is th e norm al of F . j 1 W e m ust prove th a t Si — S 2. j i jP art A: Prove th a t Si C S 2. Let I € Si. To prove th a t I G S 2 we m ust prove that-J 1(a) I € G A C (F ), and (b) Z g {Z | Z _ L n F} j |Proof of (a): To prove th a t I € GA.C'(F) we m ust show th a t V P G F , /|pfl* 3 W = 0., Or, equivalently, V F G * 2 F , l\p fl i^W — 0, and V F G S2 F , /|p fl i$W = 0. 193, B° {Q, r) cz i3W B (P, r) (by assum ption) (by definition of R G A C ) (because i3W C W ) Figure B.3: Illustration of proof for Proposition 5.1.1, P a rt A. F irst we prove th a t V P £ i2F, /|p fl i3W = 0. Let P £ i2F, we m ust prove th a t l\p fl i3W = 0. (/ £ P i) and (P £ i2F) =» i\P n w = 0 =* i\P n i3w = 0 j(P £ i2F) and (F C d W ) I j=> P £ d W ! ^ p n *3vf = 0 ’ I I (/|p = l\p U P ) and (/|p fl i3W = 0) and (P H i3VF = 0) I = > • l\p Pi i3W = 0 I So, it rem ains to be shown th a t V P £ d2F, Z|p fl « 3VF = 0. I A ssum e th e opposite, i.e. 3 P £ d2P : /|p fl i3W ^ 0 (Figure B.3). J Let Q £ (l\P D i3W ). j < 5 £ * 3 IF = 4 - 3 r > 0 : B 3(Q,r) C i^W, w here B 3(Q ,r ) is th e 3D open ball with! ] radius r and center Q. I Consider B 2(P ,r ) on th e plane of P . ( P 2 (P, r) is th e 2D open ball w ith radius r and center P .) (P £ 5 2 P ) and ( P is regular) => 3 P ' £ P 2 (P, r) such th a t P ' £ i2F and P' ^ P P ' £ P 2 (P , r) => Z|P, D P 3(<£, r) ^ 0 194! Figure B.4: Illustration of proof for Proposition 5.1.1, P a rt B. i I Let Q' E l\p> n B 3(Q , r). T hen Q' E i3W since B 3(Q, r ) C i3W. j H ence, 3P' E i2F : l\P> n i3W ± 0. J {l\P, = l\P, U P') and {l\P. n i3W / 0) => (i\P, U Pf) D i3W ± 0 I p> € i2F = > p ' e d w ^ P ' n i3w = 0 i ((/|p» U P') fl i3W ^ 0) and ( P ' n i3W = 0) => fl i3W # 0 ^ I Therefore, 3P' E * 2 -F : l\p> fl i3W ^ 0, and thus, 3 P ' E i3F ’ • l\p> d W ^ 0. This is aj contradiction to th e assum ption th a t I E S\ = R G A C fa F ). Proof of (b): Assum e th e opposite, th a t is, I E Si and I € {/ | I X ftp}. 'For any point P E i2F, l\p lies in th e plane of F and therefore intersects F in one ( or several line segm ents. Select a point Q in th e intersection. 1 Since Q E F, Q E W. Hence th ere exists a point P E i2F : l\p (1 W ^ 0. (In fact| this is tru e VP E i2F.) Hence, I RGAC(i2F) and we have a contradiction. P a rt B: Prove th a t S 2 C j S\. Let I E S 2. T h at is, I E GAC(F) and I £ {I \ I ± rap}. We m ust prove th a t I E Si. T h a t is, VP E i2F, l\p (1 W = 0. Assum e th e opposite: 3 P E i2F : l\P fl W ^ 0 (Figure B.4). Let Q E /|p fl W. I E GAC(F) =* l\P n i3W = 0 {l\p c l\p) and (l\P n i3W = 0) => l\p n i3W = 0 I 195 (Q € i\P n w) and (I\p n i3w = 0) Q e d3w Since P G « 2 -F, 3 ^ such th a t B 2(P, rq) is in th e plane of F and B 2(P ,r 1) C i2F. j Let r2 = rj x sinO, w here 9 is th e angle betw een I and th e plane of F. j I $ {I \ I A. up} => 0 < 0 < 1r. Hence sinO ^ 0 and r2 7 ^ 0. ' Let B 3(Q ,r2) be th e 3D open ball w ith center Q and radius r2. (Q € d W ) and (W regular) =* 3Qf G B 3(Q , r 2) : Q' G i3W ' B ut Q' G B 3(Q ,r2) im plies th a t 3P 1 G B 2(P,r \ ) : Q ' G because th e projection of B 3(Q ,r 2) along direction I on th e plane of F is enclosed entirely by B 2(P,ri). jHence, 3P' G i?F : l\p> fl i3W 7^ 0, and hence I ^ G AC (F). We reached a contra d ictio n . □ B .2 .2 R e g u la r M in k o w sk i su m j jp r o p o s itio n B . 2 . 1 S regular < & ■ (a) S closed, and \ (b) Vs € 5 , Ve > 0, 3q G B(s, e) and 36 > 0 : B(q, 6) < Z S 1 P R O O F P a rt A: m ust prove th a t S regular = 7* (a) and (b) (a): Since S is regular, S is closed = 7 - (a) (b): Let s g 5 and e > 0. 1 is regular 1 => S = H S = ► Vs G S', s G fc(iS') => Vs £ S, Ve > 0, i?(s, e) r u ’5 7^ 0 (from definition of closure) . Let q G B(s, e) f l iS. . q€B(s,e) (1) ,q € iS 1 = 7 - 36 > 0 : B(q,6) C S (from definition of interior) (2) |(1 ) and (2 ) = ► (b) I | P a rt B: Prove th a t ((a) and (b)) => S is regular. To show th a t S is regular we m ust show th a t S = kiS, or equivalently: 5 c kiS (3) ‘ and | k iS C 5 (4) jProof of (3): ,We m ust prove th a t Vs G S, Ve > 0, B(s,e) D iS 7^ 0 (definition of closure). ] Let s G S, e > 0, th en from (b): | 3 q G B(s, e) and 6 > 0 : B(q, 6) C S j 196] => q £ iS (definition of interior) => q £ B ( s , e) fl iS => B(s, e) D iS ^ 0 P roof of (4): iS C S =* k iS C k S => k iS C S (since S is closed and therefore S = k S ) □ i ! i (P ro p o s itio n 5 .1 .2 If A is a regular set and B is a compact non-empty set, then \A 0 B is a regular set. , I I P R O O F i i A ccording to proposition B.2.1, to show th a t A 0 B is regular, we m ust show that:( (a) A 0 B closed, and t (b) Vs £ A © B , Ve > 0, 3q £ B(s, e) and 36 > 0 : B (q , 6) C A © B. j In th e proof we use th e following two properties from [Ser82]. j A is closed, B is com pact and B ^ 0 I = 4 - A © B is closed ([Ser82], property 111-17) (i) I i I X C X ' => X © B C X ' ® B ([Ser82], property 11-16) (ii) ‘ i P roof of (a) ( Follows directly from (i). I i P roof of (b) | Let s £ A (B B and e > 0. s £ A ® B = $ > 3a £ A and 3b £ B : s = a + b From proposition B.2.1: A regular, and a £ A => 3a' £ B (a , e) and 36 > 0 : B (a f, 6) C A. Let q = a' + 6. a' £ B (a , e) => d(a, a') < e 1 => d(a 4- b,a' + b) = d(a, a') < e = > d (s,q )< e =¥ q £ B(s, e) B(a', S) ® b C A © b (B(a', 6) C A and (ii)) 1 = 4 * B (a ', 6) ©6 cA ©& cA © jE? (6 £ B and (ii)) \ => B(a' + b, 5) C A © B (since B (a f, S) © b is sim ply a ball tran slated by b) = r* B (q , 6) C A © B (because q = a' + b) j i ! |Hence, 3q = a' + b and 36 > 0, such th a t q £ B(s, e) and B(q, 6) C A © B. □ | j i j ________________ 197] Appendix C | i Bent probes: related proofs l2 o p = OQ u (a) Q C b ) Figure C .l: B ent probe specification | I C .l Convex GAC and bent probes — Proofs iln this section we prove th a t if G A C (F ) is convex, th en a bent probe whose compo-l nents belong to G A C (F ) satisfies both th e accessibility and th e approach conditions for F. T he n o tatio n below is used throughout th e proof. Recall th a t a bent probe p is specified by a triple (li, d, /2); th en p = OQ U h\Q, w here O denotes th e origin, and Q is th e point on at distance d from th e origin (Figure C .la ). N ote th a t th e tip of p is at the origin. T he notation p \a represents p positioned at A. — + — * In th e following lj and I2 denote th e unit vectors defined by th e half-lines h and h- P r o p o s itio n C .1 .1 Let F be a surface feature of a workpiece W , and suppose that{ G A C (F ) is convex. For all h, Z 2 € GAC{F) and for all d > 0, the bent probej p — (/1 , d, I2) satisfies the accessibility condition for F . 1 P R O O F Let A € F. We m ust prove th a t p \A ^ iW = 0 (Figure C .lb ). Let B = A + OQ. Then, p\A = A B U l2\B, and A B C h\A. Since h € G A C (F ) and A < E F, h\A O i W = 0, and therefore A B D iW = 0. Hence, it rem ains to be shown th a t /2|b H i W = 0, or, equivalently, th a t for any point C of Z 2|B-, C does not belong to i W . Since /x, /2 € G A C (F ) and G A C (F ) is convex, alx + f3l2 belongs to G A C (F ) for a , / 3 > 0 (from th e definition of convex cone, Section 2.3). B ut A C = 0 / 1 + /3/2 w ith a. = d and f$ = ||jBCf||. Let I be th e half-line w ith direction AC. Since A C 6 G AC (F), I belongs to G A C (F ) (Section 2.3). Thus 1\a fl iW = 0. A nd since C € 1\a , C £ iW . □ L . . 199, Figure C.2: B ent probes from convex GAC - approach condition ; P r o p o s itio n C . l . 2 Let F be a surf ace feature of a workpiece W , and suppose that] G A C (F ) is convex. For all l\, I2 € G A C (F) and for all d > 0, the bent probe' p = (/1 , d, l2) satisfies the approach condition for F. j P R O O F We m ust prove th a t th ere exists a curve c connecting a point A in F and a point- in th e bounding sphere of W , such th a t for all points B in c th e following is true:! p\b O iW = 0. Let A be a point of F. We will prove th a t 12 \a (Figure C.2) is such aj curve. [ Since /2 U is a half-line whose endpoint belongs to W , I2 \a intersects th e bounding sphere of W . Now we m ust prove th a t for all B € h \ a , p \ b O i W = 0. T he second, com ponent of p\g is a subset of th e second com ponent of p \a i and p\A does notj intersect i W since p satisfies th e accessibility condition for F (P roposition C .l.l).i Therefore, th e second com ponent of p \ b does not intersect iW . i Hence, it rem ains to be shown th a t th e first com ponent of p \ b does not intersecti iW . We will do th a t by showing th a t for every point C in th e first com ponent of p\sj C £ iW . Let C be a point th e first com ponent of p\b. A C = || AB\\l 2 -\-\\BC\\l\. Since; h, h € G A C (F ), and G A C iF ) is convex, A C € G AC(F). Let I be th e half-linei w ith direction AC. Since A C 6 G A C (F ), / belongs to G A C (F ), thus 1\a C\iW = 0.| Since C € l\A, C iW . □ j 2 0 ° j Appendix D Clustering is NP-complete D .l Proof that clustering is NP-complete In this appendix we prove th a t clustering is N P-com plete by reduction of the vertex' cover problem to th e clustering problem . We sta rt by defining th e two problems.! (C lusters and m inim um clustering are defined in Section 7.4.) [ i C lu s te r in g P r o b le m : Given a set of sets S = { A lyA 2, ■ • •, A n] and a num ber k,\ S has a fc-cluster iff there exist k clusters Ci, C2, • • •, Ck such th a t = S. (V e rte x C o v e r P ro b le m : Given a graph G = (V,E), V = {ui, • • •, t?n}, E = j{ei, • • • , em} and a num ber k, G has a fc-vertex cover iff there exists a set Vc of k or! fewer vertices such th a t for all e E E, e = (u, u), either u E Vc or v E Vc, th a t is,' every edge is incident on some vertex in Vc. P r o p o s itio n D .1 .1 The clustering problem is NP-complete. j j P R O O F i ! T he clustering problem is shown to be N P-com plete by reducing th e vertex cover problem to it, i.e., dem onstrating a polynom ial tim e com putable function / th a t m aps (G, k) to (S , k ) such th a t G has a k-vertex cover iff S has a ^-cluster. T he vertex cover problem is proven to be N P-com plete in [GJ79]. j R eduction: I ^-vertex cover t — > ^-cluster I (G,k)£(S,k) [ i Let G = (V,E). For each e = (u,v) E E, let A € S w ith A = {it,u}. T h a t is, i>| is th e set of vertex pairs th a t are edge endpoints. Now we prove: G has a fc-vertexi cover S has a fc-cluster. i I P a rt A: (=^) Suppose th a t G has a fc-vertex cover, Vc = {ui, • • • ,u r } C V, r < fc.j Let Ui — ur, r + 1 < i < k. Let Ci = {A E S | U { E A }, i — 1, • • •, k. By definition of; cluster, th e elem ents in a cluster m ust have non-null intersection, and therefore Ci is a cluster, because U{ € PUeCi A. Now suppose th a t A = {u,u} E S. Since Vc is a1 vertex cover, th e edge (u,v) G E is incident on some vertex U{ E Vc. Hence, u f - E A and A is in cluster C{. Therefore, (Jj C{ = S, and S has a fc-cluster. ' P a rt B: (<=) Now suppose th a t S has a fc-cluster C i, • • •, C*,. T hen for each i, f >AeCiA 0. Let Ui E ClAeCiA. Let Vc = {«i, ••• ,«*:}. We now show th a t Vc is! a vertex cover. Suppose e = (w, v) E E. T hen, by construction th ere exists an| A e E S such th a t A e — {w,u}. Since UiCi — S, A e E Ci for some i. Furtherm ore,] Ui € (lAeCiA im plies th a t Ui — u or Ui = v. H ence e is incident on tt;. Since Vc has! at m ost k elem ents, Vc is a A:-vertex cover of G. i : I
Linked assets
University of Southern California Dissertations and Theses
Conceptually similar
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
Asset Metadata
Core Title
00001.tif
Tag
OAI-PMH Harvest
Permanent Link (DOI)
https://doi.org/10.25549/usctheses-oUC11255725
Unique identifier
UC11255725
Legacy Identifier
DP22893