mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0027729: UnifySameDomain: allow the user to specify linear and angular tolerances
- New methods SetLinearTolerance and SetAngularTolerance have been added in the class ShapeUpgrade_UnifySameDomain. - The algorithm has been modified to consider these tolerances when checking if two faces are same domain. - The draw command unifysamedomain has been changed to accept new parameters. - The internal method MergeSeq has been changed to avoid exception connected with access to unknown key in the data map. Create test case Small correction of test case for issue CR27729
This commit is contained in:
@@ -1284,14 +1284,16 @@ static ShapeUpgrade_UnifySameDomain& Unifier() {
|
||||
//=======================================================================
|
||||
static Standard_Integer unifysamedom(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n < 3 || n > 6)
|
||||
if (n < 3)
|
||||
{
|
||||
di << "Use unifysamedom result shape [-f] [-e] [+b] [-i]\n";
|
||||
di << "Use unifysamedom result shape [-f] [-e] [+b] [-i] [-t val] [-a val]\n";
|
||||
di << "options:\n";
|
||||
di << "[-f] to switch off 'unify-faces' mode \n";
|
||||
di << "[-e] to switch off 'unify-edges' mode\n";
|
||||
di << "[+b] to switch on 'concat bspline' mode\n";
|
||||
di << "[+i] to switch on 'allow internal edges' mode\n";
|
||||
di << "-f to switch off 'unify-faces' mode \n";
|
||||
di << "-e to switch off 'unify-edges' mode\n";
|
||||
di << "+b to switch on 'concat bspline' mode\n";
|
||||
di << "+i to switch on 'allow internal edges' mode\n";
|
||||
di << "-t val to set linear tolerance\n";
|
||||
di << "-a val to set angular tolerance\n";
|
||||
di << "'unify-faces' and 'unify-edges' modes are switched on by default";
|
||||
return 1;
|
||||
}
|
||||
@@ -1305,6 +1307,8 @@ static Standard_Integer unifysamedom(Draw_Interpretor& di, Standard_Integer n, c
|
||||
Standard_Boolean anUEdges = Standard_True;
|
||||
Standard_Boolean anConBS = Standard_False;
|
||||
Standard_Boolean isAllowInternal = Standard_False;
|
||||
Standard_Real aLinTol = Precision::Confusion();
|
||||
Standard_Real aAngTol = Precision::Angular();
|
||||
|
||||
if (n > 3)
|
||||
for ( int i = 3; i < n; i++ )
|
||||
@@ -1317,10 +1321,24 @@ static Standard_Integer unifysamedom(Draw_Interpretor& di, Standard_Integer n, c
|
||||
anConBS = Standard_True;
|
||||
else if (!strcmp(a[i], "+i"))
|
||||
isAllowInternal = Standard_True;
|
||||
else if (!strcmp(a[i], "-t") || !strcmp(a[i], "-a"))
|
||||
{
|
||||
if (++i < n)
|
||||
{
|
||||
(a[i-1][1] == 't' ? aLinTol : aAngTol) = Draw::Atof(a[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
di << "value expected after " << a[i-1];
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Unifier().Initialize(aShape, anUEdges, anUFaces, anConBS);
|
||||
Unifier().AllowInternalEdges(isAllowInternal);
|
||||
Unifier().SetLinearTolerance(aLinTol);
|
||||
Unifier().SetAngularTolerance(aAngTol);
|
||||
Unifier().Build();
|
||||
TopoDS_Shape Result = Unifier().Shape();
|
||||
|
||||
@@ -1556,7 +1574,7 @@ Standard_Integer reshape(Draw_Interpretor& di,
|
||||
theCommands.Add ("removeloc","result shape",__FILE__,removeloc,g);
|
||||
|
||||
theCommands.Add ("unifysamedom",
|
||||
"unifysamedom result shape [-f] [-e] [+b]", __FILE__,unifysamedom,g);
|
||||
"unifysamedom result shape [-f] [-e] [+b] [-i] [-t val] [-a val]", __FILE__,unifysamedom,g);
|
||||
|
||||
theCommands.Add ("unifysamedomgen",
|
||||
"unifysamedomgen newshape oldshape : get new shape generated "
|
||||
|
Reference in New Issue
Block a user