Sig23 Shortest Path
Sig23 Shortest Path
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
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
ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
6 • He Chen, Elie Diaz, and Cem Yuksel
ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 7
𝒑𝒑 𝒑𝒑 𝒔𝒔
𝒔𝒔 𝒔𝒔
𝑡𝑡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.
ACM Trans. Graph., Vol. 42, No. 4, Article . Publication date: August 2023.
Shortest Path to Boundary for Self-Intersecting Meshes • 9
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
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
Without Infeasible
Region Culling
(c) Collisions using rest shape (d) Collisions using deformed 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.
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 %
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.