Next Article in Journal
Performance Assessment of Companies with the Proposed Weighted Aggregated Sum Product Evaluation Based on Distance from Average Solution (WASPEDAS) Model
Previous Article in Journal
On the Truncated Zipf Distribution and Its Structural Properties with Applications
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Narrow-Phase Collision Detection Algorithm Based on Contact Theory in 2D

1
College of Water Resources and Hydropower, Sichuan University, Chengdu 610065, China
2
Department of Civil Engineering, Zhejiang University, Hangzhou 310058, China
3
State Key Laboratory of Hydraulics and Mountain River Engineering, Sichuan University, Chengdu 610065, China
*
Authors to whom correspondence should be addressed.
Mathematics 2026, 14(11), 1965; https://doi.org/10.3390/math14111965
Submission received: 23 March 2026 / Revised: 2 May 2026 / Accepted: 8 May 2026 / Published: 3 June 2026

Abstract

Collision detection is the core of collision analysis which is a vital fundamental work in computational particle mechanics. Collision detection algorithms can be divided into direct and indirect algorithms. Among them, the indirect algorithms transform the collision detection between two 2D objects into the position judgment of a reference point and a 2D object by constructing the no-fit polygon (NFP). However, the existing NFP algorithms are either not suitable for concave objects, or their time complexity is too high. This has hindered the development of indirect algorithms. Almost unknown to researchers interested in NFP, in the field of discontinuous mechanics calculation, there exists an ‘entrance block’ in Contact theory. Since NFP is the outline of the entrance block, the entrance block also has the potential to develop into a collision detection algorithm like NFP. The entrance block is suitable for arbitrary objects but ignores the rotation in each time step, which restricts it from becoming a collision detection algorithm. In this study, we improve this limitation and propose a 2D collision detection algorithm that is suitable for arbitrary objects. This algorithm can distinguish collision and contact, which reduces the calculation of late collision response. In addition, the algorithm has the potential to be transformed into a continuous algorithm and a new narrow-phase 3D collision detection algorithm. Finally, we propose a potential NFP algorithm that can be applied to arbitrary objects, which has an important influence on many NFP-related fields like computer graphics, operations research, computational mechanics, etc.

1. Introduction

Collision refers to the behavior in that two objects come into contact and attempt to interpenetrate each other in motion [1]. This behavior causes the two objects to interact with each other at some collision positions, which causes their motions to change. For particle contact detection, computer graphics, robotics, motion planning, dynamic simulation, packing optimization, virtual reality, animation, surgical simulations, mechanical manufacturing, transportation planning, autopilot, computer-aided design (CAD), and many other fields, collision analysis is a vital fundamental work [1,2,3,4,5,6,7,8,9,10,11,12]. Collision analysis can be divided into two stages: collision detection and response. Collision detection is a spatial geometry problem [1,3] and its purpose is to calculate the collision probability and positions for objects in arbitrary translational and rotational motion. Collision response is a dynamic mechanical problem [13] and its purpose is to calculate the interaction forces at the collision positions, deformations, and changes in the motion state of objects after the collision. Collision detection is the basis of collision response and the critical problem in collision analysis.
Since collision detection is required in a wide variety of situations, many different methods have been proposed [5]. Hubbard [14] divides these algorithms into two parts: broad and narrow phases. Broad phase algorithms use some coarse tests e.g., all-pair test (exhaustive search), sweep and prune (coordinate sorting), and hierarchical hash tables (multi-level grids), to exclude the objects that are unlikely to collide. On the calculation result of the broad phase, narrow phase algorithms will further detect the exact probability, time, and position of collision between objects. The role of the broad phase algorithms is to reduce the computation amount of narrow phase algorithms which are the core of collision detection [2]. According to the logic difference, narrow phase algorithms can be divided into direct and indirect algorithms in this paper. The direct algorithm includes Feature-based algorithms (FB), Image-Space based algorithms (ISB), Bounding volume hierarchies (BVH), Distance fields (DF), Spatial division (SD), Stochastic methods, and so on [2,15,16]. For a comprehensive overview of the various direct algorithms, the readers can refer to the investigations from Kamat [17], Franquesa & Brunet [1], Lin & Manocha [18], Jiménez et al. [19], Teschner et al. [16], Kockara et al. [2] and Wang & Cao [15]. For convenience, we have summarized the main characteristics of various direct algorithms in Figure 1. It is obvious that these algorithms directly detect collision among objects using their geometric features and spatial positions without preprocessing data.
Different from the direct algorithm which takes two 2D objects as the input of collision detection directly, the indirect algorithm transforms the collision detection into the position judgment of a reference point and a 2D object by constructing the no-fit polygon (NFP) between the two objects [20,21]. In general, the time complexity of the algorithm to judge the position relation between one point and one 2D object is much lower than that of the direct collision detection between two 2D objects. Therefore, if the time complexity of the construction algorithm of NFP is not high, the indirect algorithm has the potential to be much less time-consuming than the direct method. The core of indirect algorithms is the construction of the NFP which attracts researchers in the field of computer graphics (e.g., collision detection) [20,21], operations research (e.g., irregular nesting problem) [22], and computational mechanics [23,24]. The idea of NFP was originally proposed by Art [25] for the marker layout problem but the term it ‘shape envelop’. Ten years later, the term ‘no-fit polygon’ was introduced by Adamowicz & Albano [26] and has been widely studied in operations research ever since. The following example which has been used by Rocha [27] and Burke et al. [22] gives an overview of the NFP, as shown in Figure 2. Given two polygons A and B, take any point a0 of A as a reference point. B remains fixed in position and A traverses around B’s edges whilst ensuring that A and B always touch but never intersect each other. When A traces are around the fixed polygon B, the polygon formed by the trajectory of a0 is the no-fit polygon (NFPBA) of A relative to B [22]. When detecting the collision between A and B, if a0 is outside NFPBA, the two objects have not collided yet; if a0 is at the boundary of NFPBA, the two objects are in contact; and if a0 is inside NFPBA, the two objects have interpenetrated each other.
At present, there are many methods for constructing NFP between two 2D objects. In the collision detection study of computer graphics, the GJK algorithm [20] constructs NFP by using Minkowski sums which is only suitable for convex polygons. It is worth noting that Gilbert et al. [20] did not seem to know the concept of NFP since they used configuration space obstacle (CSO) to express the same meaning as the NFP. Ghosh [28], Bennell et al. [29], and other scholars have improved Minkowski sums so that it can be applied to concave polygons for solving the irregular nesting problem. However, these improvements inevitably increase the time complexity of these algorithms, and there are still some problems, for example, the method of Bennell et al. [29] cannot deal with internal holes. In operations research, in addition to Minkowski sums, the Decomposition approach, the Orbital sliding approach, and other methods are also used to construct NFP when there are concave polygons [22]. The decomposition approach decomposes concave polygons into sub-pieces that can be ‘managed’ more easily [22], such as convex polygons [30], linear segments [31], or star-shaped polygons [32]. The time complexity of the decomposition approach is usually very high because of (1) high time complexity of decomposing original polygons into sub-pieces, (2) high time complexity of calculating the NFP of sub-pieces, and (3) high time complexity of recombining NFPs of sub-pieces. The orbital sliding approach proposed by Mahadevan [33] attempts to simulate the sliding motion of one polygon around the other. However, Mahadevan’s method has difficulties dealing with pieces with concavities that have very narrow entries or internal holes. Burke [22] improves Mahadevan’s method and proposes a new orbital sliding approach. This method first finds the possible holes. A process of identifying all feasible touching start positions is performed for the candidate edges. If a feasible start position is found, the sliding approach is performed again from that starting point [34]. Among these NFP algorithms used in computer graphics and operations research, original Minkowski sums have the lowest time complexity (O(m + n), m and n are the number of edges of two polygons, respectively), but it cannot be applied to concave polygons. The time complexity of other algorithms is much higher than that of original Minkowski sums, for example, the time complexity of the method proposed by Avnaim & Boissonnat [31] is O(m3n3log(mn)). For a comprehensive overview of the various NFP algorithms, we refer the readers to the surveys of Burke et al. [22], Bennell & Song [34], and Rocha [27]. We have sorted out the main principles and characteristics of existing NFP algorithms in Figure 3.
To sum up, the existing methods in computer graphics and operations research are difficult to accurately detect concave objects with complex shapes. At present, some assistant methods must be used to improve the detection accuracy, such as dividing concave objects into convex objects, using hierarchical subdivision, and so on. However, these assistant methods will increase the computational complexities of these collision detection algorithms. In addition, it also brings new problems, such as the selection and efficiency of the hierarchical subdivision method. Almost unknown in the fields of computer graphics and operations research, in the field of discontinuous medium mechanics, Shi [23,24], who is a famous mathematician and mechanics expert, proposed the Contact Theory which is mainly used to detect the contact among blocks under translational motion in the iterative step of rock mechanics analysis. In Contact Theory, Shi proposed a concept named ‘entrance block’ to detect the contact between two objects. The outline of the entrance block between two 2D objects is their NFP (see more details in Section 2). Therefore, entrance block can also be applied to collision detection like NFP. The time complexity of the entrance block between two 2D objects is O(mn) (m and n are the numbers of vertexes of the two objects, respectively) which is lower than that of most of the existing NFP algorithms. More importantly, this method can be applied to both convex and concave objects. Therefore, this method has the potential to become one of the most efficient indirect collision detection algorithms. However, the calculation of the entrance block fails to consider the rotational motion, which is the bottleneck that restricts it from becoming a popular collision algorithm. In this study, we improve this limitation by maintaining its time complexity and propose a new 2D collision detection algorithm based on the Contact Theory.

