Transcript Document

Operators in CAD Systems
Motivation:
(a) Which operators are available helps us to plan
how to complete the design of a part.
(b) Understand the mathematical basis, to help us
to decide when to use it
when not to use it,
understand, if it fails, why
decide how to avoid failures.
1. Transformations
Use:
(a) Building any 3D model
(b) Viewing any 3D model
Types of affine transformations of interest
object transformations
coordinate transformations
Mathematical Tool: matrices
Affine transformations
translations
rotations
Shape/size of an entities is
invariant with respect to translation and rotation
=> We need only study translation, rotation of a point (vertex)
Vertex = Point, column vector: [ x, y, z]T =
x
y
z
Translation
Coordinate transformation
Object transformation
Move r = [x, y, z]T
x = P in fixed frame oxyz
x’ = P in frame o’x’y’z’
(translated w.r.t oxyz by –t): r’ = x’
by t = [tx, ty, tz]T :
r’ = r + t,
t
tz
tx
z
y
y’
z’
z
P
r
o
ty
x’
t
r’
x
o’
-t
x’
o
y
P
x
x
Rotation
Rotations in the XY plane
Rotation of P by angle q about the oz :
 x   r cos  
r  

 y   r sin 
matrix A: Rot(z,q)
y
 x'  r cos(  q )
r'     

y
'
r
sin(


q
)
  

r cosq cos  r sin q sin  
o


r sin q cos  r cosq sin  
cosq  sin q  r cos 
x 


A
 Ar





sin q cosq  r sin  
 y
r’
q
r
P

x
Object transformation Rot(z, q) == Coordinate transformation by Rot( z, - q )
Matrix formulas
 x'  cosq  sin q 0   x 
r'   y '  sin q cosq 0  y   Rot( z ,q )r
 z '   0
0
1   z 
 x'  cosq 0 sin q 
r'   y '   0
1 0 
 z '   sin q 0 cosq 
 x'   1
r'   y '   0
 z '   0
x 
 y   Rot( y,q )r
 
 z 

cosq  sin q 
sin q cosq 
0
0
x 
 y   Rot( x,q )r
 
 z 
2.1. Scaling
Use:
to shrink / expand size of a part
Uniform scaling:
Multiply each coordinate in BREP by the scaling factor
Operation:
Map vertex, v( x, y, z) -> v’( sx, sy, sz)
Property:
Uniform scaling does not change the topology of the part
2.2. Non-uniform scaling
Non-Uniform scaling
scaling each coordinate, v( x, y, z)
by different scaling factors, (sx, sy, sz)
Transformed coordinates:
v’(sxs, syy, szz).
Question:
Does the topology of the part change ?
Applications of Non-uniform scaling:
(a) Mold design from part
(b) Clothing and Footwear design, …
Composition of Transformations
Point in E3 as [x y z 1]T 4x4 matrices for transformations
 x' 
1 0 0 a   x 
 y '
0 1 0 b   y 
Translation    
 
 z' 
0 0 1 c   z 
 

 
1 
0 0 0 1 1 
Scaling
s x 0 0
 x' 
0 s 0
 y '
y
   
0 0 s z
 z' 

 
1
0 0 0
 
0  x 
0  y 
 
0 z 
 
1 1 
Rot( X, q)
0
 x' 
1 0
 y '
0 cosq  sin q
   
 z' 
0 sin q cosq
 

1
0
 
0 0
0  x 
0  y 
0  z 
 
1  1 
Rotation about an arbitrary axis
u =[u1 u2 u3] = unit vector along given axis
u
Rotation by angle q about u
q
r’
O
u12  cosq (1  u12 )
 x' 

 y '
   u1u 2 (1  cosq )  u 3 sin q
u u (1  cosq )  u sin q
 z' 
2
 3 1
 

0
1 
u1u 2 (1  cosq )  u 3 sin q
u 22  cosq (1  u 22 )
u 2 u 3 (1  cosq )  u1 sin q
0
r
[x y z]T
[x’ y’ z’]T
u 3u1 (1  cosq )  u 2 sin q
0  x 
 
u 2 u 3 (1  cosq )  u1 sin q
0  y 
u 32  cosq (1  u 32 )
0  z 
 

0
1  1 
Arbitrary rotation of Coordinate frame
r = [x y z 1]T a point in OXYZ
Oxyz = A new coordinate frame
What are the coordinates of the point in Oxyz?
(u1, u2, u3), (v1, v2, v3), (w1, w2, w3): DCs of u, v, w in OXYZ
Z
y
Y
rz
ry
r’y
r
rx' 
u1
 '
u
 ry 
 2

 '
u 3
rz 

1 
0
x
r’x
r’z
O
z
rx
X
v1 w1 0 
v 2 w2 0
v3 w3 0 

0 0 1
rx 
r 
 y
