TD 1 - Plane intersection


Plane intersection

Today you are faced to the problem of computing (efficiently) the intersection between an input 3D triangle mesh and a given 3D hyperplane. You will have to complete the class CollisionDetection.
Task: you are given as inputs: a random 3D plane H and an edge 'e' of the mesh which is assumed to be crossed by H. Complete the method getInterectedFaces(mesh, H, e), that returns the list of connected faces intersected by H (blue triangles in the picture below), and containing the first edge 'e' (red edge).
Remark: you implementation should be efficient. The time complexity should be proportional to the number of intersected faces (the size of the output). Testing with the class MeshCollision: first press 'e' to choose a random edge and the corresponding orthogonal random plane. Then press 'c' to compute the intersected faces.

Files to download:

  1. Datasets: 3D meshes stoed in OFF. Remarque: n'oubliez pas de les placer dans le bon répertoire  ( /data, à la racine du projet TD1)
  2. The class to complete: CollisionDetection.java.
  • The main program for testing (based on Processing): MeshCollision.java.

  • Testing your code:

    1. Execute the class MeshCollision as a Java application: you should see a 3D frame as below:
    Testing collision detection (INF562, 2019-20)
    ...
    ...
    ...
    Checking Polyhedron...ok
    Closed mesh: no boundaries
    The mesh is pure triangle
    n: 162  e: 480  f: 320  b:0  genus: 0
    Setting Mesh Viewer (based on Processing 1.51)
    Setting Mesh Viewer (based on Processing 1.51)
    Checking Polyhedron...ok
    Closed mesh: no boundaries
    The mesh is pure triangle
    n: 162  e: 480  f: 320  b:0  genus: 0