URGENT HELP: Trying to make a hole on a surface

Dear all:

I wish to make a hole on a surface, defined by a closed edge or wire.
Using the following code (see bellow), it works nicelly when the surface is plannar, but for nonplannar surfaces, it does not work.

=============================================================
BRepBuilderAPI_MakeFace downFaceAPI(TopoDS::Face(faceToCut));
downFaceAPI.Add(wire); //this wire is closed

TopoDS_Face result = downFaceAPI;
=============================================================

Can anybody give some other suggestions?

Thanks in advance, Sofia Gameiro

Rob Bachrach's picture

In theory, your code should work. Remember, the wire must lie completely on the original face. From the help:

"For the wire: the wire is composed of connected edges, each edge having a parametric curve description in the parametric domain of the surface; in other words, as a pcurve."

If the wire is not truly on the face, you might try extruding it into a solid and performing a boolean cut operation.

Good luck.

Sofia Gameiro's picture

Thanks Rob, I will try your tips!
Sofia

axyl's picture

Hello Rob,
I agree with both of you on this one. From my tests, OpenCascade is not yet able to project a curve on surface (correctly) but except planar surfaces. The method I use is the extrusion one. Basically, I (at geometry level), I get the (closed) curve I want to use for perforation, extrude it (using Geom_SurfaceOfLinearExtrusion) and intersect (GeomAPI_IntSS) the result with the target surface (GeomAdaptor_Surface). This ensures the resulting 'wire' (you get) is exactly on your surface (not limited to planar surface). You are free to get a 3d curve or a 2d (p-) curve in the parameytric space of the surface, from GeomAPI_IntSS. I hops this is assuring! Good luck.
axyl