2. Introduction to Entrance Block Based on the Contact Theory

Contact detection is one of the key problems in discontinuous medium mechanical computation. In the computation, the computation process is usually divided into multiple time steps. If the displacements of models in each time step are smaller than a given limit, a linear approximation is accurate enough [23,24]. Therefore, different from collision detection in computer graphics, the existing contact detection algorithms ignore the rotations of objects in each time step of discontinuous medium mechanical computation. After decades of in-depth research, Shi [23,24] came up with the Contact theory which completely solved the contact detection problem of arbitrary 2D or 3D objects by ignoring the rotations of objects. Contact theory has rigorous mathematical derivations based on topology and has been used by many researchers in the field of discontinuous medium mechanical computation [35,36,37,38,39]. In 2D, Contact theory transforms the contact detection between two arbitrary 2D objects into the inclusion relation judgment between a reference point and an ‘entrance block’ which is a union of planes. The algebraic operations of this idea are documented in Shi’s paper in 2015, and the related algorithm is further proposed in Shi’s paper in 2021. In this section, we give the readers a brief introduction to the ‘entrance block’ and a straightforward algorithm for it in 2D. The related mathematical symbols about the entrance block in Contact Theory are shown in Table 1.

2.1. Geometrical Description of Entrance Block

The following example gives an overview of the entrance block. Existing two objects A and B in Figure 4a–f, A and B can be an arbitrary point, line, or plane. Take an arbitrary point a0 as the reference point of A(a0 may not belong to A, see Figure 4c,f). Remain B fixed and find all the positions where A might be in contact or interpenetrate with B in the translational motion. Each position of A corresponds to a translation point of a0. The set of all translation points of a0 is the ‘entrance block’ of A to B and named E(A, B), as shown in red in Figure 4. In contact detection, when a0 belongs to the boundary (deep red region) of E(A, B), A and B contact each other; when a0 is inside (light red region) E(A, B), A and B interpenetrate each other; otherwise, A and B don’t contact or interpenetrate.

2.2. Theorem of Finite Covers of Entrance Blocks

Directly calculating the entrance block between two irregular objects is very complicated like NFP. Based on rigorous mathematical proof, Shi [23,24] proposed a theorem named ‘Theorem of finite covers of entrance blocks’, as Equations (1) and (2) shown below. This theorem is suitable for arbitrary convex and concave objects in 2D (Equation (1)) and 3D (Equation (2)). The theorem proves that the entrance block between two objects is the union of the entrance blocks between the elements (vertexes, edges, and planes) of the two objects. For example, there are two 2D objects A and B with the number of edges m and n, respectively. A(0) has m points and B(0) has n points. A(1) has m edges and B(1) has n edges. A(2) has one plane which is A and B(2) has one plane which is B. Therefore, E(A(2), B(0)), E(A(1), B(1)) and E(A(0), B(2)) are the sets of n, mn, m 2D objects, respectively. Because E(A(2), B(2)) = E(A, B) when A and B are both 2D objects, E(A, B) is the set of n+mn+m 2D objects according to Equation (1).
E(A(2), B(2)) = E(A(2), B(0))∪E(A(1), B(1))∪E(A(0), B(2))
E(A(3), B(3)) = E(A(3), B(0))∪E(A(2), B(1))∪E(A(1), B(2))∪E(A(0), B(3))
where, A(3) is the set of all points of A when A is a 3D object; B(3) is the set of all points of B when B is a 3D object; A(2) is the set of all points of all planes of A when A is a 3D object or the set of all points of A when A is a 2D object; B(2) is the set of all points of all planes of B when B is a 3D object or the set of all points of B when B is a 2D object; A(1) is the set of all points of all edges of A; B(1) is the set of all points of all edges of B; A(0) is the set of all vertexes of A; B(0) is the set of all vertexes of B; and E(x, y) is the entrance block of x to y.

2.3. Calculation of Entrance Block Between Two 2D Objects

There are two methods for calculating entrance block: the first method is a direct calculation method based on the definition of entrance block; the other method converts the entrance block between two objects into the entrance block among the angles of the two objects to simplify the calculation. The second method is complex and is not suitable to be improved to calculate the entrance block between two rotating objects. Therefore, this study only describes the first method, and the second method can be referred to Shi [23,24].
There are two 2D objects A and B with the number of edges m and n respectively. According to Equation (1), the calculation of the entrance block E(A, B) of A to B can be divided into three parts: E(A(0), B(2)) which is the union of m 2D objects, E(A(2), B(0)) which is the union of n 2D objects, and E(A(1), B(1)) which is the union of mn 2D objects. The following example shows how to calculate E(A, B):
(1)
as shown in Figure 5a, take a point a0 as the reference point of A and remain B fixed;
(2)
find the entrance block E(A(2), B(0)1) of A to the first vertex of B, see Figure 5b;
(3)
similarly, find the entrance blocks of A to other vertexes of B. Combine them and E(A(2), B(0)1) to form E(A(2), B(0)), see Figure 5c;
(4)
find the entrance block E(A(0)1, B(2)) of the first vertex of A to B, see Figure 5d;
(5)
similarly, find the entrance blocks of other vertexes of A to B. Combine them and E(A(0)1, B(2)) to form E(A(0), B(2)), see Figure 5e;
(6)
find the entrance block E(A(1)1–2, B(1)1–2) of the 1–2 edge of A to the 1–2 edge of B, see Figure 5f;
(7)
similarly, find the entrance blocks of other edges of A to other edges of B. Combine them and E(A(1)1–2, B(1)1–2) to form E(A(1), B(1)), see Figure 5g;
(8)
the union of E(A(2), B(0)), E(A(0), B(2)) and E(A(1), B(1)) is E(A, B), see Figure 5h.
Comparing the E(A, B) in Figure 5h with the NFPBA in Figure 2, it can be found that NFPBA is the outline of E(A, B).

2.4. A Method to Reduce the Time Complexity of Entrance Block

