Handle(ShapeFix_Shape) aShapeFixTool = new ShapeFix_Shape;
aShapeFixTool->Init(aHTrsf.Shape());
aShapeFixTool->Perform();
+ TopoDS_Shape aResShape = aShapeFixTool->Shape();
ShapeAnalysis_ShapeTolerance aSat;
aSat.InitTolerance();
- aSat.AddTolerance(aShapeFixTool->Shape());
+ aSat.AddTolerance(aResShape);
// Check the necessarity of the next step
- if (myIsAutoSection && aHullsList.size() > 0 && aSat.GlobalTolerance(1) >= aTolerances.back())
+ if (myIsAutoSection && aHullsList.size() > 0 && aSat.GlobalTolerance(0) >= aTolerances.back())
{
isToProceed = false;
mySections.pop_back();
}
else
{
- aTolerances.push_back(aSat.GlobalTolerance(1));
- aHullsList.push_back(aShapeFixTool->Shape());
+ aTolerances.push_back(aSat.GlobalTolerance(0));
+ aHullsList.push_back(aResShape);
aSectionsList.push_back(mySections);
if (myIsAutoSection)
- addSection(aShapeFixTool->Shape());
+ addSection(aResShape);
}
}
} while (isToProceed);
if (n < 3)
{
di << "Usage result hull [-l cm cb_new cb_old lpp] or [-q aftlim cca ccf forelim aft_coef fore_coef modify_aft_zone modify_fore_zone] ";
- di << "[-s XCoord_section1 ... XCoord_sectionN] or [-a minSectionTol]\n";
+ di << "[-s XCoord_section1 ... XCoord_sectionN] or [-a minSectionTol] or [-f step]\n";
return 1;
}
std::list<double> aSections;
bool isAutoSection = false;
+ bool isQuad = false;
+ double _aftlim = 0;
+ double _cca = 0;
+ double _ccf = 0;
+ double _forelim = 0;
+ double _lpp = 0;
int i = 3;
while (i < n)
{
double _cm = Atof(a[i + 1]);
double _cb_new = Atof(a[i + 2]);
double _cb_old = Atof(a[i + 3]);
- double _lpp = Atof(a[i + 4]);
+ _lpp = Atof(a[i + 4]);
aHTrsf.InitLinear(_cm, _cb_new, _cb_old, _lpp);
i += 4;
continue;
if (a[i][0] == '-' && a[i][1] == 'q' && n > i+8)
{
// init quad transformation parameters
- double _aftlim = Atof(a[i + 1]);
- double _cca = Atof(a[i + 2]);
- double _ccf = Atof(a[i + 3]);
- double _forelim = Atof(a[i + 4]);
+ isQuad = true;
+ _aftlim = Atof(a[i + 1]);
+ _cca = Atof(a[i + 2]);
+ _ccf = Atof(a[i + 3]);
+ _forelim = Atof(a[i + 4]);
double _aft_coef = Atof(a[i + 5]);
double _fore_coef = Atof(a[i + 6]);
bool _modify_aft_zone = (Draw::Atoi(a[i + 7]) == 1);
aHTrsf.SetAutoSections(true, aTol);
continue;
}
+ if (a[i][0] == '-' && a[i][1] == 'f')
+ {
+ double aStep = Atof(a[i + 1]);
+ i += 2;
+ if (isQuad)
+ {
+ aSections.push_back(_aftlim - aStep);
+ aSections.push_back(_aftlim + aStep);
+ aSections.push_back(_forelim - aStep);
+ aSections.push_back(_forelim + aStep);
+ }
+ else
+ {
+ aSections.push_back(_lpp / 2 - aStep);
+ aSections.push_back(_lpp / 2 + aStep);
+ }
+ aHTrsf.SetSections(aSections);
+ continue;
+ }
i++;
}
"[-l cm cb_new cb_old lpp] for linear or "
"[-q aftlim cca ccf forelim aft_coef fore_coef modify_aft_zone modify_fore_zone] for quad "
"[-s XCoord_section1 ... XCoord_sectionN] to add sections or "
- "[-a tol (min distance between sections)] for auto sectioning\n",
+ "[-f step (step in both sides) for making section fence around behavior-changing points ] and/or"
+ "[-a tol (min distance between sections)] for auto sectioning",
__FILE__,
hulltrsf, g);