Fri, 04/26/2024 - 23:10
hi,
I made experiment, simple code in c++
The face and the circle as in the drawing actually intersect at one point,
I need to determine the coordinates of the intersection point.
The intersectionCalculator.NbPoints method shows two points, one is incorrect outside the face outline, outside the face area.
Handle(Geom_Surface) surface = BRep_Tool::Surface(face);
gp_Pnt intersectionPoint;
GeomAPI_IntCS intersectionCalculator(circleGeom, surface);
int common = intersectionCalculator.NbPoints(); // this=2
if (intersectionCalculator.IsDone()
intersectionCalculator.NbPoints() > 0)
{
intersectionPoint = intersectionCalculator.Point(2);
BRepBuilderAPI_MakeVertex modelV11(intersectionPoint);
What I did wrong?
Thank you PD
Sat, 04/27/2024 - 09:18
GeomAPI_IntCS
performs intersection between unbound surface and curve - it doesn't know aboutTopoDS_Face
boundary Wire to filter out found solutions.You may use tools taking BRep on input, like
BRepIntCurveSurface_Inter
, which should take into account boundaries, or handle boundaries on your own.Sat, 04/27/2024 - 16:49
Thank you
PD
Sat, 04/27/2024 - 12:10
hi,
If I get 2 points, and I want to check which is a real intersection with face, can I use class BRepClass_FaceClassifier?
Can I be sure of this solution?
BRepClass_FaceClassifier classifier(face, intersectionPoint, 1E-3);
// Klasa wyniku
TopAbs_State classifierResult = classifier.State();
if (classifierResult == TopAbs_IN) {
tak = true;
}
else if (classifierResult == TopAbs_ON) {
tak = true;
}
else {
tak = false;
}