From 3b6020cda8fb91b3de33cf812975f1bd2f29cac1 Mon Sep 17 00:00:00 2001 From: tomate44 Date: Tue, 28 Mar 2017 17:09:06 +0200 Subject: [PATCH] add doc and a couple of new methods to MakePipeShell --- .../App/BRepOffsetAPI_MakePipeShellPy.xml | 128 +++++++++++++++--- .../App/BRepOffsetAPI_MakePipeShellPyImp.cpp | 43 ++++++ 2 files changed, 155 insertions(+), 16 deletions(-) diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPy.xml b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPy.xml index 8f1b82f0ac..4c93452708 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPy.xml +++ b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPy.xml @@ -17,57 +17,114 @@ - + + setFrenetMode(True|False) + Sets a Frenet or a CorrectedFrenet trihedron to perform the sweeping. + True = Frenet + False = CorrectedFrenet + - + + setTrihedronMode(point,direction) + Sets a fixed trihedron to perform the sweeping. + All sections will be parallel. + - + + setBiNormalMode(direction) + Sets a fixed BiNormal direction to perform the sweeping. + Angular relations beetween the section(s) and the BiNormal direction will be constant. + - + + setSpineSupport(shape) + Sets support to the spine to define the BiNormal of the trihedron, like the normal to the surfaces. + Warning: To be effective, Each edge of the spine must have an representation on one face of SpineSupport. + - + + setAuxiliarySpine(wire, CurvilinearEquivalence, TypeOfContact) + Sets an auxiliary spine to define the Normal. + + CurvilinearEquivalence = bool + For each Point of the Spine P, an Point Q is evalued on AuxiliarySpine. + If CurvilinearEquivalence=True Q split AuxiliarySpine with the same length ratio than P split Spine. + + * OCC before 6.7 + TypeOfContact = bool + True = keep Contact + + * OCC >= 6.7 + TypeOfContact = long + 0: No contact + 1: Contact + 2: Contact On Border (The auxiliary spine becomes a boundary of the swept surface) + - + + add(shape Profile, bool WithContact, bool WithCorrection) + Adds the section Profile to this framework. + First and last sections may be punctual, so the shape Profile may be both wire and vertex. + If WithContact is true, the section is translated to be in contact with the spine. + If WithCorrection is true, the section is rotated to be orthogonal to the spine tangent in the correspondent point. + - + + remove(shape Profile) + Removes the section Profile from this framework. + - + + isReady() + Returns true if this tool object is ready to build the shape. + - + + getStatus() + Get a status, when Simulate or Build failed. + - + + makeSolid() + Transforms the sweeping Shell in Solid. If a propfile is not closed returns False. + - + + setTolerance( tol3d, boundTol, tolAngular) + Tol3d = 3D tolerance + BoundTol = boundary tolerance + TolAngular = angular tolerance + @@ -81,27 +138,66 @@ - + + firstShape() + Returns the Shape of the bottom of the sweep. + - + + lastShape() + Returns the Shape of the top of the sweep. + - + + build() + Builds the resulting shape. + - + + shape() + Returns the resulting shape. + - + + generated(shape S) + Returns a list of new shapes generated from the shape S by the shell-generating algorithm. + + + + + + + setMaxDegree(int degree) + Define the maximum V degree of resulting surface. + + + + + + + setMaxSegments(int num) + Define the maximum number of spans in V-direction on resulting surface. + + + + + + + setForceApproxC1(bool) + Set the flag that indicates attempt to approximate a C1-continuous surface if a swept surface proved to be C0. + diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp index 3052fbf1ff..6caf03d6e5 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp +++ b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp @@ -277,6 +277,49 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setTransitionMode(PyObject *args) Py_Return; } +PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxDegree(PyObject *args) +{ +#if OCC_VERSION_HEX >= 0x060800 + int degree; + if (!PyArg_ParseTuple(args, "i",°ree)) + return 0; + this->getBRepOffsetAPI_MakePipeShellPtr()->SetMaxDegree(degree); + Py_Return; +#else + PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.8"); + return 0; +#endif +} + +PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxSegments(PyObject *args) +{ +#if OCC_VERSION_HEX >= 0x060800 + int nbseg; + if (!PyArg_ParseTuple(args, "i",&nbseg)) + return 0; + this->getBRepOffsetAPI_MakePipeShellPtr()->SetMaxSegments(nbseg); + Py_Return; +#else + PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.8"); + return 0; +#endif +} + +PyObject* BRepOffsetAPI_MakePipeShellPy::setForceApproxC1(PyObject *args) +{ +#if OCC_VERSION_HEX >= 0x060700 + PyObject *obj; + if (!PyArg_ParseTuple(args, "O!",&PyBool_Type,&obj)) + return 0; + this->getBRepOffsetAPI_MakePipeShellPtr()->SetForceApproxC1(PyObject_IsTrue(obj) ? Standard_True : Standard_False); + Py_Return; +#else + PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.7"); + return 0; +#endif +} + + PyObject *BRepOffsetAPI_MakePipeShellPy::getCustomAttributes(const char* ) const { return 0;