# Tetrahedron - plane intersection

This topic is 2587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How to comput plane - tetrahedron plane intersection?

##### Share on other sites
Boolean only? Or do you need some sort of contact information?

##### Share on other sites

I need intersection points.

##### Share on other sites
The intersection will generally be a region, not a point. The basic method is to find which vertices of the tetrahedron are above the plane, and which are below the plane. Then, for each edge of the tetrahedron connecting an above point with a below point (discounting degenerate cases, there will be 0, 3, or 4 of these) find the intersection of that edge with the plane. The resulting points will be the vertices of the intersection polygon.

##### Share on other sites
So, if my understanding is correct, algorithm ( in C style pseuod code) is as follows

struct vec3{    float x,y,z;    };struct Plane{  vec3 pointontheplane;  vec3 normal;};vec3 PlaneEdgeIntersection(vec3& PointBelow,vec3& PointAbove,Plane* plane){//Line formed by PointBelow and PointAbove:  P = PointBelow + u *(PointAbove - PointBelow)            float u  = (Dot(Plane->normal,(plane->pointontheplane - PointBelow))/Dot(Plane->normal,(PointAbove - PointBelow));            vec3 intersectionpoint = PointBelow + u * (PointAbove - PointBelow);        return intersectionpoint;} void WhichsideofthePlane(vec3& tetrahronvertex, Plane* plane,PointaboveorBelow){			bool value = dot(plane->normal,tetrahedronvertex);	if(value > 0)	     PointaboveorBelow = true;	else	     PointaboveorBelow = false; }	point* PlaneTetrahedronIntersection(vector<vec3> tetrahedronvertex, Plane* plane){	//True if it lies above and false if it lies below	bool PointaboveorBelow[4];         // Vector of intersection points.          std::vector<vec3> intersectionpoint;	//Find which vertices are above  and below the plane. 	for(int i=0;i<4;i++)	{		   WhichsideofthePlane(tetrahedronvertex[i],Plane,PointaboveorBelow[i]);	}			// Edge Formation  	// and finding the intersection between edge and plane. 	for(int i=0;i<4;i++)	{	   for(int j=0;j<4;j++)	   {			if((PointaboveorBelow[i] == true)&& (PointaboveorBelow[j] == false))			{				  //so PointaboveorBelow[i] and PointaboveorBelow[j] form a edge				 vec3 point = PlaneEdgeIntersection(PointaboveorBelow[i],PointaboveorBelow[j],Plane);                                   intersectionpoint.insert(point);			}	   }	}}

Is this right?

[Edited by - rajesh_nest on November 11, 2010 6:43:00 AM]

##### Share on other sites
I didn't proof your code, but does it seem to be working? If you visualize it (e.g. with a fixed plane and a tetrahedron that you can move around), do the intersection points appear to be correct?

##### Share on other sites

This topic is 2587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628645
• Total Posts
2984023

• 9
• 9
• 9
• 10
• 21