It can be seen from the above description that the computational efficiency of E(A, B) is mainly determined by the construction of E(A(2), B(0)), E(A(0), B(2)), and E(A(1), B(1)). For two polygonal objects A and B with m and n edges, respectively, E(A(2), B(0)) and E(A(0), B(2)) are composed of n and m entrance-block components, respectively. In contrast, if E(A(1), B(1)) is computed by explicitly enumerating all edge pairs, mn edge-edge entrance blocks need to be constructed. Therefore, the direct finite-cover construction has a dominant edge-pair enumeration cost of O(mn), which makes the computation inefficient for polygons with many edges.
To reduce this cost, this study proposes a simplified construction of E(A(1), B(1)). The key idea is not to calculate the entrance block for each pair of edges independently, but to treat A(1) as a whole translating boundary and construct its swept region along each edge of B. In this way, the explicit mn edge-pair enumeration is replaced by n swept-region constructions after the symmetric boundary of A(1) is obtained. Therefore, for the polygonal cases considered in this study, the entrance-block components used for point-in-region judgment can be generated with a linear construction cost with respect to the numbers of edges of the two objects, i.e., O(m + n), under the implementation described below. The calculation flow is as follows:
(1) Construction of E(A(1), B(0)i): find the symmetric object A’(1) of A(1) to a0 (see the red polygon in Figure 6a). Taking a0 as the base, shift A’(1) to the ith vertex of B to form E(A(1), B(0)i) (see Figure 6b);
(2) Construction of E(A(1), B(1)i(i+1)): translate E(A(1), B(0)i) along the edge of B to the (i + 1)-th vertex of B to get E(A(1), B(0)(i+1)) (see Figure 6c). In this process, the region E(A(1), B(0)i) passes through is E(A(1), B(1)i(i+1)) (see Figure 6d).
(3) Construction of E(A(1), B(1)): repeat step (2) for each edge of B so that the entrance blocks of A(1) to all edges of B are obtained. The union of the n entrance blocks is E(A(1), B(1)).
The entrance blocks (red regions) in Figure 5g and Figure 6e are the same, which proves that the method is effective.
The above steps involve the calculation of the region passed by an arbitrary translating polygon. The following procedures are recommended (see Figure 6f): Calculate the distances between all vertexes of the polygon and the translation line (e.g., the line a0a0′ in Figure 6f). Find the farthest vertexes on both sides of the line in the translation direction (for example, the third and seventh vertexes in Figure 6f). The polygon is divided into two parts by the two vertexes (for example, the multistage line 7-1-2-3 and multistage line 3-4-5-6-7 in Figure 6f). Splice one part of the polygon after translation (for example, the multistage line 7′-1′-2′-3′), the other part of the polygon before translation (for example, the multistage line 3-4-5-6-7), and the translation lines of the two vertexes (for example, the lines 33′ and 77′) to get a new polygon. The new polygon is the region passed by the translating polygon.

3. A 2D Collision Detection Algorithm

In the real collision, besides translation, rotation also needs to be considered. But the entrance block in contact theory ignores the rotations of objects in each time step of discontinuous medium mechanical computation. According to the above description of the entrance block, the entrance block between two rotating objects is going to change over time. Since the role positions of translational velocities, translational accelerations, rotational velocities, and rotational accelerations are both the centers of gravity of the objects, choosing the centers of gravity of the objects as the reference points can simplify the calculation of the entrance block between two rotating objects. The following example shows how to detect the collision between two 2D objects. There are two 2D objects A and B in Figure 7a, where A has velocity vAx and acceleration aAx in the x direction, velocities vAy and accelerations aAy in the y direction, and rotational velocities wA and accelerations aAw in the counterclockwise direction at its center of gravity. In the same way, B has velocity vBx and acceleration aBx in the x direction, velocities vBy and accelerations aBy in the y direction, and rotational velocities wB and accelerations aBw in the counterclockwise direction at its center of gravity. Calculate the collision time and positions between A and B by following the steps below:
(1)
calculate the maximum distance LA between the center of gravity a0 (xa0, ya0) and all vertexes of A. With a0 as the center, LA as the radius to make the bounding volume ball BVA of A. In the same way, make the bounding volume ball BVB of B, As shown in Figure 7a. Note that when the material of an object is uniform, its center of gravity is its centroid. The centroid of an arbitrary polygon can be calculated as follows [40]:
C x = i = 1 n x i + x i + 1 x i y i + 1 x i + 1 y i 3 i = 1 n x i y i + 1 x i + 1 y i
C y = i = 1 n y i + y i + 1 x i y i + 1 x i + 1 y i 3 i = 1 n x i y i + 1 x i + 1 y i
where, Cx is the x coordinate of the centroid of the polygon; Cy is the y coordinate of the centroid of the polygon; n is the number of vertexes of the polygon; xi and yi are the x and y coordinates of the ith vertex of the polygon, respectively; xn+1 = x1 and yn+1 = y1.
(2)
solve the following Equation (5) for time (T). If A and B are likely to collide, the following Equation (5) for time (T) must have two positive real roots T1 and T2 (T2 > T1), as shown in Figure 7b,c. Otherwise, A and B would not collide.
x a 0 + v A x × T + 1 2 a A x × T 2 x b 0 + v B x × T + 1 2 a B x × T 2 2 + y a 0 + v A y × T + 1 2 a A y × T 2 y b 0 + v B y × T + 1 2 a B y × T 2 2 = L A + L B 2
where, (xa0, ya0) and (xb0, yb0) are the coordinates of a0 and b0, respectively; vAx and vBx are the velocities in the x direction of A and B, respectively; vAy and vBy are the velocities in the y direction of A and B, respectively; aAx and aBx are the accelerations in the x direction of A and B, respectively; aAy and aBy are the accelerations in the y direction of A and B, respectively; LA and LB are the maximum distances between the centers of gravity a0 and b0 of A and B and their vertexes, respectively.
(3)
divide the time [T1, T2] equally produces n time points t1, t2, t3, , and tn (t1 = T1 and tn = T2). Calculate the vertex positions of A and B at the n time points respectively.
(4)
for every time point, taking a0 as the reference point of A, calculate E(A(0), B(2)), E(A(2), B(0)), and E(A(1), B(1)) between A and B as described in Section 2. Judge the position relation of E(A(0), B(2)), E(A(2), B(0)) and E(A(1), B(1)) to a0 in turn. If a0 is inside E(A(0), B(2)) or E(A(2), B(0)) or E(A(1), B(1)), B(0)), it means that A and B have already collided at this time point. Otherwise, A and B have not collided.
There are many ways to determine the position relations between a point and an arbitrary 2D object. We recommend two methods here: the crossings test method and the angle summation method [41]. In the crossings test method, a ray by drew from the desired judgment point. Inside the 2D object if the ray has an odd number of crossings (NC) within the boundary of the 2D object (Figure 8a), otherwise outside or on the boundary (Figure 8b). Although this method is faster than the angle summation method, it has some special cases when rays pass through the vertexes and edges of the 2D object (Figure 8c). In the angle summation method, the vertexes of the 2D object are sorted counterclockwise or clockwise. The desired judgment point is connected with each vertex of the 2D object, respectively. Calculate the angle between adjacent vertexes, positive if the direction of this angle is the same as the vertex order, negative otherwise. Sum all the angles. If the sum of the angles is 360°, the point is inside or on the edge of the 2D object (Figure 9a,b), and if 0°, the point is outside the 2D object (Figure 9c). We recommend the angle summation method more because it can judge the position relationship between a point and a union of multiple objects at one time. If the sum of the angle summations of all objects is equal to 0°, the point is outside these objects. Otherwise, the point is inside or on the boundaries of these objects. To improve numerical robustness, singular cases and floating-point errors are handled by a tolerance-based strategy. The algorithm first checks whether the reference point lies on a vertex or an edge of any component object within a tolerance ε. Such cases are classified as boundary/contact cases. For other cases, the signed angle is computed using the stable atan2(cross, dot) formulation. The final point-in-union result is determined by comparing the accumulated angle with 0° using the same tolerance. Thus, points very close to the boundary are conservatively treated as contact, reducing false collision judgments caused by numerical noise. This allows the position judgment between the reference point and the entrance block, which is a union of m + n + mn 2D objects, to be completed in one calculation.
(5)
find the first time point t0 when A and B overlap each other from all time points. Reset T1 to t0 − (T2T1)/n and reset T2 to t0.
(6)
repeat steps (3–4) until T2T1 < Threshold. T2 is the collision time between A and B. Recorded these E(A(0), B(2)) or E(A(2), B(0)) contains a0 in T2. The vertexes corresponding to these E(A(0), B(2)) or E(A(2), B(0)) containing a0 are the collision points between A and B. For example, if E(A(2), B(0)16) contains a0, the 16th vertex of B collides with A as shown in Figure 10a; if E(A(0)5, B(2)) contains a0, the 5th vertex of A collides with B as shown in Figure 10b. The initial interval [T1, T2] is obtained from the overlap condition of the two bounding volume balls and provides a conservative possible collision interval. During the refinement process, if t0 is the first sampled time point at which overlap is detected, the first collision time must lie between t0 and the previous sampled time point. Therefore, the interval is updated to [ t 0 ( T 2 T 1 ) / n , t 0 ] . Since each refinement reduces the interval length to 1 / n of the previous length, the interval converges as the refinement proceeds. The threshold is used as the stopping criterion and controls the temporal accuracy of the detected collision time. A smaller threshold improves accuracy but increases the number of refinement iterations, whereas a larger threshold improves efficiency but reduces accuracy.

4. Case

To test the reliability of the proposed collision detection algorithm above, the algorithm is used to calculate the following 3 cases.
Case 1: There are two randomly generated concave objects in each case. The two objects in each case are of uniform material, so their centroids are their centers of translation and rotation. The method of randomly generating these concave objects is as follows:
(1)
Generates n random integers L = [l1, l2, …, ln] in [0 m, 100 m].
(2)
Generates n random integers θ = [θ1, θ2, …, θn] in [0°, 360°], and reorders θ from smallest to largest.
(3)
Use L and θ to calculate the vertex coordinates of the 2D object as follows:
xj = ljcos(θj)
yj = ljsin(θj)
where, xj is the x coordinate of the jth vertex of the 2D object; yj is the y coordinate of the jth vertex of the 2D object; lj is the jth integer in L; θj is the jth integer in θ.
There are two concave 2D objects with 12 edges in Figure 11, whose vertex coordinates are shown in Table A1 in Appendix A. By using Equations (3) and (4), the centroids of the red and blue objects are (0.32, −4.75) and (312.54, 20.12), respectively. Assume that the x-direction velocities of the red and blue objects are 10 m/s and −10 m/s, respectively. Assume that the counterclockwise rotation speeds of the red and blue objects are −90°/s and 90°/s, respectively. By using Equation (5), the time of possible collision between the two objects is [2.46 s, 10.03 s]. Defaulting the time accuracy is 0.0001 s, collision detection is performed for the two objects in the possible collision time. At each time point, the centroid of the red object is used as the reference point to construct the entrance block between the two objects. After judging the position relationship between the reference point and entrance block, the exact collision time and position are gradually approached. Finally, collision detection results show that the collision time is 9.6965 s and the collision position is the 3rd vertex of the red object, as shown in Figure 12.
Case 2: Two concave 2D objects with 96 edges are generated using the same method as in Case 1 in Figure 13, whose vertex coordinates are shown in Table A2 in Appendix A. By using Equations (3) and (4), the centroids of the red and blue objects are (5.20, −5.12) and (292.52, 8.76), respectively. Assume that the x-direction velocities of the red and blue objects are 25 m/s and −25 m/s, respectively. Assume that the counterclockwise rotation speeds of the red and blue objects are −180°/s and 180°/s, respectively. By using Equation (5), the time of possible collision between the two objects is [1.50 s, 10.00 s]. Defaulting the time accuracy is 0.0001 s, collision detection is performed for the two objects in the possible collision time. At each time point, the centroid of the red object is used as the reference point to construct the entrance block between the two objects. After judging the position relationship between the reference point and entrance block, the exact collision time and position are gradually approached. Finally, collision detection results show that the collision time is 2.7698 s and the collision position is the 8th vertex of the blue object, as shown in Figure 14.
Case 3: Collision detection in 2D is mainly used in robot path planning [42], traffic planning [43], ship avoidance [43], and other fields. Bernabeu et al. [42] used the GJK method to detect the collision time between two mobile robots, as shown in Figure 15a. Since the GJK method can only be used for convex objects, they simplified the robots to circles for calculation, see Figure 15b. The centers of the two robots A and B are (933, 400) and (400, 1051.6), respectively. The velocities of the two robots A and B are 58 mm/s and 57 mm/s, respectively. The acceleration of the two robots A and B are −0.42 mm/s2 and −0.95 mm/s2, respectively. The calculation result of Bernabeu et al. [41] is that the collision time between the two robots is about 7.1 s, as shown in Figure 15c. Since our method can be applied to concave objects, the two robots are simplified into two concave polygons according to the outlines of the two robots, see Figure 15d. Using our method to conduct collision detection on these two robots, the result shows that the two robots collide at 7.96 s. It can be seen from Figure 15d that there is no collision between the two robots at 7.1 s, which shows that our method is more accurate. This case provides a quantitative comparison with the GJK-based collision detection result reported by Bernabeu et al. [42]. The GJK-based circular approximation gives a collision time of approximately 7.1 s, whereas the proposed entrance-block-based method gives a collision time of 7.96 s using concave polygonal outlines. The difference mainly comes from the geometric simplification required by the GJK-based circular model, while the proposed method can directly use concave polygonal representations of the robot outlines. In addition, the computational complexity of the method of Bernabeu et al. [42] is the same as ours, which is O(m + n). In this case, the calculation time of both methods is less than 10 ms.
The above cases demonstrate the feasibility of the proposed collision detection algorithm for concave 2D objects with translation and rotation. Cases 1 and 2 illustrate that the method can detect collision time and collision position for randomly generated concave polygons with different numbers of edges, while Case 3 provides a quantitative comparison with a GJK-based result in a robot collision-detection example. However, it should be noted that these cases are mainly used to verify the applicability of the proposed entrance-block-based collision detection algorithm. They do not constitute a complete benchmark evaluation. A systematic benchmark study involving different polygon sizes, concavity levels, motion patterns, and comparisons with optimized existing algorithms is still needed to fully evaluate the computational performance and scalability of the proposed method.

5. Discussion