rz 
 
1 
Concatenation of Transformations
Successive transformations:
(i) Translate [-5 0 –5]
(ii) Rotate(Y, 45)
(iii) Translate [5√2 0 15]
1

0
0

0
0 0 5 2  1 / 2 0 1 / 2 0 1


1 0
0  0
1 0 0  0
0 1 15   1 / 2 0 1 / 2 0 0


0 0 1   0
0 0 1  0
0 0  5 1 / 2 0 1 / 2 0 



1 0 0 0
1 0
0 

A



0 1 5
 1 / 2 0 1 / 2 15


0 0 1   0
0 0
1 
Summary
1. affine transformations: preserve collinearity
2. Affine transformations useful in CAD
3. Matrices are useful to compute transformations
4. Translations, Rotations, Scaling
5. 4x4 matrices can represent all three of these
6. A series of transformation  resultant transformation
 multiply corresponding matrix in reverse order
Operators in CAD: Boolean operators
Boolean operations: U*, ∩*, -*
inputs: regular 2-manifold solid(s)
outputs: regular 2-manifold solid(s)
f2
e1
A
B
Problem:
f1: One loop or two ?
f1
(A -* B) is not a 2-manifold
f2: One loop or two ?
e1: Two co-edges ? Three ? Four ?
-e1
+e1
+e1
-e1
Operators in CAD: Sweeping
Linear and Non-linear sweep
Use: solid shapes from 2D sketches
INPUTS:
Profile (2D sketch, one or more loops)
Sweep path (continuous, bounded curve)
OUTPUT:
regular 2-manifold solid
Operators in CAD: Sweeping..
Geometric Problem:
all vertices, edges, faces of output easy to generate
(i) fix sketch in frame OXYZ
(ii) move OXYZ along sweep-path
rotation determined by tangency, torsion
sketch
A:= sweep outer loop
B:= sweep inner loop(s)
Out := A -* B
(a) Linear sweep normal to sketch
(b) Linear sweep oblique to sketch
Operators in CAD: Sweeping...
axis
sketch
circular sweep path
(270°) (360°)
sketch
sweep path
(c) Circular sweep
Other names: Extrude, Extrude-cut
(d) Complex sweep path
Operators in CAD: Topological problems in Sweeping
(i) sweep path not smooth (C0, C1)
(ii) self-intersection of the swept shape
Example 1. How to generate shape?
OR
Operators in CAD: Topological problems in Sweeping..
Example 2. How to generate shape?
Profile maintains orientation
w.r.t. global frame
Profile maintains orientation
w.r.t. path
FAILS!
Operators in CAD: Chamfer, Fillet
Special cases of Blending
INPUTS:
Surfaces S1 and S2 that share an edge, E
OUTPUT:
Blending surface, B, between S1 and S2; E will vanish
Interfaces between (B, S1), an (B, S2) are continuous
chamfer: C0
fillet, round: C1
Operators in CAD: Chamfer
Typical Uses:
angled recess at the end of a hole
angled edge to of shaft for ease of assembly
chamfer along arc
chamfer along linear edge
screw-surface mates with/without chamfers
Operators in CAD: Chamfer computations
(a) For each edge, create chamfer cross-section: a ‘triangle’
(b) sweep the section of each edge along the corresponding edge
(c) fill ‘gaps’ at vertices (filler shapes)
(d) Boolean (Part -* solid shape) for each solid shape and filler shape
PROBLEM:
what if neighboring faces are curved?
Operators in CAD: Chamfer…
Geometry, Topological Problems
step (a): cross-section
step (c): filling “gaps”
step (d) poor/changed topology
Concavely connected curved face (red edge)
is not C1, difficult to ‘merge’ the two chamfers
corresponding to the two green edges
Green edge difficult to chamfer, since
chamfer geometry will destroy the
triangular dark face.
Operators in CAD: Fillet, Round
Same as Chamfer, except:
Geometric section used is Circular arc
Round
Fillet
Operators in CAD: Blending
General case of Chamfers, Fillets and Rounds
USES:
Smooth the edge shared between two (spline) surfaces
Merge two surfaces that are close, but not touching
INPUTS:
Two surfaces, and shared/blending edges
Blend radius
Operators in CAD: Blending..
(a) blending intersecting
(complex) surfaces
(b) blending non-intersecting
(complex) surfaces
Operators in CAD: Blending...
section plane perpendicular
to blend edge
blend-edge
normal view of
section plane
blend surface:
sweep blend arc along blend edge
blend arc
Problems:
1. If edge is not C1, then sweep of blend arc is not C0
2. How to store the surface equation ?
Blend computation: Rolling Ball Method
Operators in CAD: Tapers and drafts...
Main Use:
manufacturing related features: casting or molding
INPUTS:
(a) face / faces to be drafted
(b) a neutral plane, that
intersects the faces being drafted
cross-section of the drafting faces on the neutral face unchanged
(c) the draft angle
OUTPUT:
(a) Modified part geometry
Operators in CAD: Tapers and drafts...
Examples
Cylindrical faces:
F1
F2
F3
Draft F1, F2, F3 by 15°
Green section shows neutral plane
Operators in CAD: Tapers and drafts...
Examples (4th example is special!)
Opposite faces (green outline) to
be drafted by 15°
Neutral faces (green outline)
A complex draft
Operators in CAD: Tapers and drafts...
Example 4:
INPUTS:
(a) Face(s) to be drafted (b) Draft line (c) Draft angle (d) Neutral plane
Opposite faces (green outline) to
be drafted by 15°
Neutral faces (green outline)
A complex draft
Operators in CAD: Tapers and drafts...
Draft method:
(i) Intersect the neutral plane with the draft faces,
to get a series of edges (or a loop) that must stay fixed;
(ii) Each point, p on the fixed loop belongs to a Draft face, F.
(iii) For each point p, form the drafted edge:
(a) P = plane through p, with normal = NF X NN
(b) Intersect P with F to get drafting edge, ep.
(c) Rotate ep by the drafting angle in plane P, to get the drafted edge
Operators in CAD: Tapers and drafts...
This Draft method works for (some) non-planar draft-lines
NN
drafted line
drafting line
P
NF
q
p
drafted planes
neighboring plane
intersection line
Operators in CAD: Tapers and drafts...
Draft failures
(a) draft feature results in non-manifold geometry
draft angle: 44
10
20
draft angle: 45
X
X
Operators in CAD: Tapers and drafts...
Draft failures
(b) draft face intersection with neighboring face ill-defined
Requires intersection after draft generation
neutral face
neighboring face
45° Draft extends partially
beyond neighboring face
Operators in CAD: Tapers and drafts...
Draft failures
(c) draft face intersection with neighboring face ill-defined
neutral face
NON-PLANAR
neighboring face
45° Draft extends partially
beyond neighboring face
ill-defined geometry
Operators in CAD: Surface operations: Offsets
Inputs: Surface S, offset distance, r, offset direction
Computation:
for each point p on the base surface
Normal = Np
Offset point of p := p + r Np
Planar surface:
offset
surface
offset
Operators in CAD: Surface offsets, cylindrical surface
Û
q = a + xÛ
offset
p
q
(q - p).Û = 0
(a +xÛ – p).Û = 0
surface
x = (p – a).Û
z
offset
y
a
x
Offset point:
po = p + r (p - q)/|(p – q)|
Operators in CAD: Surface operations
Surface offsets: BSpline surface
Surface equation: p = p(u, v)
pu 

