how to get curve by cutting surface with plane?

how to get curve by cutting surface with plane?

cpicke
Explorer Explorer
508 Views
0 Replies
Message 1 of 1

how to get curve by cutting surface with plane?

cpicke
Explorer
Explorer

Hello Everyone

I am trying to intersect a surface with a plane in order to get a curve, much like you can do in the GUI. I even tried two different functions but with no success. Here is a rough snapshot of the code that I am using. Also take into account that

1. double theta is user input;

2. Inventor.Face face is output from another part of the code


ObjectsEnumerator out1;
ObjectsEnumerator out2;
Inventor.Point planePoint = oTG.CreatePoint(0,0,0);
Inventor.Vector planeNormal = oTG.CreateVector(-Math.Sin(theta), -Math.Cos(theta), 0)
Inventor.Plane plane = oTG.CreatePlane(planePoint,planeNormal);
Object oSurface = face.get_Surface(face.SurfaceType) as Object;
out1 = plane.IntersectWithSurface(oSurface);
for (i = 0; i < out1.Count; i++)
{
    // this function never returns anything!
}
Inventor.Object oPlane = plane as Inventor.Object;
out2 = oTG.SurfaceSurfaceIntersection(oSurface,oPlane);
for (i = 0; i < out2.Count; i++)
{
    // this function returns the correct number of entities but
    // I do not know how to typecast them! E.g., something like this:
    // drawingCurve = out2[i] as Inventor.DrawingCurve;
}

Has anybody ever had success with using either plane.IntersectWithSurface or SurfaceSurfaceIntersection? Can anybody please help me and provide me with code that contains either function and gets the curve generated by the intersection?


Thanks!

0 Likes
509 Views
0 Replies
Replies (0)