#include <ModelAPI_Session.h>
#include <ModelAPI_Validator.h>
+
static GeomShapePtr faceByThreeVertices(const std::shared_ptr<GeomAPI_Vertex> theV1,
const std::shared_ptr<GeomAPI_Vertex> theV2,
const std::shared_ptr<GeomAPI_Vertex> theV3);
aC = anAttrC->value(), aD = anAttrD->value();
std::shared_ptr<GeomAPI_Pln> aPlane =
std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(aA, aB, aC, aD));
- double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size");
+ double aSize = Config_PropManager::real(SKETCH_TAB_NAME, "planes_size");
+ if (aSize <= 1.e-7)
+ aSize = 200; // Set default value
aSize *= 4.;
aPlaneFace = GeomAlgoAPI_FaceBuilder::squareFace(aPlane, aSize);
}
gp_Pnt aStart = aC3D->Value(aT1);
gp_Pnt aEnd = aC3D->Value(aT2);
+ if (aStart.Distance(aEnd) <= Precision::Confusion())
+ return false;
+
// check the edge is orthogonal to the previous
gp_XYZ aCurDir = (aEnd.XYZ() - aStart.XYZ()).Normalized();
if (aPrevDir.Dot(aCurDir) < Precision::Confusion())
std::shared_ptr<GeomAPI_Dir> theNorm,
const int theRGB[3])
{
- double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size");
+ double aSize = Config_PropManager::real(SKETCH_TAB_NAME, "planes_size");
+ if (aSize <= Precision::Confusion())
+ aSize = 200; // Set default value
+
std::shared_ptr<GeomAPI_Shape> aFace =
GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize);
AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject());
aAIS->createShape(aFace);
- aAIS->setWidth(Config_PropManager::integer(SKETCH_TAB_NAME, "planes_thickness"));
+ aAIS->setWidth(Config_PropManager::real(SKETCH_TAB_NAME, "planes_thickness"));
aAIS->setColor(theRGB[0], theRGB[1], theRGB[2]);
return aAIS;
}
theSketch->data()->attribute(SketchPlugin_Sketch::NORM_ID()));
double aFaceSize = myIsUseSizeOfView ? mySizeOfView
- : Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size");
+ : Config_PropManager::real(SKETCH_TAB_NAME, "planes_size");
+ if (aFaceSize <= Precision::Confusion())
+ aFaceSize = 200; // Set default value
myShape = GeomAlgoAPI_FaceBuilder::squareFace(
myViewCentralPoint.get() ? myViewCentralPoint : anOrigin->pnt(), aNormal->dir(), aFaceSize);