From 87db9dccb548e433b1dffa3054c4011057bba894 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 4 May 2022 14:09:03 +0200 Subject: [PATCH] Part: expose ShapeFix_Shape to Python --- src/Mod/Part/App/AppPart.cpp | 2 + src/Mod/Part/App/CMakeLists.txt | 3 + src/Mod/Part/App/ShapeFix/ShapeFix_FacePy.xml | 5 + .../Part/App/ShapeFix/ShapeFix_FacePyImp.cpp | 18 +- src/Mod/Part/App/ShapeFix/ShapeFix_RootPy.xml | 12 +- .../Part/App/ShapeFix/ShapeFix_RootPyImp.cpp | 3 +- .../Part/App/ShapeFix/ShapeFix_ShapePy.xml | 101 ++++++++ .../Part/App/ShapeFix/ShapeFix_ShapePyImp.cpp | 224 ++++++++++++++++++ .../Part/App/ShapeFix/ShapeFix_ShellPy.xml | 5 + .../Part/App/ShapeFix/ShapeFix_ShellPyImp.cpp | 15 +- src/Mod/Part/App/ShapeFix/ShapeFix_WirePy.xml | 5 + .../Part/App/ShapeFix/ShapeFix_WirePyImp.cpp | 13 +- src/Mod/Part/TestPartApp.py | 43 ++++ 13 files changed, 443 insertions(+), 6 deletions(-) create mode 100644 src/Mod/Part/App/ShapeFix/ShapeFix_ShapePy.xml create mode 100644 src/Mod/Part/App/ShapeFix/ShapeFix_ShapePyImp.cpp diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index 46fbe9560a..cd47b69968 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -102,6 +102,7 @@ #include #include #include +#include #include #include #include @@ -345,6 +346,7 @@ PyMOD_INIT_FUNC(Part) PyObject* shapeFix(module.getAttr("ShapeFix").ptr()); Base::Interpreter().addType(&Part::ShapeFix_RootPy::Type, shapeFix, "Root"); Base::Interpreter().addType(&Part::ShapeFix_FacePy::Type, shapeFix, "Face"); + Base::Interpreter().addType(&Part::ShapeFix_ShapePy::Type, shapeFix, "Shape"); Base::Interpreter().addType(&Part::ShapeFix_ShellPy::Type, shapeFix, "Shell"); Base::Interpreter().addType(&Part::ShapeFix_WirePy::Type, shapeFix, "Wire"); diff --git a/src/Mod/Part/App/CMakeLists.txt b/src/Mod/Part/App/CMakeLists.txt index 3799f38c78..29a3a2fc9c 100644 --- a/src/Mod/Part/App/CMakeLists.txt +++ b/src/Mod/Part/App/CMakeLists.txt @@ -138,6 +138,7 @@ generate_from_xml(HLRBRep/PolyHLRToShapePy) generate_from_xml(ShapeFix/ShapeFix_RootPy) generate_from_xml(ShapeFix/ShapeFix_FacePy) +generate_from_xml(ShapeFix/ShapeFix_ShapePy) generate_from_xml(ShapeFix/ShapeFix_ShellPy) generate_from_xml(ShapeFix/ShapeFix_WirePy) @@ -429,6 +430,8 @@ SET(ShapeFixPy_SRCS ShapeFix/ShapeFix_RootPyImp.cpp ShapeFix/ShapeFix_FacePy.xml ShapeFix/ShapeFix_FacePyImp.cpp + ShapeFix/ShapeFix_ShapePy.xml + ShapeFix/ShapeFix_ShapePyImp.cpp ShapeFix/ShapeFix_ShellPy.xml ShapeFix/ShapeFix_ShellPyImp.cpp ShapeFix/ShapeFix_WirePy.xml diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_FacePy.xml b/src/Mod/Part/App/ShapeFix/ShapeFix_FacePy.xml index 8f28046391..b421481d8d 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_FacePy.xml +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_FacePy.xml @@ -20,6 +20,11 @@ Initializes by face + + + Returns tool for fixing wires + + Sets all modes to default diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_FacePyImp.cpp b/src/Mod/Part/App/ShapeFix/ShapeFix_FacePyImp.cpp index 7e751f362a..2209ffad7e 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_FacePyImp.cpp +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_FacePyImp.cpp @@ -28,6 +28,7 @@ #include "ShapeFix/ShapeFix_FacePy.h" #include "ShapeFix/ShapeFix_FacePy.cpp" +#include "ShapeFix/ShapeFix_WirePy.h" #include #include #include @@ -43,7 +44,7 @@ std::string ShapeFix_FacePy::representation() const PyObject *ShapeFix_FacePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { // create a new instance of ShapeFix_FacePy - return new ShapeFix_FacePy(new ShapeFix_Face); + return new ShapeFix_FacePy(nullptr); } // constructor method @@ -51,6 +52,7 @@ int ShapeFix_FacePy::PyInit(PyObject* args, PyObject* /*kwds*/) { PyObject* face = nullptr; if (PyArg_ParseTuple(args, "|O!", &TopoShapeFacePy::Type, &face)) { + setHandle(new ShapeFix_Face()); if (face) { getShapeFix_FacePtr()->Init(TopoDS::Face(static_cast(face)->getTopoShapePtr()->getShape())); } @@ -62,6 +64,7 @@ int ShapeFix_FacePy::PyInit(PyObject* args, PyObject* /*kwds*/) double prec; PyObject* fwd = Py_True; if (PyArg_ParseTuple(args, "O!d|O!", &GeometrySurfacePy::Type, &face, &prec, &PyBool_Type, &fwd)) { + setHandle(new ShapeFix_Face()); if (face) { Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast(static_cast(face)->getGeomSurfacePtr()->handle()); getShapeFix_FacePtr()->Init(surf, prec, PyObject_IsTrue(fwd) ? Standard_True : Standard_False); @@ -75,7 +78,7 @@ int ShapeFix_FacePy::PyInit(PyObject* args, PyObject* /*kwds*/) "-- Surface, Precision, [Forward=True}\n" " Precision is a Float\n" " If Forward is the orientation will be FORWARD or REVERSED otherwise" - ); + ); return -1; } @@ -108,6 +111,17 @@ PyObject* ShapeFix_FacePy::init(PyObject *args) return nullptr; } +PyObject* ShapeFix_FacePy::fixWireTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + Handle(ShapeFix_Wire) tool = getShapeFix_FacePtr()->FixWireTool(); + ShapeFix_WirePy* wire = new ShapeFix_WirePy(nullptr); + wire->setHandle(tool); + return wire; +} + PyObject* ShapeFix_FacePy::clearModes(PyObject *args) { if (!PyArg_ParseTuple(args, "")) diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_RootPy.xml b/src/Mod/Part/App/ShapeFix/ShapeFix_RootPy.xml index a1464ebf69..aba5af8231 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_RootPy.xml +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_RootPy.xml @@ -11,7 +11,7 @@ FatherInclude="Base/PyObjectBase.h" FatherNamespace="Base" Constructor="true" - Delete="true"> + Delete="false"> Root class for fixing operations @@ -39,5 +39,15 @@ + +private: + Handle(ShapeFix_Root) hRoot; + +public: + void setHandle(Handle(ShapeFix_Root) handle) { + setTwinPointer(handle.get()); + hRoot = handle; + } + diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_RootPyImp.cpp b/src/Mod/Part/App/ShapeFix/ShapeFix_RootPyImp.cpp index 3106bdf2f7..e79aac1afb 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_RootPyImp.cpp +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_RootPyImp.cpp @@ -41,7 +41,7 @@ std::string ShapeFix_RootPy::representation() const PyObject *ShapeFix_RootPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { // create a new instance of ShapeFix_RootPy - return new ShapeFix_RootPy(new ShapeFix_Root); + return new ShapeFix_RootPy(nullptr); } // constructor method @@ -50,6 +50,7 @@ int ShapeFix_RootPy::PyInit(PyObject* args, PyObject* /*kwds*/) if (!PyArg_ParseTuple(args, "")) return -1; + setHandle(new ShapeFix_Root); return 0; } diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_ShapePy.xml b/src/Mod/Part/App/ShapeFix/ShapeFix_ShapePy.xml new file mode 100644 index 0000000000..158dfbea35 --- /dev/null +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_ShapePy.xml @@ -0,0 +1,101 @@ + + + + + + Class for fixing operations on shapes + + + + Initializes by shape + + + + + Iterates on sub- shape and performs fixes + + + + + Returns resulting shape + + + + + Returns tool for fixing solids + + + + + Returns tool for fixing shells + + + + + Returns tool for fixing faces + + + + + Returns tool for fixing wires + + + + + Returns tool for fixing edges + + + + + Mode for applying fixes of ShapeFix_Solid + + + + + + Mode for applying fixes of ShapeFix_Shell + + + + + + Mode for applying fixes of ShapeFix_Face + + + + + + Mode for applying fixes of ShapeFix_Wire + + + + + + Mode for applying ShapeFix::SameParameter after all fixes + + + + + + Mode for applying ShapeFix::FixVertexPosition before all fixes + + + + + + Mode for fixing tolerances of vertices on whole shape + + + + + diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_ShapePyImp.cpp b/src/Mod/Part/App/ShapeFix/ShapeFix_ShapePyImp.cpp new file mode 100644 index 0000000000..701384e803 --- /dev/null +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_ShapePyImp.cpp @@ -0,0 +1,224 @@ +/*************************************************************************** + * Copyright (c) 2022 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" +#ifndef _PreComp_ +# include +#endif + +#include "ShapeFix/ShapeFix_ShapePy.h" +#include "ShapeFix/ShapeFix_ShapePy.cpp" +//#include "ShapeFix/ShapeFix_EdgePy.h" +#include "ShapeFix/ShapeFix_WirePy.h" +#include "ShapeFix/ShapeFix_FacePy.h" +#include "ShapeFix/ShapeFix_ShellPy.h" +//#include "ShapeFix/ShapeFix_SolidPy.h" +#include + +using namespace Part; + +// returns a string which represents the object e.g. when printed in python +std::string ShapeFix_ShapePy::representation() const +{ + return ""; +} + +PyObject *ShapeFix_ShapePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper +{ + // create a new instance of ShapeFix_ShapePy + return new ShapeFix_ShapePy(nullptr); +} + +// constructor method +int ShapeFix_ShapePy::PyInit(PyObject* args, PyObject* /*kwds*/) +{ + PyObject* shape = nullptr; + if (!PyArg_ParseTuple(args, "|O!", &TopoShapePy::Type, &shape)) + return -1; + + setHandle(new ShapeFix_Shape); + if (shape) { + getShapeFix_ShapePtr()->Init(static_cast(shape)->getTopoShapePtr()->getShape()); + } + + return 0; +} + +PyObject* ShapeFix_ShapePy::init(PyObject *args) +{ + PyObject* shape; + if (!PyArg_ParseTuple(args, "O!", &TopoShapePy::Type, &shape)) + return nullptr; + + getShapeFix_ShapePtr()->Init(static_cast(shape)->getTopoShapePtr()->getShape()); + Py_Return; +} + +PyObject* ShapeFix_ShapePy::perform(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + Standard_Boolean ok = getShapeFix_ShapePtr()->Perform(); + return Py::new_reference_to(Py::Boolean(ok ? true : false)); +} + +PyObject* ShapeFix_ShapePy::shape(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + TopoShape shape = getShapeFix_ShapePtr()->Shape(); + return shape.getPyObject(); +} + +PyObject* ShapeFix_ShapePy::fixSolidTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + Handle(ShapeFix_Solid) tool = getShapeFix_ShapePtr()->FixSolidTool(); + Py_Return; +} + +PyObject* ShapeFix_ShapePy::fixShellTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + Handle(ShapeFix_Shell) tool = getShapeFix_ShapePtr()->FixShellTool(); + ShapeFix_ShellPy* shell = new ShapeFix_ShellPy(nullptr); + shell->setHandle(tool); + return shell; +} + +PyObject* ShapeFix_ShapePy::fixFaceTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + Handle(ShapeFix_Face) tool = getShapeFix_ShapePtr()->FixFaceTool(); + ShapeFix_FacePy* face = new ShapeFix_FacePy(nullptr); + face->setHandle(tool); + return face; +} + +PyObject* ShapeFix_ShapePy::fixWireTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + Handle(ShapeFix_Wire) tool = getShapeFix_ShapePtr()->FixWireTool(); + ShapeFix_WirePy* wire = new ShapeFix_WirePy(nullptr); + wire->setHandle(tool); + return wire; +} + +PyObject* ShapeFix_ShapePy::fixEdgeTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + //Handle(ShapeFix_Edge) tool = getShapeFix_ShapePtr()->FixEdgeTool(); + Py_Return; +} + +Py::Boolean ShapeFix_ShapePy::getFixSolidMode() const +{ + return Py::Boolean(getShapeFix_ShapePtr()->FixSolidMode()); +} + +void ShapeFix_ShapePy::setFixSolidMode(Py::Boolean arg) +{ + getShapeFix_ShapePtr()->FixSolidMode() = arg; +} + +Py::Boolean ShapeFix_ShapePy::getFixFreeShellMode() const +{ + return Py::Boolean(getShapeFix_ShapePtr()->FixFreeShellMode()); +} + +void ShapeFix_ShapePy::setFixFreeShellMode(Py::Boolean arg) +{ + getShapeFix_ShapePtr()->FixFreeShellMode() = arg; +} + +Py::Boolean ShapeFix_ShapePy::getFixFreeFaceMode() const +{ + return Py::Boolean(getShapeFix_ShapePtr()->FixFreeFaceMode()); +} + +void ShapeFix_ShapePy::setFixFreeFaceMode(Py::Boolean arg) +{ + getShapeFix_ShapePtr()->FixFreeFaceMode() = arg; +} + +Py::Boolean ShapeFix_ShapePy::getFixFreeWireMode() const +{ + return Py::Boolean(getShapeFix_ShapePtr()->FixFreeWireMode()); +} + +void ShapeFix_ShapePy::setFixFreeWireMode(Py::Boolean arg) +{ + getShapeFix_ShapePtr()->FixFreeWireMode() = arg; +} + +Py::Boolean ShapeFix_ShapePy::getFixSameParameterMode() const +{ + return Py::Boolean(getShapeFix_ShapePtr()->FixSameParameterMode()); +} + +void ShapeFix_ShapePy::setFixSameParameterMode(Py::Boolean arg) +{ + getShapeFix_ShapePtr()->FixSameParameterMode() = arg; +} + +Py::Boolean ShapeFix_ShapePy::getFixVertexPositionMode() const +{ + return Py::Boolean(getShapeFix_ShapePtr()->FixVertexPositionMode()); +} + +void ShapeFix_ShapePy::setFixVertexPositionMode(Py::Boolean arg) +{ + getShapeFix_ShapePtr()->FixVertexPositionMode() = arg; +} + +Py::Boolean ShapeFix_ShapePy::getFixVertexTolMode() const +{ + return Py::Boolean(getShapeFix_ShapePtr()->FixVertexTolMode()); +} + +void ShapeFix_ShapePy::setFixVertexTolMode(Py::Boolean arg) +{ + getShapeFix_ShapePtr()->FixVertexTolMode() = arg; +} + +PyObject *ShapeFix_ShapePy::getCustomAttributes(const char* /*attr*/) const +{ + return nullptr; +} + +int ShapeFix_ShapePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPy.xml b/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPy.xml index 88c7fe6f04..96b0c96af6 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPy.xml +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPy.xml @@ -20,6 +20,11 @@ Initializes by shell + + + Returns tool for fixing faces + + Iterates on subshapes and performs fixes diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPyImp.cpp b/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPyImp.cpp index 19fdc6fcb2..8a6c78fbdc 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPyImp.cpp +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_ShellPyImp.cpp @@ -30,6 +30,7 @@ #include "ShapeFix/ShapeFix_ShellPy.h" #include "ShapeFix/ShapeFix_ShellPy.cpp" +#include "ShapeFix/ShapeFix_FacePy.h" #include using namespace Part; @@ -43,7 +44,7 @@ std::string ShapeFix_ShellPy::representation() const PyObject *ShapeFix_ShellPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { // create a new instance of ShapeFix_RootPy - return new ShapeFix_ShellPy(new ShapeFix_Shell); + return new ShapeFix_ShellPy(nullptr); } // constructor method @@ -53,6 +54,7 @@ int ShapeFix_ShellPy::PyInit(PyObject* args, PyObject* /*kwds*/) if (!PyArg_ParseTuple(args, "|O!", &TopoShapeShellPy::Type, &shell)) return -1; + setHandle(new ShapeFix_Shell); if (shell) { getShapeFix_ShellPtr()->Init(TopoDS::Shell(static_cast(shell)->getTopoShapePtr()->getShape())); } @@ -70,6 +72,17 @@ PyObject* ShapeFix_ShellPy::init(PyObject *args) Py_Return; } +PyObject* ShapeFix_ShellPy::fixFaceTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + Handle(ShapeFix_Face) tool = getShapeFix_ShellPtr()->FixFaceTool(); + ShapeFix_FacePy* face = new ShapeFix_FacePy(nullptr); + face->setHandle(tool); + return face; +} + PyObject* ShapeFix_ShellPy::perform(PyObject *args) { if (!PyArg_ParseTuple(args, "")) diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_WirePy.xml b/src/Mod/Part/App/ShapeFix/ShapeFix_WirePy.xml index 85b7adfbc1..c917418979 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_WirePy.xml +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_WirePy.xml @@ -20,6 +20,11 @@ Initializes by wire, face, precision + + + Returns tool for fixing wires + + Sets all modes to default diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp b/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp index 9d52081e4e..70676981ce 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_WirePyImp.cpp @@ -46,7 +46,7 @@ std::string ShapeFix_WirePy::representation() const PyObject *ShapeFix_WirePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - return new ShapeFix_WirePy(new ShapeFix_Wire); + return new ShapeFix_WirePy(nullptr); } // constructor method @@ -54,6 +54,7 @@ int ShapeFix_WirePy::PyInit(PyObject* args, PyObject* /*kwds*/) { if (PyArg_ParseTuple(args, "")) { // Nothing needs to be done + setHandle(new ShapeFix_Wire); return 0; } @@ -63,6 +64,7 @@ int ShapeFix_WirePy::PyInit(PyObject* args, PyObject* /*kwds*/) double prec; if (PyArg_ParseTuple(args, "O!O!d", &TopoShapeWirePy::Type, &wire, &TopoShapeFacePy::Type, &face, &prec)) { + setHandle(new ShapeFix_Wire); TopoDS_Shape w = static_cast(wire)->getTopoShapePtr()->getShape(); TopoDS_Shape f = static_cast(face)->getTopoShapePtr()->getShape(); getShapeFix_WirePtr()->Init(TopoDS::Wire(w), TopoDS::Face(f), prec); @@ -93,6 +95,15 @@ PyObject* ShapeFix_WirePy::init(PyObject *args) Py_Return; } +PyObject* ShapeFix_WirePy::fixEdgeTool(PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) + return nullptr; + + //Handle(ShapeFix_Edge) tool = getShapeFix_WirePtr()->FixEdgeTool(); + Py_Return; +} + PyObject* ShapeFix_WirePy::clearModes(PyObject *args) { if (!PyArg_ParseTuple(args, "")) diff --git a/src/Mod/Part/TestPartApp.py b/src/Mod/Part/TestPartApp.py index 48e723a953..96ac8ce212 100644 --- a/src/Mod/Part/TestPartApp.py +++ b/src/Mod/Part/TestPartApp.py @@ -414,6 +414,46 @@ class PartTestShapeFix(unittest.TestCase): self.assertEqual(fix.limitTolerance(0.25), 0.25) + def testShapeFix_Shape(self): + surface = Part.Plane() + face = surface.toShape(-1, 1, -1, 1) + + with self.assertRaises(TypeError): + Part.ShapeFix.Shape([]) + + fix = Part.ShapeFix.Shape(face) + fix.init(face) + print (fix) + fix.shape() + fix.fixSolidTool() + fix.fixShellTool() + fix.fixFaceTool() + fix.fixWireTool() + fix.fixEdgeTool() + + fix.FixSolidMode = True + self.assertEqual(fix.FixSolidMode, True) + + fix.FixFreeShellMode = True + self.assertEqual(fix.FixFreeShellMode, True) + + fix.FixFreeFaceMode = True + self.assertEqual(fix.FixFreeFaceMode, True) + + fix.FixFreeWireMode = True + self.assertEqual(fix.FixFreeWireMode, True) + + fix.FixSameParameterMode = True + self.assertEqual(fix.FixSameParameterMode, True) + + fix.FixVertexPositionMode = True + self.assertEqual(fix.FixVertexPositionMode, True) + + fix.FixVertexTolMode = True + self.assertEqual(fix.FixVertexTolMode, True) + + fix.perform() + def testShapeFix_Face(self): surface = Part.Plane() face = surface.toShape(-1, 1, -1, 1) @@ -439,6 +479,7 @@ class PartTestShapeFix(unittest.TestCase): fix.add(face.OuterWire) current = fix.face() result = fix.result() + fix.fixWireTool() fix.FixWireMode = True self.assertEqual(fix.FixWireMode, True) @@ -490,6 +531,7 @@ class PartTestShapeFix(unittest.TestCase): fix.perform() fix.shell() fix.shape() + fix.fixFaceTool() fix.setNonManifoldFlag(True) fix.fixFaceOrientation(shell) @@ -519,6 +561,7 @@ class PartTestShapeFix(unittest.TestCase): fix.setFace(face) fix.setMaxTailAngle(math.pi) fix.setMaxTailWidth(10.0) + fix.fixEdgeTool() self.assertEqual(fix.isLoaded(), True) self.assertEqual(fix.isReady(), True)