+ All Categories
Home > Documents > Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 ·...

Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 ·...

Date post: 16-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
54
Department of Physics April 21, 2015 Collision detection using boundary representation, BREP Master Thesis Jonas Sandqvist [email protected] Master Thesis Project Supervisor: Michael Brandl Examiner: Martin Servin
Transcript
Page 1: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

Department of PhysicsApril 21, 2015

Collision detection using boundaryrepresentation, BREP

Master ThesisJonas Sandqvist

[email protected]

Master Thesis ProjectSupervisor: Michael BrandlExaminer: Martin Servin

Page 2: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

I

Master Thesis - Collision detection using BREP

Page 3: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

II

AbstractThis thesis treats how to generate collision information for multibody simulations in AgX Dynamicswhere the geometries are described with the data structure boundary representation, BREP. BREP is adata structure that contains the exact mathematical description of each individual surface. To describecomplex surfaces exact and efficient non uniform rational basis spline, NURBS, is used and for trivialsurfaces like planes or spheres simpler equations is used. Since all surfaces in a BREP is described veryaccurate, the accuracy for the collision information can be set high without affecting the amount of dataneeded to describe the geometries.

To make AgX Dynamics able to calculate forces in a multibody simulation, collision informationabout were and how much two geometries are intersecting is required. The collision information containswere the overlap between two geometries is, how much the objects have penetrated each other and thedirection for which the objects have to separate. To find the penetration depth and the overlap theNewton Raphson method were used. The experiments conducted, showed that it is possible to useBREPs as a description of geometries to produce the collision information needed for the physics engineused by AgX Dynamics to handle collisions. A comparison between trimesh and BREP for producingthe collision information, shows that data usage is much lower for the representation of geometries withBREPs than trimesh. The results also shows that the accuracy can be significantly higher than fortrimesh as the data usage for trimesh becomes non practical to handle when the required accuracy ishigh. With the high accuracy and with the smooth surfaces used with the BREP the artificial friction isalmost negligible except for cases were intersection points could not be found all around the intersectioncurves due to limitations in the algorithm.

Master Thesis - Collision detection using BREP

Page 4: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

III

Master Thesis - Collision detection using BREP

Page 5: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

IV

SammanfattningDetta examensarbete behandlar hur man skapar kollisionsinformation för flerkropps simuleringar i AgXDynamics där geometrier beskrivs med datastrukturen boundary representation, BREP. BREP är endatastruktur som innehåller den exakta matematiska beskrivningen för varje enskild yta. Att beskrivakomplexa ytor exakta och effektivt med non uniform rationell basis spline, NURBS, används och förtriviala ytor som plan eller sfärer kan enklare ekvationer används. Eftersom alla ytor i en BREP beskrivsexakt, kan noggrannheten för kollisions informationen sättas högt utan att påverka den mängd data sombehövs för att beskriva geometrier.

För att göra AgX Dynamics kunna beräkna krafter i en flerkroppssimulering, krävs kollisions in-formation om var och hur mycket två geometrier kolliderar. Kollisions informationen innehåller varöverlappningen mellan två geometrier är, hur mycket objekten har penetrerat varandra och den riktningsom föremålen ska separeras. För att hitta penetrationsdjup och överlapp användes Newton Raphsonsmetod. De experiment som utförts, visade att det är möjligt att använda BREPs som en beskrivning avgeometrier för att producera kollisions information som behövs för att den fysikmotor som används avAGX Dynamics ska kunna hantera kollisioner. En jämförelse mellan trimesh och BREP för att producerakollisionen informationen, visar att dataanvändning är mycket lägre när geometrier representeras medBREPs än trimesh. Resultaten visar också att noggrannheten kan vara väsentligt högre för BREP änför trimesh eftersom dataanvändning för trimesh blir opraktiskt att hantera när noggrannheten är hög.Med hög noggrannhet och med de släta ytor som används med BREP blev den artificiella friction nästanförsumbar, utom i fallen där skärningspunkter inte kunde hittas runt hela skärningskurvor på grund avbegränsningar i algoritmen.

Master Thesis - Collision detection using BREP

Page 6: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

V

Master Thesis - Collision detection using BREP

Page 7: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

List of Figures VI

List of Figures1 A circle tessellated to a linear mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 False positives for tessellation of the dashed and dotted curves . . . . . . . . . . . . . . . 73 False negatives for tessellation of the dashed and dotted curves . . . . . . . . . . . . . . . 74 BREP structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 pyramid with four surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 One face of a pyramid with trimming curves . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Surface to parametric face for a BREP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Illustration of forces acting on a rotating disk . . . . . . . . . . . . . . . . . . . . . . . . . 149 Illustration of vectors used for minimization . . . . . . . . . . . . . . . . . . . . . . . . . 1710 Approximation of planes from two intersecting patches . . . . . . . . . . . . . . . . . . . . 1811 Scheme of how the BREP-BREP collider fits into AgX Dynamics . . . . . . . . . . . . . . 2212 A table with a fragment of the colliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2313 Curve separated into Axis Aliened Bounding Boxes . . . . . . . . . . . . . . . . . . . . . . 2314 Axis Aliened Bounding Boxes structured in a binary tree . . . . . . . . . . . . . . . . . . 2415 Intersection for two parallel toruses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2816 Intersection for two orthogonal toruses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2817 Intersection for two cylinders over one trimming curve. . . . . . . . . . . . . . . . . . . . . 2818 Intersection for two cylinders over two trimming curves. . . . . . . . . . . . . . . . . . . . 2819 Intersection for two Cylinders with sphere edges. . . . . . . . . . . . . . . . . . . . . . . . 2920 Intersection for two Cylinders with sphere edges. . . . . . . . . . . . . . . . . . . . . . . . 2921 setup for a cylinder in a cylinder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2922 Intersection for a cylinder in a cylinder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2923 Intersection at cube edge. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3024 Intersection at cube vertex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3025 Depth for two torus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3026 Depth for two torus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3027 Two depth found between two torus with one torus tilted . . . . . . . . . . . . . . . . . . 3128 No depth found between two torus with one torus tilted . . . . . . . . . . . . . . . . . . . 3129 Depth for two Cylinders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3130 Depth not found for two Cylinders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3131 Plot of the iterations required to find intersection points for different geometries . . . . . 3232 Setup to derive applied torque . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3433 Plot of torque applied to maintain constant velocity . . . . . . . . . . . . . . . . . . . . . 3534 A circle trimmed by an ellipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Master Thesis - Collision detection using BREP

Page 8: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

List of Figures VII

Master Thesis - Collision detection using BREP

Page 9: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

Contents 1

Contents1 Introduction 2

1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Delimitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4 Previous work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.4.1 Trimming curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4.2 Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4.3 Penetration depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4.4 Previous work by Algoryx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Description 62.1 Solid modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Multibody Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 AgX Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4 Collision Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Theory 83.1 BREPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83.2 Parametrization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.3 NURBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.3.1 Rational Bézier Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3.2 Basis spline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3.3 NURBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.4 Newton-Raphson method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.4.1 One dimensional minimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.4.2 n dimensional minimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.4.3 Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.5 Torque for rotating disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4 Method 164.1 Middle phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.2 Trim control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.3 Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.4 Separation direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.5 Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5 Implementation 225.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225.2 Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235.3 Trimming curve detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245.4 Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245.5 Normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.6 Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

6 Results 286.1 Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286.2 Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306.3 Computational performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

6.3.1 Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326.3.2 Computational time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336.3.3 Data usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

6.4 Friction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

7 Discussion 36

Master Thesis - Collision detection using BREP

Page 10: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

Contents 2

Appendix A 40

Appendix B 41

Appendix C 42

References 44

Master Thesis - Collision detection using BREP

Page 11: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

1 Introduction 3

1 Introduction1.1 BackgroundDevelopment of products using solid modelling software is a key component to produce products of highquality. With a solid modelling software a designer can get a virtual preview of a product and testthe functionality of the product virtually. With knowledge from the virtual test changes to the designcan be made to improve the product. As products can be tested virtually before production the costto develop a new product can be significantly reduced, provided that the product testing is made withsufficient precision, if all imperfections of the product can be detected and corrected before production.SpaceClaim is a solid modelling software used to design and test products. When the product is designedin SpaceClaim the product can be tested through the add-on Dynamics for SpaceClaim. Dynamics forSpaceClaim is used to simulate multibody systems.

