Thu, 03/11/2010 - 15: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
Mon, 03/15/2010 - 12:32
Dear Marc Duflot.
To classify 2D point aP2D(u,v) you may use the class IntTools_FClass2d.
Mon, 03/15/2010 - 12: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
Tue, 03/16/2010 - 12:22
Thank you both for the hints.
Tue, 11/22/2016 - 13:00
Hello,
anyone know how to project 3d point on wire ( containing edges of square ) ?
i tried GeomAPI_ProjectPointOnCurve api, it works only if wire containing circular edge otherwise fails.