HAL Id: hal-00691703
https://hal.archives-ouvertes.fr/hal-00691703
Submitted on 26 Apr 2012
HAL
is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or
L’archive ouverte pluridisciplinaire
HAL, estdestinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires
Using the witness method to detect rigid subsystems of geometric constraints in CAD
Dominique Michelucci, Simon Thierry, Pascal Schreck, Christoph Fünfzig, Jean-David Génevaux
To cite this version:
Dominique Michelucci, Simon Thierry, Pascal Schreck, Christoph Fünfzig, Jean-David Génevaux.
Using the witness method to detect rigid subsystems of geometric constraints in CAD. Symposium
on Solid and Physical Modeling, 2010, Haïfa, Israel. pp.91-100, �10.1145/1839778.1839791�. �hal-
00691703�
subsystems of geometri onstraints in CAD
Dominique Mihelui
∗
Pasal Shrek
†
Simon E.B. Thierry
†
Christoph Fünfzig
*
Jean-David Génevaux
†
September1 st
3 rd
,2010
Abstrat
Thispaperdeals withtheresolution ofgeometri onstraintsystems
enounteredinCAD-CAM.Themainresultsarethatthewitnessmethod
an be used to detet that a onstraint system is over-onstrained and
thattheomputationofthemaximalrigidsubsystemsofasystemleads
toapowerfuldeompositionmethod.
In a rst step, we reall the theoretial framework of the witness
methodingeometri onstraint solvingand extendthis methodto gen-
erateawitness. Weshowthenthat itanbe usedto inrementallyde-
tetover-onstrainedness. Wegiveanalgorithm toeientlyidentifyall
maximalrigidpartsofageometrionstraint system. Weintroduethe
algorithmofW-deompositiontoidentifyallrigidsubsystems: itmanages
to deompose systemswhihwerenotdeomposableby lassial ombi-
natorialmethods.
Keywords:GeometriConstraintsSolving,witnessonguration,Ja-
obianmatrix,rigiditytheory,W-deomposition
1 Introdution
GeometrionstraintssolvinginComputer-AidedDesign(CAD)aimsatyield-
ingagurewhihmeetssomeinideneandmetrirequirements(e.g.distanes
betweenpointsoranglesbetweenlines),usuallyspeiedingraphialform.For-
mally,ageometrionstraintsystem(GCS)onsistsinonstraints(prediates),
unknowns (geometri entities) and parameters (metri values). Solutions are
returnedastheoordinatesofthegeometrientities. Theleftofgure1shows
anexampleofatehnialsketh, andtherightshowsapossiblesolution.
Theliteraturedesribesanumberofdierentapproahestosolvegeometri
onstraintsystems:
∗
LE2I,UMRCNRS5158,UniversitédeBourgogne
†
LSIIT,UMRCNRS7005,UniversitédeStrasbourg
p1
p1 p2
p2 p3
p3
p4 p4
p5 p5
p6 p6
7
5
9
8 6
7 135
◦
120
◦
115
◦
Figure1: A2Dtehnialsketh(left)andapossiblesolution(right).
• algebraimethods onsistin translatingthe GCSinto aset ofequations andworkingontheequationsystem,thusforgettingthegeometrialbak-
ground. Algebraimethodsanbelassiedinnumerialmethods[22℄(it-
erativeomputations onverging to anapproximate solutionfrom initial
valuesgivenby theuser)andsymbolimethods[2, 11℄(diret omputa-
tionsontheequations thesemethods areseldom usedbeauseoftheir
omplexity),
• geometrimethodsusethegeometriknowledgetosolvethesystem:graph-
basedmethods[6,9,22,28,29,31℄ompilethisknowledgeintoalgorithms
whih onsider only ombinatorial and onnetivity riteria, rule-based
methods[3,17℄dedueonstrutionsplansbyanexpliituseofgeometri
rules,
• hybridmethods[4,8,18℄alternatealgebraiandgeometriphasesofom-
putationstousethepowerofbothapproahes.
For moredetailsongeometri onstraintsolving,see[12℄. Ageneraltrend,
both to redue omplexity and to enhane resolution power, is to deompose
theGCS into solvablesubsystems and to assembletheir solutions[4, 5, 9, 13,
15,22,28,29,31,33℄. Forinstane,onthe2Dexampleofgure1,itiseasyto
separatelysolveeahtriangle (p1p2p6,p2p3p4 andp4p5p6)andthenassemble
them. Foradetailedsurveyofdeompositionmethods,see[16℄.
Notiethat,ontheexampleofgure1,ifone removesoneof thetriangles,
sayp2p3p4, andthen triesto solvetheremainingsystem,one needstoadd in-
formationfromthesolvedsubsystem,otherwisetheremainingsystembeomes
artiulated. Thispieeofinformationisalledtheboundary[24℄. Althoughsev-
eralmethodsexisttondtherelevantinformationinspeiresolutionframe-
works [28℄, no generalalgorithm yet exists to omputethe boundary without
addingtoomuh information.
Indeed, it is important for resolution methods, espeially for graph-based
methods, that the system does not have too few or too many onstraints.
Looselyspeaking, asystemisalled
• under-onstrainedifit hasan innitenumberof solutionsbeausethere arenotenoughonstraintstopindowneverygeometrientity,
• over-onstrainedifithasnosolutionbeauseofonstraintontraditions,
• well-onstrainedifithasanitepositivenumberofsolutions.
Invarianeofrigidsystemsbydisplaementsisgenerallytakenintoaountby
anhoring a point and a diretion in 2D, a point and two diretions in 3D.
Thepointandthediretionarealledareferene forthedisplaements. Other
transformationgroupsmaybeonsidered [30℄.
Alotofworkhasbeendoneaboutthedetetionofover-onstrainedness[14,
27℄orunder-onstrainedness[19,32,37℄ andmoregenerallyaboutthehara-
terization of rigidity [21, 20,30, 35℄. Yet, methods desribed in the literature
may fail to onsider the onsequenes of mathematial theorems that are not
expliitly taken into aount in the onstrution of the resolution algorithm.
Sine a theorem list annot be exhaustive, it is impossible to develop arule-
basedor graph-based algorithm that detets geometri properties induedby
mathematialtheorems.
Inthisartile,weextendthewitnessmethod[25℄toaddressseveralproblems
ited above: how to determine the onstrainedness level of a GCS without
being triked by mathematial theorems (see for instane gure 6); how to
eientlydetetallmaximalwell-onstrainedsubsystemsofagivenGCS;how
to deompose a well-onstrained system into the set of all its minimal well-
onstrainedsubsystems.
For onisenessreasons,in the rest ofthis paper,weonsider 2D systems,
unlessexpliitlymentionnedotherwise. Yet,allalgoritmsanbeextendedto3D
systemswithnearlynohangesand,mostofthetime,theonlymodiationto
bemadeforthetexttobevalidin 3Distoexhangementionsofthreedegrees
offreedom/parameterswithmentionsofsixdegreesoffreedom/parameters.
Thisartileisorganizedasfollows: setion2reallsthepriniplesofthewit-
nessmethodandgivesawaytogenerateawitness;setion3demonstratesthat
aninremental versionof the Gauss-Jordanelimination has the sameompu-
tationalostthantheoriginalversionbutallowstodetetoveronstrainedness
in allases;setion 4givesalgorithmsto eiently identify themaximalrigid
subsystems of anartiulated system; setion 5dedues from these algorithms
a method to further deompose a rigid system into rigid subsystems; nally,
setion7onludesandgivesperspetivestothiswork.
2.1 Priniple
ThewitnessmethodomesfromideasofStruturalTopology,orRigidityThe-
ory [10℄where the questionofrigidityis studied throughthenotion offrame-
works. Aframework isatriple(V, E, p)where(V, E)isagraphandp:V →Rd
arealizationofthegraph,whihmapsthevertiesofV topointsofdimension d. Thinking ofgraphedgesasrigidbarsandofvertiesasartiulationpoints, themain goalof ombinatorial rigidityis toanswerIs (V, E, p)rigid?, i.e. it
admitsonlyrigidmotionsasawhole,nodeformations.
Innitesimal exion. InRigidity Theory, aninnitesimal exion is amap
q : V → Rd suh that (p(i)−p(j))·(q(i)−q(j)) = 0, for eah (i, j) ∈E. A
framework is alled innitesimally rigid, if theonlyinnitesimal exionsarise
fromthediretisometriesofRd,i.e. thetranslationsand rotations.
Under mild assumptions onerning inidene relationships, if one frame-
work (V, E, p0) isinnitesimally rigidthen almostall frameworks (V, E, p)are
innitesimally rigid. And theinnitesimal rigidity impliesthe rigidity of the
framework. Note thatthere areounter-examplesfor theonverse, whih on-
tainspeialinidenes.
Inotherwords,aframeworkinrigiditytheoryorrespondstotherealization
ofageometrionstraintsystemwhereallonstraintsarepoint-to-pointdistane
onstraints: suhasystemisgeneriallywell-onstraineduptodiretisometries
ifit is generiallyrigid. This was generalizedby Mihelui et al. [25, 26℄ to
metrionstraintsoverpoints,lines,et.(distanesandangles)andtoinidene
onstraints(olinearitiesin2Dand3D,oplanaritiesin3D).
InCAD whenthe designer drawsasketh, he/she hasasolutionX0 for a
systemF(X, Ae) = 0,withsomeparametervaluesAereadonthesketh. Then
the goalis a solutionfor the system F(X, Aa) = 0, where Aa are the values
givenforthedimensioning.
Witness. Let F(X, A) = 0 be a onstraint system, where X are the un-
knowns and A theparameters. We suppose that F(X, A) is dierentiable. A witness isthenasolutionX0 ofF(X, A) = 0forsomeparametervaluesAe.
Using aTaylorexpansionfora small perturbation aroundthe solutionX0
ofF(X, Ae) = 0,wehave
F(X0+εv, Ae) =F(X0, Ae) +εF′(X0, Ae)v+O(ε2)
wherev analso beseenasthe instantveloityof eah objetinvolved in the
systemandεisasmalltimestep. Thus,ifaninnitesimallysmallperturbation isanothersolutionofF(X, Ae),wemust have
F′(X0, Ae)v= 0
Thespaeoftheinnitesimalmotionsallowedbytheonstraintsatthewitness
isthengivenbyker(F′(X0, Ae)). Notethat
• thematrixF′(X0, Ae)is knownastheJaobianofsystemF(X, Ae) = 0
takenatpointX0;
• whenallonstraintsarepoint-to-pointdistanes,theJaobianistherigid- itymatrixonsideredin RigidityTheory;
• for otheronstraintswith parametersthegeneriityonditionsare more
ompliatedthan intheombinatorialase: aparametervalueAeand a
orrespondingsolutionX0aregeneriiftherootisanimpliitfuntionof
theparametersinsomeopenneighborhoodof(X0, Ae);forinstane,fora
trianglespeiedwiththreelengthparameters,thisonditionforbidsthat
onelengthisthesumoftheothers;moregenerallythisonditionimplies
thatthematrix
∂F(X, A)/∂X ∂F(X, A)/∂A
0 Id
has thesamerankin anopen neighborhood of (X0, Ae)It remains that
the generi parameter values are dense in the set of parameter values
orrespondingtoarealization.
Wegivesomeexamplesfortheformulationofgenerionstraints. Forpoint,
line,planeinidenes,weassumethattheorrespondingonstraintsarespei-
edexpliitlywithoutparameters. Thisistoavoidexpressingpoint-pointini-
denesbyadistaneonstraint(P1,x−P2,x)2+ (P1,y−P2,y)2=d2withdistane
parameterd= 0. Foradistaneonstraint(P1,x−P2,x)2+ (P1,y−P2,y)2=d2,
the parameterd = 0 is not generi, asthe onstraint is singular at the solu-
tionpoint. Foran angle onstraint angle(P1, P2, P3) = θ, i.e. P1P2·P3P2 = lP1P2lP3P2cosθ, the parameter valuesθ =±π, θ = ±π/2, and θ = 0 are not
generi. Similarly, point-line, line-plane inidenes and line-line, plane-plane
parallelism/orthogonalityonstraintsarenotexpressedbyangleonstraintsbe-
auseitwouldintroduenon-generiangles.
Typiality. A witnessistypial ifit isrepresentativeforthe searhedsolu-
tion,i.e. it hasthesameombinatorialproperties (oinidenes,ollinearities,
oplanarities, et.). So a random solution (X0, Ae), {(X, A) : F(X, A) = 0}
with the speiedombinatorial properties is typial with probability 1 for a
setof witnesssolutions. Notethat systemsexistwith witnesssolutions,whih
aredierentinombinatorialproperties,and noontinuousdeformationexists
totransformoneintotheother. Foranexampleofsuhasystemsee gure14
in[16℄.
We an then study the degrees of freedom of the system by studying the
rank of the Jaobian F′(X0, Ae) on a typial witness X0, and in the ase of
under-onstrainedness,thestrutureoftheallowedinnitesimalmotionsanbe
deduedfromthestudyofthekernelofF′(X0, Ae).
In the rest of this paper, we onsider that rows of the Jaobian matrix
representonstraintsand olumnsrepresentoordinatesofthe unknowns. We
lassiallydenotebymthenumberofrowsandbynthenumberofolumnsof
thematrix.
Theskethisusuallyawitnessbutduetoimpliedinidenesthismaynotbethe
ase. Inthisase,wesolvetheunder-determinedsystem{(X, A) :F(X, A) = 0}
forawitness(X0, Ae). Inthesubdivision solverpresentedin [7℄, thenonlinear monomialsx2i andxixjfori < jarereplaedbyadditionalvariablesxi,iandxi,j,
whihareenlosedin apolytopeBD(xi, xi,i, xi,j,i<j)≥0 withhalfspaesgiven
bythe non-negativity of relevant Bernstein polynomials (Bernstein polytope).
The quadrati onstraint system beomes a polytope S(xi, xi,i, xi,j,i<j) ≥ 0
after rewriting into the additional variables xi,i and xi,j. Thesubsript D of BD(xi, xi,i, xi,j,i<j)≥0indiatesthatthispolytopedependsonthedomainD.
In this way, bounds for the solutiondomain of quadrati polynomialsan be
expressedastwolinearprograms
minxi and maxxi
S(xi, xi,i, xi,j,i<j)≥0 BD(xi, xi,i, xi,j,i<j)≥0
Domainboundsareomputedbylinearprogramminginordertoreduethe
urrent solutiondomain D. If the feasible set is empty, whih is detetedby
linearprogramming,thentheurrentdomainboxontainsnosolution. Other-
wise,weanperformasequeneof redutions andbisetions ofdomain boxes
untilthedomain boxD = [x1, x1]×. . .×[xn, xn] isδ-small: (xi−xi)< δ for
alli. These δ-smallboxesoverthesolutionsetpieewise.
The subdivision solverrequires adomain box to start thesearh. The in-
tervalsfor generi parameter valuesof onstraintsare easy to nd: angle pa-
rameterscosθ(cosθinsteadofθtoavoidtrigonometrifuntions inthesolver) arein [−1 +ǫ,−ǫ]or [ǫ,1−ǫ] with asmall, arbitrary ǫ; intervalsfor distane
parametersdanbeobtainedfrommagnitudeboundsofthepointoordinates.
Findingaboundonthemagnitudeofanyroot[36℄,wouldbeneessarytoprove
thatthe systemhasnosolution. Fortheproblems here,abound onthepoint
oordinatesisknownbeforehand.
Inordertoenumerateallsolutionsofasystem,weusedmid-bisetionofthe
largestintervalin [7℄, whih minimizestheheightof theexplorationtreewhile
ylingthroughdimensions. Fortheaseofdeterminingasinglesolutionasfast
aspossible,thehoie ofthesmallestinterval(greaterorequalδ)isbeneial
assettingvariablestovaluesallowingsolutionsimprovestheeetivenessofthe
domainredutionstep.
We selet the next domain box (of smallest minimum side length greater
thanδ)for redutionand bisetion atrandom. Inthis way,wendasolution
boxontaininga randomsolution, and we take thebox enter projetedonto
thesolutionsetasawitness.
As examples, weshow two systems of dierent diulty. In gure 2, two
triangles with a ommon point p0 are speied by six side lengths. In the
randomsolution,thesidelengthsare alldierent. Ingure3,four pointsand
velineswith10point-lineinidenesarespeiedbyfourangleparametersand
adistane parameter. Theleft partshowsasolutionwithsymmetriandnie
p0 p1
p2 p3
p4
Figure2: Thebuttery: 2Dsystemwith5pointsand 6distane parameters
d(p0, p1),d(p1, p2),d(p2, p0), d(p0, p3),d(p3, p4),d(p4, p0).
p
q r
c
p
q r c
Figure3:2Dsystemof4pointsand5lineswith10point-lineinidenes,4angle
parameterangle(qp, cp),angle(cp, rp),angle(rq, cq),angle(cq, pq)and1distane
parameterd(r, c). Symmetri solution(left)and random,typialwitnesssolu-
tion(right).
thetrianglepoints. Intherightpart,atypialwitnesssolutionisshown,whih
wasfoundat random. Itisusedforfurther analysis.
3 Over-onstrainedness
Wealreadyshowedin setion1that thedetetionofover-onstrainednessis a
ompliatedyet essentialproblemin theeld ofgeometrionstraintssolving.
In this setion, we show that the use of the witness method leads to an
eientandrobustdetetionofredundanyin geometrionstraints.
Wealsoshowtheusefulnessofthewitnessmethodtoenhanerobustnessof
deompositionmethodsbyanaurateomputationoftheboundary.
3.1 Inremental detetion of redundany
Weshowedin[25℄ thatitispossibleto interrogateawitnessinordertodetet
whetherasetofonstraintsisdependentornot.Indeed,itispossibletoompute
the rank of the Jaobian matrix at the witness and to ompare it with the
number of onstraints. However, nding a maximal independent subset of a
dependentset isnotatrivialproblem. Working onthewitness,thenaiveidea
wouldbetotryand removeonstraintsonebyoneand,ateahstep,ompute
therankagainto determineif theonstraintisredundant withtheremaining
set. If therank of S −c equalsthe rankof S, then onstraintc isredundant
andanberemoved. Performedthisway,theremovalofredundantonstraints
is expensive. Yet, onsidering an inremental onstrution of the geometri
onstraint system allows to identify the set of redundant onstraints with no
additionalostsinomparisonto thebasidetetionof redundany.
Indeed, onsider a geometri onstraintsystem S with no redundany be-
tweentheonstraints. ApplyingtheGauss-Jordan eliminationmethod on the
Jaobianmatrix at the witnessleads to amatrix J′ = (IP) with I am×m
diagonal matrixand P a m×f matrix, f =n−m being the number of a-
tualdegrees of freedom of the system. This method hasa known omplexity
of O(min(n, m)nm). Let us nowonsider a systemS′ with S ⊂ S′. Inorder
to knowifS′ is over-onstrained,oneonlyneeds to inrementallyadd thege- ometrientities andtheonstraints(bearing in mindthat aonstraintanbe
insertedonlywhen the geometrientities it onernsare all in thesystem) of
S′− S to S and applying Gauss-Jordanagain. Sinethe leftmost partof the
matrixis thediagonal, thenumber ofoperations is at most2 min(m, n)f: for
eahrowofI,eahnon-zeroelementofP mustbemultipliedandaddedtothe
newrow. Thenumberof operationsisin fat farsmaller,sinethenumberof
zeroelementsin thenewrowofthematrixishigh.
Proeeding inrementallydoesnot raise thenumber ofoperations: it only
hangestheorderoftheoperations. Indeed,thelassialGauss-Jordanelimina-
tionmethodonsistsinolumn-by-olumnoperations: foreaholumnc,divide
rowc byJc,c,thensubstratJr,ctimesthisnewrowfromrowrforeveryr,so