In multibody dynamics a physics engine relies on collision detection algorithms to be able to calculatethe collision information, which in this thesis refers to where two objects are intersecting, how deep thetwo objects have penetrated each other and the direction in which the objects should be separated.One way of describing complex geometries is to use the mathematical smooth surface which the objectsinherent from construction. Another way of describing an object, currently used by Algoryx, is totessellate the surface into a triangular mesh, figure 1. With a tessellated surface the collision informationwill contain false positives as seen in figure 2 as a contact generated were there should not be a contact.There will also be false negatives generated as seen in figure 3 as a missed contact were there should bea contact. One effect of false positives and negatives is artificial friction. Artificial friction of a meshedsurface can be reduced, but not eliminated, with increased tessellation. With increased tessellationthe size of the triangle elements is reduced and the amount of data needed to represent a surface isincreased. To eliminate artificial friction the original mathematical smooth surface has to be used.The mathematical smooth surface can be used if one uses non uniform rational basis spline, NURBS,surfaces in the data structure boundary representation, BREP. Another benefit of using BREP insteadof tessellated surfaces is that BREP is used by the CAD program SpaceClaim as the representation for asolid. Since SpaceClaim stores objects as BREPS the contact information needed in the physics engineAgX, used in the add-on Dynamics for SpaceClaim, can be found without the operation of tessellatingthe objects. Using BREPs it is also possible to select the precision for the contact information to godown to machine precision without increasing the data storage for the surface.

Figure 1: A circle tessellated to a linear mesh

Master Thesis - Collision detection using BREP

Page 12: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

1 Introduction 4

1.2 AimThe aim with this master thesis is to create contact information with high precision using BREPS inmultibody simulations that reduces artificial friction compared to existing method of creating contactinformation. The first part of the contact information should contain if and where two objects areintersecting. The second part of the contact information should contain the direction for which theobjects should be separated to make the movement of the objects as small as possible to separate theobjects. The third part of the contact information should contain how deep the penetration of the objectsis in the direction of separation.

1.3 DelimitationsThe collision detection algorithm for BREPs is restricted to handle surfaces represented by trimmedNURBS surfaces. Since NURBS surfaces can adopt any shape, any type of geometry is still supportedfor the BREP. As a NURBS curve can have an arbitrary high degree this thesis restricts the solutionto handle NURBS curves of no higher degree than two and the depth finding algorithm is restricted toonly handle surfaces of degree two. The restriction to NURBS curve will also affect NURBS surfacessince they are spanned up by two NURBS curves. The collision detection algorithm is restricted to onlyhandle one intersection between two objects.

1.4 Previous work1.4.1 Trimming curves

To test if a point is inside of trimming curves Östman [20] implemented a shooting ray algorithm todetermine the number of trimming curve intersected by the ray. With an odd number of intersectedtrimming curves the point was considered to lie inside of the trimming curves. If one wants to knowwhere the trimming curve is crossed a more suitable algorithm is suggested by Cohen, Fish, Martin andShirley [3] where as the trimming curves are arranged in bounding boxes and a ray could be shoot inany direction to give a position where the ray intersects the trimming curve.

1.4.2 Intersection

Huang and Zhu [15] derived an algorithm to find an intersection curve between two surfaces by firstfinding one intersection point on an intersection curve. To create an approximation of the intersectioncurve Huang and Zhu used a similar algorithm as Patrikalakis, Maekawa, Ko and Mukundan [14]. Thealgorithm was to use the face normal vectors of both surfaces to find the direction for which the nextintersection point could be found.

Another method of finding the intersection between two objects was derived by Teixeira and Creus[5]. Their method to find the intersection consisted in using a simplification the geometries as boxes. Theboxes where subdivided until the curvature of the intersection had small enough tolerance. Poutrain andConstensin [4] had a similar approach as Teixeira and Creus. Because they were limited to polyhedronstheir bounding boxes could be constructed in a more efficient way.

1.4.3 Penetration depth

Fisher and Lin [11] and Edelsbrunner [8] investigated how one can find extreme distances between twoparametric surfaces, such as NURBS, meshed using polygons. With accuracy and data use for bothalgorithms depending the meshed deviation tolerance the performance will decrease with high demandson accuracy. A simplified distance calculation was derived by Dyllong and Luther [6] by finding theshortest distance from a point to a NURBS surface. The method to find the shortest distance weredivide and conquer as they first calculated the distance for three points. In the section where theshortest point was found divided into two smaller sections until the given tolerance was reached. Asnone of the mentioned algorithms is able to find the depth between two parametric surfaces explicitlywithout tessellation, additional work is needed to be able calculate the penetration depth between twoBREPs.

Master Thesis - Collision detection using BREP

Page 13: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

1 Introduction 5

1.4.4 Previous work by Algoryx

Häggström [13] proposed a collision finding algorithm between two NURBS surfaces using the NewtonRaphson method. Häggström made it possible to find collision of a NURBS surfaces with a line, plane,and a sphere. Östman [20] continued Häggströms work by using trimmed NURBS surfaces in a BREPand made it possible to find collisions of a BREP with a line, plane and a sphere. The result fromÖstman’s thesis showed that the artificial friction is significantly smaller and the performance usingBREPS is better than for meshed surfaces if there is a small tolerance on the smoothness of a surface.

Master Thesis - Collision detection using BREP

Page 14: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

1 Introduction 6

Master Thesis - Collision detection using BREP

Page 15: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

2 Description 7

2 Description2.1 Solid modellingSolid modelling can be seen to contain three different stages. In the first stage the geometry is createdwith a computer aided design, CAD, software. With a CAD software one can sketch and visualize 3Dobjects. In the second stage of solid modelling the 3D object is tested virtually using a computer aidedengineering, CAE, software [29]. With a CAE software it is possible to test the physics of an object.Physics that can be tested is fluid dynamics, stress analysis or see the behaviour for for multibodysimulations. With information from a CAE software the produced can be improved by altering parts ofthe geometry that did not work as intended. The final step in the solid modelling process uses computeraided manufacturing , CAM, to transform the information from the CAD model to information that aCNC controlled machine, like a lathe or milling, require to manufacture the product [28]. A productcan also be manufactured by using a 3D printer which is a growing segment in CAM. One reason whymanufacturing using 3D printing is growing is because a 3D printer can create shapes that a lathe ormilling never can create.

One branch in solid modelling is geometrical modelling. In geometrical modelling objects are usuallyconstructed by primitive geometries added or subtracted by logical operations, called Constructive SolidGeometry, CSG. Another branch in solid modelling is surface modelling where each individual surfaceis modelled rather than using whole geometries. The dominating surface modelling representation isBREP, which is a data structure that handles the surfaces in a geometry individually. As BREP handlesthe surfaces individually, each surface can have different complexity. Surfaces with low complexity canbe described with some primitive surface representation while surfaces with high complexity may notbe described with a primitive surface. The surfaces are connected through their edges which can havearbitrary complexity. The edge where surfaces are connected has to be the same edge for both surfaces.One way of describing a surface or a curve with high complexity is to use NURBS. Due to BREPs’flexibility and together with fast and stable algorithms, BREPs have taken over from CSG as the mostfrequently used geometrical representation in solid modelling. [18, 19]

2.2 Multibody SimulationMultibody simulation is a method of simulating systems composed by multiple rigid, elastic or plasticbodies numerically. The simulation can be kinematic or dynamic, or it can be a mix of both. In akinematic simulation of a multibody system the bodies interact without mass or global forces, like gravity,are considered. For a simulation of a multibody system the laws from classical mechanics determine theforces acting on the bodies. [7, 10, 1]

