return Standard_False;
}
+ const gp_Pnt aPntOnSphere (myAxis.Location().XYZ() + myAxis.Direction().XYZ() * aDepth);
+ const gp_Vec aNormal (aPntOnSphere.XYZ() - theCenter.XYZ());
thePickResult.SetDepth (aDepth);
+ thePickResult.SetPickedPoint (aPntOnSphere);
+ thePickResult.SetSurfaceNormal (aNormal);
return Standard_True;
}
{
return false;
}
+
+ const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aDepth;
thePickResult.SetDepth (aDepth);
+ thePickResult.SetPickedPoint (aPntOnCylinder.Transformed (theTrsf));
+ if (Abs (aPntOnCylinder.Z()) < Precision::Confusion())
+ {
+ thePickResult.SetSurfaceNormal (-gp::DZ().Transformed (theTrsf));
+ }
+ else if (Abs (aPntOnCylinder.Z() - theHeight) < Precision::Confusion())
+ {
+ thePickResult.SetSurfaceNormal (gp::DZ().Transformed (theTrsf));
+ }
+ else
+ {
+ thePickResult.SetSurfaceNormal (gp_Vec (aPntOnCylinder.X(), aPntOnCylinder.Y(), 0.0).Transformed (theTrsf));
+ }
return true;
}