| Is the projection of a point on a surface inside the wire? |
 |
| Marc Duflot | 2010/03/11 13:56 | Hello,
I am an OpenCASCADE newbie, impressed by its capabilities.
I need to find if the projection of a given point on a surface (read in an IGES file) is inside this surface wire (there is no hole). This is what I have so far:
gp_Pnt p (...);
TopoDS_Face face = ... ;
Handle_Geom_Surface surface = BRep_Tool::Surface(face);
GeomAPI_ProjectPointOnSurf projection (point, surface);
double u, v;
projection.Parameters(1, u, v); // assuming there is at least one projection
TopExp_Explorer exp;
for(exp.Init(face, TopAbs_WIRE); exp.More(); exp.Next())
{
TopoDS_Wire wire = TopoDS::Wire(exp.Current());
// How do I check if (u,v) is inside the wire?
}
I tried playing with surface->Bounds(u1,u2,v1,v2) and ShapeAnalysis::GetFaceUVBounds(face,u1,u2,v1,v2) but this is not sufficient since these are BOUNDS to the parameters. I can't tell for sure with these bounds that the projection is inside the wire.
Thank you for your help,
Marc
|  |
|
|  |
| Lodyzhensky Evgeny Nicolaich | 2010/03/15 10:32 | Dear Marc Duflot.
To classify 2D point aP2D(u,v) you may use the class IntTools_FClass2d.
|  |
|
|  |
| Roman Lygin | 2010/03/15 10:38 | Hmm, interesting.
Evgeny Nicolaich, why not BRepTopAdaptor_FClass2d? Always have used the latter until now. API's seem to be aligned. Are you aware of any advantages of IntTools_FClass2d ?
Thanks.
Roman
|  |
|
|  |
| Marc Duflot | 2010/03/16 10:22 | | Thank you both for the hints. |  |
|
| | |