11Reverse EngineeringReverse Engineering11 July 200211 July 2002
Reverse EngineeringReverse Engineering
Dr. GDr. Gábor Rennerábor Renner
Geometric Modelling Laboratory,Geometric Modelling Laboratory,
Computer and Automation Research Institute Computer and Automation Research Institute
22Reverse EngineeringReverse Engineering11 July 200211 July 2002
Reverse Engineering
set data point CAD model measured data boundary representation (incomplete, noisy, outliers) (accurate and consistent)
intelligent 3D Scanner • interpret the structure of data points in order to create
an appropriate computer representation allowing redesign of objects
applications– no original drawing or documentation– reengineering for constructing improved products– reconstruct wooden or clay models– incorporate, matching human surfaces, etc.
33Reverse EngineeringReverse Engineering11 July 200211 July 2002
Classifying objects
conventional engineering objects– many faces; mostly simple geometry– f(x,y,z)=0, implicit surfaces:
• plane, cylinder, cone, sphere, torus
– sharp (or blended) edges free - form shapes
– small number of faces; complex geometry– r = r(u,v), piecewise parametric surfaces, – smooth internal subdividing curves
artistic objects natural surfaces
44Reverse EngineeringReverse Engineering11 July 200211 July 2002
Conventional engineering partsConventional engineering parts
55Reverse EngineeringReverse Engineering11 July 200211 July 2002
Free-form objects
66Reverse EngineeringReverse Engineering11 July 200211 July 2002
Artistic objectsArtistic objects
77Reverse EngineeringReverse Engineering11 July 200211 July 2002
Natural objectNatural object
88Reverse EngineeringReverse Engineering11 July 200211 July 2002
Natural objects
99Reverse EngineeringReverse Engineering11 July 200211 July 2002
Natural objects
1010Reverse EngineeringReverse Engineering11 July 200211 July 2002
Basic Phases of REBasic Phases of RE
1. data acquisition1. data acquisition 2. pre-processing2. pre-processing
• triangulation,triangulation,• decimationdecimation• merging multiple viewsmerging multiple views
3. segmentation3. segmentation 4. surface fitting4. surface fitting 5. CAD model creation5. CAD model creation
11 July 200211 July 2002 Reverse EngineeringReverse Engineering 1111
TriangulationTriangulation
11 July 200211 July 2002 Reverse EngineeringReverse Engineering 1212
TriangulationTriangulation
1313Reverse EngineeringReverse Engineering11 July 200211 July 2002
Decimation Decimation
1414Reverse EngineeringReverse Engineering11 July 200211 July 2002
Merging point clouds Merging point clouds (registration) - 1(registration) - 1
1515Reverse EngineeringReverse Engineering11 July 200211 July 2002
Merging point clouds Merging point clouds (registration) - 2(registration) - 2
FIAT
1616Reverse EngineeringReverse Engineering11 July 200211 July 2002
SEGMENTATION: separate subsets of data points; each point region corresponds to the pre-image of a particular face of the object
“chicken and egg” problem• given the geometry, selecting point sets is easy• given the pointsets, fitting geometry is easy
to resolve this we need:• interactive help• iterative procedures• restricted object classes
segmentation and surface fitting are strongly coupled: hypothesis tests
Segmentation and surface fitting
1717Reverse EngineeringReverse Engineering11 July 200211 July 2002
Reconstructing conventional engineering objects - 1
basic assumptions• relatively large primary surfaces
– planes, cylinders, cones, spheres, tori
• linear extrusions and surfaces of revolution• relatively small blends
“accurate” reconstruction ”without” user assistance
1818Reverse EngineeringReverse Engineering11 July 200211 July 2002
Object and decimated meshObject and decimated mesh
1919Reverse EngineeringReverse Engineering11 July 200211 July 2002
Reconstructing conventional engineering objects - 2
the basic structure can be determined direct segmentation
• decompose the point cloud into regions
a sequential approach using filters• find “stable” regions• discard “unstable” triangular strips, by detecting sharp
edges and smooth edges• simple regions• composite, smooth regions
2020Reverse EngineeringReverse Engineering11 July 200211 July 2002
Reconstructing conventional engineering objects - 3
sharp edges (and edges with small blends)• computed by surface-surface intersection
smooth edges • assure accuracy and tangential continuity • surface/surface intersections would fail in the
almost tangential situations• explicitly created by constrained fitting of multiple
geometric entities
2121Reverse EngineeringReverse Engineering11 July 200211 July 2002
Direct segmentation - 1
basic principle• 1. based on a given environment compute
an indicator for each point • 2. based on the current filter exclude
unstable portions and split the region into smaller ones
• 3. if simple region: done• 4. if linear extrusion or surface of
revolution: create a 2D profile• 5. if smooth, composite region: compute
the next indicator and go to 1
2222Reverse EngineeringReverse Engineering11 July 200211 July 2002
Direct segmentation - 2
planarity filter: detect sharp edges and small blends dimensionality filter: separate
• planes• cylinders or cones, linear extrusions, composite
conical-cylindrical regions• spheres or tori, surfaces of revolution, composite
toroidal-spherical regions direction filter: separate
• cylinders, linear extrusions, composite conical regions apex filter: separate cones axis filter: separate
• spheres, tori, surfaces of revolution
2323Reverse EngineeringReverse Engineering11 July 200211 July 2002
Planarity filtering
Angular deviationNumerical curvatures
Remove data points aroundsharp edges
2424Reverse EngineeringReverse Engineering11 July 200211 July 2002
Dimensionality filtering using Dimensionality filtering using the Gaussian spherethe Gaussian sphere
2525Reverse EngineeringReverse Engineering11 July 200211 July 2002
Dimensionality filtering - An example.Dimensionality filtering - An example.
2626Reverse EngineeringReverse Engineering11 July 200211 July 2002
Dimensionality filteringDimensionality filtering
• based on the number of points in two concentric spheres
• separate data points by their dimensionality
D0: planesD1: cylinders-cones-transl. surfsD2: tori-spheres-rot. surfs
2727Reverse EngineeringReverse Engineering11 July 200211 July 2002
Planarity and dimensionality Planarity and dimensionality filteringfiltering
2828Reverse EngineeringReverse Engineering11 July 200211 July 2002
Planarity and dimensionality Planarity and dimensionality filteringfiltering
2929Reverse EngineeringReverse Engineering11 July 200211 July 2002
Detect translational and rotational symmetries
translational direction
• normal vectors ni of a translational surface are perpendicular to a common direction
• minimise ni,d2
rotational axis
• normal lines of a rotational surface (li, pi) intersect a common axis
i - angle between the normal line li and the plane containing the axis and the point pi
• various measures, in general: a non-linear system
3030Reverse EngineeringReverse Engineering11 July 200211 July 2002
Computing best fit rotational axis
3131Reverse EngineeringReverse Engineering11 July 200211 July 2002
Conical - cylindrical regionConical - cylindrical region
direction estimation detects cylinders and composite linearextrusions, rest: composite conical region
3232Reverse EngineeringReverse Engineering11 July 200211 July 2002
Conical composite regionConical composite region
fit a least squares pointto the tangent planes tocompute the apex
3333Reverse EngineeringReverse Engineering11 July 200211 July 2002
Toroidal - spherical regionToroidal - spherical region
estimate a localaxis of revolution
if largest eigenvalue(almost) zero ->sphere
otherwise torus orsurface of revolution
3434Reverse EngineeringReverse Engineering11 July 200211 July 2002
Apex and axis filteringApex and axis filtering
3535Reverse EngineeringReverse Engineering11 July 200211 July 2002
Surface fitting
given a point set and a hypothesis - find the best least squares surface
simple analytic surfaces - f(s,p) = 0• s: parameter vector, p: 3D point
minimise Euclidean distances - true geometric fitting algebraic fitting - minimise f(s,pi )2
approximate geometric fit - f / | f ’| ‘faithful’ geometric distances (Pratt 1987, Lukács et al.,
1998): unit derivative on the surface sequential least squares
• based on normal vector estimations
• series of linear steps
• reasonably accurate, computationally efficient
3636Reverse EngineeringReverse Engineering11 July 200211 July 2002
Constrained fitting Constrained fitting
needed for various engineering purposes fitting smooth profile curves for linear extrusions
and surfaces of revolution refitting elements of smooth composite regions
for B-rep model building• good initial surface parameters from segmentation• set of constraints• edge curves - explicitly computed
beautify the model• resolve topological inconsistencies• rounded values, perpendicular faces, concentric axis
11 July 200211 July 2002 Reverse EngineeringReverse Engineering 3737
Constrained fittingConstrained fitting
11 July 200211 July 2002 Reverse EngineeringReverse Engineering 3838
Constrained profilesConstrained profiles
Translational profileRotational profile
3939Reverse EngineeringReverse Engineering11 July 200211 July 2002
Constrained fitting problemConstrained fitting problem
primary surfaces:primary surfaces: s s S S parameter set:parameter set: aa point sets:point sets: p p P Pss
individual weight:individual weight: ss
k k constraint equations:constraint equations: {c {cii}} findfind aa, , which minimizeswhich minimizes f f
whilewhile c=0 c=0
c(a) = 0
Constraints: tangency, perpendicularity, concentricity, symmetry, etc..
4040Reverse EngineeringReverse Engineering11 July 200211 July 2002
Constrained fitting techniques Constrained fitting techniques
standard solution: Lagrangian multipliers, standard solution: Lagrangian multipliers, n+kn+k equations, multidimensional Newton-Raphson equations, multidimensional Newton-Raphson
problem: constraints contradict or not problem: constraints contradict or not independentindependent
preferred solution: sequential constraint preferred solution: sequential constraint satisfaction constraints sorted by satisfaction constraints sorted by prioritypriority
c(a) = 0c(a) = 0 and and f(a) = min.f(a) = min. is solved simultaneously is solved simultaneously by iterationby iteration
4141Reverse EngineeringReverse Engineering11 July 200211 July 2002
Constrained fitting - 2 Constrained fitting - 2
linear approximation forlinear approximation for c, c, quadratic forquadratic for f f
in matrix formin matrix form
wherewhere
4242Reverse EngineeringReverse Engineering11 July 200211 July 2002
Efficient representation Efficient representation
signed distance functionsigned distance function
the function to be minimizedthe function to be minimized
middle term needs to be computed only oncemiddle term needs to be computed only once
4343Reverse EngineeringReverse Engineering11 July 200211 July 2002
Fitting a circle - an exampleFitting a circle - an example
centercenter o, o, radiusradius r, r, pointpoint p p Euclidean distance function:Euclidean distance function: |p - o| - r |p - o| - r faithful approximation:
terms are now separated
alternative parameters with a constraint:
4444Reverse EngineeringReverse Engineering11 July 200211 July 2002
Equations for constrained fitting Equations for constrained fitting of circlesof circles
circles (lines) - in Pratt’s form (1987) circles (lines) - in Pratt’s form (1987)
tangency constraintstangency constraints
4545Reverse EngineeringReverse Engineering11 July 200211 July 2002
Using auxiliary objectsUsing auxiliary objects
1a 1b
2a 2b
4646Reverse EngineeringReverse Engineering11 July 200211 July 2002
Simple part reconstructionSimple part reconstruction
4747Reverse EngineeringReverse Engineering11 July 200211 July 2002
Final CAD (B-rep) modelFinal CAD (B-rep) model
with blends
without blends
11 July 200211 July 2002 Reverse EngineeringReverse Engineering 4848
Functional decomposition:
primary surfaces + features
P0
P3
P4
P5
P6
P7
P8S1
P10
P1
P2
S2
ST(S1,S2)
Ignore area
Reconstruction of free-form shapes
11 July 200211 July 2002 Reverse EngineeringReverse Engineering 4949
Reconstruction of free-form shapes
Surfacestructure
11 July 200211 July 2002 Reverse EngineeringReverse Engineering 5050
Reconstruction of free-form shapes
Curvatureplot
5151Reverse EngineeringReverse Engineering11 July 200211 July 2002
Advanced Surface Fitting (BMW model)
11 July 200211 July 2002 Reverse EngineeringReverse Engineering
Free form surface fittingFree form surface fitting
Functional:Functional:
F F F
F u v
F v u
lsq sm
lsq i ii
n
i
sm uu uv vvv
v
u
u
( ) ( ( , ) )
( )min
max
min
max
S S P
S S S S
1
2
2 2 2 d d
Initialization:Initialization: • data point parametersdata point parameters• knot-distributionknot-distribution• smoothing weight (smoothing weight ())
F minimizationF minimization ParametercorrectionParametercorrection Knot-insertionKnot-insertion Smoothing weight opt.Smoothing weight opt.
5353Reverse EngineeringReverse Engineering11 July 200211 July 2002
Reconstructing free-form features (vrrb blend)
Global surface fitting
Functional decomposition- stable regions- constrained fitting
5454Reverse EngineeringReverse Engineering11 July 200211 July 2002
Reconstructing free-form features(free-form step)
Global surface fitting Functional decomposition
5555Reverse EngineeringReverse Engineering11 July 200211 July 2002
Conclusion
RE: a complex process, approaches differ by model type, quality of measured data sets and ‘a priori’ assumptions
free-form objects: functional decomposition - some user assistance needed
conventional engineering objects: direct segmentation - basically automatic• smooth edges
• accurate surfaces - linear extrusions - surfaces of revolution
• constrained fitting