Is u,v coord on the trimmed part of a surface?

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

Cauchy Ding's picture

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;
}

jelle's picture

Hi Cauchy,

Thanks you so much for the function, that works just perfectly!
Much appreciated,

-jelle

Tae Hyun Kim's picture

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?