The problem is resultPnt.Y() is 0, not 1000, which means the transformation of tfs doesn't influence GeomAPI_ProjectPointOnCurve's calculation. Is it a bug?
Discussion
4 archived replies
Posts are displayed in their archived order.
01Commenter-1
Dear Tom,
Nearest point gives correct result:
## NearestPoint: X = 0 Y = 1000 Z = 0
So, it is not a bug. I suggest you to check it using Draw command
See for details file GeometryTest_APICommands.cxx which contains source code of the command.
Best regards
FSR
02Commenter-2
My OCCT version is 6.7.1, I check over and over and still got the wrong result. I build the code with Visual Studio 2012, not using draw comand
03Commenter-3
I think your usage of BRepAdaptor_Curve is wrong. By accessing bc.Curve() the information about the translation is lost. The result is only a geometric object which does not know about the translation.
According to my understanding BRepAdaptor_Curve should only be used in methods where an Adaptor3D_Curve is expected.
Probably, your problem can be solved by not using an adaptor but accessing your geometrical curve and transforming it if needed. I found the following code for it in LocOpe_Spliter.Select:
GeomAPI_ProjectPointOnCurve proj;
...
C = BRep_Tool::Curve(edg,Loc,f,l);
if (!Loc.IsIdentity()) {
Handle(Geom_Geometry) GG = C->Transformed(Loc.Transformation());
C = *((Handle(Geom_Curve)*)&GG);
}
proj.Init(Pt,C,f,l);