(1)
Difference between collision and contact
Collision refers to the behavior in that two objects come into contact and attempt to interpenetrate each other in motion [1]. Therefore, contact is the prerequisite and necessary condition of collision. However, if two objects do not interact after contact, the contact cannot be considered a collision because there is no interaction between the two objects. Existing two examples in Figure 16, the two objects are moving toward each other in the x direction and come into contact. However, there’s no pressure and friction between the two objects, so no collision between two objects. Unlike Figure 16, when the two objects in Figure 17a are moving toward each other in the x direction, there will be a collision with pressure and no friction at the yellow points in Figure 17b. In the collision detection algorithm above, when the reference point is at the boundary of the entrance block between two objects, the two objects are considered to have contacted but not collided. Therefore, the contact like Figure 16 will not be misjudged as a collision in this algorithm, which reduces the calculation of late collision response.
(2)
Comparison with mainstream NFP-related algorithms for concave polygons
Although the proposed method is closely related to the no-fit polygon (NFP), its objective is different from that of most traditional NFP-generation algorithms. Existing NFP-related methods, such as Minkowski-sum-based methods, decomposition-based methods, and orbital sliding methods, mainly focus on generating the complete NFP boundary for nesting, packing, or layout optimization problems. In contrast, the proposed entrance-block-based method aims to determine the collision state, collision time, and collision position of two objects under translational and rotational motion.
A direct quantitative comparison with these methods is not straightforward because they differ in applicable object types, preprocessing procedures, robustness treatments, output forms, and implementation details [45,46]. Without unified benchmark cases and standardized implementations, a simple runtime comparison may introduce implementation bias and lead to misleading conclusions. Therefore, a methodological comparison between the proposed method and existing NFP-related methods is summarized in Table 2.
As shown in Table 2, the proposed method differs from traditional NFP-generation algorithms in terms of its objective, applicable object types, treatment of rotation, and output form. Therefore, the comparison in this section focuses on methodological characteristics rather than direct runtime results. Systematic quantitative comparisons with mainstream NFP-related algorithms under unified benchmark cases and standardized implementations will be carried out in future work.
(3)
Potential of this discrete algorithm to evolve into a continuous algorithm
According to the continuity of time in the calculation, collision detection algorithms can be divided into discrete and continuous algorithms [44]. Most existing algorithms belong to discrete algorithms which check for overlaps at given discrete time steps in the simulation and may miss collisions between the time steps [47]. The collision detection algorithm in Section 3 is also a discrete algorithm. In general, discrete algorithms are faster but less accurate than continuous algorithms [44,47]. For example, when the density of collision detection time points is relatively sparse, the collision time may not be captured using discrete algorithms.
More specifically, if a penetration-retraction event occurs completely between two adjacent sampled time points, the proposed finite-step discrete algorithm may theoretically miss this event. This phenomenon is usually referred to as the tunneling effect in discrete collision detection [44]. Therefore, the current algorithm should be regarded as a time-discrete implementation of the entrance-block-based collision detection framework, rather than a rigorous continuous collision detection algorithm. For example, moving A down by a tiny amount results in a collision in Figure 16b, but catching it using a finite amount of time samples might fail depending on the number of samples. This can be improved by increasing the density of collision detection time points (for example, the number of time points n take 10,000 in this method), but this leads to an inefficiency computation.
However, this limitation is caused by the finite time sampling strategy and does not prevent the proposed entrance-block-based framework from being developed into a time-continuous method. Under continuous rigid-body motion, the variables required for contact judgment can be expressed as functions of time. For example, they can be written compactly as:
{ a 0 ( t ) = a 0 ( 0 ) + v A t + 1 2 a A t 2 ; θ A ( t ) = θ A ( 0 ) + ω A t + 1 2 α A t 2 ; p A , i ( t ) = a 0 ( t ) + R ( θ A ( t ) [ p A , i ( 0 ) a 0 ( 0 ) ] ) ; p B , j ( t ) = b 0 ( t ) + R ( θ B ( t ) [ p B , j ( 0 ) b 0 ( 0 ) ] ) ; E ( t ) = E ( A ( t ) , B ( t ) ) ; t 0 = inf { t | a 0 ( t ) E ( t ) } = inf { t | S ( t ) 0 } ;
where a 0 ( t ) and b 0 ( t ) are the reference points of objects A and B at time t, respectively; v A and a A are the translational velocity and acceleration of object A, respectively; θ A ( t ) , ω A , and α A are the rotation angle, angular velocity, and angular acceleration of object A, respectively; p A , i ( t ) and p B , j ( t ) are the coordinates of the i-th vertex of object A and the j-th vertex of object B at time t, respectively; R ( ) is the rotation matrix; E(t) is the time-varying entrance block constructed from A(t) and B(t); S(t) denotes the angle summation used to judge the inclusion relation between the reference point and the entrance block; and t0 is the first collision time.
Therefore, although the current implementation is time-discrete and may theoretically miss penetration-retraction events, the variables required for contact judgment have continuous-time representations. This indicates the potential of the proposed method to evolve into a continuous collision detection algorithm. However, solving t0 is still difficult because S(t) is generally a complex nonlinear function under simultaneous translation and rotation. This is the main bottleneck for transforming the current discrete algorithm into a rigorous continuous collision detection algorithm.
(4)
Potential of using entrance block for 3D collision detection
According to Shi’s contact theory [23,24], the entrance block is not only suitable for 2D objects, but also 3D objects. Unlike 2D entrance block calculation, 3D entrance block calculation needs to consider the entrance blocks between the edges and planes, vertexes, and bodies of two 3D objects according to Equation (2). We are trying to combine 3D entrance block with collision detection algorithms to generate a new narrow-phase 3D collision detection algorithm. Please pay attention to our follow-up work.
(5)
Applicability to objects with inner holes
Concave objects with inner holes are a challenging case for NFP-related and entrance-block-based methods. The present numerical examples focus on concave objects without inner holes. From the formulation of the entrance block, an object with inner holes can be represented by multiple boundary loops, including one outer boundary and one or more inner boundary loops. The vertices and edges of all these loops can be included in A(0), A(1), B(0), and B(1), and the solid region excluding the holes can be used as A(2) or B(2). Therefore, the finite-cover formulation of the entrance block can in principle be extended to objects with inner holes. In the point-in-region judgment, oriented boundary loops and the winding-number or angle-summation method can be used to distinguish the solid region from the holes. Nevertheless, dedicated numerical examples involving inner holes are not included in the present study, and this will be investigated in future work.
(6)
Extension of ‘theorem of finite covers of entrance surfaces’ in 2D and its influence on NFP
It can be seen from Section 3 that NFP is the outline of the entrance block. Therefore, the method used to calculate the boundary of the entrance block can also be used to calculate the NFP. According to the ‘theorem of finite covers of entrance surfaces’ proposed by Shi [23,24], there exists the following theorem, when two 2D objects A and B both are convex:
E(A(2), B(2)) = E(A(1), B(0)) ∪ E(A(0), B(1))
where, A(2) = A; B(2) = B; A(0) is the point set that includes all vertexes of A; B(0) is the point set that includes all vertexes of B; A(1) is the boundary of A; B(1) is the boundary of B; ∂E(x, y) is the boundary of the entrance block of A to B; and E(x, y) is the entrance block of x to y.
Equation (9) provides a potential way to simplify the calculation of the boundary of the entrance block between two 2D objects. In the original Contact Theory, this equation was mainly established for convex objects, which limits its direct application to concave polygons. It should be noted that the boundary discussed here refers to the external boundary, or outline, of the entrance block corresponding to the NFP, rather than all internal boundaries that may be generated during the union operation. Based on the theorem of finite covers of entrance blocks and entrance surfaces proposed by Shi [23,24], we further extend the external-boundary form of Equation (9) from convex objects to general 2D polygonal objects. The derivation is given as follows:
E(A(2), B(2)) = E(A(2), B(0)) ∪ E(A(1), B(1)) ∪ E(A(0), B(2))
∴∂E(A(2), B(2)) = ∂E(A(2), B(0)) ∪ ∂E(A(1), B(1)) ∪ ∂E(A(0), B(2))
∵∂E(A(2), B(0)) = E(∂A(2), B(0)) = E(A(1), B(0))
E(A(1), B(1)) = E(A(1), B(0)) ∪ E(A(0), B(1))
E(A(0), B(2)) = E(A(0), ∂B(2)) = E(A(0), B(1))
∴∂E(A(2), B(2)) = E(A(1), B(0)) ∪ E(A(0), B(1))
The above derivation is suitable for arbitrarily 2D objects, which proves that Equation (8) can be applied to arbitrarily 2D objects including concave and convex, as shown in Figure 18. The outline of the boundary of the entrance block is NFP (see Figure 18c,d), so Equation (8) provides a potential way to calculate NFP. This method is suitable for arbitrary 2D objects, which is an advantage that many NFP algorithms do not have. This method has an important influence on the NFP-related fields e.g., computer graphics, operations research, computational mechanics, etc.

6. Conclusions

Based on the entrance block in contact theory proposed by Shi [23,24], a new 2D collision detection algorithm is proposed in this study. By constructing the entrance block between two 2D objects, the collision detection problem between the two objects is transformed into the position judgment of a reference point and an entrance block which is a union of m + n + mn 2D objects (m and n are the numbers of vertexes of the two objects, respectively). Using a simplified method, the time complexity of the entrance block is reduced from O(mn) to O(m + n). In collision detection between two 2D objects, this algorithm first uses the bounding volume ball method for broad phase detection, which obtains the time of the possible collision. Further, the time of possible collision is divided into n time points and the positions of the two objects by calculated at the n time points, respectively. For each time point, the entrance block between the two objects is calculated. Finally, the position relation between the reference point and the entrance block is judged. If the reference point is inside the entrance block, the two objects have a collision. The vertexes corresponding to these E(A(2), B(0)) or E(A(0), B(2)) containing the reference point are the collision points. Different from other indirect algorithms represented by GJK which is only suitable for convex objects, the algorithm above can be applied to an arbitrary 2D object including convex and concave. This algorithm can distinguish collision and contact, which reduces the calculation of late collision response. In addition, the algorithm has the potential to be transformed into a continuous algorithm and a new narrow-phase 3D collision detection algorithm. Finally, we extend the ‘theorem of finite covers of entrance surfaces’ proposed by Shi [23,24] so that it can be used to compute the boundary of the entrance block of an arbitrary 2D object including convex and concave. Because NFP is the outline of the entrance block, this work has an important influence on the NFP-related fields e.g., computer graphics, operations research, computational mechanics, etc.

Author Contributions

Methodology, G.L. and S.D.; Investigation, G.L. and J.W.; Resources, J.W. and R.Z.; Data curation, J.W.; Writing—original draft, G.L.; Writing—review & editing, S.D. and R.Z.; Funding acquisition, S.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding authors.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Appendix A

Table A1. The vertex coordinates of the concave objects in case 1.
Table A1. The vertex coordinates of the concave objects in case 1.
Red ObjectBlue Object
Vertex #x Coordinatey CoordinateVertex #x Coordinatey Coordinate
150.7418.471338.8883.38
2−21.0443.142236.9728.06
3−78.25−16.633206.7518.13
4−6.69−7.434290.00−0.17
5−44.50−77.085250.27−15.20
6−0.37−0.936289.71−6.18
7−12.58−50.467262.49−40.22
85.93−67.748254.73−52.07
920.43−53.219308.17−12.58
1028.21−38.8310364.66−43.62
1123.33−23.3311338.97−9.00
1246.04−40.0212389.51−9.41
Table A2. The vertex coordinates of the concave objects in case 2.
Table A2. The vertex coordinates of the concave objects in case 2.
Red ObjectBlue Object
Vertex #x Coordinatey CoordinateVertex #x Coordinatey Coordinate
168.962.411345.990.80
251.804.532307.980.56
351.8411.023324.862.61
410.672.664373.597.74
585.7251.505304.910.95
630.1919.616342.218.20
752.2335.237352.0017.91
832.7722.948385.5443.58
90.690.729318.0010.82
1037.5140.2210310.186.36
1133.4638.4911348.3043.49
1214.6920.2312308.047.50
132.874.1013366.2473.57
1446.2971.2914316.4018.87
151.044.8915334.1150.57
163.3431.8216341.0071.01
176.8978.7017339.4474.17
188.5497.6318320.7144.41
191.0358.9919330.0970.88
20−2.7277.9520332.9785.89
21−5.0972.8221332.6184.96
22−5.7565.7522307.1620.80
23−9.3266.3523314.2453.13
24−17.9492.2724316.4377.27
25−11.2352.8225302.4419.85
26−10.3538.6426305.2374.82
27−18.7465.3727297.4947.93
28−15.3942.2928296.9158.92
29−9.1810.5729296.7126.80
30−32.7029.4430297.378.61
31−41.5136.0831291.2328.69
32−31.0925.1732271.5787.50
33−32.3623.5133284.3745.38
34−62.2643.5934291.2125.53
35−45.4327.3035263.8567.99
36−44.9421.9236259.8366.86
37−8.163.8037298.412.54
38−24.438.8938248.2771.19
39−44.990.7939231.4341.20
40−64.000.0040270.8615.49
41−70.73−6.1941239.2828.32
42−99.45−10.4542271.8110.26
43−92.84−14.7043211.5528.74
44−9.88−1.5644272.278.48
45−93.90−19.9645283.443.82
46−15.97−5.8146226.3814.31
47−90.21−38.2947252.738.34
48−55.23−23.4448234.011.15
49−22.66−10.5749204.19−15.17
50−7.06−3.7650268.70−6.65
51−21.92−21.9251292.17−1.66
52−56.96−58.9952223.50−23.39
53−5.56−5.7553265.23−12.65
54−24.09−26.7554244.92−21.14
55−9.37−10.4055283.07−8.63
56−10.07−12.4356293.14−4.12
57−4.11−5.6657286.89−9.18
58−40.72−58.1658236.42−53.35
59−4.90−7.5559279.66−23.40
60−27.18−55.7360277.63−31.95
61−7.61−16.3161265.03−55.97
62−25.79−60.7562265.35−74.32
63−16.28−47.2863267.46−69.79
64−8.96−27.5864285.15−34.98
65−17.46−82.1665293.50−17.85
66−2.86−81.9566282.08−62.48
671.64−93.9967299.88−0.99
680.09−1.0068296.97−28.84
6913.51−63.5869294.42−63.76
700.21−0.9870298.95−59.99
712.47−10.7271299.42−32.99
722.66−10.6772301.73−98.98
7312.05−34.9873301.58−12.90
7411.27−21.1974320.40−71.13
7516.43−30.9075305.99−14.83
7612.88−21.4376316.48−40.80
7721.24−32.7177338.14−74.84
7823.42−36.0678317.45−31.49
7937.28−53.2479304.47−6.63
8055.86−55.8680336.00−42.90
8120.06−18.0781320.48−19.10
8264.15−55.7782310.57−9.18
8356.60−49.2083353.62−45.00
8463.58−53.3584339.13−29.49
8514.55−12.2185315.37−11.17
865.59−4.2186309.01−6.31
8749.52−37.3187317.61−11.44
8858.16−40.7288312.24−6.79
8910.18−6.3689328.86−16.00
908.48−5.3090384.76−45.07
9150.88−31.8091348.53−23.67
9277.05−28.0592322.47−10.96
9377.53−26.7093341.08−15.77
948.51−2.9394364.07−19.59
9573.28−10.3095352.87−15.16
9690.11−12.6696360.07−10.59

References

  1. Franquesa, M.; Brunet, P. Collision Detection: Models and Algorithms. 1998, pp. 1–30. Available online: http://hdl.handle.net/2117/96814 (accessed on 22 March 2026).
  2. Kockara, S.; Halic, T.; Iqbal, K.; Bayrak, C.; Rowe, R. Collision detection: A survey. In Proceedings of the 2007 IEEE International Conference on Systems, Man and Cybernetics, Montreal, QC, Canada, 7–10 October 2007; pp. 4046–4051. [Google Scholar] [CrossRef]
  3. Zhang, X.; Lee, M.; Kim, Y.J. Interactive continuous collision detection for non-convex polyhedral. Vis. Comput. 2006, 22, 749–760. [Google Scholar] [CrossRef]
  4. Liao, X.; Lu, J.; Ma, J.; Xue, J.; Yu, X. Modeling of 2D Layout Design System Based on Convex Hull Plus Rubber Band Analog. Appl. Mech. Mater. 2012, 215–216, 1219–1223. [Google Scholar] [CrossRef]
  5. Zhang, D.; Yuen, M.M.F. A Coherence-based Collision Detection Method for Dressed Human Simulation. Comput. Graph. Forum 2002, 21, 33–42. [Google Scholar] [CrossRef]
  6. Huang, S.; Huang, L.; Lai, Z. An extension of the Fourier series-based particle model to the GJK-based contact detection and resolution framework for DEM. Comput. Part. Mech. 2022, 9, 381–391. [Google Scholar] [CrossRef]
  7. Kheradmand, E.; Laforest, M.; Prudhomme, S. A mathematical framework for the analysis and comparison of contact detection methods for ellipses and ellipsoids. Comput. Part. Mech. 2022, 9, 1153–1203. [Google Scholar] [CrossRef] [PubMed]
  8. Krijgsman, D.; Ogarko, V.; Luding, S. Optimal parameters for a hierarchical grid data structure for contact detection in arbitrarily polydisperse particle systems. Comput. Part. Mech. 2014, 1, 357–372. [Google Scholar] [CrossRef]
  9. Rubio-Largo, S.M.; Lind, P.G.; Maza, D.; Hidalgo, R.C. Granular gas of ellipsoids: Analytical collision detection implemented on GPUs. Comput. Part. Mech. 2015, 2, 127–138. [Google Scholar] [CrossRef]
  10. Shellshear, E. 1D sweep-and-prune self-collision detection for deforming cables. Vis. Comput. 2014, 30, 553–564. [Google Scholar] [CrossRef]
  11. Zheng, J.; Guo, J.; Wang, J.; Sun, H.; Deng, J.; Lü, Q. A universal elliptical disc (UED) model to represent natural rock fractures. Int. J. Min. Sci. Technol. 2022, 32, 261–270. [Google Scholar] [CrossRef]
  12. Guo, J.; Zheng, J.; Lü, Q.; Deng, J. Estimation of fracture size and azimuth in the universal elliptical disc model based on trace information. J. Rock Mech. Geotech. Eng. 2022, 15, 1391–1405. [Google Scholar] [CrossRef]
  13. Moore, M.; Wilhelms, J. Collision Detection and Response for Computer Animation. ACM SIGGRAPH Comput. Graph. 1988, 22, 289–298. [Google Scholar] [CrossRef]
  14. Hubbard, P.M. Interactive collision detection. In Proceedings of the 1993 IEEE Research Properties in Virtual Reality Symposium, San Jose, CA, USA, 25–26 October 1993; pp. 24–31. [Google Scholar] [CrossRef]
  15. Wang, M.; Cao, J. A review of collision detection for deformable objects. Comput. Animat. Virtual Worlds 2021, 32, e1987. [Google Scholar] [CrossRef]
  16. Teschner, M.; Kimmerle, S.; Heidelberger, B.; Zachmann, G.; Raghupathi, L.; Fuhrmann, A.; Cani, M.P.; Faure, F.; Magnenat-Thalmann, N.; Strasser, W.; et al. Collision Detection for Deformable Objects. Comput. Graph. Forum 2005, 24, 61–81. [Google Scholar] [CrossRef]
  17. Kamat, V. A survey of techniques for simulation of dynamic collision detection and response. Comput. Graph. 1993, 17, 379–385. [Google Scholar] [CrossRef]
  18. Lin, M.; Manocha, D. Fast interference detection between geometric models. Vis. Comput. 1995, 11, 542–561. [Google Scholar] [CrossRef]
  19. Jiménez, P.; Thomas, F.; Torras, C. 3D collision detection: A survey. Comput. Graph. 2001, 25, 269–285. [Google Scholar] [CrossRef]
  20. Gilbert, E.; Johnson, D.; Keerthi, S. Procedure for Computing the Distance Between Complex Objects in Three-dimensional Space. IEEE J. Robot. Autom. 2002, 4, 193–203. [Google Scholar] [CrossRef] [PubMed]
  21. Bergen, G.V.D. Ray Casting Against General Convex Objects with Application to Continuous Collision Detection. 2004, pp. 1–17. Available online: http://dtecta.com/papers/jgt04raycast.pdf (accessed on 22 March 2026).
  22. Burke, E.K.; Hellier, R.; Kendall, G.; Whitwell, G. Complete and robust no-fit polygon generation for the irregular stock cutting problem. Eur. J. Oper. Res. 2007, 179, 27–49. [Google Scholar] [CrossRef]
  23. Shi, G. Contact theory. Sci. China Technol. Sci. 2015, 58, 1450–1496. [Google Scholar] [CrossRef]
  24. Shi, G. Contact theory and algorithm. Sci. China Technol. Sci. 2021, 64, 1775–1790. [Google Scholar] [CrossRef]
  25. Art, R.C. An Approach to the Two Dimensional Irregular Cutting Stock Problem. Ph.D. Thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, 1966; pp. 1–28. [Google Scholar]
  26. Adamowicz, M.; Albano, A. Nesting two dimensional shapes in rectangular modules. Comput. Aided Des. 1976, 8, 27–33. [Google Scholar] [CrossRef]
  27. Rocha, P. Robust NFP generation for Nesting problems. arXiv 2019, arXiv:1903.11139. [Google Scholar] [CrossRef]
  28. Ghosh, P.K. An algebra of polygons through the notion of negative shapes. CVGIP Image Underst. 1991, 54, 119–144. [Google Scholar] [CrossRef]
  29. Bennell, J.A.; Dowsland, K.A.; Dowsland, W.B. The irregular cutting-stock problem—A new procedure for deriving the no–fit polygon. Comput. Oper. Res. 2001, 28, 271–287. [Google Scholar] [CrossRef]
  30. Agarwal, P.K.; Flato, E.; Halperin, D. Polygon decomposition for efficient construction of Minkowski sums. Comput. Geom. 2002, 21, 39–61. [Google Scholar] [CrossRef]
  31. Avnaim, F.; Boissonnat, J.D. Polygon placement under translation and rotation. In Annual Symposium on Theoretical Aspects of Computer Science; Springer: Berlin/Heidelberg, Germany, 1988; Volume 294, pp. 323–333. [Google Scholar] [CrossRef]
  32. Li, Z.; Milenkovic, V.J. Compaction and separation algorithms for non-convex polygons and their applications. Eur. J. Oper. Res. 1995, 84, 539–561. [Google Scholar] [CrossRef]
  33. Mahadevan, A. Optimisation in Computer Aided Pattern Packing. Ph.D. Thesis, North Carolina State University, Raleigh, NC, USA, 1984. [Google Scholar]
  34. Bennell, J.A.; Song, X. A comprehensive and robust procedure for obtaining the nofit polygon using Minkowski sums. Comput. Oper. Res. 2008, 35, 267–281. [Google Scholar] [CrossRef]
  35. Zhuang, X.; Zheng, F.; Zheng, H.; Jiao, Y.; Rabczuk, T.; Wriggers, P. A cover-based contact detection approach for irregular convex polygons in discontinuous deformation analysis. Int. J. Numer. Anal. Methods Geomech. 2021, 45, 208–233. [Google Scholar] [CrossRef]
  36. Jiao, Y.; Zhao, Q.; Zheng, F.; Wang, L. Latest advances in discontinuous deformation analysis method. Sci. China Technol. Sci. 2017, 60, 963–964. [Google Scholar] [CrossRef][Green Version]
  37. Li, C.; Yang, Y.; Zheng, H. Numerical study of soil-rock mixture: Generation of random aggregate structure. Sci. China Technol. Sci. 2018, 61, 359–369. [Google Scholar] [CrossRef]
  38. Liu, Q.; Jiang, Y.; Jun, H. Precision improvement methods and research trends of discontinuous deformation analysis. Rock Soil Mech. 2017, 38, 1746–1761. [Google Scholar] [CrossRef]
  39. Wang, L.; Jiao, Y.; Huang, G.; Zheng, F.; Zhao, Z.; Tan, F. Improvement of contact calculation in spherical discontinuous deformation analysis. Sci. China Technol. Sci. 2017, 60, 765–771. [Google Scholar] [CrossRef]
  40. Robert, N. Calculating the Area and Centroid of a Polygon in 2d; Imperial College London: London, UK, 2013; Available online: https://www.ma.ic.ac.uk/~rn/centroid.pdf (accessed on 22 March 2026).
  41. Haines, E. Point in Polygon Strategies. Graph. Gems 1994, 4, 24–46. [Google Scholar] [CrossRef]
  42. Bernabeu, E.J.; Valera, A.; Gomez-Moreno, J. Distance Computation Between Non-Holonomic Motions with Constant Accelerations. Int. J. Adv. Robot. Syst. 2013, 10, 329. [Google Scholar] [CrossRef]
  43. An, H.; Jung, J.I. Design of a Cooperative Lane Change Protocol for a Connected and Automated Vehicle Based on an Estimation of the Communication Delay. Sensors 2018, 18, 3499. [Google Scholar] [CrossRef]
  44. Redon, S.; Kheddar, A.; Coquillart, S. Fast Continuous Collision Detection between Rigid Bodies. Comput. Graph. Forum 2002, 21, 280–287. [Google Scholar] [CrossRef]
  45. Keissar, Y.; Gardner, M.; Sitar, N. Benchmarking Contact Detection Algorithms Used in Polyhedral Particle System. Int. J. Numer. Anal. Methods Geomech. 2026, 50, 53–64. [Google Scholar] [CrossRef]
  46. Bennell, J.A.; Oliveira, J.F. The geometry of nesting problems: A tutorial. Eur. J. Oper. Res. 2008, 184, 397–415. [Google Scholar] [CrossRef]
  47. Min, T.; Curtis, S.; Sung-Eui, Y.; Manocha, D. ICCD: Interactive Continuous Collision Detection between Deformable Models Using Connectivity-Based Culling. IEEE Trans. Vis. Comput. Graph. 2009, 15, 544–557. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Characteristics of some widely used direct algorithms in narrow phase collision detection [2,11,13,14,16].
Figure 1. Characteristics of some widely used direct algorithms in narrow phase collision detection [2,11,13,14,16].
Mathematics 14 01965 g001
Figure 2. An example of constructing a no-fit polygon (revised after Burke et al. [22] and Rocha [27]).
Figure 2. An example of constructing a no-fit polygon (revised after Burke et al. [22] and Rocha [27]).
Mathematics 14 01965 g002
Figure 3. The main methods of constructing NFP [18,19,20,25,26,27,28,31,32,33,34].
Figure 3. The main methods of constructing NFP [18,19,20,25,26,27,28,31,32,33,34].
Mathematics 14 01965 g003
Figure 4. Some examples of constructing the entrance block between two arbitrary objects.
Figure 4. Some examples of constructing the entrance block between two arbitrary objects.
Mathematics 14 01965 g004
Figure 5. Calculation of E(A, B).
Figure 5. Calculation of E(A, B).
Mathematics 14 01965 g005aMathematics 14 01965 g005b
Figure 6. A simple calculation method for E(A(1), B(1)).
Figure 6. A simple calculation method for E(A(1), B(1)).
Mathematics 14 01965 g006
Figure 7. Broad phase collision detection between two 2D objects is carried out using bounding volume balls. (a) The bounding volume balls (BVA and BVB) of two 2D objects A and B. (b) The positions of BVA and BVB in the earliest possible collision time (T1). (c) The positions of BVA and BVB in the latest possible collision time (T2).
Figure 7. Broad phase collision detection between two 2D objects is carried out using bounding volume balls. (a) The bounding volume balls (BVA and BVB) of two 2D objects A and B. (b) The positions of BVA and BVB in the earliest possible collision time (T1). (c) The positions of BVA and BVB in the latest possible collision time (T2).
Mathematics 14 01965 g007
Figure 8. An example for determining the position relations between a point and a 2D object using the crossings test.
Figure 8. An example for determining the position relations between a point and a 2D object using the crossings test.
Mathematics 14 01965 g008
Figure 9. An example for determining the position relations between a point and a 2D object using angle summation.
Figure 9. An example for determining the position relations between a point and a 2D object using angle summation.
Mathematics 14 01965 g009
Figure 10. An example shows that ‘A and B collide at some vertexes’ is equivalent to ‘some E(A(0), B(2)) or E(A(2), B(0)) contain the reference point a0’.
Figure 10. An example shows that ‘A and B collide at some vertexes’ is equivalent to ‘some E(A(0), B(2)) or E(A(2), B(0)) contain the reference point a0’.
Mathematics 14 01965 g010
Figure 11. The positions and velocities of the two concave objects with 12 edges in case 1.
Figure 11. The positions and velocities of the two concave objects with 12 edges in case 1.
Mathematics 14 01965 g011
Figure 12. The collision position between the two concave objects with 12 edges in case 1.
Figure 12. The collision position between the two concave objects with 12 edges in case 1.
Mathematics 14 01965 g012
Figure 13. The positions and velocities of the two concave objects with 96 edges in case 2.
Figure 13. The positions and velocities of the two concave objects with 96 edges in case 2.
Mathematics 14 01965 g013
Figure 14. The collision position between the two concave objects with 96 edges in case 2.
Figure 14. The collision position between the two concave objects with 96 edges in case 2.
Mathematics 14 01965 g014
Figure 15. Collision detection between two robots. (a) Collision experimental photos of the two robots [42]. (b) Simplified collision model of Bernabeu et al. [44]. (c) The collision detection result of Bernabeu et al. [42]. (d) The collision detection result of our method.
Figure 15. Collision detection between two robots. (a) Collision experimental photos of the two robots [42]. (b) Simplified collision model of Bernabeu et al. [44]. (c) The collision detection result of Bernabeu et al. [42]. (d) The collision detection result of our method.
Mathematics 14 01965 g015
Figure 16. Two examples that two objects have contact but no collision.
Figure 16. Two examples that two objects have contact but no collision.
Mathematics 14 01965 g016
Figure 17. An example that two objects that come into a collision with pressure and no friction.
Figure 17. An example that two objects that come into a collision with pressure and no friction.
Mathematics 14 01965 g017
Figure 18. A example of the construction of ∂E(A, B) and the comparison between ∂E(A, B) and NFP.
Figure 18. A example of the construction of ∂E(A, B) and the comparison between ∂E(A, B) and NFP.
Mathematics 14 01965 g018
Table 1. Related mathematical symbols about the entrance block in Contact Theory.
Table 1. Related mathematical symbols about the entrance block in Contact Theory.
SymbolsMeaning
AAn arbitrary object
BAnother arbitrary object
a0The reference point of A(a0 may not belong to A)
E(A, B)Entrance block of A to B
E(A, B)The boundary of the entrance block of A to B
E(A(2), B(0)i)Entrance block of A to the ith vertex of B, when A is a 2D object
E(A(0)j, B(2))Entrance block of the jth vertex of A to B, when A is a 2D object
E(A(1)i-j, B(1)k-h)Entrance block of the i-j edge of A to the k-h edge of B
E(A(1)i-j, B(1))Entrance block of the i-j edge of A to all edges of B
A(3)A(3) is a 3D object
B(3)B(3) is a 3D object
A(2)A(2) = A, when A is a 2D object
B(2)B(2) = B, when B is a 2D object
A(1)A(1) is the boundary of A when A is a 2D object
B(1)B(1) is the boundary of B when B is a 2D object
A(0)A(0) is the point set that includes all vertexes of A
B(0)B(0) is the point set that includes all vertexes of B
Union calculation symbol
Table 2. Comparison between the proposed method and existing NFP-related methods.
Table 2. Comparison between the proposed method and existing NFP-related methods.
MethodApplicable Object TypesConcave Polygons and HolesTreatment of RotationComputational Complexity/FeatureMain Limitations
Original Minkowski-sum/GJK-based methodsMainly convex polygonsNot directly applicable to concave polygons or holesRotation can be considered only by repeated updating or samplingEfficient for convex objects; original Minkowski-sum construction is usually O(m + n)Not directly suitable for complex concave polygons
Improved Minkowski-sum methodsConvex and some concave polygonsCan handle concave polygons with extensions; holes depend on implementationUsually not the main focusHigher complexity due to Boolean operations and special treatmentsRobustness and efficiency decrease for complex concavities and holes
Decomposition-based methodsConcave polygons after decompositionApplicable after decomposing concave polygons; holes depend on decomposition strategyUsually not the main focusUsually high complexity due to decomposition, sub-NFP construction, and recombinationEfficiency strongly depends on decomposition quality
Orbital sliding methodsGeneral polygonsApplicable to many concave polygons; holes and narrow concavities require special treatmentUsually not the main focusNo simple fixed complexity; cost depends on iterative sliding steps, contact events, and additional procedures for holes or feasible start positionsMay fail or require extra procedures for narrow concavities, holes, and feasible starting positions
Proposed entrance-block-based methodArbitrary 2D objectsApplicable to convex and concave objects; potentially applicable to objects with holes based on Contact TheoryConsidered by time-discrete updating of object positionsEntrance block construction can be simplified from O(mn) to O(m + n) in this studyCurrent implementation is time-discrete and may suffer from tunneling
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, G.; Wang, J.; Dong, S.; Zhang, R. A Narrow-Phase Collision Detection Algorithm Based on Contact Theory in 2D. Mathematics 2026, 14, 1965. https://doi.org/10.3390/math14111965

AMA Style

Li G, Wang J, Dong S, Zhang R. A Narrow-Phase Collision Detection Algorithm Based on Contact Theory in 2D. Mathematics. 2026; 14(11):1965. https://doi.org/10.3390/math14111965

Chicago/Turabian Style

Li, Gen, Jiongchao Wang, Shihua Dong, and Ruichen Zhang. 2026. "A Narrow-Phase Collision Detection Algorithm Based on Contact Theory in 2D" Mathematics 14, no. 11: 1965. https://doi.org/10.3390/math14111965

APA Style

Li, G., Wang, J., Dong, S., & Zhang, R. (2026). A Narrow-Phase Collision Detection Algorithm Based on Contact Theory in 2D. Mathematics, 14(11), 1965. https://doi.org/10.3390/math14111965

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop