
Wed, 01/14/2009 - 22:17
Forums:
I'd like to know if a u,v coordinate lies on the trimmed part of a surface.
I've tried checking this with the Brep_PointOnSurface class, but this seems not to know about the trimmed part of a surface.
Any pointers would be much appreciated.
Many thanks,
-jelle
Thu, 01/15/2009 - 04:24
Hi jelle,
Here is the code I used.
bool IsPoint2dInFaceDomain(const TopoDS_Face& face, const gp_Pnt2d& pnt2d)
{
double tol;
double u1, u2, v1, v2, dialen;
tol = 1.0e-4; //Precision::Confusion()
BRepTools::UVBounds(face, u1, u2, v1, v2);
dialen = (u2-u1)*(u2-u1) + (v2-v1)*(v2-v1);
dialen = sqrt(dialen)/400.0;
tol = std::max(dialen, tol);
BRepTopAdaptor_FClass2d CL(face,tol);
if(CL.Perform(pnt2d) == TopAbs_IN)
return true;
else
return false;
}
Thu, 01/15/2009 - 13:35
Hi Cauchy,
Thanks you so much for the function, that works just perfectly!
Much appreciated,
-jelle
Wed, 07/08/2009 - 15:12
Hi, Did u get it working fully??
It does not include the face with the edges lying on the boundary..
Do you have any idea?