You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all: thanks for sharing your powerfull library !
I have a very easy tasks -but can't figure out how to do that with geometry3Sharp? :
In 3D space: how to find Ray3 and Triangle3 intersection point coordinates (e.g. Xhit, Yhit, Zhit)?
All what I can do to find out : bool IsIntersected and distance, but I need intersection point coordinates as well:
This is where I'm actually:
g3.Vector3d origin = new g3.Vector3d(0, 0, 50);
g3.Vector3d direction = new g3.Vector3d(t_point_X, t_point_Y, t_point_Z);
g3.Ray3d ray = new g3.Ray3d(origin, direction);
g3.Vector3d V0 = new g3.Vector3d(ClosestFACE.Vertices[0].Position[0], ClosestFACE.Vertices[0].Position[1], ClosestFACE.Vertices[0].Position[2]);
g3.Vector3d V1 = new g3.Vector3d(ClosestFACE.Vertices[1].Position[0], ClosestFACE.Vertices[1].Position[1], ClosestFACE.Vertices[1].Position[2]);
g3.Vector3d V2 = new g3.Vector3d(ClosestFACE.Vertices[2].Position[0], ClosestFACE.Vertices[2].Position[1], ClosestFACE.Vertices[2].Position[2]);
double rayT = 0;
bool IsIntersected = g3.IntrRay3Triangle3.Intersects(ref ray, ref V0, ref V1, ref V2, out rayT);
So, ho to find intersection point coordinates ?
Thanks for your kind help in advance,
Best Regards,
Peter
The text was updated successfully, but these errors were encountered:
g3.Vector3d origin = new g3.Vector3d(0, 0, 50);
g3.Vector3d direction = new g3.Vector3d(t_point_a, t_point_b, t_point_L);
g3.Ray3d ray = new g3.Ray3d(origin, direction);
g3.Triangle3d triangle3D = new g3.Triangle3d(V0, V1, V2);
g3.IntrRay3Triangle3 intrRay3Triangle3 = new g3.IntrRay3Triangle3(ray, triangle3D);
intrRay3Triangle3.Compute();
var intersectionResult = intrRay3Triangle3.Result; // Intersects : OK, as expected
// How to get the intersection point coordinates ?
You can use the TriangleBaryCoords member. This is the barycentric coordinates of the intersection point in the triangle. So the intersection point is BaryCoords.XV0 + BaryCoords.YV1 + BaryCoords.Z*V2, or use Triangle3d.PointAt() which takes the barycentric coordinates.
First of all: thanks for sharing your powerfull library !
I have a very easy tasks -but can't figure out how to do that with geometry3Sharp? :
In 3D space: how to find Ray3 and Triangle3 intersection point coordinates (e.g. Xhit, Yhit, Zhit)?
All what I can do to find out : bool IsIntersected and distance, but I need intersection point coordinates as well:
This is where I'm actually:
g3.Vector3d origin = new g3.Vector3d(0, 0, 50);
g3.Vector3d direction = new g3.Vector3d(t_point_X, t_point_Y, t_point_Z);
g3.Ray3d ray = new g3.Ray3d(origin, direction);
So, ho to find intersection point coordinates ?
Thanks for your kind help in advance,
Best Regards,
Peter
The text was updated successfully, but these errors were encountered: