For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

2D point in/on/out trimmed param. domain

F.-Régis Degott's picture
Forums: 

Hi all, someone knows how to determine if a 2D point (uv) is in/on or out of the trimmed parameter domain of a face (surface)? I can't find (in occ doc.) any API to do this job. Any hints? Thanks. FR

chenya's picture

Dear F.-Régis Degott
Have you got any solution of this problem ?
I have the same problem with you

Mauro Mariotti's picture

Look at
BRepTopAdaptor_FClass2d (or IntTools_FClass2d).

Regards.
Mauro

chenya's picture

Thanks very much, Mauro Mariotti!
I have test BRepTopAdaptor_FClass2d (or IntTools_FClass2d),it works OK.
But if I want to get the point on suface when I am moving mouse on screen.
It need that this BRepTopAdaptor_FClass2d class performs high efficiency.
But after my testing,it can not be qualified to this work. Do you hava any
idea that can solve this problem?

It means that if I do 10000 times using this class, the time needed should be less than 0.5s(500ms)!

Best regards

Joney's picture

I want to know how to solve this question too .
Does anyone answer it ?

Laszlo Kudela's picture

I think this has to do something with the algorithm that is lying behind this function.

I guess it first computes the distance of the point to all the boundaries (wires), picks the closest one, projects the point to this closest one, then computes the cross product of the projection and the tangent vector of the edge, and depending on the direction of this cross product decides whether the point lies inside or outside.

If the object has many edges, and they are not simple ones (line or arc) the distance computation takes a long time, especially if it is done many times.

I think it can be made faster by first checking if the point lies inside or outside the bounding box that encloses the trimmed surface.

Something like that (pseudo code):

bbox = compute_bbox(face);
if(bbox.point_is_inside(point))
call BRepTopAdaptor_FClass2d
return result of BRepTopAdaptor_FClass2d
else
point is outside

Although, I am not sure in this... If someone could confirm my theory from the OCC developers' side, would be really nice.