Try to auto-fix any invalid generated helix
This commit is contained in:
committed by
Kacper Donat
parent
26c6aa934d
commit
39c902c616
@@ -36,6 +36,7 @@
|
||||
# include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||
# include <BRepPrimAPI_MakeRevol.hxx>
|
||||
# include <ShapeFix_ShapeTolerance.hxx>
|
||||
# include <ShapeFix_Solid.hxx>
|
||||
# include <Precision.hxx>
|
||||
# include <TopoDS.hxx>
|
||||
# include <TopoDS_Face.hxx>
|
||||
@@ -259,6 +260,13 @@ App::DocumentObjectExecReturn* Helix::execute()
|
||||
|
||||
fix.LimitTolerance(result, Precision::Confusion() * size * Tolerance.getValue() ); // significant precision reduction due to helical approximation - needed to allow fusion to succeed
|
||||
|
||||
// try to auto-fix possible invalid result
|
||||
ShapeFix_Solid fixer;
|
||||
fixer.Init(TopoDS::Solid(result));
|
||||
if (fixer.Perform()) {
|
||||
result = fixer.Solid();
|
||||
}
|
||||
|
||||
AddSubShape.setValue(result);
|
||||
|
||||
if (base.isNull()) {
|
||||
|
||||
Reference in New Issue
Block a user