2.3 AgX DynamicsAgX Dynamics [23] is a simulation tool used in the add-on Dynamics for SpaceClaim to simulate multi-body systems. AgX Dynamics is a high performance simulation tool for multibody systems as thesimulations is done with high speed and at the same time with high precision and accuracy. Due to theability to solve kinematic and dynamic systems with high speed makes AgX Dynamics a powerful toolwhen simulating rigid bodies in real time. AgX Dynamics can also be used off line to solve big systems,like granular, with high accuracy and precision. Other types of system that can be simulated using AgXDynamics are vehicles, cranes and ships.

Master Thesis - Collision detection using BREP

Page 16: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

2 Description 8

2.4 Collision DetectionThe goal with collision detection is to create contact information from colliding geometries to be usedby the physics engine. To reduce the need of heavy calculations when no solution can be found collisiondetection is separated into different phases [7], the first phase of collision detection called "broad phase"determines which objects are potentially colliding. One way to determine if two objects have a possibilityof colliding is to put the objects in a simple geometry, like a box. To determine if two boxes are intersectingthe algorithm sweep and prune [24] can be used. Sweep and prune sorts all boxes from its boundaries,the boxes have to have the same orientation. If the boundaries are intersecting in all dimensions thecolliding pair of objects are kept to the second phase. The second phase, called middle phase, is morespecific to the geometry and finds out which part of the geometry that might be in collision. The thirdphase, called narrow phase, uses the real surface, or the tessellated surface, of the object to find theintersection, if it exists, and the penetration depth. The narrow phase is the most essential part of thecollision detection. It is in the narrow phase that the contact information is found and passed on to thesolver.

The accuracy of the collision detection depends on the purpose with the collision detection. Whenspeed is the main priority, the collision detection may be simplified which will reduce the accuracy of thecontact information. In physics simulation the collision detection accuracy is of high priority since anerror in a contact point can make the simulation behave non-physically. The collision detection algorithmalso has to find an accurate penetration depth between two objects to make the physics engine able tocalculate the forces needed to separate the object in a proper way, making the narrow phase essential incollision detection for physics simulations.

The method used today by AgX to solve for complex geometries is by tessellating the complex surfacesinto meshed surfaces. A meshed surface is an approximation of the real surface as the surface is dividedinto triangular sections. With a meshed surface, contacts are fast and easily detected. The problem withthe approach based on tessellation is that contact points can be found when there are none as seen infigure 2. A contact can also be missed as seen in figure 3.

Figure 2: False positives for tessellation of the dashed anddotted curves

Figure 3: False negatives for tessellation of the dashed anddotted curves

Since contact points can be missed when there is a contact or a contact can be detected when there is none,the solver will not be able to handle the collision properly. One thing that will occur when two tessellatedsurfaces glide against each other is artificial friction. To minimize friction from false intersections thetessellation of the surfaces have to be increased. As the tessellation increases the amount of data neededto store the object will increase. The computational time will also increase due to more elements tocalculate intersection of. To make sure that no contact information is lost, the mathematical descriptiongiven for the solid can be used directly. One way of using the mathematical description is to use BREPas the representation for the solid.

Master Thesis - Collision detection using BREP

Page 17: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 9

3 Theory3.1 BREPSBREP [18, 19] is a data structure which consists of two main parts [21], geometry and topology. Ingeometry the information about Euclidian space can be found in form of surface, curve and points. Inthe topology the parametric form of surface, curve and points can be found as face, edge and vertex. Anoverview for the BREP structure [22] can be found in figure 4. How the surface is transformed to a faceis illustrated in figure 7.

Figure 4: BREP structure[19]

The 3D space contains the surfaces that construct the solid. Each surface is projected onto a 2Drectangular region called parametric space. As the rectangle is large, the whole surface can be projectedonto it and there will exist regions in parametric space which lie outside of the surface. The boundariesbetween the regions where the surface exists and where the surface does not exist are called trimmingcurves. An example of a BREP with four surfaces is the pyramid, figure 5. Each triangular surface of thepyramid is stored in the rectangular parametric space called face, figure 6. The part of the face wherethe triangular surface exists is limited by the trimming curves.

Figure 5: pyramid with four surfaces

An advantage of using BREPS instead of CSG is that each individual surface in a BREP can have its ownparametric equations. A complex surface can be transformed to parametric space using NURBS whilea plane or a sphere can have simpler transforms and hence needs less data. For the CSG representation

Master Thesis - Collision detection using BREP

Page 18: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 10

Figure 6: One face of a pyramid with trimming curves

of a geometry, a complex surface needs many geometries added and subtracted to get all details of thesurface which makes it non practical to use when one wants to model complex geometries.

Master Thesis - Collision detection using BREP

Page 19: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 11

3.2 ParametrizationIn the topology part of the BREP, figure 4, faces and edges are in parametric form. Figure 7 illustratesa surface that is transformed into a face with its corresponding 2-dimensional parametric space. In thesame manner any 2-dimensional curve can be parametrized to only depend on one variable.

Figure 7: Surface to parametric face for a BREP[22]

For instance the unit circle in Cartesian coordinates [25]

x2 + y2 = 1 (3.1)

is a 2-dimensional curve which can be shown to be parametrized for any points on the circle with thepolynomials

x = 1− t2

1 + t2(3.2)

y = 2t1 + t2

(3.3)

except for the point (−1, 0) which is the limit when t goes to ±∞. Another way to parametrize acurve is to use NURBS. To buckle up a 2-dimensional parametric face one can use two one dimensionalparametric curves.

Master Thesis - Collision detection using BREP

Page 20: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 12

3.3 NURBSNon Uniform Rational B-Spline, NURBS, is a generalization of B-splines which in its turn a generalizationof Bézier curves. NURBS make it possible to describe any geometric shape and NURBS remain invariantunder common geometric transformations [17]. A NURBS can easily be modified to represent anygeometric shape and with fast and stable algorithms for evaluation of points on a surface or a curve [18],NURBS have become very popular to use in CAD and in solid modelling to represent complex surfacesand curves.

3.3.1 Rational Bézier Curve

A Bézier curve is defined by the polynomial

C(u) =n∑

i=0Bi,n(u)Pi (3.4)

where Pi are points in space and Bi,n are nth-degree Bernstein polynomials.

Bi,n(u) = n!i!(n− i)!u

i(1− u)(n−i) (3.5)

One disadvantage of representing a curve with a polynomial coordinate function is that a circle, ellipses,hyperbolas, cylinders, cones, spheres, etc. cannot be represented precisely unless the Bézier curve isdivided by the sum of the polynomial of the Bézier curve as

C(u) =

n∑i=0

Bi,n(u)Pi

n∑j=0

Bj,n(u)(3.6)

which can be rewritten as

C(u) =n∑

i=0Ri,n(u)Pi (3.7)

whereRi,n(u) = Bi,n(u)

n∑j=0

Bj,n(u)(3.8)

3.3.2 Basis spline

The basis spline, B-spline, is constructed by making the Bernstein polynomials non zero around a controlpoint and zero otherwise

