Edge/Face Intersection Test..

Seems like it should be the easiest thing in the world but is there a "standard" way to test for intersection between a TopoDS_Face and a TopoDS_Edge.

I've seen things that say use IntCS but it seems to elude me how to convert my TopoDS objects into Curves and Surfaces which are useable by this function.

I dont need to know what the intersection is, i just want to know *if* there is one. I've tried BRepCommon Section and it doesnt give me anything.

Stephen

Stephen Leary's picture

Ok.. the following code always claims there is an intersection.

Im guessing its because it doesnt know about the limits of my TopoDS Face and Edge.

Any help?

S

public static bool PlaneLineIntersection(TopoDS.Face face, TopoDS.Edge wire)
{
double first,last,u,v,w;
TopLoc.Location loc = new TopLoc.Location();
Geom.Curve C = BRep.Tool.Curve(wire, loc, out first,out last);
Geom.Surface S = BRep.Tool.Surface(face);

GeomAPI.IntCS intersection = new GeomAPI.IntCS();
intersection.Perform(C, S);
if (intersection.IsDone())
{
intersection.Parameters(1, out u, out v, out w);
// is always 1... regardless.
return (intersection.NbPoints() > 0);
}
return false;
}

Francois Lauzon's picture

Hello,
look at IntCurvesFace_ShapeIntersector. And you're right, you find an intersection because you're curve and surface from Geom have lost there topology information (trimming information).

Good Luck,
Francois.

Evgeny Lodyzhehsky's picture

Dear Stephen Leary.

The class IntTools_EdgeFace is what you want.
If you consider that the problem is "...easiest thing in the world..." why not to write your own algorithm for it? But /IMHO/ you do not have even a grain of insight how to do it.

Stephen Leary's picture

I am required to use OpenCascade because my company insist that i use it for all my geometry calculations.

I'm not going to comment on the rather inflamatory remarks you made at the end of your message since you havent the faintest insight into what i can and cannot do.

But please, I'd rather have silence than that BS.

Stephen

Evgeny Lodyzhehsky's picture

Hey you forgot to say thanks.

Dmitry Khabi's picture

I have tried "IntTools_EdgeFace". It#s very slow. Is it so ?

Roman Lygin's picture

Dmitry,

As I said in another post (http://www.opencascade.org/org/forum/thread_14933/), I am looking for models that would demonstrate slow work of Boolean Operations. I'm not totally sure but IntTools_EdgeFace can be called from them and thus contribute to their slowness, so if you provide a test case that would be helpful in my experiments.
My top todo item so far is Edge-Edge intersection, which greatly exploits Extrema which is also used in edge-face intersections. So the larger test database I have the more relevant results can be.

If you decide to, please send me models to my email (roman dot lygin at gmail dot com) or send a link for download.

Thanks.
Roman

---
opencascade.blogspot.com - blog on Open CASCADE

Dmitry Khabi's picture

Sorry,
this model is from company's customer. It was provided us for internal using only . Wenn I have some other model with same problems i will send it you with pleasure.