+ // compute the start and the end points of the resulting edge by the bounding box of the face
+ // (vertices projected to the axis) plus 10%
+ Bnd_Box aFaceBnd;
+ BRepBndLib::Add(aFace, aFaceBnd);
+ gp_Pnt aBoxMin(aFaceBnd.CornerMin()), aBoxMax(aFaceBnd.CornerMax());
+ bool isFirst = true;
+ double aParamMin = 0, aParamMax = 0;
+ for(int aX = 0; aX < 2; aX++) {
+ for(int aY = 0; aY < 2; aY++) {
+ for(int aZ = 0; aZ < 2; aZ++) {
+ gp_XYZ aBoxVertex(aX == 0 ? aBoxMin.X() : aBoxMax.X(),
+ aY == 0 ? aBoxMin.Y() : aBoxMax.Y(), aZ == 0 ? aBoxMin.Z() : aBoxMax.Z());
+ gp_XYZ aVec(aBoxVertex - anAxis.Location().XYZ());
+ double aProjParam = aVec.Dot(anAxis.Direction().XYZ());
+ if (isFirst) {
+ isFirst = false;
+ aParamMin = aProjParam;
+ aParamMax = aProjParam;
+ } else {
+ if (aParamMin > aProjParam)
+ aParamMin = aProjParam;
+ else if (aParamMax < aProjParam)
+ aParamMax = aProjParam;
+ }
+ }
+ }
+ }
+ // add 10%
+ double aDelta = aParamMax - aParamMin;
+ if (aDelta < 1.e-4) aDelta = 1.e-4;
+ aParamMin -= aDelta * 0.1;
+ aParamMax += aDelta * 0.1;
+
+ gp_Pnt aStart(aParamMin * anAxis.Direction().XYZ() + anAxis.Location().XYZ());
+ gp_Pnt anEnd(aParamMax * anAxis.Direction().XYZ() + anAxis.Location().XYZ());
+ /*