Ni,0(u) ={

1 ui 6 u < ui + 10 otherwise (3.9)

Ni,p(u) = u− ui

ui+p − uiNi,p−1(u) + ui+p+1 − u

ui+p+1 − ui+1Ni+1,p−1(u) (3.10)

where ui are knots from the knots vector U where ui 6 ui+1 which implies that the definition of aB-spline is

C(u) =n∑

i=0Ni,p(u)Pi (3.11)

The B-spline C(u) is rational if the piecewise non zero basis function, equation (3.10), is made rational.With a rational basis function equation (3.11) can be rewritten as

C(u) =n∑

i=0Ri,p(u)Pi (3.12)

Master Thesis - Collision detection using BREP

Page 21: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 13

whereRi,p(u) = Ni,p(u)

n∑j=0

Nj,p(u)(3.13)

3.3.3 NURBS

NURBS is a B-Spline with more degrees of freedom in the construction of a curve. A B-spline becomesNon Uniform if weights for the polynomials at each control point are added to equation (3.12) as

C(u) =n∑

i=0

Ni,p(u)win∑

j=0Nj,p(u)wj

Pi (3.14)

equation (3.14) could be rewritten as

C(u) =n∑

i=0Ri,p(u)Pi (3.15)

whereRi,p(u) = Ni,p(u)wi

n∑j=0

Nj,p(u)wj

(3.16)

Pi are the control points and w are the weights. With modifications to the weights and the positions ofthe control points it is possible to modify a NURBS curve to adopt any shape.

3.4 Newton-Raphson methodNewton Raphson is a method for finding roots of a function. It can also be used for finding extremevalues of a function by finding roots of the derivative. [16]

3.4.1 One dimensional minimization

A function f(x+ ∆x) can be Taylor expanded around x to first order as

f(x+ ∆x) ≈ f(x) + f ′(x)(x+ ∆x− x) (3.17)

where f ′(x) is the derivative of function f at x. To make equation (3.17) discreet, x could be seen as thecurrent value of the argument and x+ ∆x could be seen as the next value for the argument. x could bechanged to xn and x+ ∆x could be changed to xn+1. Equation (3.17) will take the form

f(xn+1) ≈ f(xn) + f ′(xn)(xn+1 − xn) (3.18)

With the Newton Raphson method one looking for a solution to f(xn+1) = 0 which result in thatequation (3.18) will change to

0 ≈ f(xn) + f ′(xn)(xn+1 − xn) (3.19)

with some rewriting equation (3.19) takes the form

xn+1 = xn −f(xn)f ′(xn) (3.20)

Master Thesis - Collision detection using BREP

Page 22: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 14

3.4.2 n dimensional minimization

Let vector f contain m functions asf =

[f1, f2, · · · , fm

](3.21)

To minimize a f , equation (3.20) transforms to

xi+1 = xi − J(xi)−1f(xi) (3.22)

If f depends on n variables the Jacobian, J, is a m · n sized matrix as

J ≡

∂f1

∂x1· · · ∂f1

∂xn...

. . ....

∂fm

∂x1· · · ∂fm

∂xn

(3.23)

3.4.3 Convergence

The convergence rate of the Newton Raphson method is quadratic for non linear equations under fa-vorable conditions. The convergence rate is only valid if the true Jacobian matrix, or a very goodapproximation of the Jacobian matrix is chosen. The Newton Raphson method is not always guaranteedto converge at all, for instance the quadratic function may start to cycle around its root value if theguess of starting point is done badly. The Newton Raphson method can also start to oscillate for rationalfunctions [27]. Since NURBS per definition is a rational function there is a risk of not reaching a solutionwith the Newton Raphson method. To avoid getting stuck in an infinitive loop around a solution one canuse the Armijo rule, were a maximum step length is defined and reduced when the root value is passed.[12]

Master Thesis - Collision detection using BREP

Page 23: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 15

3.5 Torque for rotating disk

Figure 8: Illustration of forces acting on a rotating disk

In figure 8 the forces acting on a rotating disk which is only allowed to move in the vertical direction isshown. The disk is assumed to rotated with constant angular velocity due to torque applied by a motor.If one assumes that the rotating disk is not moving in the vertical direction implies that the force, FN ,acting at the surface will be equal to the gravitational force acting on the disk as

FN = mg (3.24)

The force applied by the friction, Ff is proportional to the normal force acting at the contact [2] as

Ff = µFN (3.25)

as the forces acting on the disk at the contact of the surfaces are in equilibrium, the force from frictionhas to be equal to the force applied by the motor. The torque is calculated by taking the radius of thecircle times the force

T = rFf (3.26)

by combining the equations (3.24), (3.25) and (3.26) one ends up with an equation for the torque thatthe motor has to apply to maintain constant velocity as

T = rµmg (3.27)

Master Thesis - Collision detection using BREP

Page 24: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

3 Theory 16

Master Thesis - Collision detection using BREP

Page 25: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

4 Method 17

4 Method4.1 Middle phaseThe middle phase is used to determine which parts of a geometry that have a possibility of intersecting.For usage of the middle phase on a geometry to reduce possible areas of the geometry in collision, thegeometry has to be built up of different segments. Since a BREP is constructed by different surfaceseach surface can be treated as a segment and placed in a bounding box. To reduce the possibility ofnot finding the global solution surfaces with high complexity are subdivided into smaller sections. Thesubdivision of the surface occurs at face level as the face is subdivided into smaller square regions calledpatches. From each patch a bounding box is calculated to fit the piece of the surface that is createdfrom the patch. The size of the patches is chosen to be so small that there can only exist one extremevalue within the boundary of the patch [13]. The bounding boxes on both surface level and patch level isarranged in binary trees. The BREP can use the middle phase twice as the BREPs surfaces and patchesare arranged binary trees. The first middle phase determines which of the surfaces in the BREP thathave a possibly intersection with another object as shown in article [20]. The second middle phase takesthe binary threes with the bounding boxes of the patches from the surfaces with possible intersectionand compares the boxes the other object.

Master Thesis - Collision detection using BREP

Page 26: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

4 Method 18

4.2 Trim controlTo test if a point lies outside of a trimming curve, the Newton Raphson method in 1-dimension, equation(3.20), can be used as [20] suggested. As the approach in [20] only searches in one direction the pointcan only be tested if it is inside or outside of the trimming curve. By instead making the search fortrimming curves along the vector from a previous point known to lie inside of the trimming curve to anew point, the coordinate of the intersection of the trimming curve can be found.

Figure 9: Illustration of vectors used for minimization

In figure 9, T is the trimming curve, l is the vector from old parametric coordinates to the new parametriccoordinates, d is a normalized vector orthogonal to l, r is a vector from old parametric coordinates to apoint on the trimming curve and ∂T

∂u is the derivative of a point on the trimming curve. The minimizationfunction, f , is found as

f(u) = d · ‖r(uk)‖ (4.1)

where uk is the parametric coordinate on the trimming curve.

∂f∂uk

= d · ‖ ∂T∂uk‖ (4.2)

The Newton-Raphson step, equation (3.20), in 1-dimension is then

uk+1 = uk −d · ‖r(uk)‖d · ‖ ∂T

∂uk‖

(4.3)

For the case when the denominator in equation (4.3) is zero or close to zero the ratio would go to infinity.With a ratio approaching infinity the change of uk is set to a fraction of the trimming curve length.The case when l cuts the same trimming curve twice is not handled. This could lead to the algorithmlosing track if the new position is on or off the surface. A possible solution might be to investigate thedirection of the trimming curve to insure that one does not intersect the trimming curve from outside ofthe surface.

Master Thesis - Collision detection using BREP

Page 27: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

4 Method 19

4.3 Intersection

Figure 10: Approximation of planes from two intersecting patches

For those patch pairs remaining from middle phase, section 4.1, the narrow phase algorithm to find anintersection derived in article [15] is used. For one patch pair, figure 10, H and G, a point in 3D space isfound from its parametric coordinates, u, v and s, t respectively, defined within the patches. To find theintersection between two patches the Newton Raphson method in n dimensions, equation (3.22), can beused to find the roots. The distance between two points, one from each patch, is found as

r = H(u, v)−G(s, t) (4.4)

Since the vector r only gives rise to three minimization functions and there are four parametric coordi-nates, a fourth function is needed to construct a Jacobian with rank different from zero. One functioncan be found as the distance to a plane that is orthogonal to both surfaces. The normal vectors forpatches H and G can be found as

nh = ∂H∂u× ∂H

∂v(4.5)

ng = ∂G∂s× ∂G

∂t(4.6)

(4.7)

where the orthogonal normal vector, n, to nh and ng, in figure 10 can be found as

n = nh × ng (4.8)

with equation (4.4) and equation (4.8) the minimization function, f , can be found as

f =[

rn·r2

](4.9)

For those cases where nh and ng are parallel a small perturbation is added to both normal vectors, nh

and ng to make n non zero.

J =[

∂r∂u

∂r∂v

∂r∂s

∂r∂t

n · ∂r∂u n · ∂r

∂v 0 0

](4.10)

with the function, f , equation (4.9), and the Jacobian, J, equation (4.10), the iterative step for the

Master Thesis - Collision detection using BREP

Page 28: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

4 Method 20

Newton Raphson method, equation (3.22), is found asuk+1vk+1sk+1tk+1

=

uk

vk

sk

tk

−[[

∂r∂u

∂r∂v

∂r∂s

∂r∂t

n · ∂r∂u n · ∂r

∂v 0 0

]−1 [ rn·r2

]]∣∣∣∣∣u = uk

v = vk

s = sk

t = tk

(4.11)

The cases where n is not defined due to that nh and ng are parallel is handled by giving the vector nh

a small perturbation. Without the perturbation the Jacobian would get rank zero and would hence notbe invertible.

Master Thesis - Collision detection using BREP

Page 29: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

4 Method 21

4.4 Separation directionWhen a intersection curve is found, a plane that best fits the intersection curve is calculated using linearregression [26]. The linear regression takes all points on the intersection and tries to fit a plane with leastamount of deviation of the distance from each point to the plane. The minimization direction is thenfound as the normal of the plane. If a regression plane is found the sign of the minimization directionis calculated by taking all normals from one of the surfaces at all points on the intersection curve andthen set the sign of the normal to best matches the normals from the intersection curve. For case when aplane can not be calculated since the points forms a line the normal is calculated by taking an average ofthe normals of the intersection points. The normals of the intersection points parallel to the calculatedline is neglected. The case when the intersection points is one point nether a plane or a line can becalculated. The minimization direction for the case with one point is chosen to be the difference of thenormals from the surfaces at the intersection point.

Master Thesis - Collision detection using BREP

Page 30: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

4 Method 22

4.5 DepthThe algorithms in article [15] and [14] have the storage data depending on which depth quality onewants to achieve. By instead using the Newton-Raphson method, equation (3.22), the storage datafor the geometry is kept constant since the method uses the original equations for the surfaces duringminimization.Let r(u, v, s, t) be a vector from a point on surface G to a point on surface H. r(u, v, s, t) could be foundas

r(u, v, s, t) = H(u, v)−G(s, t) (4.12)

By realizing that the vector r(u, v, s, t) has to be parallel to the minimization direction, calculated fromthe intersection curve, one gets to the insight that any vector orthogonal to r(u, v, s, t) also has to beorthogonal to the minimization direction. Which gives the first condition for calculating the penetrationdepth. The second condition one could find from the normal vectors of the surfaces as the absolute depthis found when the normal vectors on the surfaces is parallel. The normal vectors are found as

nh = ∂H(u, v)∂u

× ∂H(u, v)∂v

(4.13)

ng = ∂G(s, t)∂s

× ∂G(s, t)∂t

(4.14)

When nh and ng are parallel the cross product of the normal vectors are zero as

nh × ng = 0 (4.15)

which can simplify using equation (4.13) and equation (4.14) and using the same principal as in conditionone leads to

∂H(u, v)∂u

· ng = 0 (4.16)

nh ·∂G(s, t)∂s

= 0 (4.17)

With equation (4.12), (4.16) and equation (4.17) and by stating that d1 and d2 are two orthogonalvectors in the minimization plane, the minimization function will take the form

f =

r · d1

r · d2

∂H∂u · ng

nh · ∂G∂s

(4.18)

The Jacobian can be written as

J =

d1 · ∂H

∂u d1 · ∂H∂v −d1 · ∂G

∂s −d1 · ∂G∂t

d2 · ∂H∂u d2 · ∂H

∂v −d2 · ∂G∂s −d2 · ∂G

∂t

∂2H∂u2 · ng

∂2H∂uv · ng

∂H∂u ·

∂ng

∂s∂H∂u ·

∂ng

∂t

∂nh

∂u ·∂G∂s

∂nh

∂v ·∂G∂s nh · ∂2G

∂s2 nh · ∂2G∂st

(4.19)

Those cases were the Jacobian, J, has rank zero are not handled.

Master Thesis - Collision detection using BREP

Page 31: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

5 Implementation 23

5 Implementation5.1 GeneralThe implementation is done in a C++ and is complementary to AgX already existing colliders. Fewparts from some of the existing colliders is used to create the BREP-BREP collider. In figure 11 anoverview of how the BREP-BREP collider fits into AgX Dynamics is shown. The first thing AgXDynamics does is to load the geometries that goes into the simulation. With all geometries loadedthe geometries are displayed with graphic tools in the library "OpenSceneGraph". As the simulation isstarted AgX Dynamics generates the collision information. As there can be different types of geometriesin the simulation a specific collider is called after the broad phase have found which types of geometriesthat have a possibility of colliding. The collider chosen from the table in figure 12 if the combination ofgeometries exists, otherwise the collision is ignored. If it happens to be two BREPs with a possibility

Figure 11: Scheme of how the BREP-BREP collider fits into AgX Dynamics

of colliding the BREP-BREP collider is chosen as seen in figure 11 the first part that is checked is ifthere exists an intersection. If there is no intersection the collider aborts further investigation. With anintersection, the direction do search for the depth is calculated and then the actual penetration depth iscalculated. With the information from the colliders the simulation is taken a step forward and visualizedwith the graphic tool. After the visualization of the current situation the simulation loop is repeated.

Master Thesis - Collision detection using BREP

Page 32: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

5 Implementation 24

Figure 12: A table with a fragment of the colliders

5.2 LoadingThe algorithm used to load the BREP is the same as the existing algorithm used in the colliders BREP-LINE, BREP-SPHERE and BREP-PLANE. When the BREP is loaded all surfaces are converted toNURBS surfaces to reduce the number of algorithms needed to be implemented to find the intersectionand the depth between two geometries. To create the NURBS-surfaces and NURBS-curves the samealgorithm implemented to handle NURBS is used. For loading the BREP an axis alined bounding boxis created for each surface. The bounding boxes are then placed in a binary three, figure 14, where theparent node contains a bounding box sizable enough to contain both bounding boxes of its children.The same approach was applied to the NURBS surfaces and to the NURBS trimming curves. As aNURBS can be of arbitrary order the NURBS surface and curves were broken into patches to insureglobal convergence, section 3.4.3. The size of each patch could not be greater than that there could onlybe one extreme value within the patch boundaries. The patches were placed in bounding boxes in thesame way as for the BREP. A example of a curve broken up in patches and with the patches placed inaxis alined bounding boxes is seen in figure 13. To order the bounding boxes in a binary tree is seen infigure 14.

Figure 13: Curve separated into Axis Aliened Bounding Boxes

Master Thesis - Collision detection using BREP

Page 33: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

5 Implementation 25

Figure 14: Axis Aliened Bounding Boxes structured in a binary tree

5.3 Trimming curve detectionThe implementation of the algorithm derived in section 4.2 is done in the BREP class to be used in allcolliders of BREP. To calculate the derivative of the trimming curve and to calculate the parametriccoordinates of the face from the trimming curve methods in the library "opennurbs" are used.

TrimmingCurveDetection(PointOne, PointTwo, BrepSurface)for all trimming curves on BrepSurface do

Run the Newton Raphson method to test if trimming curve has a point closer to the pathbetween PointOne and PointTwo than given tolerance

end forif odd number of trimming curves are close the path between PointOne and PointTwo doset PointTwo == point on trimming curve closest to PointOnereturn

elsereturn

end ifend

5.4 IntersectionThe intersection algorithm was implemented in the BREP-BREP collider. The first step of the inter-section algorithm was the reduction of possible area of the surfaces with possibility of intersecting. Thereduction of surfaces of the BREPs where done by using an existing algorithm to compare binary threes.The binary trees used to reduce the number of possible intersecting surfaces was the binary tree withbounding boxes of the surfaces, section 4.1. With reduced number of surfaces the next step taken was toreduce the number of patch pairs with possible intersection. The reduced number of patches were foundwith the same method as for the surfaces by comparing the binary trees with bounding boxes for thepatches. After comparison of the binary trees only patch pairs with possible intersection are kept to thenarrow phase.Implementation of the narrow phase algorithm follows the method derived in section 4.3.FindIntersection(BrepOne, BrepTwo)find possible colliding bounding box of the surfaces between BrepOne and BrepTwofor each colliding surface pair dofind possible collide bounding box of the patches from the surfacesfor each colliding patch pair doSelect PointOne and PointTwo in middle of their patchif the iteration == 2 doif even number of trimming curves crossedin the direction from OldPointOne to NewPointOne doselect new start point for surface one between closest two trimming curves

Master Thesis - Collision detection using BREP

Page 34: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

5 Implementation 26

end ifend ifif the iteration == 2 doif even number of trimming curves crossed in the direction from OldPointTwo toNewPointTwo doselect new start point for surface two between closest two trimming curves

end ifend ifloop until distance between the points on the patches is smaller than given tolerance.

Find NewPointOne and NewPointTwo the Newton Raphson method starting fromOldPointOne and OldPointTwoTrimmingCurveDetection(OldPointOne, NewPointOne, BrepOneSurface)TrimmingCurveDetection(OldPointTwo, NewPointTwo, BrepTwoSurface)OldPointOne = NewPointOneOldPointTwo = NewPointTwo

end loopend for

end forend

5.5 NormalThe calculation of the minimization plane, from where the direction to find depth is found, uses a prebuilt method in AgX called RegressionPlane. RegressionPlane uses the least square method to calculatethe plane with the least amount of deviation from the intersection points. If a plane can not be created,as in the case of where the intersection points create a line or there is only one point the normal directionneeds additional calculations. The case where the intersection points forms a line, the normal is calculatedby taking an average of the normals at all intersection points on the line. The normals parallel to theline were neglected. If all normal at the intersection point for both surfaces intersecting are parallel nonormal direction can be chosen. The case were only one intersection point is found the normal from oneof the surfaces were subtracted from the other normal of the other surface. This method works if bothsurface normals are pointing in almost the correct direction but if one of the normals, or both of them inreality is orthogonal to the wanted minimization direction the minimization direction will not be correct.

FindNormal(BrepOne, BrepTwo, IntersectionPoints)get RegressionPlane of IntersectionPointsset normal1 = sum of normals of BrepOne at intersection pointsset normal2 = sum of normals of BrepTwo at intersection pointsif RegressionPlane is a point doset normal of RegressionPlane to normal2 - normal1

else if RegressionPlane is a line doset LineDir = point1-point2set n = normal2-normal1set n = (LineDir cross n) cross LineDirnormalize nset normal of RegressionPlane to n

else if RegressionPlane is a plane doif normal1 is more parallel to plane than normal2 doif normal1 is in same direction as normal of RegressionPlane do

change normal of RegressionPlane to point in opposite directionend if

else if normal2 is in opposite direction as normal of RegressionPlane dochange normal of RegressionPlane to point in opposite direction

end ifend if

end

Master Thesis - Collision detection using BREP

Page 35: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

5 Implementation 27

5.6 DepthThe penetration between two objects is calculated in the normal direction derived from the regressionplane. The method to calculate the depth is derived in section 4.5. For every iteration done by theNewton Raphson method the new parametric coordinates were compared to the trimming curves usingthe implementation in section 5.3. The search for a solution is restricted to the sizes of the surfaces andwill hence stop the search if the edge of a surface is crossed.FindDepth(BrepOne, BrepTwo)for All intersection points doselect PointOne and PointTwo at the intersectionloop until normals of the surfaces are parallel within given tolerance and vector betweenpoints on the surfaces is parallel with the minimization direction do

Improve PointOne and PointTwo with the Newton Raphson methodif TrimmingCurveDetection(OldPointOne, NewPointOne, BrepOneSurface) ORTrimmingCurveDetection(OldPointTwo, NewPointTwo, BrepTwoSurface) dobreak

end ifend loop

end forend

Master Thesis - Collision detection using BREP

Page 36: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

5 Implementation 28

Master Thesis - Collision detection using BREP

Page 37: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 29

6 ResultsThe rendering of the figures in this section are taken from trimesh, the method of calculating intersectionsand depth is from the implemented BREP-BREP collider.

6.1 IntersectionAs all surfaces in the BREP are divided into patches, section 4.1, only one contact point is calculatedper intersecting patch pair. The algorithm used to calculate the intersection is derived in section 4.3. Asseen in the figures 15-24 the intersection algorithm manages to find an intersection for almost all patchpairs both for curved and planar surfaces. The intersection point search manages to find the intersectionbetween two one-surface-geometries seen in figure 15 and figure 16.

Figure 15: Intersection for two parallel toruses. Figure 16: Intersection for two orthogonal toruses.

The intersection between two solid cylinders were also found as seen in figure 17 and figure 18

Figure 17: Intersection for two cylinders over one trimmingcurve.

Figure 18: Intersection for two cylinders over two trimmingcurves.

For the case where a cylinder has a sphere at the edge instead of being flat the intersection was found asseen in figure 19 and in figure 20. At a closer inspection one can see that there are a false intersectionpoints found inside the cylinder. The false intersection points lies on the sphere geometry but is outside

Master Thesis - Collision detection using BREP

Page 38: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 30

of the trimming curve from the cylinder on the sphere. The false intersection occur since the trimmingalgorithm presented in section 4.2 only determines where a trimming curve is crossed and not consideringthe direction of the trimming curve. An algorithm that might be a possible solution to the problem withfalse intersection points is presented in Appendix B. The figure 21 shows the setup for a cylinder in a

Figure 19: Intersection for two Cylinders with sphere edges. Figure 20: Intersection for two Cylinders with sphere edges.

pipe where as the cylinder having a motor with a controller trying to achieve constant angular velocity.The pipe is lying on the cylinder and rotates with the cylinder due to friction. The figure 22 is a snapshotshowing the intersection points for one time step.

Figure 21: setup for a cylinder in a cylinder. Figure 22: Intersection for a cylinder in a cylinder.

The case where two cubes collide can be seen in figure 23 and figure 24. As the cubes only containplanar surfaces there is only one patch per surface and there will hence only be one intersection pointbetween for each surface in collision. The case with two cubes colliding can easily be solved with anexisting collider, but the case with two cubes is still interesting to use since it shows that the intersectionalgorithm works for planar and parallel surfaces.

Master Thesis - Collision detection using BREP

Page 39: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 31

Figure 23: Intersection at cube edge. Figure 24: Intersection at cube vertex.

6.2 DepthThe depth finding algorithm is dependent of the second derivative of the surface and will hence not workfor planar surfaces. For curved surfaces the depth finding algorithm manages to find the correct depthin some cases, figure 29, where there are many depths point found, but they have different normals, themerge of intersection points has failed to merge all of the points lying on the intersection, resulting intoo many intersection curves, where each intersection curve gives rise to its own minimization direction.Results where the whole intersection curve is not merged can be seen in figure 27. As seen in figure 30the depth finding algorithm is not able to find depth when the penetration is too large. The figure 27and figure 28 is the same setup but the torus on top is tilted in the opposite direction for both cases.The depth finding algorithm is able to find the depth for one of the cases but not for the other. Noimplementation for finding the depth for planar surfaces was implemented and hence no results for planarsurfaces are presented. The depth searching algorithm is able to find the depth in the case when the

Figure 25: Depth for two torus Figure 26: Depth for two torus

Master Thesis - Collision detection using BREP

Page 40: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 32

toruses are given a angle as seen in figure 27. For the case when the toruses are given some other angleno depth could be found as seen in figure 28. As the difference between figure 27 and figure 28 is purelyangular related the reason why the depth is missed for one of the cases has to do with the implementationof the depth finding algorithm.

Figure 27: Two depth found between two torus with onetorus tilted

Figure 28: No depth found between two torus with onetorus tilted

The difference between figure 29 and figure 30 are that in figure 30 the cylinders have a deeper penetrationthen the cylinders have in figure 29. One reason for the missed depth at de deep penetration might bethat the Newton Raphson step derived with equation (4.18) and (4.19) is too large, which makes theNewton Raphson method not converge.

Figure 29: Depth for two Cylinders Figure 30: Depth not found for two Cylinders

Master Thesis - Collision detection using BREP

Page 41: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 33

6.3 Computational performance6.3.1 Convergence

As the Newton Raphson method is an iterative method the maximum amount of iterations the NewtonRaphson method is allowed to use will effect the performance. The maximum number of iterations willalso affect the stability of the solution for the Newton Raphson method. If the maximum number ofiterations is set to small, the Newton Raphson method will never find a solution, but if the maximumnumber of iterations is set to high, cases where there is no solution will only slow down the process offinding a solution.

10−8 10−6 10−4 10−2

020406080

100120140160

Accuracy [m]

Iterations

Iterations vs accuracy

CubeCylinderTorus

Figure 31: Plot of the iterations required to find intersection points for different geometries

In figure 31 the amount of iterations required for three types of geometries to be able to detect anintersection between intersecting patches is shown. The test scenes used for deriving the iterations arethe scene with cubes, figure 23, cylinders, figure 29 and two torus, figure 15. According to section 3.4.3the Newton Raphson method should converge quadratically for non linear equations if the Jacobian is thetrue Jacobian of the minimization function. As seen in figure 31 the Newton Raphson method convergeslinearly which suggests that the Jacobian used for calculating the intersection is a bad approximation,section 3.4.3. Closer investigation of the convergence is derived in Appendix C. One could also see thatthe number of iterations needed to solve the intersection for planar surfaces is low for all accuraciestested. For one of the intersection points found for the case with two cubes the convergence rate wasquadratic and for the other two intersection points found the convergence rate was close to quadratic,present in appendix C.

Master Thesis - Collision detection using BREP

Page 42: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 34

6.3.2 Computational time

Table 1: Computational time for BREP and Trimesh at different accuracies

Accuracy [m]

2 · 10−3

2 · 10−4

2 · 10−5

2 · 10−6

2 · 10−7

2 · 10−8

2 · 10−9

Computational time [s]Trimesh0.0180.140.210.96

BREP11152631374248

The test scene used to get data in table 1 is derived from test scene with two torus that have a slightpenetration as seen in figure 15. The number of iterations found in figure 31 for the Torus is used toderive the update time for BREP in table 1. In table 1, the accuracy for trimesh is twice the maximumdeviation from the surface the tessellation is allowed to have since the deviation adds up from bothgeometries. The accuracy for BREP is the maximum distance between two surfaces to consider it asa intersection. To calculate the performance in table 1 the maximum number of iterations for BREPwas set according to the results from the plot in figure 31 for different accuracies. Even with optimumnumber of iteration used for BREP is the performance for trimesh way better.

6.3.3 Data usage

Table 2: Data Usage for BREP and Trimesh at different accuracies

Accuracy [m]

2 · 10−3

2 · 10−4

2 · 10−5

2 · 10−6

2 · 10−7

2 · 10−8

2 · 10−9

Data Usage [kb]Trimesh

4230202001930001880000

BREP637637637637637637637

The data usage is the amount of data for the geometry and for the constraints that come with thegeometry. The performance is derived by taking an average for ten updates with the same setup. Thestorage needed by the trimesh is pervading higher than for the BREP as seen in table 2. The highestdifference of storage data is found for the highest possible accuracy tested with trimesh and the storagedata is almost 3000 times larger for trimesh then for BREP.

Master Thesis - Collision detection using BREP

Page 43: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 35

6.4 FrictionThe setup used to derive the artificial friction was constructed by having two spheres with one of thespheres having a constraint to maintain constant rotational velocity is seen in figure 32. In figure 32 thebottom sphere is static and the top sphere is dynamic with a constraint trying to achieve constant angularvelocity. The rotational axis for the sphere goes through the center of plate. The plate is restricted toonly move vertically to maintain pressure between the spheres. The setup was run for both BREP andfor trimesh.

Figure 32: Setup to derive applied torque

In table 3 quantities required in equation 3.27 to calculate the theoretical torque applied by the constraintto maintain constant velocity. The resulting theoretical threshold torque is shown in the plot in figure33 as black line.

Table 3: Quantities for the setup in figure 32

Value UnitMass 5.5 kg

Radius 0.11 mGravity 9.82 m/s2

Friction 0.42

As one can see in the plot in figure 33 the torque applied by the constraint follows a smooth curve closeto the theoretical value for BREP but not for Trimesh, as one expects since the surface used by theBREP is smooth and the surface used by Trimesh is not. A plausible reason why there are ripples in afew places for BREP is that the patches of on the surfaces are parallel and the patch pairs containingtwo intersection curves. Since only one intersection point will be found for each patch pair, intersectionpoints all around the intersection curve will not be found. The number of intersection curves that canbe found is not restricted due to parallel patches and the the whole intersection curve can be found bycontinue the search around the intersection curve starting from the detected intersection points.

Master Thesis - Collision detection using BREP

Page 44: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

6 Results 36

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

Time [s]

Torque

[Nm

]

Applied torque over time

TrimeshBREP

Theoretical

Figure 33: Plot of torque applied to maintain constant velocity

Master Thesis - Collision detection using BREP

Page 45: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 37

7 DiscussionThe main goal with this thesis was to create an algorithm that allows AgX Dynamics to be able touse BREPs when producing collision information when one wants to reduce artificial friction. Althoughthe scene used to derive how the artificial friction affect the simulation can be simulated with simpleralgorithms, the concept of reducing artificial friction using BREP as the representation for objects isdemonstrated.

The aim to develop an algorithm that can produce information about where an intersection occurredwith high precision is fulfilled. To find the intersection with high precision the Newton Raphson methodworks for BREPs with NURBS surfaces. The overall convergence rate for the Newton Raphson methodon the NURBS surfaces to find an intersection was found to be linear and not quadratic as section3.4.3 suggest as the convergence rate for the Newton Raphson method. However for some steps wherethe current state is not too close to the solution the convergence rate acts quadratically, as derived inAppendix C, but goes to linear convergence rate as the solution is approached. This is an indicationthat the method is implemented correctly but it is a bad approach to use for the surface types tested,except for planar surfaces where the convergence rate was quadratic for most cases.

Also the aim of calculating the separation direction of two objects with one intersection is fulfilled.The calculation of the separation direction works well when the normals of the points on the surfaceswhich are intersecting are not parallel to the calculated regression plane from all the points on theintersection curve. As the algorithm to calculate the separation direction only derives one direction foreach set of intersection points given, an algorithm to merge intersection points along an intersectioncurve is needed to distinguish different intersection curves.

The aim of develop an algorithm with ability to calculate the deepest point is not fulfilled. Cases inwhich a depth could be detected with the Newton Raphson method were few which makes the depthfinding algorithm in present state unreliable to use to produce the contact information, an alternativewould be to use a variant of the Newton Raphson method which does not relies on the derivatives whichis achieved with the quasi Newton Raphson method. The problems to derive the depth might not allbe due to the method, it could come from bugs in the implementation as there has been too little bugsearch to neglecting the possibility that there are bugs in the code that prevent the algorithm to find asolution.

The algorithm implemented to handle trimming curves works as intended to find where on a trimmingcurve a vector is intersected. The algorithm do not distinguish from which direction a trimming curve isintersected. A situation were this is a problem can be understood by taking a look at the cross sectionof a surface, the figure 34 Appendix A, with multiple trimming curves. Since there will always be thesame number of trimming curves crossed if a ray is shot in any direction, regarding were on the surfacethe current position is one cant decide if the starting point is on or off the surface.

Master Thesis - Collision detection using BREP

Page 46: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 38

Master Thesis - Collision detection using BREP

Page 47: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 39

sectionFuture work To be able to use collision detection with BREPs more work has to be put intoall parts of the solution. The most critical part to derive a solution for is the merge of the intersectionpoints since multiple intersections can not be detected with the existing algorithm. There also need to bework added to the calculation of the normal of the minimization plane as there are still bugs that allowsthe direction of the normal to be incorrect. To make the depth finding algorithm able to calculate thepenetration depth a thorough bug search is needed or in worst case a new strategy of finding the depthhas to be derived. To handle more general objects work as to be added for handling of the trimmingsearch. One example that does not work is the case where there exist multiple trimming curves on thesurface, a cross section of such surface can be seen in Appendix A, figure 34. A possible algorithm tohandle the problem with the trimming curves is presented in Appendix B.

The computational time of the collision information between BREPs is one of the main things toimprove to make the collision detection with BREPs suitable to use in the real time multibody simula-tions. Lot of computational time can be cut by using better tests to terminate the computation if thereis non solution possible. The computational time can also be cut by making the convergence rate of theNewton Raphson method higher. One possible way to increase the convergence rate and at the same timereducing the need of calculating the Jacobian at every step in the solution, is to use the Quasi-Newtonmethod.

Master Thesis - Collision detection using BREP

Page 48: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 40

Master Thesis - Collision detection using BREP

Page 49: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 41

markbothAppendix

Appendix A

Figure 34: A circle trimmed by an ellipse

Master Thesis - Collision detection using BREP

Page 50: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 42

Appendix BIsOnSurface(Point, BrepSurface)select A point on the closest trimming curves to Point from the outer loop on BrepSurfaceconstruct A vector from Point to point on trimget direction of the trimming curveget normal at point on trimif (direction of trim cross vector to point on trim) == normal of surface at pointfor all inner loops doselect A point on the closest trimming curves to Point from the inner loop on Brep-Surfaceconstruct A vector from Point to point on trimget direction of the trimming curveget normal at point on trimif (direction of trim cross vector to point on trim) not = normal of surface at pointreturn not on surface

end ifend forreturn on surface

elsereturn not on surface

end ifend

Master Thesis - Collision detection using BREP

Page 51: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 43

Appendix CThe convergence rate of a iterative solver can be derived by

|xi+1 − L||xi − L|q

= µ (7.1)

where L is x when i→∞, q is the convergence rate if there exists an µ ∈ (0, 1). In tables 4, 5 and 6 theconvergence rate for the Newton Raphson method, section 4.3, is derived for the beginning iterations ofthree intersection points with linear and quadratic assumed convergence rate.

Table 4: Convergence rate for three intersection points between two cubes

Parametric value µ|q=1 µ|q=2x1 -0.692 0.127 33.2x2 -0.6886536542L -0.6881654925x1 -0.692 0.0505 2.32x2 -0.7148418777L -0.7137431983x1 -0.692 0.00232 0.0367x2 -0.6285810447L -0.6287278037

Table 5: Convergence rate for three intersection points between two cylinders

Parametric value µ|q=1 µ|q=2x1 3.730641276 0.988 27.5x2 3.731057572 0.987 27.7x3 3.731507812 0.979 27.9x4 3.73226271 0.968 28.1x5 3.733366749 0.958 28.8L 3.766637956x1 3.337942194 0.801 5.23x2 3.368462457 0.809 6.60x3 3.391896794 0.816 8.23x4 3.410155103 0.822 10.2x5 3.424541037 0.828 12.5L 3.491044146x1 3.730641276 0.906 10.8x2 3.722770014 0.906 11.9x3 3.715596508 0.905 13.1x4 3.70906493 0.905 14.5x5 3.703123061 0.904 16.0L 3.646636541

Master Thesis - Collision detection using BREP

Page 52: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

7 Discussion 44

Table 6: Convergence rate for three intersection points between two torus

Parametric value µ|q=1 µ|q=2x1 6.086835766 0.09758300547 1.090967139x2 6.185010537 0.701989042 80.42547278x3 6.182409366 0.7026928035 114.6828462x4 6.180587684 0.7031312288 163.306638x5 6.179309489 0.7034158088 232.3502737L 6.176282095x1 5.694136685 0.6967981228 53.548766482x2 5.753670187 0.7001463431 65.117434625x3 5.794694931 0.7018524203 87.326903229x4 5.823254827 0.7027681479 110.4529993x5 5.843238095 0.7032802756 14.88487595L 5.890486072x1 5.694136685 0.00210999442 0.02153757516x2 5.595961914 1 4837.647193x3 5.595961914 1.007659729 4874.702262x4 5.596376922 0.7030351745 3375.183148x5 5.596315065 0.7033090168 4802.743808L 5.596168626

Master Thesis - Collision detection using BREP

Page 53: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

References 45

References

References

[1] Bender, J. & Coumans, E. & Erleben, K. & Trinkle, J. (2012) Interactive Simulation of Rigid BodyDynamics in Computer Graphics.

[2] Nordling, C. & Österman, J. (2006). Physics handbook for science and engineering. Lund: Stu-dentlitteratur.

[3] Cohen, E. & Fish, R. & Martin, W. & Shirley, P. (2000) Practical Ray Tracing of Trimmed NURBSSurfaces. Salt Lake City. http://www.cs.utah.edu/~shirley/papers/raynurbs.pdf.

[4] Constensin, M. & Poutrain, K. (2001). Ninth Pacific Conference on Computer Graphics and Appli-cations proceedings. Tokyo, Japan. Los Alamitos, Calif: IEEE Computer Society.

[5] Creus, G. & Teixeira, F. (2008). A robust algorithm to determine surface/surface intersection inboth parametric spaces. San Lois, Argentina.

[6] Dyllong, E. & Luther, W. (1999). Distance calculation between a point and a NURBS surface.http://www.dtic.mil/dtic/tr/fulltext/u2/p012016.pdf.

[7] Eberly, D. & Shoemake, K. (2004). Game physics. Amsterdam Boston: Elsevier/Morgan Kaufmann.

[8] Edelsbrunner, H. Computing the extreme distances between two convex polygons.https://www.cs.duke.edu/~edels/Papers/1985-J-02-ComputingExtremeDistances.pdf.

[9] Ericson, C. (2005). Real-time collision detection. Amsterdam Boston: Elsevier.

[10] Erleben, K. (2005). Physics-based animation. Hingham, Mass: Charles River Media.

[11] Fisher, S. Lin, M. Fast Penetration Depth Estimation for Elastic Bodies Using Deformed DistanceFields. http://gamma.cs.unc.edu/DDF/iros01.pdf.

[12] Kelley, C. (2003). Solving nonlinear equations with Newton’s method (chapters 1.6, 1.7.1). Philadel-phia: Society for Industrial and Applied Mathematics.

[13] Häggstrom, M. (2013). unpublished. Collision Detection With NURBS.

[14] Ko, K, H. & Maekawa, T. & Mukunda, H. & Patikalakis, N, M. (1993). Surface to surface intersec-tions.

[15] Ling, H. & Xinxiong, Z. (1996). A practical algorithm for surface/surface intersection.http://www.cs.berkeley.edu/~hling/research/paper/intersection.htm.

[16] Nocedal, J. & Wright, S. (2006). Numerical optimization. New York: Springer.

[17] Piegl, L. & Tiller, W. (1997). The NURBS book. Berlin New York: Springer.

[18] Stroud, I. (2006). Boundary Representation Modelling Techniques. London: Springer.

[19] Stroud, I. & Nagy, H. (2011). Solid modelling and CAD systems how to survive a CAD system.London New York: Springer.

[20] Östman, A. (2014). Collision detection for trimming curves and BREPs. Umeå University.

[21] (2014, 26 November). http://www.rhino3d.com/opennurbs.

[22] (2014, 11 December). http://wiki.mcneel.com/developer/brepstructure.

[23] (2014, 15 December) http://www.algoryx.se/.

[24] (2014, 15 December). http://en.wikipedia.org/wiki/Sweep_and_prune.

Master Thesis - Collision detection using BREP

Page 54: Collision detection using boundary representation, BREP808317/FULLTEXT01.pdf · 2015-04-28 · DepartmentofPhysics April21,2015 Collision detection using boundary representation,

References 46

[25] (2014, 15 December). http://en.wikipedia.org/wiki/Parametric_equation.

[26] (2014, 16 December). http://en.wikipedia.org/wiki/Linear_regression.

[27] (2015, 05 Januari). http://en.wikipedia.org/wiki/Newton_fractal.

[28] (2015, 07 Januari). http://sv.wikipedia.org/wiki/Computer_Aided_Manufacturing.

[29] (2015, 07 Januari). http://en.wikipedia.org/wiki/Computer-aided_engineering.

Master Thesis - Collision detection using BREP


Recommended