p (u , v)
u
pv 

p (u , v)
v
Tangent vectors:
^
Normal vector:
N 
Bspline
pu
pv
pu  pv
| pu  pv |
For each point, p offset point po = p + rN
Offset surface equation: p(u, v) + r N(u, v)
NOT
Bspline
Operators in CAD: Surface operations
Find a grid of points on the surface,
For each point of grid, offset point po = p + rN
Fit a new BSpline surface through grid po
BSpline offset is UNSTABLE !
poor
geometry
Operators in CAD: Surface operations
Surface offsets:
Inputs: Surface S, offset distance, r, offset direction
Computation:
for each point p on the base surface
Normal = Np
Offset point of p := p + r Np
Planar surface:
offset
surface
offset
Operators in CAD: Offset -- interpretations
non-intersecting faces
extended
intersecting faces
trimmed
non-intersecting faces
extended
Operators in CAD: Trimming
Trimming operation is based on intersection
Trim R by B
B
R
Trim B by R
R must be
EXTENDED
Operators in CAD: Trimming
BSpline surface trimming
Curve extension
Intersection curve
Operators in CAD: Shelling
Convert a solid to a “shell”
Examples
shell all
don’t shell
top face
don’t shell
top, left faces
don’t shell
left, front faces
Operators in CAD: Shelling
Shell computation:
For each face f, compute offset face, fo
Intersect each pair of offset faces
Re-compute BREP of solid [topologically difficult]
Operators in CAD: Lofting/ Skinning
Use a series of (2D) “guide” profiles
Put a “skin”: surface that interpolates each guide profile
Example
Operators in CAD: Lofting/ Skinning
Lofting computation:
Complex, involving BSpline surfaces
self intersection: fails
Instability:
skinned surface not smooth
Issues in using CAD for PDM/PLM
- Reuse same model (saves time/money)
 Parametric designs
 Design tables
- Automated design verifications
 Design rules, triggers (constraints)
 Knowledge-based designs (using API’s)
Conclusions
Understanding of CAD operations 
Using the correct operation to make a given shape
Ability to anticipate & analyze why/when an opn may fail