Introduction and problem
description
Given the CAD models of various parts, an assembly sequence and a trajectory followed by the assembled parts for the assembly, it is important to detect any undue collision between the parts. Such collisions could occur due to various reasons such as incorrect trajectories, defective CAD models etc. Since the basic idea is to automatically simulate the real life assembly sequence, collision detection between the complex polyhedral parts is of utmost importance.This project deals with efficient collision detection of polyhedral objects which are CAD models (described as STL files). The second phase of collision handling algorithm might be correct prediction of the dynamics of the object after the collisions, we however are not dealing with this aspect of the problem.
The main aim of the project is to load complex tesselated parts of a Light Combat Aircraft and build a framework to study the proper assembly sequences for these parts. The parts are extremely complex with thousands of surface triangles. To study assembly sequences for these complex parts, it is essential to detect collisions among them robustly.
The brute force method for collision detection is to detect intersections between two triangles. This obviously is going to be extremely computational intensive (the order of complexity being O(nm) where n, m are the number of surface triangles in the models). A better approach is to build a simple approximation of the object and then test for collisions using this approximate model.
Realistic simulation of assembly sequence is of great significance in industry as it much cheaper and efficient than the real world alternative. While designing an assembly model, a number of modifications in the design take place before the actual model is conceptualised. During the design phase it would be convenient if we could test the actual assembly sequence using virtual models and look for 'imperfect fits' and other flaws in the various parts. This will give feedback for redesigning the parts or the assembly sequence. Moreover sometimes it is important to find out the exact instant at which the collision took place. This leads to the concept of time critical collision detection.A further step might be to suggest the appropriate trajectory or the changes that might be needed in the CAD models. Next one could also find out the behaviour of the objects once the collision has taken place. This would require incorporating the material properties of the objects into the CAD models. This however is beyond the scope of this project.
Our motivation in this project is to build a framework in which the assembly sequences for complex polyhedral objects could be studied. We have defined a format in which the user is supposed to give the assembly sequence between two polyhedral objects and the application tries to simulate the sequence in real time and find out the collision (if any) among the models in the execution of the assembly sequence.
![]()
Figure : An example of the LCA part which is used for the assembly sequence.
The problem of Collision Detection has been studied in detail and rich literature is available each of which suggest various methods of apporaching the problem so that the time complexity is reduced and the real time simulation can take place. The basic algorithm for collision detection has a fixed sampling time after which the detection algorithm is run. This does not give the exact time in which the collsion occured and also leads to inaccuracies and inefficiencies. The major deficiency is the absence of a proper representation which would make collision detection simpler.
Hubbard discusses in detail the pitfalls of the basic algorithm.The approaches to rectify the above weaknesses has been the inclusion of another dimension to represent the simulation time. Canny uses numerical techniques to calculate the position and time of collision. Samet and Tamminen apply recursive subdivision to the four dimensions of space and time to finally locate the "cube" in which the collision occurs. These approaches, however, require the prior knowledge of the path taken by the object and are not suitable for interactive applications.
Other algorithms that do not focus on the time aspect are based on the subdivision of 3D space into regions and check for collision between these regions. Further approaches in this category use octrees, which are a hierarchy of grids at different resolutions. Collision detection based on octrees involve a recursive subdivision of the objects and check for collision among the subtrees. This approach essentially avoids unnecessary computation for the whole geometry of the objects and concentrates on the parts that actually suffer collision. The various models which have been proposed to approximate the objects are Sphere hierarchies by Philip M. Hubbard, OBBs (Oriented bounding boxes) by S. Gottschalk et_al, AABs (Axis Aligned Bozes), Octrees etc. All these hierarchial models are very well suited for rejection tests when the objects are far apart. Furthermore, detecting collision among the basic building blocks of these models are very easy to reduce complexity of detecting collisions among them.
Creation of OBBtrees
Initially we had planned to implement the algorithm proposed by Philip M. Hubbard, Brown Univ, in his thesis work. His idea was to recursively subdivide the object using sphere trees. This sphere tree representation would then be used to detect collisions among the models. We, however, found out very soon that full implementation of the algorithm is impossible in a course project due to the complexity involved and we would never be able to carry out the primary motive of studying the LCA parts and testing assembly sequences for them. Furthermore, most of the hierarchial models use bounding boxes or octrees instead of sphere hierarchies. We, therefore, decided to implement the hierarchial model based on OBBs (Oriented Bounding Boxes) mainly because there were a lot of resources available on the web which would help us do the computations involved.[2] describes the idea of Sphere hierarchies for Collision Detection in great detail.
The method that we have used was proposed by S. Gottschalk et_al [1]. The algorithm uses Oriented Bounding Boxes to approximate the model. The issues that come up are :-
Creation of OBBtrees Collision Detection using OBBtrees
Placement of tight fitting OBBs
Follow this link for further insight into the algorithm.
<---
The basic idea used for splitting the bouding box is the following. The longest axis of the bounding box is taken and the box is split along a plane which is orthogonal to one of its axes. The polygons are partitioned depending upon the which side of the plane their center lies in. If such a subdivision is not possible then the second largest axis is taken. Else the shortest one. The 2D analog of the splitting algorithm is shown in the figure below.
The basic requirement here is to calculate the overlap between the two bounding boxes. The Bounding boxes are projected on an axis in space. This is called 'Axial Projection'. The projection of the box on the axis forms an interval. If the intervals of two boxes overlap then further tests need to be done to find out if they actually overlap. Otherwise, one may be assured that the boxes don't overlap. Moreover, it has been proved that any two disjoint convex polyhedras in 3D can always be separated by a plane which is parallel to a face of either polyhedra or parallel to the edge of each polyhedra. This fact coupled with the previous elimination test can be used to find out efficiently if the bounding boxes overlap.
![]()
Figure : L is the separating axis for the OBBs A and B as they become disjoint intervals after projection onto L.
Format of STL files
The STL files have a very specific format and are used by a number of CAD packages to save the models. The STL file format is based on the representation of an object using triangles in 3D. The following is a link to the html file which explains the STL file format in detail : stl_fmt.html
Assembly Sequence
The application we have built has the capability of loading multiple STL files and then running an assembly sequence on all of them. The format of the assembly sequence has been kept with the source code too. The assembly sequence is provided using a simple representation in which the user will have to enter the amount of translation in each frame. The user can also specify rotation about one of the three major axes. Initially we had kept the option of rotating around any arbitrary axis, but since specifying the rotations in that manner aren't extremely intuitive to the user, we have kept the rotation axes as the major axes.
Back to ContentsThe Generator program
To do OBB based collision detection, its best to have the position of the objects in the world with respect to an origin denoted by the rotation and translation matrices from the initial placement in the world. Hence the assembly sequence which is an input to the program is best specified by the transformation of the models from the initial world coordinates. However, it is difficult for the user to specify the matrices himself. The best way in which the user can specify the sequence is by giving relative transformation about the last step in the sequence in a simple, intuitive format. Hence we have written a generator program which takes as input the user specified assembly sequence and outputs the matrix transformations for the steps specified in the sequence. The format of the input and the output files is specified in the following section.
Input, Output and Results
InputOutput
- The CAD models (in STL format) which are involved in the assembly sequence are input to the system
- The assembly sequence in the format specified
- The matrix file generated by the generator. It takes the relative translations which the user specifies and generates matrices relative the original position in the world.
Results
- The collided parts of the models are rendered in red.
The following are some of the result images which we obtained by taking a screen dump of the application.
- The program is efficient and can be run in real time with a fast display card. The major reason for this is the use of efficient algorithms for solving the sub problems involved.
- The results obtained are satisfactory. For very complex non-convex polyhedra, the program gives erratic results at times.
Figure : The figures show the collision detection among the parts while they were undergoing assembly
![]()
Figure : Four parts undergoing assembly simultaneously and there is collision between the 2nd and the third part
Back to ContentsLinks to Resources: