0% found this document useful (0 votes)
113 views15 pages

Sig23 Shortest Path

Uploaded by

Sachin G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views15 pages

Sig23 Shortest Path

Uploaded by

Sachin G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Shortest Path to Boundary for Self-Intersecting Meshes

HE CHEN, University of Utah, USA


ELIE DIAZ, University of Utah, USA
CEM YUKSEL, University of Utah & Roblox, USA

Fig. 1. Example simulation results involving complex self-collision scenarios, generated using our method with XPBD [Macklin et al. 2016].
We introduce a method for efficiently computing the exact shortest path 1 INTRODUCTION
to the boundary of a mesh from a given internal point in the presence Self-intersecting meshes, though they are often highly undesirable,
of self-intersections. We provide a formal definition of shortest boundary
are commonplace in computer graphics. They can appear due to
paths for self-intersecting objects and present a robust algorithm for com-
puting the actual shortest boundary path. The resulting method offers an
the limitations of modeling techniques, animation methods, or man-
effective solution for collision and self-collision handling while simulating ual editing operations. Even physics-based simulations with self-
deformable volumetric objects, using fast simulation techniques that pro- collision handling are not immune to self-intersections, as most of
vide no guarantees on collision resolution. Our evaluation includes complex them cannot guarantee an intersection-free state.
self-collision scenarios with a large number of active contacts, showing that Notwithstanding the amount of work on self-intersection han-
our method can successfully handle them by introducing a relatively minor dling within physics-based simulations, it still remains a challenge
computational overhead. in most cases. Continuous collision detection techniques [Li et al.
2020] require starting with and maintaining an intersection-free
CCS Concepts: • Computing methodologies → Collision detection;
Physical simulation.
state; therefore, they must be used with computationally-expensive
methods that can always resolve all self-intersections and they fail
Additional Key Words and Phrases: Collision response, Computational ge- when combined with cheaper techniques that are unable to do so.
ometry, geodesics, shortest path Methods that split an object into pieces [Macklin et al. 2020] turn
the self-intersection problem into intersections of these separate
ACM Reference Format:
pieces, entirely avoiding the self-intersection problem, and they
He Chen, Elie Diaz, and Cem Yuksel. 2023. Shortest Path to Boundary for
Self-Intersecting Meshes. ACM Trans. Graph. 42, 4 (August 2023), 15 pages. fail to resolve self-intersections within a piece. Methods that solve
https://doi.org/10.1145/3592136 self-intersections using an intersection-free pose [McAdams et al.
2011] not only require such a pose, but also become inaccurate as
the objects deform and fail with sufficiently large deformations and
Authors’ addresses: He Chen, ankachan92@gmail.com, University of Utah, Salt Lake
City, UT, USA; Elie Diaz, elie.diaz@utah.edu, University of Utah, Salt Lake City, UT,
deep penetrations. Therefore, none of these methods provides a
USA; Cem Yuksel, cem@cemyuksel.com, University of Utah & Roblox, Salt Lake City, robust and general solution for self-intersections.
UT, USA. In this paper, we present a method that robustly and efficiently
finds the exact shortest internal path of a point inside a mesh to its
Permission to make digital or hard copies of all or part of this work for personal or boundary, even in the presence of self-intersections and some in-
classroom use is granted without fee provided that copies are not made or distributed verted elements. We achieve this by introducing a precise definition
for profit or commercial advantage and that copies bear this notice and the full citation of the shortest path to the mesh boundary, including points that
on the first page. Copyrights for components of this work owned by others than the
author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or are both on the boundary and inside the mesh at the same time, an
republish, to post on servers or to redistribute to lists, requires prior specific permission unavoidable condition with self-intersections. Our approach works
and/or a fee. Request permissions from permissions@acm.org.
with tetrahedral meshes in 3D (with boundaries forming triangular
© 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM.
0730-0301/2023/8-ART $15.00 meshes) and triangular meshes in 2D (with polyline boundaries).
https://doi.org/10.1145/3592136

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
2 • He Chen, Elie Diaz, and Cem Yuksel

We demonstrate that one important application of our method is In contrast, DCD allows the simulation framework to start and
solving arbitrary self-intersections after they appear in deformable recover from a state with existing intersections. DCD detects colli-
simulations, allowing the use of cheaper integration techniques that sions at a single point in time, after they happen. That is why, extra
do not guarantee complete collision resolution. computation is needed to determine how to resolve the collisions.
Our method is based on the realizations that (1) the shortest path Collisions can be resolved by minimizing the penetration vol-
must be fully contained within the geodesic embedding of the mesh ume [Allard et al. 2010; Wang et al. 2012] or by applying constraints
and (2) it must be a line segment under Euclidean metrics. Based [Bouaziz et al. 2014; Macklin et al. 2016; Müller et al. 2007; Verschoor
on these, given a candidate boundary point, our method quickly and Jalba 2019], penalty forces [Belytschko and Neal 1991; Ding
checks if the line segment to this point is contained within the mesh. and Schroeder 2019; Drumwright 2007; Huněk 1993], or impulses
Combined with a spatial acceleration structure, we can efficiently [Kavan 2003; Mirtich and Canny 1995; O’Sullivan and Dingliana
find and test the candidate closest boundary points until the shortest 1999] that involve computing the penetration depth, the minimum
path is determined. We also describe a fast and robust tetrahedral translational distance to resolve the penetration [Hirota et al. 2000;
traversal algorithm that avoids infinite loops, needed for checking Platt and Barr 1988; Terzopoulos et al. 1987]. The exact penetration
if a path is within the mesh. Furthermore, we propose an additional depth can be computed using analytical methods based on geomet-
acceleration that can quickly eliminate candidate boundary points ric information of polygonal meshes [Baraff 1994; Cameron 1997;
based on local geometry without the need for checking their paths. Hahn 1988; Moore and Wilhelms 1988], or it can be approximated
One application of our method is resolving intersections between using a volumetric mesh [Fisher and Lin 2001a], mesh partitioning
separate objects and self-intersections alike within a fast physics- [Redon and Lin 2006], tracing rays [Hermann et al. 2008], or solving
based simulation system that cannot guarantee intersection-free an optimization problem [Je et al. 2012]. Heidelberger et al. [2004]
states. It can be used alone or as a backup for continuous collision proposed a consistent penetration depth by propagating penetration
detection to handle cases when the simulation system fails to re- depth through the volumetric mesh. These methods, however, strug-
solve a previously-detected collision. In either case, we achieve a gle with handling self-intersections. Starting with a self-intersecting
robust collision handling method that can solve extremely chal- shape, Li and Barbič [2018] proposed a method to separate the over-
lenging cases, involving numerous deep self-intersections, using a lapping parts and create a bounding case mesh that represents the
fast simulation system that does not provide any guarantees about underlying geometry to allow "un-glued" simulation.
collision resolution. As a result, we can simulate highly complex Using a signed distance fields (SDF) is a more popular alternative
scenarios with a large number of self-collisions and rest-in-contact for recent methods. They can be defined either on a volumetric mesh
conditions, as shown in Figure 1. [Fisher and Lin 2001a] or a regular grid [Gascuel 1993; Koschier et al.
2017; Macklin et al. 2020]. Once built, both the penetration depth
and the shortest path to the surface can be directly queried from
2 RELATED WORK the volumetric data structure. This provides an efficient solution
One important application of our method is collision handling (Sec- at run time as long as the SDF does not need updating, though the
tion 2.1), though we actually introduce a method for certain types returned penetration depth and shortest path are approximations
of geodesic distances and paths (Section 2.2). A core part of our (formed by interpolating pre-computed values). Also, the SDF is
method is tetrahedral ray traversal (Section 2.3). In this section, not well defined when there are self-intersections, as they cannot
we overview the prior in these areas and briefly present how our represent immersion, so it must be built using an intersection-free
approach compares to them. pose.
For handling self-intersections, SDFs of an intersection-free pose
can be used [McAdams et al. 2011]. This can provide sufficient
2.1 Collision Handling accuracy for handling minor deformations, but quickly becomes
Collision handling is directly related to how they are detected, which inaccurate with large deformations and deep penetrations. Using
can be done using either continuous collision detection (CCD) or a deformable embedding helps [Macklin et al. 2020], but requires
discrete collision detection (DCD). splitting the object into pieces [Fisher and Lin 2001a,b; Macklin
Starting with an intersection-free state, CCD can detect the first et al. 2020; McAdams et al. 2011; Teng et al. 2014]. An alternative
time of contact between elements [Canny 1986], but requires main- approach is bifurcating the SDF nodes during construction when
taining an intersection-free state. Through the use of a strong barrier a volumetric overlap, which can be formed by self-intersection, is
function, incremental potential contact (IPC) [Li et al. 2020] provides detected [Mitchell et al. 2015]. These solutions entirely circumvent
guaranteed collision resolution combined with a CCD-aware line the self-intersection problem by only considering intersections of
search. This idea was later extended to rigid [Ferguson et al. 2021] separate pieces and self-intersections within a piece are ignored.
and almost rigid bodies [Lan et al. 2022a]. Incorporating projec- Such approaches are particularly problematic with complex models
tive dynamics into IPC offers performance improvement [Lan et al. and in cases when determining where to split is unclear ahead of
2022b], but resolving all collisions still remains expensive. Even time, since the splitting or bifurcation is usually pre-computed and
when the simulation system is able to resolve all collisions, CCD expensive to update at run time. Also, the closest boundary point
itself can fail due to numerical issues, in which case, it can no longer found within a piece is not necessarily the actual one for the entire
help with resolving the collision, resulting in objects linking to- mesh, as it might be contained in a separate piece. Even for cases
gether [Wang et al. 2021].

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 3

they can handle with sufficient accuracy, SDFs have a significant


pre-computation and storage cost.
𝜕𝜕𝑀𝑀 Ψ(𝜕𝜕𝑀𝑀)
In comparison, our solution can find the exact penetration depth
for models with arbitrary complexity and the accurate shortest
path to the boundary regardless of the type or severity of self- 𝒔𝒔 ψ
intersections. In addition, we do not require costly pre-computations
𝒔𝒔
or volumetric storage.
𝒔𝒔/𝒑𝒑
∘ 𝒑𝒑
2.2 Geodesic Path and Distances 𝑀𝑀 𝑀𝑀∘
Following the categorization of Crane et al. [2020], our method 𝑀𝑀 𝑀𝑀
falls into the category of multiple source geodesic distance/shortest (a) (b)
path (MSGD/MSSP) problems. Actually, the problem we solve is a
special case of MSSP, where the set of sources is the collection of all Fig. 2. Illustrations of the notations. (a) Notations on the undeformed
the boundary points of the mesh. Also, ours is an exact polygonal pose. (b) Notations on the deformed model. The image of the unde-
method that can compute global geodesic paths. MMP algorithm formed pose boundary Ψ(𝜕𝑀) is marked as the red curve.
[Mitchell et al. 1987] is the first practical algorithm that can com-
pute geodesic path between any two points on a polygonal surface.
Succeeding methods [Chen and Han 1990; Liu 2013; Surazhsky et al.
2005; Xin and Wang 2009] focus on optimizing its computation time other object. In the case of self-intersections, however, even the
and memory requirements. Yet, all of these method only aim at definition of the shortest path to boundary is somewhat ambiguous.
solving the single source geodesic distance/shortest path (SSGD/SSSP) Consider a point on the boundary and also inside the object due to
problems. For solving the all-pairs geodesic distances/shortest paths self-intersections. Since this point is already on the boundary, its Eu-
(APGD/APSP) problem, a vertex graph that encodes the minimal clidean closest boundary point would be itself. Yet, this information
geodesic distances between all pairs of vertices on the mesh can is not helpful for resolving the self-intersection.
be built [Balasubramanian et al. 2008]. These methods are general In this section, we provide a formal definition of the shortest path
enough for handling 2D manifolds in 3D, but they do not offer an to boundary based on the geodesic path of the object in the pres-
efficient solution for our MSSP problem. Our solution for MSSP, ence of self-intersections (Section 3.1). Then, we present an efficient
however, is limited to planar (2D, triangular) or volumetric (3D, algorithm to compute it for triangular/tetrahedral meshes in 2D/3D,
tetrahedral) meshes, where we can rely on Euclidean metrics. respectively, (Section 3.2). We also describe how to handle meshes
that contain some inverted elements, (Section 3.5). The resulting
2.3 Tetrahedral Ray Traversal method provides a robust solution for handling self-collisions that
can be used with various simulation methods and collision resolu-
For handling tetrahedral meshes in 3D, our method uses a topologi-
tion techniques (using forces or constraints).
cal ray traversal. Tetrahedral ray traversal has been used in volu-
metric rendering [Marmitt and Slusallek 2006; Parker et al. 2005;
Şahıstan et al. 2021]. Methods that improve their computational 3.1 Shortest Path to Boundary
cost include using scalar triple products [Lagae and Dutré 2008] and Consider a self-intersecting model 𝑀, such that a boundary point s
Plucker coordinates [Maria et al. 2017]. More recently, Aman et al. coincides with an internal point p. Figure 2b shows a 2D illustration,
[2022] introduced a highly-efficient dimension reduction approach. though the concepts we describe here apply to 3D (and higher
A common problem with tetrahedral ray traversal is that numeri- dimensions) as well. In this case, s and p have the same geometric
cal inaccuracies can lead to infinite loops when a ray passes near positions, but topologically they are different points. In fact, to fix
an edge or vertex. Many rendering problems can safely terminate the self-intersection, we need to apply a force/constraint that would
when an infinite loop is detected. In our case, however, we must move s along p’s geodesic shortest path to boundary.
detect and resolve such cases, because failing to do so would result To provide a formal definition of this geodesic shortest path, we
in returning an incorrect shortest path, which can have catastrophic consider a self-intersection-free form of this model as 𝑀 which we
effects in simulation. Therefore, we introduce a robust variant of call undeformed pose, and a deformation Ψ that maps all points in 𝑀
tetrahedral ray traversal. to its current shape 𝑀, such that 𝑀 = Ψ(𝑀). Note that our algorithm
(explained in Section 3.2) does not actually need computing 𝑀 or
3 SHORTEST PATH TO BOUNDARY Ψ. For any point p in 𝑀, we represent its image under Ψ as p ∈ 𝑀,
A typical solution for resolving intersections (detected via DCD) such that p = Ψ(p). In the following, we assume that 𝑀 is a path-
is finding the closest boundary point for each intersecting point connected (i.e. a single piece) manifold, though the concepts below
and then applying corresponding forces/constraints along the line can be trivially extended to models with multiple separate pieces.
segment toward this point, i.e. the shortest path to boundary. The To cause self-intersection, Ψ should not be injective. In this case,
length of this path is the penetration depth. Ψ is an immersion of 𝑀 but not embedding, meaning multiple points
When two separate objects intersect, finding the closest boundary from 𝑀 are mapped to the same position p inside 𝑀. To differentiate
point is a trivial problem: it is the closest boundary point on the such points that coincide in 𝑀, we label them using their unique

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
4 • He Chen, Elie Diaz, and Cem Yuksel

𝒑𝒑𝟏𝟏
𝒔𝒔 ψ 𝒃𝒃
𝒔𝒔𝒔
𝒔𝒔 𝒔𝒔 𝒃𝒃 𝒔𝒔𝒔
𝒑𝒑 =𝒑𝒑1 /𝒑𝒑2 𝒑𝒑 𝒑𝒑
𝒑𝒑𝟐𝟐 𝒂𝒂
𝒂𝒂

𝑀𝑀 𝑀𝑀 𝑀𝑀 𝑀𝑀
(a) (b) (c) (d) (e)

Fig. 3. (a) An intersection-free pose of the deformable model 𝑀. p1, p2 ∈ 𝑀 . (b) 𝑀’s image under Ψ, where p1, p2 are mapped to the same point
p. (c) Treated as different pre-image, p has different shortest paths to the boundary (blue line). (d) Two paths are contained by 𝑀. (c) Only ps ′ is a
valid path.

positions in 𝑀. For simplicity, we say p as p, when we are referring • First, by definition, the shortest path must be a continuous
p as the image of p. curve that is fully contained inside undeformed model 𝑀.
For simplicity, let us consider non-degenerate Ψ that forms no • Second, the shortest path (under the Euclidean distance met-
inversion, i.e. det(∇Ψ) > 0. We discuss inversions later in Section 3.5. rics) that connects two points in the deformed model 𝑀 must
Note that under this Ψ, the boundary of the undeformed model 𝜕𝑀 be a line segment.
does not completely overlap with the boundary of the deformed
◦ Based on these properties, we can construct and prove the funda-
model 𝜕𝑀, i.e. Ψ(𝜕𝑀) ≠ 𝜕𝑀, see Figure 2b. We use 𝑀 to denote
◦ mental theorem of our algorithm:
the set of interior points of 𝑀, such that 𝑀 = 𝜕𝑀 ∪ 𝑀 .
Let s as be a point on the boundary, i.e. s ∈ Ψ(𝜕𝑀) and we refer Theorem 1. For any point p ∈ 𝑀 (as (p), its shortest path to the
to it as an undeformed pose boundary point s. For a given point p boundary is the shortest line segment from p to a boundary point
(as p), we can construct a path c(𝑡) : [0, 1] ↦→ 𝑀 as a continuous s ∈ Ψ(𝜕𝑀) (as s), that is a valid path.
curve that connects p = c(0) to s = c(1).
Definition 1 (Valid path). The path c(𝑡) from p (as p) to s (as Here we verbally prove the theorem, we also provide a formal
s) is a valid path if there exists a continuous curve c(𝑡) : [0, 1] ↦→ 𝑀 proof in the supplementary document. If the shortest path is not a
such that c(𝑡) = Ψ(c(𝑡)), c(0) = p, c(1) = s. line segment, we can continuously deform it into a line segment,
while keeping the end points fixed. This procedure can induce a
Based on this definition, a valid path must be the image of a path
deformation on the undeformed pose, which continuously deforms
that is fully contained within 𝑀, which connects the two points
the pre-image of that curve to the pre-image of the line segment,
on the undeformed pose we are referring to. Any path that moves
while keeping the end points fixed. This is always achievable because
outside of 𝑀 is considered an invalid path, see Figure 3de. Our goal
the curve cannot touch the boundary of the undeformed pose during
is to find the shortest valid path from a given point p (as p) to the
the deformation, otherwise, we will form an even shorter path to
boundary.
the boundary. Thus the line segment is also a valid path.
Definition 2 (Shortest path to boundary). For an interior Based on these properties, our algorithm investigates a set of
point p (as p), the shortest path to boundary is the shortest curve c(𝑡) candidate boundary points s and checks if the line segment from
in 𝑀 that connects p to a boundary point s (as s) that is a valid path the interior point p to s is a valid path. This is accomplished without
between p and s. having to construct 𝑀 or determine the deformation Ψ by relying
Definition 3 (Closest boundary point). For an interior point on the topological connections of the given discretized model.
p (as p), the closest boundary point is the boundary point s (as s) at
the other end of p’s shortest path to boundary c(𝑡) = Ψ(c(𝑡)), such 3.2 Shortest Path to Boundary for Meshes
that s = c(1) and s = c(1). In practice, models we are interested in are discretized in a piece-
Here we must emphasize that the definition of the shortest path wise linear form. These are triangular meshes in 2D and tetrahedral
is dependent on the pre-image point we are referring to. For a point meshes in 3D. We refer to each piecewise linear component as an
located at the overlapping part of 𝑀, referring to it as a different element (i.e. a triangle in 2D and a tetrahedron in 3D) and the one-
point on the undeformed pose may lead to a different shortest path dimension-lower-simplex shared by two topologically-connected
to the boundary (see Figure 3c). Also, this definition is equivalent to elements as a face (i.e. an edge between two triangles in 2D and a
the image of p’s global geodesic path to boundary in 𝑀 evaluated triangular face between two tetrahedra in 3D). This discretization
under the metrics pulled back by Ψ. Thus the shortest path we makes it easy to test the validity of a given path, without construct-
defined is a special class of geodesics. ing a self-intersection-free 𝑀 or the related deformation Ψ.
To construct an efficient algorithm for finding the shortest path, We propose the concept of element traversal for meshes, as a
we rely on two properties: sequence of topologically connected elements:

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 5

Definition 4 (Element traversal). For a mesh 𝑀, and two-


𝒔𝒔
point a ∈ 𝑒 a, b ∈ 𝑒 b , we define a element traversal from a to b as a list
of elements T (a, b) = (𝑒 0, 𝑒 1, 𝑒 2, . . . , 𝑒𝑘 ), where 𝑒𝑖 is a element of 𝑀,
𝑒 0 = 𝑒 a , 𝑒𝑘 = 𝑒 b , and 𝑒𝑖 ∩ 𝑒𝑖+1 must be a face. 𝒓𝒓𝟎𝟎 𝒔𝒔
𝒓𝒓𝟏𝟏
Specifically, we call it tetrahedral traversal for 3D meshes, and 𝒑𝒑
triangular traversal for 2D meshes.
Let c(𝑡) be a line segment from a point p inside an element 𝑒 p to 𝒑𝒑
a boundary point s of a boundary element 𝑒 s (with a boundary face
that contains s). If c(𝑡) is a valid path, there must be a corresponding (a) (b)
piecewise linear path c(𝑡) in 𝑀 from p to s that passes through an
element traversal of 𝑀. Actually, an element traversal containing Fig. 4. (a) An example of a triangular traversal, marked by red trian-
c(𝑡) is the sufficient and necessary condition for c(𝑡) being a valid gles. A line segment connecting p and s is included in this triangular
path. Please see the supplementary material for a rigorous proof. traversal. (b) An example of a line segment being an invalid path when
Thus, evaluating whether c(𝑡) is a valid path, is equivalent to there are self-intersections, the triangular traversal (marked by the
searching for an element traversal from s to p, and a piece-wise linear red triangles) stops at the boundary of the mesh but the line segment
curve c(𝑡) : 𝐼 ↦→ 𝑀 defined on it, such that c(𝑡) = Ψ(c(𝑡)). Such penetrates the boundary and continues going.
an element traversal and piece-wise linear curve can be efficiently
constructed in 𝑀.
Going through the element traversal, c(𝑡) must pass through
3.3 Robust Topological Ray Traversal
faces shared by neighoring elements at points r𝑖 ∈ 𝑒𝑖 ∩ 𝑒𝑖+1 , where
𝑖 = 0, 1, 2, . . . , 𝑘 − 1. When Ψ forms no inversion, corresponding The process we describe above for testing the validity of the linear
face points r𝑖 must be along the line segment c(𝑡), i.e. r𝑖 = c(𝑡𝑖 ) path to a candidate boundary point involves traversing a ray through
for some 𝑡𝑖 ∈ [0, 1], see Figure 4a. If we can form such an element the mesh. This ray traversal is significantly simpler than typical ray
traversal using the topological connections of the model, we can traversal algorithms used for rendering with ray tracing. This is
safely conclude that the path is valid. because it directly follows the topological connections of the mesh.
This gives us an efficient mechanism for testing the validity of At each step, the ray enters an element through one of its faces
the shortest path from p to s. Starting from 𝑒 p , we trace a ray from p and must exit from one of its other faces. Therefore, we do not need
towards s and find the first face point r0 . If r0 is not on the boundary, to rely on an acceleration structure to quickly determine which
this face must connect 𝑒 p to a neighboring element 𝑒 1 . Then, we faces to test ray intersections, as they are directly known from the
enter 𝑒 1 from r0 and trace the same ray to find the exit point r1 on mesh topology. In fact, we do not need to check each one of the
another face. We continue traversing until we reach 𝑒 s , in which other faces individually, since the ray exits from exactly one of them.
case we can conclude that this is a valid path, see Figure 4a. This Therefore, we can quickly test all possible exit faces together.
also includes the case 𝑒 p = 𝑒 s . If we reach a face point r𝑖 that is on For example, Aman et al. [2022] present such a tetrahedral traver-
the boundary (see Figure 4b) or we pass-through s without entering sal algorithm in 3D. Yet, due to limited numerical precision, this algo-
𝑒 s , s cannot be the closest boundary point to p. rithm is prone to forming infinite loops. Such infinite loops are easy
This process allows us to efficiently test the validity of a path to to detect and terminate (e.g. using a maximum iteration count), but
a given boundary point, but we have infinitely many points on the such premature terminations are entirely unacceptable in our case.
boundary to test. Fortunately, we are only interested in the shortest This is because incorrectly deciding on the validity of a path would
path and we can use the theorem below to test only a single point force our algorithm to pick an incorrect shortest path to boundary,
per boundary face. which can be arbitrarily far from the correct one. Therefore, the
simulation system that relies on this shortest path to boundary can
Theorem 2. For each interior point p (as p), if its closest boundary place strong and arbitrarily incorrect forces/constrains in an attempt
point s (as s) is on the boundary face 𝑓 , s must also be the Euclidean to resolve the self-intersection.
closest point to p on 𝑓 . Our solution for properly resolving such cases that arise from
limited numerical precision is three fold:
The proof is similar to Theorem 1, which is included in the sup-
plementary document. Based on Theorem 2, we only need to check (1) We allow ray intersections with more than one face by effec-
a single point (the Euclidean closest point) on each boundary face tively extending the faces using a small tolerance parameter
to find the closest boundary point. If we test these boundary points 𝜖𝑖 in the intersection test. This forms branching paths when
in the order of increasing distance from the interior point p, as soon a ray passes between multiple faces and, therefore, intersects
as we find a valid path to one of them, we can terminate the search (within 𝜖𝑖 ) with more than one of them.
by returning it as the closest boundary point. In practice, we use a (2) We keep a list of traversed elements and terminate a branch
BVH (bounding volume hierarchy) to test these points, which al- when the ray enters an element that was previously entered.
lows testing them approximately (though not strictly) in the order of (3) We keep a stack containing all the candidate intersecting
increasing distance and, once a valid path is found, quickly skipping faces from the intersection test. After a loop is detected, we
the further away bounding boxes. pick the latest element from it and continue the process.

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
6 • He Chen, Elie Diaz, and Cem Yuksel

elements. Unfortunately, though inverted elements are often highly


undesirable, they are not always unavoidable. Fortunately, the al-
gorithm we describe above can be slightly modified to work in the
presence of certain types of inverted elements.
If the inverted elements are not a part of the mesh boundary, we
𝒔𝒔′ 𝑀𝑀1
can still test the validity of paths by allowing the ray traversal to
go backward along the ray. This is because the ray would need to
𝒑𝒑1
traverse backward within inverted elements. In addition, we cannot
𝒔𝒔 simply terminate the traversal once the ray passes through the
𝑀𝑀2 target point, because an inverted element further down the path
may cause backward traversal to reach (or pass through) the target
point, see Figure 6b. Therefore, ray traversal must continue until
Fig. 5. An object 𝑀2 intersects with a self-intersecting object 𝑀1 . A a boundary point is reached. We also need to allow the ray to go
surface point of 𝑀2 is overlapping with an interior point p1 ∈ 𝑀1 . s behind the starting point, see Figure 6c.
and s ′ are p1 ’s closest boundary point by our definition and Euclidean A consequence of this simple modification to our algorithm is
closest boundary point, respectively. that, when we begin from an internal point p toward a boundary
point s, it is unclear if we would reach s by beginning the traversal
toward s or in the opposite direction. While one may be more likely,
Please see our supplementary material for the pseudo-code and
both are theoretically possible.
more detailed explanations of our algorithm.
To avoid this decision, in our implementation we start the tra-
In practice such branching happens rarely, but solution ensures
versal from the target boundary point s. In this case, there is no
that we never incorrectly terminate the ray traversal. Note that 𝜖𝑖
ambiguity, since there is only one direction we can traverse along
is a conservative parameter for extending the ray traversal through
the ray. This also allows using the same traversal routine for the first
branching to prevent problems of numerical accuracy issues. It does
element and the other elements along the path by always entering
not introduce any error to the final shortest paths we find. Using
an element from a face. Therefore, it is advisable even in the absence
an unnecessarily large 𝜖𝑖 would only have negative, though mostly
of inverted elements.
imperceptible, performance consequences. We verified this by mak-
Nonetheless, our algorithm is not able to handle all possible in-
ing the 𝜖𝑖 ten times larger, which did not result in a measurable
verted elements. For example, if the inverted element is on the
performance difference.
boundary, as shown in Figure 7, the inversion itself can cause self-
One corner case is when the internal point p (as p) and the bound-
intersection. In such a case, a surface point s is overlapping with
ary point s (as s) coincide, such that p = s (within numerical pre-
an interior point p (as p). Our algorithm will not be able to try to
cision). This forms a line segment with zero length and, therefore,
construct a tetrahedral traversal between those two points because
does not provide a direction for us to traversal. This happens when
we cannot determine a ray direction for a zero-length line segment.
testing self-intersections of boundary points, which pick themselves
Actually, in this case, the very definition of the closest boundary
as their first candidate for the closest boundary point. This zero-
point can be ambiguous.
length line segment cannot be a valid path. Fortunately, since we
Our solution is to skip the self-intersection detection of inverted
know we are testing self-intersection for s, when the BVH query
boundary elements. As a result, the only way for us to solve such
returns the boundary face includes s, we can directly reject it.
self-intersections caused by inverted boundary elements is to resolve
3.4 Intersections of Different Objects the inversion itself. Fortunately, inverted elements are undesirable
for most simulation scenarios, and they are often easier to fix for
Although our method is mainly designed for solving self- boundary elements. Unfortunately, if the inverted boundary ele-
intersections, it is still needed for handling intersections of different ments have global self-intersections with other parts of the mesh,
objects when they may have self-intersections as well. As shown in our solution ignores them. Though this does not form a complete
Figure 5, an object 𝑀2 intersects with a self-intersecting object 𝑀1 , solution, because the inverted boundary elements are rare, the other
where a surface point of 𝑀2 is overlapping with an interior point boundary elements surrounding the inverted elements are often
p1 ∈ 𝑀1 . Simply querying for p1 ’s Euclidean closest boundary point enough to solve the global self-intersection.
in 𝑀1 will give us s ′ , which does not help resolve the penetration.

This is because p1 s ′ is not a valid path between p1 (as p1 ∈ 𝑀 1 ) and
s1′ as (s ′ ∈ 𝜕𝑀 1 ). What is actually needed is p1 ’s shortest path to 3.6 Infeasible Region Culling
boundary as p1 , which is the same problem as the self-intersection In a lot of cases, it is possible to determine that a given candidate
case, a surface point of 𝑀1 is overlapping with an interior point boundary point s cannot be the closest boundary point to an interior
p1 ∈ 𝑀1 . point p, purely based on the local information about the mesh around
s, without performing any ray traversal. For this test we construct
3.5 Inverted Elements a particular region of space, i.e. the feasible region, around s. When
Our derivations in Section 3.1 assume that 𝑑𝑒𝑡 (∇Ψ) > 0 everywhere. p is outside of this region of s, thus in its infeasible region, we can
For a discrete mesh, this would mean no inverted or degenerate safely conclude that s is not the closest boundary point.

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 7

𝑡𝑡1 𝑡𝑡1 𝑡𝑡1

𝒑𝒑 𝒑𝒑 𝒔𝒔
𝒔𝒔 𝒔𝒔
𝑡𝑡0 𝑡𝑡2
𝑡𝑡2 𝑡𝑡0
𝑡𝑡2
𝑡𝑡0

𝜕𝜕𝑀𝑀 ψ(𝜕𝜕𝑀𝑀)
(a) (b) (c)
Fig. 6. (a) A part of the undeformed pose of a triangular mesh 𝑀, which is inversion free. p ∈ 𝑀, s ∈ 𝜕𝑀. A surface edge is marked with red color.
(b) The image of 𝑀 under Ψ, the tetrahedron 𝑡 2 (colored with gray), is inverted by Ψ. The green line illustrates p’s global geodesics to the surface, it
has a self-overlapping part, which is marked by the two-sided arrow. (c) An interior tetrahedron is inverted and got out of the surface. In this case,
the global geodesics to the surface path can go backward.

v1 s v2
(a) (b) (c)
𝒔𝒔/p Fig. 8. The feasible region, shaded in blue, for (a) a boundary vertex
𝒔𝒔� in 2D, (b) a boundary vertex in 3D, and (c) a boundary edge in 3D.
Note that the 3D meshes in (b) and (c) are observed from the inside.

𝜕𝜕𝑀𝑀 ψ(𝜕𝜕𝑀𝑀)
Edge Feasible Region. In 3D, when s is on the edge of a triangle,
(a) (b) its feasible region is the intersection of 4 half-spaces defined by four
Fig. 7. (a) A part of the undeformed pose of a triangular mesh 𝑀, planes: two planes that contain the edge and perpendicular to its
which is inversion free. The surface edges are marked with red color. two adjacent faces, and two others that are perpendicular to the
(b) After deformation, a triangle (marked by gray color), is inverted edge and pass through its two vertices, as shown in Figure 8c. Let
and folded into the interior of the mesh. A deformed surfaces point s v0 and v1 be the two vertices of the edge and n0 and n1 be the two
overlaps with the interior point p. neighboring face normals (pointing to the interior of the mesh). p is
in the infeasible region if any of the following is true:
(p − v0 ) · (v1 − v0 ) < 0 (2)
The construction of this feasible region depends on whether s is (p − v1 ) · (v0 − v1 ) < 0 (3)
on a vertex, edge, or face.
(p − s) · (n0 × (v1 − v0 )) < 0 (4)
Vertex Feasible Region. In 2D, when s is on a vertex, the feasible (p − s) · (n1 × (v0 − v1 )) < 0 (5)
region is bounded by the two lines passing through the vertex and
perpendicular to its two boundary edges, as shown in Figure 8a. note that n0 is from the face whose orientation accords to v0 → v1 .
For a neighboring boundary edge of s and its perpendicular line Face Feasible Region. We can similarly construct the feasible re-
that passes through s, if p is on the same side of the line as the gion when s in on the interior of a face as well. Nonetheless, this
edge, based on Theorem 2, there must be a closer boundary point particular feasible region test is unnecessary, because when s is the
on the face. More specifically, for any neighboring boundary vertex closest point on the face to p, which is how we pick our candidate
v𝑖 connected to s by a edge, if the following inequality is true, p is boundary points (based on Theorem 2), p is guaranteed to be in the
in the infeasible region: feasible region.
(p − s) · (s − v𝑖 ) < 0 (1) Our infeasible region culling technique performs the tests above
and skips the ray traversal if p is determined to be in the infeasible
The same inequality holds in 3D for all neighboring boundary ver- region, quickly determining that s cannot be the closest boundary
tices v𝑖 connected to s by an edge (Figure 8b). The 3D version of the point. Due to numerical precision, the feasible region check can
vertex feasible region is actually the space bounded by a group of return false results when p is close to the boundary of the feasible
planes perpendicular to its neighboring edges. region. There are two types of errors: false positives and false neg-

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
8 • He Chen, Elie Diaz, and Cem Yuksel

Fig. 10. Dropping 6 octopi into a box simulated using implicit Euler.
This simulation contains 30K vertices and 88K tetrahedra and it takes
an average of 15s to simulate each frame. Please see the supplementary
material for the details of our implicit Euler framework.

center point. If an edge intersects with multiple tetrahedra, we


choose the intersection center that is closest to the center of the
edge. The idea is by keep pushing the center of the edge-tetrahedron
intersection towards the surface, which eventually resolves the
intersection.
This provides an effective collision handling method with XPBD
[Macklin et al. 2016]. Once we find the penetrating point x we use
the standard PBD collision constraint [Müller et al. 2007]
𝑐 (x, s) = (x − s) · n (6)
where s is the closest surface point computed by our method when
this collision is from DCD, or the colliding point when it is from
(a) CCD only (b) DCD only (c) CCD and DCD CCD, and n is the surface normal at s. If s is on a surface edge or
Fig. 9. Dropping 8 octopi to a box simulated with (a) CCD only, vertex, we use the area-weighted average of its neighboring face
(b) DCD with our shortest path query only, and (c) CCD and DCD normals. The XPBD integrator applies projections on each collision
with our shortest path query. The bottom row shows the bottom view constraint 𝑐 to satisfy 𝑐 (x, s) ≥ 0. We also apply friction, following
of the final state. The blue tint highlights the intersecting geometry. Bender et al. [2015]. Please see the supplementary material for the
The octopus model is from Zhou and Jacobson [2016]. pseudocode of our XPBD framework.
Unlike CCD alone, DCD with our method significantly improves
the robustness of collision handling when using a simulation system
atives. A false positive is not a big problem: it will only result in like XPBD that does not guarantee resolving all collision constraints.
an extra traversal. But if a false negative happens, there is a risk of This is demonstrated in Figure 9, comparing different collision de-
discarding the actual closest surface point. In practice, however, we tection approaches with XPBD. Using only CCD leads to missed
replace the zeros on the right-hand-sides of the inequalities above collisions when XPBD fails to resolve the collisions detected in pre-
with a small negative number 𝜖𝑟 to avoid false-positives due to vious steps, because CCD can no longer detect them. This quickly
numerical precision limits. In our tests, we have observed that infea- results in objects completely penetrating through each other (Fig-
sible region culling can provide more than an order of magnitude ure 9a). Our method with only DCD effectively resolves the majority
faster shortest path query. of collisions (Figure 9b), but it inherits the limitations of DCD. More
specifically, using only DCD with sufficiently large time steps and
4 COLLISION HANDLING APPLICATION fast enough motion, some collisions can be missed and deep pene-
As mentioned above, an important application of our method is trations can resolve the collisions by moving the objects in incorrect
collision handling with DCD. When DCD finds a penetration, we directions, again resulting in object parts passing through each
can use our method to find the closest point on the boundary and other. Furthermore, our method only provides the closest path to
apply forces or constraints that would move the penetrating point the boundary and properly resolving the collisions is left to the
towards this boundary point. simulation system. Unfortunately, XPBD cannot provide any guar-
In our tests with tetrahedral meshes, we use two types of antees in collision resolution, so detected penetrations may remain
DCD: vertex-tetrahedron and edge-tetrahedron collisions. For unresolved.
vertex-tetrahedron collisions, we find the closest surface point for We recommend a hybrid solution that uses both CCD and DCD
the colliding vertex. For edge-tetrahedron collisions, we find the with our method. This hybrid solution performs DCD in the be-
center of the part of the edge that intersects with the tetrahedron ginning of the time step to identify the preexisting penetrations or
and then use our method to find the closest surface point to that collisions that were not properly resolved in the previous time step.

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 9

(a) (b) (c) (d) (e)


Fig. 11. Flattening a squishy ball (774K vertices, 2.81M tetrahedra) using two planes. (a-c) the flattening process, (d) Side view of the flattened ball
to to 1/20 of its radius, and (e) the other side of the flattened squishy ball.

Fig. 12. Simulation of two squishy balls in head-on collision that come to contact at a relative speed of 50𝑚/𝑠. Both self-collisions and collisions
between the two squishy balls are handled using our method.

The rest of the collisions are detected by CCD without requiring our We implement both collision detection and closest point query
method to find the closest surface point. The same simulation with on CPU using Intel’s Embree framework [Wald et al. 2014] to create
this hybrid approach is shown in Figure 9c. Since all penetrations are BVH. We generate our timing results on a computer with an AMD
first detected by CCD and proper collision constraints are applied Ryzen 5950X CPU, an NVIDIA RTX 3080 Ti GPU, and 64GB of
immediately, deep penetrations become much less likely even with RAM. We acknowledge that our timings are affected by the fact
large time steps and fast motion. Yet, this provides no theoretical that we copy memory from GPU to CPU every iteration in order
guarantees. The addition of CCD allows the simulation system to to do collision detection and handling, and the whole framework
apply collision constraints immediately, before the penetrations be- can be further accelerated by implementing the collision detection
come deep, and DCD with our method allows it to continue applying and shortest path querying on the GPU. As to the parameters of the
collision constraints when it fails to resolve the initial collision con- algorithm, we set 𝜖𝑟 to −0.01. 𝜖𝑖 is related to the scale and unit of
straints. Note that, while this significantly reduces the likelihood of the object, when the object is at a scale of a few meters, we set 𝜖𝑖 to
failed collisions, they can still occur if the simulation system keeps 1−10 .
failing to resolve the detected collisions.
The collision handling application of our method is not exclusive
to PBD. Our method can also be used with force-based simulation 5.1 Stress Tests
techniques for defining a penalty force with penetration potential Figure 11 shows a squishy ball with thin tentacles compressed on
energy two sides and flattened to a thickness that is only 1/20 of its original
1 2 radius. Notice that all collisions, including self-intersections of ten-
𝐸𝑐 = 𝑘 (p − s) · n (7)
2 tacles, are properly resolved even under such extreme compression.
where 𝑘 is the collision stiffness. An example of this is shown in Also. the model was able to revert to its original state after the the
Figure 10. two planes compressing it were removed.
Figure 12 shows a high-speed head-on collision of two squishy
5 RESULTS balls. Though the tentacles initially get tangled with frictional-
We use XPBD [Macklin et al. 2016] to evaluate our method, because contact right after the collision, all collisions are properly resolved
it is one of the fastest simulation methods for deformable objects, and the two squishy balls bounce back, as expected.
providing a good baseline for demonstrating the minor computa- Figure 13 shows two challenging examples of self-collisions
tion overhead introduced by our method. We use mass-spring or caused by twisting a thin beam and two elastic rods. Both instances
NeoHookean [Macklin and Muller 2021] material constraints imple- have shown notable buckling after the twisting. A different
mented on the GPU. We handle the collision detection and handling frame for the same thin beam is also included in Figure 1. Such
part on the CPU, including the position updates of the collision self-collisions are particularly challenging for prior self-collision
constraints. We use the hybrid collision detection approach that handling methods that pre-split the model into pieces, since it is
combines CCD and DCD, as explained above. unclear where the self-collisions might occur before the simulation.

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
10 • He Chen, Elie Diaz, and Cem Yuksel

(a) Naive collisions between objects (b) Our inter-object collisions


Fig. 15. Two squishy balls in head-on collision comparing collision
handling between two different objects (a) by naively accepting the
Euclidean closest point as the closest boundary point and (b) with our
method. All self-collisions are handled using our method in both cases.

Fig. 13. Twisting (top-middle) a thin beam with 400K vertices & 1.9M
tetrahedra, and (bottom) two elastic rods with 281K vertices & 1.3M
tetrahedra, demonstrating unpredictable self-collisions and buckling.

Fig. 14. Simulation of a nested knot starting from (left) the initial
state to (right) the final knot.
(a) Self-collisions off (b) Self-collisions turned on
Fig. 16. Simulation of a squishy ball compressed from either side, as
Another challenging self-collision case is shown in Figure 14, in Figure 11, (a) with self-collisions turned off to produce a state with
where nested knots were formed by pulling an elastic rod from both many complex self-collisions, where the blue tint highlights deeper
sides. In this case, there is a significant amount of sliding frictional penetrations caused by subsurface scattering artifacts due to intersect-
self-contact, changing pairs of elements that collide with each other. ing geometry, and (b) a few frames after self-collisions are turned on,
Though a substantial amount of force is applied near the end, the showing that our method with XPBD quickly recovers them.
simulation is able to form a stable knot.
Figure 15a shows the same experiment using naive closest bound-
ary point computation for the collisions between the two squishy (Figure 17d). In this experiment, we perform collision projections
balls (by picking the closest boundary point on the other object for all vertices (not only for surface vertices) and all tetrahedra’s
purely based on Euclidean distances), only handling self-collisions centroids to resolve the intersection in the completely overlapping
with our method. Notice that it includes (temporarily) entangled ten- parts. Note that we do not provide a theoretical guarantee to resolve
tacles between the two squishy balls and visibly more deformations all the existing intersections. In practice, however, in all our tests
of tentacles elsewhere, as compared to using our method (Figure 15b). all collisions are resolved after just a few iterations/substeps.
This is because, in the presence of self-collisions, naively handling Another example is shown in Figure 16, generated by compressing
closest boundary point queries between different objects is prone to a squishy ball with two planes on either side, similar to Figure 11 but
picking incorrect boundary points that do not resolve the collision, without handling self-collisions. This results in a significant number
resulting in prolonged contact and inter-locking. of complex unresolved self-collisions (Figure 16a), which are quickly
resolved within a few substeps when self-collision handling is turned
5.2 Solving Existing Intersections on (Figure 16b).
Our method can successfully resolve existing self collisions. A
demonstration of this is provided in Figure 17. In this example, the 5.3 Large-Scale Experiments
initial state (Figure 17a) is generated by dropping a noodle model An important advantage of our method is that, by providing a robust
without handling self-collisions. When we turn on self-collisions, all collision handling solution, we can use fast simulation techniques
existing self-intersections are quickly resolved within 10 substeps for scenarios involving a large number of objects and complex col-
(Figure 17b), resulting in numerous inverted elements due to lisions. An example of this is demonstrated in Figure 18, showing
strong collision constraints. Then, the simulation resolves them 600 deformable octopus models forming a pile. Due to its complex
(Figure 17c) and finally the model comes to a rest with self-contact geometry, the octopus model can cause numerous self-collisions

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 11

(a) Initial state (b) Collisions enabled (c) Collisions resolved (d) Final state
Fig. 17. Solving existing collisions. Starting from (a) an initial state with many self-collisions, (b) after collision handling is enabled, (c) our
method can quickly resolve them, and (d) achieve a self-collision-free final state.

Fig. 18. 600 deformable octopus models (3.1M vertices and 8.88M tetrahedra in total) dropped into a container, forming a pile with collisions.

Fig. 19. Simulation of 16 squishy balls (a total of 11.2 million tetrahedra) dropped into a bowl, forming a stable pile with active collisions.

(a) (b)
Fig. 20. Simulation of a long noodle (a) presenting unpredictable complex self-collisions and (b) forming a large pile with self-collisions.

and inter-object collisions. Both collision types are handled using Figure 19 shows another large-scale experiment involving 16
our method. At the end of the simulation, a stable pile is formed squishy balls. Another frame from this simulation is also included in
with 185K active collisions per time step. Figure 1. At the end of the simulation, the squishy balls form a stable

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
12 • He Chen, Elie Diaz, and Cem Yuksel

Computation Time Statistics

Without Infeasible
Region Culling

(a) Rest shape (b) Deformed shape

(c) Collisions using rest shape (d) Collisions using deformed shape

incorrect shortest path


our shortest path
(using the rest shape)

With Infeasible (e) The incorrect shortest path using the rest shape vs. ours
Region Culling Fig. 22. Comparison between the rest pose closest boundary point
and our closest boundary point. (a) The rest pose the cuboid model. (b)
We deform the cuboid to a certain shape, then drop a cube on top of
it. (c) In the simulation using the rest pose closest boundary point, the
cube got incorrectly pulled up. (d) Using our exact closest point, the
cube successfully slides down. (e) The shortest path to the surface for
an example point, showing that using the closest surface point queried
from the rest shape results in an incorrect and longer path.

a relatively small overhead. This includes some highly-challenging


experiments, involving a large number of complex collisions. The
Fig. 21. The computation time statistics of each simulation component highest overhead of our method is in experiments in which delib-
on stacked bar charts: (top) without infeasible region culling and erately disabled self-collisions to form a large number of complex
(bottom) with infeasible region culling. The middle row shows the self-collisions. Note that all collision detection and handling com-
simulation at frames 0, 75, 125, 175 respectively. putations are performed on the CPU, and a GPU implementation
would likely result in a smaller overhead.
We demonstrate the effect of our infeasible region culling by
pile and remain in rest-in-contact with active self-collisions (12K) simulating a squishy ball dropped to the ground with and without
and inter-object collisions (125K) between neighboring squishy this acceleration. The computation time breakdown of all frames are
balls. visualized in Figure 21. In this example, using our infeasible region
We also include an experiment with a single long noodle piece culling, the shortest path query gains a speed-up of 10-30× for some
in Figure 20 that is dropped into a bowl. This simulation forms frames, providing identical results. Additionally, the accelerated
numerous complex and unpredictable self-collisions (Figure 20a). shortest path query results in a more uniform computation time,
At the end of the simulation, we achieve a stable pile with 104K avoiding the peaks visible in the graph.
active self-collisions per time step in this example. Figure 1 includes
a rendering of this final pile without the bowl and a cross-section 5.5 Comparisons to Rest Shape Shortest Paths
view, showing that the interior self-collisions are properly resolved. A popular approach in prior work for handling self-collisions is us-
ing the rest shape of the model that does not contain self-collisions
5.4 Performance for performing the shortest path queries. This makes the computa-
We provide the performance numbers for the experiments above tion much simpler, but obviously results in incorrect shortest bound-
in Table 1. Notice that, even though we are using a highly efficient ary paths. With sufficient deformations, these incorrect boundary
material solver that is parallelized on the GPU, our method provides paths can lead to large enough errors and instabilities.

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 13

Table 1. Performance results. Time step size and frame times are given in seconds, where frame times are measured at 60 FPS. Operations Q., Tr.,
and Tet. represent the number of BVH queries, traversals, and total tetrahedra visited on average per time step, respectively.
Number of Avrg. Collisions Avrg. Operations Time Step Frame Time Average Time %
Vert. Tet. CCD DCD Q. Tr. Tet. Size × Iter. Avrg. Max. XPBD CCD DCD Ours
Flattened Squishy Ball (Fig. 11) 774 K 2.81 M 16.8 K 7.1 K 56 6.6 5.2 3.3e-4 × 3 10.89 18.04 30.9 % 29.0 % 31.7 % 8.3 %
Twisted Thin Beam (Fig. 13) 400 K 1.9 M 8.3 K 3.1 K 45 5.7 7.2 3.3e-4 × 3 8.16 15.92 29.7 % 31.3 % 32.1 % 6.9 %
Twisted Rods (Fig. 13) 281 K 1.3 M 4.8 K 2.6 K 33 5.3 4.7 3.3e-4 × 3 5.25 11.17 42.1 % 26.9 % 27.0 % 4.0 %
Nested Knots (Fig. 14) 38.1 K 103 K 3.1 K 0.6 K 31 4.2 4.4 5.5e-4 × 3 0.25 0.32 61.8 % 23.3 % 9.5 % 5.2 %
2 Squishy Balls (Fig. 12) 418 K 1.4 M 22.4 K 1.3 K 36 9.6 11.3 3.3e-4 × 3 1.96 2.87 52.2 % 28.4 % 18.5 % 10.9 %
Pre-Intersect. Noodle (Fig. 17) 40 K 110 K N/A 15.2 K 65 12.0 13.6 8.3e-4 × 3 0.21 0.45 51.6 % 17.6 % 18.4 % 12.4 %
Pre-Intersect. Squishy Ball (Fig. 16) 219 K 704 K N/A 45.8 K 89 12.0 14.0 3.3e-4 × 3 1.54 2.63 44.3 % 18.2 % 19.1 % 18.4 %
600 Octopi (Fig. 18) 3.1 M 8.88 M 104.0 K 6.4 K 12 3.6 4.1 8.3e-4 × 3 16.40 17.90 68.3 % 15.4 % 13.4 % 2.9 %
16 Squishy Balls (Fig. 19) 3.5 M 11.2 M 118.5 K 8.5 K 29 4.5 6.6 3.3e-4 × 3 18.50 20.20 49.3 % 25.0 % 21.8 % 3.9 %
Long Noodle (Fig. 20) 860 K 2.29 M 102.6 K 6.1 K 11 3.6 3.2 8.3e-4 × 3 4.10 4.50 67.6 % 14.8 % 14.9 % 2.7 %
8 Octopi CCD Only (Fig. 9a) 40 K 118 K 2.1 K N/A N/A N/A N/A 3.3e-3 × 5 0.028 0.036 86.6 % 13.4 % N/A N/A
8 Octopi DCD Only (Fig. 9b) 40 K 118 K N/A 2.4 K 13 3.7 4.1 3.3e-3 × 5 0.038 0.045 79.2 % N/A 10.7 % 10.1 %
8 Octopi hybrid (Fig. 9c) 40 K 118 K 2.3 K 0.2 K 11 3.3 3.9 3.3e-3 × 5 0.035 0.038 79.3 % 10.1 % 9.6 % 1.0 %

self-collisions are formed. When we switch to using the rest shape


to find the boundary paths, the simulation explodes following a
number of incorrectly-handled self-collisions.
In general, using the rest shape not only generates incorrect
shortest boundary paths, but also injects energy into the simulation.
This is because an incorrect shortest boundary path is, by definition,
longer than the actual shortest boundary path, thereby corresponds
to higher potential energy.
(a)
6 DISCUSSION
An important advantage of our method is that it can work with
simulation systems that do not provide any guarantees about re-
solving collisions. Therefore, we can use fast simulation techniques
like XPBD to handle complex scenarios involving numerous self-
collisions, as demonstrated above.
Yet, our method cannot handle all types of self-collisions and it
requires a volumetric mesh. We cannot handle collisions of codi-
mensional objects, such as cloth or strands. Our method would also
(b) have difficulties handling meshes with thin volumes or no interior
elements.
Fig. 23. Simulation of twisting a thin beam, shown in Figure 13, soon
Our method is essentially a shortest boundary path computation
after replacing our method with using the rest pose for finding the
method. It is based on the fact that an interior point’s shortest path
closest boundary point: (a) instabilities caused by incorrect closest
to the boundary is always a line segment. This assumption always
boundary points found using this approach, and (b) exploded simula-
holds for objects like tetrahedral meshes in 3D or triangular mesh in
tion after a few frames.
2D Euclidean space. Therefore, our method cannot handle shortest
boundary paths in non-Euclidean spaces, such as geodesic paths on
Figure 22 shows a simple example, where a small cube is dropped surfaces in 3D.
onto a deformed object. Notice that the rest shape of the object Using our method for collision handling with DCD inherits the
(Figure 22a) is sufficiently different from the deformed shape (Fig- limitations of DCD. For example, when with large time steps and
ure 22b). With collision handling using this rest shape, the cube sufficiently fast motion, penetration can get too deep, and the short-
moves against gravity and eventually bounces back (Figure 22c), est boundary path may be on the other side of the penetrated model,
instead of sliding down the surface, as simulated using our method causing undesirable collision handling. In practice, this problem can
(Figure 22d). Figure 22e shows a 2D illustration of example shortest be efficiently solved by coupling CCD and DCD, as we demonstrate
paths generated by both methods. Notice that using the rest shape with our results above.
results in a longer path to the surface that corresponds to higher
collision energy. In contrast, our method minimizes the collision 7 CONCLUSION
energy by using the actual shortest path to the boundary. We have presented a formal definition of the shortest path to bound-
Figure 23 shows a more complex example with self-collisions that ary in the context of self-intersections and introduced an efficient
is initially simulated using our method (Figure 13) until complex and robust algorithm for finding the exact shortest boundary paths

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
14 • He Chen, Elie Diaz, and Cem Yuksel

for meshes. We have shown that this approach provides an effective Graphics Theory and Applications. INSTICC, 293–299.
solution for handling both self-collisions and inter-object collisions Gentaro Hirota, Susan Fisher, and Ming Lin. 2000. Simulation of non-penetrating elastic
bodies using distance fields. University of North Carolina at Chapel Hill Technical
using DCD in combination with CCD, using a simulation system Report: TR00-018. Spring (2000).
that does not provide any guarantees about resolving the collision I Huněk. 1993. On a penalty formulation for contact-impact problems. Computers &
structures 48, 2 (1993), 193–203.
constraints. Our results show highly complex simulation scenarios Changsoo Je, Min Tang, Youngeun Lee, Minkyoung Lee, and Young J Kim. 2012. Poly-
involving collisions and rest-in-contact conditions that are properly Depth: Real-time penetration depth computation using iterative contact-space pro-
handled with our method with a relatively small computational jection. ACM Transactions on Graphics (TOG) 31, 1 (2012), 1–14.
Ladislav Kavan. 2003. Rigid body collision response. Vectors 1000, 2 (2003).
overhead. Dan Koschier, Crispin Deul, Magnus Brand, and Jan Bender. 2017. An hp-adaptive
discretization algorithm for signed distance field generation. IEEE transactions on
ACKNOWLEDGMENTS visualization and computer graphics 23, 10 (2017), 2208–2221.
Ares Lagae and Philip Dutré. 2008. Accelerating ray tracing using constrained tetrahe-
We thank Alper Sahistan, Yin Yang, and Kui Wu for their help- dralizations. In Computer Graphics Forum, Vol. 27. Wiley Online Library, 1303–1312.
Lei Lan, Danny M. Kaufman, Minchen Li, Chenfanfu Jiang, and Yin Yang. 2022a. Affine
ful comments and suggestions. We also thank Alec Jacobson and Body Dynamics: Fast, Stable and Intersection-Free Simulation of Stiff Materials.
Tiantian Liu for providing online volumetric mesh datasets. This ACM Trans. Graph. 41, 4, Article 67 (jul 2022), 14 pages. https://doi.org/10.1145/
project was supported in part by NSF grant #1764071. 3528223.3530064
Lei Lan, Guanqun Ma, Yin Yang, Changxi Zheng, Minchen Li, and Chenfanfu Jiang.
2022b. Penetration-free projective dynamics on the GPU. ACM Transactions on
REFERENCES Graphics (TOG) 41, 4 (2022), 1–16.
Minchen Li, Zachary Ferguson, Teseo Schneider, Timothy Langlois, Denis Zorin, Daniele
Jérémie Allard, François Faure, Hadrien Courtecuisse, Florent Falipou, Christian Duriez, Panozzo, Chenfanfu Jiang, and Danny M Kaufman. 2020. Incremental potential con-
and Paul G Kry. 2010. Volume contact constraints at arbitrary resolution. In ACM tact: Intersection-and inversion-free, large-deformation dynamics. ACM transactions
SIGGRAPH 2010 papers. 1–10. on graphics (2020).
Aytek Aman, Serkan Demirci, and Uğur Güdükbay. 2022. Compact tetrahedralization- Yijing Li and Jernej Barbič. 2018. Immersion of self-intersecting solids and surfaces.
based acceleration structures for ray tracing. Journal of Visualization (2022), 1–13. ACM Transactions on Graphics (TOG) 37, 4 (2018), 1–14.
Mukund Balasubramanian, Jonathan R Polimeni, and Eric L Schwartz. 2008. Exact Yong-Jin Liu. 2013. Exact geodesic metric in 2-manifold triangle meshes using edge-
geodesics and shortest paths on polyhedral surfaces. IEEE transactions on pattern based data structures. Computer-Aided Design 45, 3 (2013), 695–704.
analysis and machine intelligence 31, 6 (2008), 1006–1016. Miles Macklin, Kenny Erleben, Matthias Müller, Nuttapong Chentanez, Stefan Jeschke,
David Baraff. 1994. Fast contact force computation for nonpenetrating rigid bodies. and Zach Corse. 2020. Local optimization for robust signed distance field collision.
In Proceedings of the 21st annual conference on Computer graphics and interactive Proceedings of the ACM on Computer Graphics and Interactive Techniques 3, 1 (2020),
techniques. 23–34. 1–17.
Ted Belytschko and Mark O Neal. 1991. Contact-impact by the pinball algorithm with Miles Macklin and Matthias Muller. 2021. A Constraint-based Formulation of Stable
penalty and Lagrangian methods. Internat. J. Numer. Methods Engrg. 31, 3 (1991), Neo-Hookean Materials. In Motion, Interaction and Games. 1–7.
547–572. Miles Macklin, Matthias Müller, and Nuttapong Chentanez. 2016. XPBD: position-based
Jan Bender, Matthias Müller, and Miles Macklin. 2015. Position-Based Simulation simulation of compliant constrained dynamics. In Proceedings of the 9th International
Methods in Computer Graphics.. In Eurographics (tutorials). 8. Conference on Motion in Games. 49–54.
Sofien Bouaziz, Sebastian Martin, Tiantian Liu, Ladislav Kavan, and Mark Pauly. 2014. Maxime Maria, Sébastien Horna, and Lilian Aveneau. 2017. Efficient ray traversal of
Projective dynamics: Fusing constraint projections for fast simulation. ACM trans- constrained Delaunay tetrahedralization. In 12th International Joint Conference on
actions on graphics (TOG) 33, 4 (2014), 1–11. Computer Vision, Imaging and Computer Graphics Theory and Applications (VISI-
Stephen Cameron. 1997. Enhancing GJK: Computing minimum and penetration dis- GRAPP 2017), Vol. 1. 236–243.
tances between convex polyhedra. In Proceedings of international conference on Gerd Marmitt and Philipp Slusallek. 2006. Fast ray traversal of tetrahedral and hex-
robotics and automation, Vol. 4. IEEE, 3112–3117. ahedral meshes for direct volume rendering. In Proceedings of the Eighth Joint
John Canny. 1986. Collision detection for moving polyhedra. IEEE Transactions on Eurographics/IEEE VGTC conference on Visualization. 235–242.
Pattern Analysis and Machine Intelligence 2 (1986), 200–209. Aleka McAdams, Yongning Zhu, Andrew Selle, Mark Empey, Rasmus Tamstorf, Joseph
Jindong Chen and Yijie Han. 1990. Shortest paths on a polyhedron. In Proceedings of Teran, and Eftychios Sifakis. 2011. Efficient elasticity for character skinning with
the sixth annual symposium on Computational geometry. 360–369. contact and collisions. In ACM SIGGRAPH 2011 papers. 1–12.
Keenan Crane, Marco Livesu, Enrico Puppo, and Yipeng Qin. 2020. A Survey of Brian Mirtich and John Canny. 1995. Impulse-based simulation of rigid bodies. In
Algorithms for Geodesic Paths and Distances. arXiv preprint arXiv:2007.10430 Proceedings of the 1995 symposium on Interactive 3D graphics. 181–ff.
(2020). Joseph SB Mitchell, David M Mount, and Christos H Papadimitriou. 1987. The discrete
Ounan Ding and Craig Schroeder. 2019. Penalty force for coupling materials with geodesic problem. SIAM J. Comput. 16, 4 (1987), 647–668.
Coulomb friction. IEEE transactions on visualization and computer graphics 26, 7 Nathan Mitchell, Mridul Aanjaneya, Rajsekhar Setaluri, and Eftychios Sifakis. 2015. Non-
(2019), 2443–2455. manifold level sets: A multivalued implicit surface representation with applications
Evan Drumwright. 2007. A fast and stable penalty method for rigid body simulation. to self-collision processing. ACM Transactions on Graphics (TOG) 34, 6 (2015), 1–9.
IEEE transactions on visualization and computer graphics 14, 1 (2007), 231–240. Matthew Moore and Jane Wilhelms. 1988. Collision detection and response for computer
Zachary Ferguson, Minchen Li, Teseo Schneider, Francisca Gil Ureta, Timothy R Lan- animation. In Proceedings of the 15th annual conference on Computer graphics and
glois, Chenfanfu Jiang, Denis Zorin, Danny M Kaufman, and Daniele Panozzo. 2021. interactive techniques. 289–298.
Intersection-free rigid body dynamics. ACM Trans. Graph. 40, 4 (2021), 183–1. Matthias Müller, Bruno Heidelberger, Marcus Hennix, and John Ratcliff. 2007. Position
Susan Fisher and Ming C Lin. 2001a. Deformed distance fields for simulation of non- based dynamics. Journal of Visual Communication and Image Representation 18, 2
penetrating flexible bodies. In Computer Animation and Simulation 2001. Springer, (2007), 109–118.
99–111. Carol O’Sullivan and John Dingliana. 1999. Real-time collision detection and response
Susan Fisher and Ming C Lin. 2001b. Fast penetration depth estimation for elastic using sphere-trees. (1999).
bodies using deformed distance fields. In Proceedings 2001 IEEE/RSJ International Steven Parker, Michael Parker, Yarden Livnat, Peter-Pike Sloan, Charles Hansen, and
Conference on Intelligent Robots and Systems. Expanding the Societal Role of Robotics Peter Shirley. 2005. Interactive ray tracing for volume visualization. In ACM
in the the Next Millennium (Cat. No. 01CH37180), Vol. 1. IEEE, 330–336. SIGGRAPH 2005 Courses. 15–es.
Marie-Paule Gascuel. 1993. An implicit formulation for precise contact modeling John C Platt and Alan H Barr. 1988. Constraints methods for flexible models. In
between flexible solids. In Proceedings of the 20th annual conference on Computer Proceedings of the 15th annual conference on Computer graphics and interactive
graphics and interactive techniques. 313–320. techniques. 279–288.
James K Hahn. 1988. Realistic animation of rigid bodies. ACM Siggraph computer Stéphane Redon and Ming C. Lin. 2006. A Fast Method for Local Penetration Depth
graphics 22, 4 (1988), 299–308. Computation. Journal of Graphics Tools 11 (2006), 37 – 50.
Bruno Heidelberger, Matthias Teschner, Richard Keiser, Matthias Müller, and Markus H Alper Şahıstan, Serkan Demirci, Nathan Morrical, Stefan Zellmann, Aytek Aman, Ingo
Gross. 2004. Consistent penetration depth estimation for deformable collision Wald, and Uğur Güdükbay. 2021. Ray-traced shell traversal of tetrahedral meshes
response.. In VMV, Vol. 4. 339–346. for direct volume visualization. In 2021 IEEE Visualization Conference (VIS). IEEE,
Everton Hermann, François Faure, and Bruno Raffin. 2008. Ray-traced collision detection 91–95.
for deformable bodies. In GRAPP 2008-3rd International Conference on Computer

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 15

Vitaly Surazhsky, Tatiana Surazhsky, Danil Kirsanov, Steven J Gortler, and Hugues Graphics (TOG) 33, 4 (2014), 1–8.
Hoppe. 2005. Fast exact and approximate geodesics on meshes. ACM transactions Bin Wang, François Faure, and Dinesh K Pai. 2012. Adaptive image-based intersection
on graphics (TOG) 24, 3 (2005), 553–560. volume. ACM Transactions on Graphics (TOG) 31, 4 (2012), 1–9.
Yun Teng, Miguel A Otaduy, and Theodore Kim. 2014. Simulating articulated subspace Bolun Wang, Zachary Ferguson, Teseo Schneider, Xin Jiang, Marco Attene, and Daniele
self-contact. ACM Transactions on Graphics (TOG) 33, 4 (2014), 1–9. Panozzo. 2021. A Large-scale Benchmark and an Inclusion-based Algorithm for
Demetri Terzopoulos, John Platt, Alan Barr, and Kurt Fleischer. 1987. Elastically de- Continuous Collision Detection. ACM Transactions on Graphics (TOG) 40, 5 (2021),
formable models. In Proceedings of the 14th annual conference on Computer graphics 1–16.
and interactive techniques. 205–214. Shi-Qing Xin and Guo-Jin Wang. 2009. Improving Chen and Han’s algorithm on the
Mickeal Verschoor and Andrei C Jalba. 2019. Efficient and accurate collision response discrete geodesic problem. ACM Transactions on Graphics (TOG) 28, 4 (2009), 1–8.
for elastically deformable models. ACM Transactions on Graphics (TOG) 38, 2 (2019), Qingnan Zhou and Alec Jacobson. 2016. Thingi10K: A Dataset of 10,000 3D-Printing
1–20. Models. arXiv preprint arXiv:1605.04797 (2016).
Ingo Wald, Sven Woop, Carsten Benthin, Gregory S Johnson, and Manfred Ernst. 2014.
Embree: a kernel framework for efficient CPU ray tracing. ACM Transactions on

ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy