Merge pull request #3579 from WandererFan/prefDirs

[Part]Fix #4285 Bad Shape from Chamfer
This commit is contained in:
WandererFan
2020-06-07 15:41:52 -04:00
committed by GitHub
2 changed files with 18 additions and 0 deletions

View File

@@ -73,6 +73,18 @@ App::DocumentObjectExecReturn *Chamfer::execute(void)
TopoDS_Shape shape = mkChamfer.Shape();
if (shape.IsNull())
return new App::DocumentObjectExecReturn("Resulting shape is null");
//shapefix re #4285
//https://www.forum.freecadweb.org/viewtopic.php?f=3&t=43890&sid=dae2fa6fda71670863a103b42739e47f
TopoShape* ts = new TopoShape(shape);
double minTol = 2.0 * Precision::Confusion();
double maxTol = 4.0 * Precision::Confusion();
bool rc = ts->fix(Precision::Confusion(), minTol, maxTol);
if (rc) {
shape = ts->getShape();
}
delete ts;
ShapeHistory history = buildHistory(mkChamfer, TopAbs_FACE, shape, baseShape);
this->Shape.setValue(shape);

View File

@@ -428,6 +428,9 @@ for ProjectionGroups</string>
<property name="toolTip">
<string>Starting directory for menu 'Insert Page using Template'</string>
</property>
<property name="mode">
<enum>Gui::FileChooser::Directory</enum>
</property>
<property name="prefEntry" stdset="0">
<cstring>TemplateDir</cstring>
</property>
@@ -539,6 +542,9 @@ for ProjectionGroups</string>
<property name="toolTip">
<string>Default directory for welding symbols</string>
</property>
<property name="mode">
<enum>Gui::FileChooser::Directory</enum>
</property>
<property name="prefEntry" stdset="0">
<cstring>WeldingDir</cstring>
</property>