1D deformable model forreal time physical simulation
Julien Lenoirnovember 23rd 2004
GRAPHIX-LIFLChristophe ChaillouPhilippe Meseure, Laurent Grisoni
2
Objectives
IRCAD
Simulation group-CIMIT
3
Outlines
1) 1D deformable model
2) Constraints
3) Multi-resolution
4
Physically-based animation: generalities
Possible independent geometry-physics
Time discretization => time step
Collision detection and response
Physical resolution: static vs dynamic Static: calculates the new positions
Dynamic: computes the accelerations Numerical integration => velocities and positions
5
General context
Mechanical model = Model defined by physical laws Discrete => physical equations are linked to some
specific location
Continuous => physical equations are formulated in a continuous domain with spatial discretization without spatial discretization
6
Outlines
1) 1D deformable model
2) Constraints
3) Multi-resolution
7
1) 1D deformable model
Real/Interactive time for manipulation
Realistic behavior
stretching bending twisting
8
1) 1D deformable modelPrevious works
Geometric model: piecewise linear, subdivision, spline…
Physical model: Discrete models:
Mass-spring [Desbrun et al.99] [Casiez01] dynamic
Continuous models: Finite difference [Terzo87]
dynamic, spatial discretization (regular grid) Lagrange [QinTerzo96][Remion99]
dynamic, non spatial discretization, spline Cosserat elasticity - static resolution [Pai02]
static
9
1) 1D deformable modelChoices
Geometry: Discrete model (points) Subdivision curve Continuous model (spline…)
Physics: Discrete models: Mass-spring (Newton) Continuous models:
Spatial discretization: FDM, LEM… Any DOF: Modal analysis, Lagrange formalism
10
1) 1D deformable modelOur Choices
Geometry: Discrete model (points) Subdivision curve Continuous model (spline…)
Physics: Discrete models: Mass-spring (Newton) Continuous models:
Spatial discretization: FDM… Any DOF: Modal analysis, Lagrange formalism
11
1) 1D deformable modelOur Choices: Geometry
Spline model: interpolation/approximation of n control points weight given by basis functions abscissa parameter
iq
ib
0q
1q
2q
3q
n
i
i sbs1
)()( iqP
s
12
1) 1D deformable modelOur Choices: Geometry
Important properties of a spline:
Vector of particular parametric values
Continuity: C0, C1(Catmull-Rom), C2(cubic Bspline),…
For most models: locality of order m:Each control point influences at most m spline segments
13
1) 1D deformable modelOur Choices: Geometry
Bezierbasis functions
Uniform cubic Bsplinebasis functions
No locality Locality of order 4
14
1) 1D deformable modelOur Choices: Physics
Lagrange formalism: Set of n virtual DOF
Defines and
Principle of virtual works
Lagrangian
Principle of minimum action
=> minimization of the Lagrangian action
)(tqi
),,( tqqE iic ),,( tqqE iip
0)(
ii q
L
q
L
dt
d
),,(),,(),,( tqqEtqqEtqqL iipiicii
ii
c
i
c Qq
E
q
E
dt
d
)(
15
DOF = coordinates of the control points => equations of motion:
Defining kinetic energy:
1) 1D deformable modelDynamic simulation of a spline
)(tqi
dstststqqE iic 2),(),(2
1),,( P
i
ii
E
q
E
dt
d cc
)(
mts ),(
Parametric density of mass
n
i
i sbttst
ts1
)()(),(),( iqP
P Velocity of a point
dstsm 2),(2
1P
16
Matrix form:
where is the generalized mass matrixand is the DOF acceleration vector
1) 1D deformable modelDynamic simulation of a spline
n
jjji
cc tqdssbsbmq
E
q
E
dt
d
i
ii 1
)()()()(
,z}y,{x,{1..n},
A
Tzyx qqqA
17
Properties of : Axis independence => 3 sub-systems symmetric Band of width 2m-1 (m=locality order) Constant over time
=> LU pre-computation of(constant and band)
1) 1D deformable modelDynamic simulation of a spline
n
jjji
cc tqdssbsbmq
E
q
E
dt
d
i
ii 1
)()()()(
,z}y,{x,{1..n},
dssbsbmM jiij )()(M
M
M
18
1) 1D deformable modelDynamic simulation of a spline
Right part of Lagrange equations: Gravity Ambient viscosity Interactions with other objects, users or itself Deformation energies
=> Gathered in a vector System resolution:
LU band => O(n) Numerical integration
=> getting new velocities and positions
i
Q
B
BA M
19
1) 1D deformable modelDeformation energies
Type: Discrete
Continue
Deformations: Stretching
Bending
20
1) 1D deformable modelDeformation energies
Discrete deformation energies Parametric sampling of the curve
points = extremities of the spline segments
Point sampling on spline segments
21
Discrete deformation energies Stretching springs
Bending springs
1) 1D deformable modelDeformation energies
Continuous distribution of masses (Lagrange)=> not a mass-spring model
Angular springs
22
1) 1D deformable modelDeformation energies
Continuous deformation energies Stretching [Nocent01]
elasticity given by the Young modulus Bending:
Estimated by the second derivative of the position
n
i
i sbttss 1
2
2
)()(),( iqP
Tangent
CurvatureCT
PF bats
sk
),(2
2
Force:
not a pure bending energy
23
1) 1D deformable modelTest framework
Visualization using generalized cylinder, implicit surface,...
Animation software framework: SPORE Approximation using spheres for collision detection
=> decomposition of the spline into spheres: Curvilinear distribution of spheres
=> dynamic algorithm
Extremity of a spline segment
24
1) 1D deformable modelResults (PIV 2.4Ghz, 512 Mb)
Computation time for one simulation time step (1ms), including numerical integration (RK4): Cubic NUBS, 50 points, discrete energies: 7.69ms Cubic UBS, 50 points, discrete energies: 5.73ms
spline having a uniform knot vector get pre-computed parts
25
1) 1D deformable modelResults (PIV 2.4Ghz, 512 Mb)
Computation time for one simulation time step (1ms), including numerical integration (RK4): 4 cubic NUBS, 15 points, discrete energies: 6.9ms 4 cubic NUBS, 15 points, continuous energies: 8.9ms
26
1) 1D deformable modelResults (PIV 2.4Ghz, 512 Mb)
Computation time for one simulation time step (1ms), including numerical integration (RK4): 11 cubic NUBS, 15 points, discrete energies: 7.1ms 4 cubic NUBS, 10 points, continuous energies: 5ms
27
1) 1D deformable modelApplication: Intestine simulation
Rendering: Implicit surface - punctual skeleton [Triquet01]
Simulation: 165 points, 14ms for one time step of 1msSpline with uniformknot vector =>pre-computation
28
1) 1D deformable modelContribution summary
Real-time simulation of 1D dynamic spline Proposition of a continuous bending energy Extension to 2D and 3D objects
29
Outlines
1) 1D deformable model
2) Constraints
3) Multi-resolution
30
2) ConstraintsWhy using constraints ?
Some interactions cannot be handled by collisions: Linked objects (articulated bodies) Strong interactions (suture...)
31
2) ConstraintsPrevious Works
Penalty Methods [Platt Bar88]
Kinematic reduction
Projection [Gascuel92]
Lagrange multipliers
[Baraff96,Cotin99,Remion99]
Post-stabilization methods
[Ascher94,Faure98,Cline02]
32
2) ConstraintsPrevious Works
Penalty Methods [Platt Bar88]
Kinematic reduction
Projection [Gascuel92]
Lagrange multipliers
[Baraff96,Cotin99,Remion99]
Post-stabilization methods
[Ascher94,Faure98,Cline02]
33
2) ConstraintsSimple constraints
What do we call “a simple constraint” ? Interaction without any other object (or considered as
immobile) Absolute constraint in space Examples:
pendulum,rope moving along a stick, ...
34
2) ConstraintsSimple constraints
Dynamic equations extended by:
One Lagrange multiplier λ per constraint equation Extended matrix system
Faster resolution using acceleration decomposition:
0),,(
.)(1
tqqC
Lq
EQ
q
E
q
E
dt
d
j
c
j
jijp
i
c
i
c
i
i
EA
BλA
L
LM T
ct AAA
35
2) ConstraintsSimple constraints
Constraint must be rewritten as a function of the DOF acceleration: Baumgarte scheme:
=> possible violation but no drift
Examples of constraints: Fixed point, point on a plane, point on an axis Fixed tangent Fixed curvature vector ...
0),( tqC
0),(),(),( tqcCtqCbtqCa
36
2) ConstraintsSimple constraints
Results: 30 points, 6 constraints = 2 ms
37
2) ConstraintsSliding constraints
Sliding movement through a hole
38
0),,,( tsqqg
General constraint equation:
2) ConstraintsSliding constraints
A new class of constraints Example on a fixed point constraint:
0),(),,( 0 PtsPtqqg A
Let be mobile, determined by the object dynamic !!As
0)),((),,,( 0 PttsPtsqqg
39
2) ConstraintsSliding constraints
becomes a new unknown, neither a DOF, nor a lagrange multiplier, a free variable
=> requires a new equationLagrange multipliers formalism gives:
s
0.
λs
g T
λ Force ensuring the constraint g T
sg
P(s,t) s(t)
Example on a sliding point constraint:
0)),((),,( PttsPtsqg
40
2) ConstraintsSliding constraints
Acceleration of the resolution:allowing the constraint to work:
=> direct relation to compute=> accelerates the global resolution=> controls the dynamic of (« friction-like »)
0.
λs
gs
T
s
s
theoretical framework => no friction00 accelerates the dynamic => inverse friction0 brakes the dynamic => normal friction
ss
P(s,t) s(t)
λT
sg
41
2) ConstraintsResults
Shoelace: 28 points, discrete energy, 10ms
42
2) ConstraintsResults
Suture
43
2) ConstraintsResults
Slipknot... Sliding point constrained on another point of the curve
44
2) Constraints
Tensor product: extension to 2D and 3D Two types of constraints:
simple constraints sliding constraints
45
2) ConstraintsConstraints among different objects
Link objects of different nature Rigid bodies,
deformable objects... Example: swing
46
Global system equations:
2) ConstraintsConstraints among different objects
How to link several objects involving different physical formalisms ?
Hypothesis:Each object animation can be defined in a matrix form
DOF unknowns:(positions, displacements, velocities, accelerations…)
BA M
1
1
n
1
B
B
A
A
nM
M
0
01
FU K
47
2) ConstraintsConstraints among different objects
Constraint method: Lagrange multipliers
Proposition of a software framework: Interface: ArticulableObject and Constraint Articulation: composition of ArticulableObject and set
of Constraint Optimization of the computation:
Articulation solves the system of equations Updating matrices if required (done by each object)
EA
BλA
L
LM T
48
2) ConstraintsResults
3x10 points, 42 constraints= 3.14 ms
4x8 points + mass spring (25 nodes) + rigid body + 54 constraints
= 10.3 ms
49
2) ConstraintsContribution summary
Practical set of constraints based on Lagrange
multipliers
Extension of the theoretical Lagrange multipliers
to handle sliding constraints
Software framework for the simulation of
articulations
All results easily extensible to 2D and 3D objects
50
Outlines
1) 1D deformable model
2) Constraints
3) Multi-resolution
51
3) Multi-resolution
Problem: Bending properties of the model depend on the
distribution of the control points Increases the number of control points
=> increases the computation and the memory cost
52
3) Multi-resolution
Requirements: Overcoming the curvature limitation on the spline
control (example: knot tightening) concentration of control points in a small parametric area
Keeping acceptable computation times and reasonable memory costs
Proposal: Dynamic control of the spline resolution (geometric
and mechanical)
53
3) Multi-resolutionPrevious Works
Mass-spring [Hutchinson et al.96]
FEM multi-resolution [Debunne et al.00]
Lagrange reduction parameters [Nocent et al.01]
Subdivision [Grinspun et al.02]: function
refinement
FEM with hierarchical function and non regular
grid [Capelle et al.02]
54
Well known results about geometric subdivision of Non Uniform B-splines exact insertion algorithm (Oslo)
3) Multi-resolutionLocal refinement of BSplines
NUBS of degree d
Knot vectors:
i
id
jij bb~
,
sinon
~si
0
1 10,
jjjji
ttt
rji
iri
rjrirji
iri
irjrji tt
tt
tt
tt,1
11
1,
1,
~
~
~
01,
0,
1 )1( idiii
diii qqq
)(sbit it 1it
insertion
)(~
sbit~ it~
1~it 2
~it
The simplification of BSplines is often an approximation
55
3) Multi-resolutionProposition
Extension of the spline subdivision scheme to the mechanical model=> dynamic number of DOF=> local modification (due to locality property)
Local adaptation of the resolution
Adaptation criteria based on curvature
56
3) Multi-resolutionProposition
Deformation energies:
discrete energy related to one resolution=> needs a re-distribution=> inadequate
continuous energy not linked to the resolution but to the shape=> adequate
57
3) Multi-resolutionProposition
Continuous stretching energy: data structure 4D array:
Sparse Symmetric
Proposition: Efficient encoding: compression into a 1D array No redundance, no null values Access with 4 indirection tables => O(1)
ds
sbq
sbsbsbsbB
n
jjj
qpmiimpq
3
1
)()0(
)()()()(
58
3) Multi-resolutionResults
NUBS, 11 points, continuous stretching
Without multi-resolution2.16ms
With automatic insertion12ms
stability with 20 points
With automatic insertionand suppression
11msstability with 18 points
59
3) Multi-resolutionProposition
Interesting side effect: cuttingeach insertion on the same Bspline knot decreases the continuity => C-1 after enough number of insertions => cutting
60
3) Multi-resolutionContribution summary
Automatic adaptation of the resolution
Knot tightening
Cutting
No extension to 2D or 3D:
tensor product not adequate !!
61
Conclusion & Future Works
62
Conclusion & Future WorksContribution summary
Spline-based real-time deformable model: Set of optimization strategies for real-time Continuous bending energy
Constraints based on Lagrange multipliers: Set of practical constraints Sliding constraints Software framework for articulation
Multi-resolution: Dynamic and automatic adaptation of the resolution Dynamic cutting
63
Conclusion & Future Works
Improving the continuous bending energy Developing a continuous twisting energy Exploring other possibilities of the sliding
constraints Accelerating the multi-resolution procedure:
Sherman-Morrisson scheme for inverse matrix Studying other type of geometry in 2D and 3D
like subdivision surfaces
64
Thank you !
70
1) 1D deformable modelWhat about visualization ?
2 slides: Modèle 1D => pas de volume (2 videos pour transition) Epaisseur donnée par la collision (correlation modele
collision – modele visu)
Broken Lines Continuity C0
No depth perception
71
1) 1D deformable modelRendering 4/4
Implicit surfaces Ponctual model with marching cubes Convolution model
72
1) 1D deformable modelDynamic simulation of a spline
Right part of Lagrange equation: Gravity: Ambient viscosity:
Gathered in a vector (except the ambient viscosity)
System resolution:
LU band => O(n) Numerical integration
i
Q
dssbmgQ ii )(
n
jjij qdssbsbCQ
i1
)()(
B
MVm
CQ
jqV j
VBA Mm
CM
with
BVA )(m
CM
76
Goal (video en haut d’où on en tire les buts pt par pt) on le vire
Interactive 1D deformable model evolving in an environement (=> collision with other objects)
Links between different objects ( collision) Enough flexibility to tight a knot difficile à faire !!
Citer les source (ou le noter) Citer que c ’est du réel !!
77
2) ConstraintsSmooth constraints
Coulomb friction on a sliding point constraint: adherence vs sliding
fixed point vs sliding point Two states: adherence-sliding
If adherence try simulation with a fixed point constraint
if force needed to ensure the constraint to high transform the fixed point into a sliding point
and re-itere the resolution with introducing a friction forcec
78
!! « Adequate » à la place de « adapte » !! « Involving » remplacer par « based on »
ou « using »