}
FeaturePtr aFeature = aDocument->feature(aResult);
- if(!aFeature.get() || aFeature->getKind() != "SketchCircle") {
+ if(!aFeature.get() ||
+ ((aFeature->getKind() != "SketchCircle") &&
+ (aFeature->getKind() != "SketchBSplinePeriodic"))) {
return Standard_True;
}
gp_Pnt EyePoint(XEye, YEye, ZEye);
gp_Pnt AtPoint(XAt, YAt, ZAt);
+ if (EyePoint.Distance(AtPoint) < Precision::Confusion())
+ return gp_Pnt();
+
gp_Vec EyeVector(EyePoint, AtPoint);
gp_Dir EyeDir(EyeVector);
gp_Pnt ConvertedPoint(X, Y, Z);
gp_Pnt2d ConvertedPointOnPlane = ProjLib::Project(PlaneOfTheView, ConvertedPoint);
- gp_Pnt ResultPoint = ElSLib::Value(ConvertedPointOnPlane.X(), ConvertedPointOnPlane.Y(),
+ return ElSLib::Value(ConvertedPointOnPlane.X(), ConvertedPointOnPlane.Y(),
PlaneOfTheView);
- return ResultPoint;
}
void PartSet_Tools::convertTo2D(const gp_Pnt& thePoint, FeaturePtr theSketch,
if (!theIO.IsNull()) {
anAISObj->setImpl(new Handle(AIS_InteractiveObject)(theIO));
}
- anObject = myWorkshop->module()->findPresentedObject(anAISObj);
+ if (myWorkshop->module())
+ anObject = myWorkshop->module()->findPresentedObject(anAISObj);
}
return anObject;
}