Part: Wrap PyArg_ParseTupleAndKeywords
This commit is contained in:
@@ -80,6 +80,7 @@
|
||||
#include <Base/FileInfo.h>
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "BSplineSurfacePy.h"
|
||||
@@ -2229,13 +2230,16 @@ private:
|
||||
PyObject *noElementMap = Py_False;
|
||||
PyObject *refine = Py_False;
|
||||
short retType = 0;
|
||||
static char* kwd_list[] = {"obj", "subname", "mat",
|
||||
"needSubElement","transform","retType","noElementMap","refine",nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|sO!O!O!hO!O!", kwd_list,
|
||||
&App::DocumentObjectPy::Type, &pObj, &subname, &Base::MatrixPy::Type, &pyMat,
|
||||
&PyBool_Type,&needSubElement,&PyBool_Type,&transform,&retType,
|
||||
&PyBool_Type,&noElementMap,&PyBool_Type,&refine))
|
||||
static const std::array<const char *, 9> kwd_list{"obj", "subname", "mat",
|
||||
"needSubElement", "transform", "retType", "noElementMap",
|
||||
"refine", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), kwds.ptr(), "O!|sO!O!O!hO!O!", kwd_list,
|
||||
&App::DocumentObjectPy::Type, &pObj, &subname, &Base::MatrixPy::Type,
|
||||
&pyMat,
|
||||
&PyBool_Type, &needSubElement, &PyBool_Type, &transform, &retType,
|
||||
&PyBool_Type, &noElementMap, &PyBool_Type, &refine)) {
|
||||
throw Py::Exception();
|
||||
}
|
||||
|
||||
App::DocumentObject *obj =
|
||||
static_cast<App::DocumentObjectPy*>(pObj)->getDocumentObjectPtr();
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# include <TopoDS_Face.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "BRepFeat/MakePrismPy.h"
|
||||
@@ -53,13 +54,14 @@ int MakePrismPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
PyObject* Direction;
|
||||
int Fuse;
|
||||
PyObject* Modify;
|
||||
static char* keywords[] = {"Sbase", "Pbase", "Skface", "Direction", "Fuse", "Modify", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!O!iO!", keywords,
|
||||
&(TopoShapePy::Type), &Sbase,
|
||||
&(TopoShapePy::Type), &Pbase,
|
||||
&(TopoShapeFacePy::Type), &Skface,
|
||||
&(Base::VectorPy::Type), &Direction, &Fuse,
|
||||
&(PyBool_Type), &Modify)) {
|
||||
static const std::array<const char *, 7> keywords{"Sbase", "Pbase", "Skface", "Direction", "Fuse", "Modify",
|
||||
nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!O!iO!", keywords,
|
||||
&(TopoShapePy::Type), &Sbase,
|
||||
&(TopoShapePy::Type), &Pbase,
|
||||
&(TopoShapeFacePy::Type), &Skface,
|
||||
&(Base::VectorPy::Type), &Direction, &Fuse,
|
||||
&(PyBool_Type), &Modify)) {
|
||||
try {
|
||||
TopoDS_Shape sbase = static_cast<TopoShapePy*>(Sbase)->getTopoShapePtr()->getShape();
|
||||
TopoDS_Shape pbase = static_cast<TopoShapePy*>(Pbase)->getTopoShapePtr()->getShape();
|
||||
@@ -110,14 +112,16 @@ PyObject* MakePrismPy::init(PyObject *args, PyObject* kwds)
|
||||
PyObject* Direction;
|
||||
int Fuse;
|
||||
PyObject* Modify;
|
||||
static char* keywords[] = {"Sbase", "Pbase", "Skface", "Direction", "Fuse", "Modify", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!O!iO!", keywords,
|
||||
&(TopoShapePy::Type), &Sbase,
|
||||
&(TopoShapePy::Type), &Pbase,
|
||||
&(TopoShapeFacePy::Type), &Skface,
|
||||
&(Base::VectorPy::Type), &Direction, &Fuse,
|
||||
&(PyBool_Type), &Modify))
|
||||
static const std::array<const char *, 7> keywords{"Sbase", "Pbase", "Skface", "Direction", "Fuse", "Modify",
|
||||
nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!O!iO!", keywords,
|
||||
&(TopoShapePy::Type), &Sbase,
|
||||
&(TopoShapePy::Type), &Pbase,
|
||||
&(TopoShapeFacePy::Type), &Skface,
|
||||
&(Base::VectorPy::Type), &Direction, &Fuse,
|
||||
&(PyBool_Type), &Modify)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
@@ -140,11 +144,12 @@ PyObject* MakePrismPy::add(PyObject *args, PyObject* kwds)
|
||||
{
|
||||
PyObject* Edge;
|
||||
PyObject* Face;
|
||||
static char* keywords[] = {"Edge", "Face", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!O!", keywords,
|
||||
&(TopoShapeEdgePy::Type), &Edge,
|
||||
&(TopoShapeFacePy::Type), &Face))
|
||||
static const std::array<const char *, 3> keywords{"Edge", "Face", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!", keywords,
|
||||
&(TopoShapeEdgePy::Type), &Edge,
|
||||
&(TopoShapeFacePy::Type), &Face)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
@@ -164,10 +169,10 @@ PyObject* MakePrismPy::perform(PyObject *args, PyObject* kwds)
|
||||
{
|
||||
PyObject* From;
|
||||
PyObject* Until;
|
||||
static char* keywords_fu[] = {"From", "Until", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!", keywords_fu,
|
||||
&(TopoShapePy::Type), &From,
|
||||
&(TopoShapePy::Type), &Until)) {
|
||||
static const std::array<const char *, 3> keywords_fu{"From", "Until", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!", keywords_fu,
|
||||
&(TopoShapePy::Type), &From,
|
||||
&(TopoShapePy::Type), &Until)) {
|
||||
try {
|
||||
TopoDS_Shape from = static_cast<TopoShapePy*>(From)->getTopoShapePtr()->getShape();
|
||||
TopoDS_Shape until = static_cast<TopoShapePy*>(Until)->getTopoShapePtr()->getShape();
|
||||
@@ -181,9 +186,8 @@ PyObject* MakePrismPy::perform(PyObject *args, PyObject* kwds)
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
static char* keywords_u[] = {"Until", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_u,
|
||||
&(TopoShapePy::Type), &Until)) {
|
||||
static const std::array<const char *, 2> keywords_u {"Until", nullptr};
|
||||
if (Base:: Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_u, &(TopoShapePy::Type), &Until)) {
|
||||
try {
|
||||
TopoDS_Shape until = static_cast<TopoShapePy*>(Until)->getTopoShapePtr()->getShape();
|
||||
getBRepFeat_MakePrismPtr()->Perform(until);
|
||||
@@ -197,8 +201,8 @@ PyObject* MakePrismPy::perform(PyObject *args, PyObject* kwds)
|
||||
|
||||
PyErr_Clear();
|
||||
double length;
|
||||
static char* keywords_l[] = {"Length", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d", keywords_l, &length)) {
|
||||
static const std::array<const char *, 2> keywords_l {"Length", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d", keywords_l, &length)) {
|
||||
try {
|
||||
getBRepFeat_MakePrismPtr()->Perform(length);
|
||||
Py_Return;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
# include <TopoDS_Face.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "BRepOffsetAPI_MakeFillingPy.h"
|
||||
@@ -91,12 +92,13 @@ int BRepOffsetAPI_MakeFillingPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
double tolCurv = 0.1;
|
||||
PyObject* anisotropy = Py_False;
|
||||
|
||||
static char* keywords[] = {"Degree", "NbPtsOnCur", "NbIter", "MaxDegree", "MaxSegments", "Tol2d",
|
||||
"Tol3d", "TolAng", "TolCurv", "Anisotropy", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iiiiiddddO!", keywords,
|
||||
°ree, &nbPtsOnCur, &nbIter, &maxDeg, &maxSegments,
|
||||
&tol2d, &tol3d, &tolAng, &tolCurv, &PyBool_Type, &anisotropy))
|
||||
static const std::array<const char *, 11> keywords{"Degree", "NbPtsOnCur", "NbIter", "MaxDegree", "MaxSegments",
|
||||
"Tol2d", "Tol3d", "TolAng", "TolCurv", "Anisotropy", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|iiiiiddddO!", keywords,
|
||||
°ree, &nbPtsOnCur, &nbIter, &maxDeg, &maxSegments,
|
||||
&tol2d, &tol3d, &tolAng, &tolCurv, &PyBool_Type, &anisotropy)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
try {
|
||||
std::unique_ptr<BRepOffsetAPI_MakeFilling> ptr(new BRepOffsetAPI_MakeFilling(degree, nbPtsOnCur, nbIter,
|
||||
@@ -126,10 +128,11 @@ PyObject* BRepOffsetAPI_MakeFillingPy::setConstrParam(PyObject *args, PyObject *
|
||||
double tolAng = 0.01;
|
||||
double tolCurv = 0.1;
|
||||
|
||||
static char* keywords[] = {"Tol2d", "Tol3d", "TolAng", "TolCurv", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|dddd", keywords,
|
||||
&tol2d, &tol3d, &tolAng, &tolCurv))
|
||||
static const std::array<const char *, 5> keywords {"Tol2d", "Tol3d", "TolAng", "TolCurv", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|dddd", keywords,
|
||||
&tol2d, &tol3d, &tolAng, &tolCurv)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
getBRepOffsetAPI_MakeFillingPtr()->SetConstrParam(tol2d, tol3d, tolAng, tolCurv);
|
||||
@@ -148,10 +151,11 @@ PyObject* BRepOffsetAPI_MakeFillingPy::setResolParam(PyObject *args, PyObject *k
|
||||
int nbIter = 2;
|
||||
PyObject* anisotropy = Py_False;
|
||||
|
||||
static char* keywords[] = {"Degree", "NbPtsOnCur", "NbIter", "Anisotropy", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iiiO!", keywords,
|
||||
°ree, &nbPtsOnCur, &nbIter, &PyBool_Type, &anisotropy))
|
||||
static const std::array<const char *, 5> keywords {"Degree", "NbPtsOnCur", "NbIter", "Anisotropy", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|iiiO!", keywords,
|
||||
°ree, &nbPtsOnCur, &nbIter, &PyBool_Type, &anisotropy)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
getBRepOffsetAPI_MakeFillingPtr()->SetResolParam(degree, nbPtsOnCur, nbIter,
|
||||
@@ -169,10 +173,11 @@ PyObject* BRepOffsetAPI_MakeFillingPy::setApproxParam(PyObject *args, PyObject *
|
||||
int maxDeg = 8;
|
||||
int maxSegments = 9;
|
||||
|
||||
static char* keywords[] = {"MaxDegree", "MaxSegments", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii", keywords,
|
||||
&maxDeg, &maxSegments))
|
||||
static const std::array<const char *, 3> keywords {"MaxDegree", "MaxSegments", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|ii", keywords,
|
||||
&maxDeg, &maxSegments)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
getBRepOffsetAPI_MakeFillingPtr()->SetApproxParam(maxDeg, maxSegments);
|
||||
@@ -210,9 +215,9 @@ PyObject* BRepOffsetAPI_MakeFillingPy::add(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
// 1st
|
||||
PyObject* pnt;
|
||||
static char* keywords_pnt[] = {"Point", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_pnt,
|
||||
&Base::VectorPy::Type, &pnt)) {
|
||||
static const std::array<const char *, 2> keywords_pnt {"Point", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_pnt,
|
||||
&Base::VectorPy::Type, &pnt)) {
|
||||
try {
|
||||
Base::Vector3d vec = static_cast<Base::VectorPy*>(pnt)->value();
|
||||
getBRepOffsetAPI_MakeFillingPtr()->Add(gp_Pnt(vec.x, vec.y, vec.z));
|
||||
@@ -227,10 +232,10 @@ PyObject* BRepOffsetAPI_MakeFillingPy::add(PyObject *args, PyObject *kwds)
|
||||
// 2nd
|
||||
PyObject* support;
|
||||
int order;
|
||||
static char* keywords_sup_ord[] = {"Support", "Order", nullptr};
|
||||
static const std::array<const char *, 3> keywords_sup_ord {"Support", "Order", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!i", keywords_sup_ord,
|
||||
&TopoShapeFacePy::Type, &support, &order)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!i", keywords_sup_ord,
|
||||
&TopoShapeFacePy::Type, &support, &order)) {
|
||||
try {
|
||||
TopoDS_Face face = TopoDS::Face(static_cast<TopoShapeFacePy*>(support)->getTopoShapePtr()->getShape());
|
||||
if (face.IsNull()) {
|
||||
@@ -255,11 +260,11 @@ PyObject* BRepOffsetAPI_MakeFillingPy::add(PyObject *args, PyObject *kwds)
|
||||
// 3rd
|
||||
PyObject* constr;
|
||||
PyObject* isbound = Py_True;
|
||||
static char* keywords_const[] = {"Constraint", "Order", "IsBound", nullptr};
|
||||
static const std::array<const char *, 4> keywords_const {"Constraint", "Order", "IsBound", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!i|O!", keywords_const,
|
||||
&TopoShapeEdgePy::Type, &constr,
|
||||
&order, &PyBool_Type, isbound)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!i|O!", keywords_const,
|
||||
&TopoShapeEdgePy::Type, &constr,
|
||||
&order, &PyBool_Type, isbound)) {
|
||||
try {
|
||||
TopoDS_Edge edge = TopoDS::Edge(static_cast<TopoShapeEdgePy*>(constr)->getTopoShapePtr()->getShape());
|
||||
if (edge.IsNull()) {
|
||||
@@ -283,12 +288,12 @@ PyObject* BRepOffsetAPI_MakeFillingPy::add(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// 4th
|
||||
static char* keywords_const_sup[] = {"Constraint", "Support", "Order", "IsBound", nullptr};
|
||||
static const std::array<const char *, 5> keywords_const_sup {"Constraint", "Support", "Order", "IsBound", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!i|O!", keywords_const_sup,
|
||||
&TopoShapeEdgePy::Type, &constr,
|
||||
&TopoShapeFacePy::Type, &support,
|
||||
&order, &PyBool_Type, isbound)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!i|O!", keywords_const_sup,
|
||||
&TopoShapeEdgePy::Type, &constr,
|
||||
&TopoShapeFacePy::Type, &support,
|
||||
&order, &PyBool_Type, isbound)) {
|
||||
try {
|
||||
TopoDS_Edge edge = TopoDS::Edge(static_cast<TopoShapeEdgePy*>(constr)->getTopoShapePtr()->getShape());
|
||||
if (edge.IsNull()) {
|
||||
@@ -318,10 +323,10 @@ PyObject* BRepOffsetAPI_MakeFillingPy::add(PyObject *args, PyObject *kwds)
|
||||
|
||||
// 5th
|
||||
double u, v;
|
||||
static char* keywords_uv[] = {"U", "V", "Support", "Order", nullptr};
|
||||
static const std::array<const char *, 5> keywords_uv {"U", "V", "Support", "Order", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "ddO!i", keywords_uv,
|
||||
&u, &v, &TopoShapeFacePy::Type, &support, &order)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "ddO!i", keywords_uv,
|
||||
&u, &v, &TopoShapeFacePy::Type, &support, &order)) {
|
||||
try {
|
||||
TopoDS_Face face = TopoDS::Face(static_cast<TopoShapeFacePy*>(support)->getTopoShapePtr()->getShape());
|
||||
if (face.IsNull()) {
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "BRepOffsetAPI_MakePipeShellPy.h"
|
||||
@@ -182,11 +183,9 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
|
||||
PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
PyObject *prof, *curv=Py_False, *keep=Py_False;
|
||||
static char* keywords_pro[] = {"Profile","WithContact","WithCorrection",nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args,kwds, "O!|O!O!", keywords_pro
|
||||
,&Part::TopoShapePy::Type,&prof
|
||||
,&PyBool_Type,&curv
|
||||
,&PyBool_Type,&keep)) {
|
||||
static const std::array<const char *, 4> keywords_pro{"Profile", "WithContact", "WithCorrection", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|O!O!", keywords_pro, &Part::TopoShapePy::Type, &prof,
|
||||
&PyBool_Type, &curv, &PyBool_Type, &keep)) {
|
||||
try {
|
||||
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(prof)->getTopoShapePtr()->getShape();
|
||||
this->getBRepOffsetAPI_MakePipeShellPtr()->Add(s, Base::asBoolean(curv), Base::asBoolean(keep));
|
||||
@@ -200,12 +199,11 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
|
||||
|
||||
PyErr_Clear();
|
||||
PyObject *loc;
|
||||
static char* keywords_loc[] = {"Profile","Location","WithContact","WithCorrection",nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args,kwds, "O!O!|O!O!", keywords_loc
|
||||
,&Part::TopoShapePy::Type,&prof
|
||||
,&Part::TopoShapeVertexPy::Type,&loc
|
||||
,&PyBool_Type,&curv
|
||||
,&PyBool_Type,&keep)) {
|
||||
static const std::array<const char *, 5> keywords_loc{"Profile", "Location", "WithContact", "WithCorrection",
|
||||
nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!|O!O!", keywords_loc, &Part::TopoShapePy::Type, &prof,
|
||||
&Part::TopoShapeVertexPy::Type, &loc, &PyBool_Type, &curv, &PyBool_Type,
|
||||
&keep)) {
|
||||
try {
|
||||
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(prof)->getTopoShapePtr()->getShape();
|
||||
const TopoDS_Vertex& v = TopoDS::Vertex(static_cast<Part::TopoShapePy*>(loc)->getTopoShapePtr()->getShape());
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "BSplineCurvePy.h"
|
||||
@@ -790,22 +791,23 @@ PyObject* BSplineCurvePy::toBiArcs(PyObject * args)
|
||||
|
||||
PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
PyObject* obj;
|
||||
Standard_Integer degMin=3;
|
||||
Standard_Integer degMax=8;
|
||||
Standard_Integer segMax=8;
|
||||
char* continuity = "C2";
|
||||
PyObject *obj;
|
||||
Standard_Integer degMin = 3;
|
||||
Standard_Integer degMax = 8;
|
||||
Standard_Integer segMax = 8;
|
||||
char *continuity = "C2";
|
||||
double tol3d = 1e-3;
|
||||
char* parType = "ChordLength";
|
||||
PyObject* par = nullptr;
|
||||
char *parType = "ChordLength";
|
||||
PyObject *par = nullptr;
|
||||
double weight1 = 0;
|
||||
double weight2 = 0;
|
||||
double weight3 = 0;
|
||||
|
||||
// Approximate this curve with a given continuity and degree
|
||||
static char* kwds_reapprox[] = {"MaxDegree", "MaxSegments", "Continuity", "Tolerance", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|isd", kwds_reapprox,
|
||||
&tol3d, °Max, &segMax, &continuity)) {
|
||||
static const std::array<const char *, 5> kwds_reapprox{"MaxDegree", "MaxSegments", "Continuity", "Tolerance",
|
||||
nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|isd", kwds_reapprox,
|
||||
&tol3d, °Max, &segMax, &continuity)) {
|
||||
|
||||
GeomAbs_Shape c;
|
||||
std::string str = continuity;
|
||||
@@ -832,20 +834,22 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds)
|
||||
|
||||
// Approximate a list of points
|
||||
//
|
||||
static char* kwds_interp[] = {"Points", "DegMax", "Continuity", "Tolerance", "DegMin", "ParamType", "Parameters",
|
||||
"LengthWeight", "CurvatureWeight", "TorsionWeight", nullptr};
|
||||
static const std::array<const char *, 11> kwds_interp{"Points", "DegMax", "Continuity", "Tolerance", "DegMin",
|
||||
"ParamType", "Parameters", "LengthWeight", "CurvatureWeight",
|
||||
"TorsionWeight", nullptr};
|
||||
|
||||
PyErr_Clear();
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|isdisOddd",kwds_interp,
|
||||
&obj, °Max,
|
||||
&continuity, &tol3d, °Min,
|
||||
&parType, &par,
|
||||
&weight1, &weight2, &weight3))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O|isdisOddd", kwds_interp,
|
||||
&obj, °Max,
|
||||
&continuity, &tol3d, °Min,
|
||||
&parType, &par,
|
||||
&weight1, &weight2, &weight3)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
TColgp_Array1OfPnt pnts(1,list.size());
|
||||
TColgp_Array1OfPnt pnts(1, list.size());
|
||||
Standard_Integer index = 1;
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
Base::Vector3d vec = Py::Vector(*it).toVector();
|
||||
@@ -942,8 +946,8 @@ PyObject* BSplineCurvePy::getCardinalSplineTangents(PyObject *args, PyObject *kw
|
||||
PyObject* tgs;
|
||||
double parameter;
|
||||
|
||||
static char* kwds_interp1[] = {"Points", "Parameter", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "Od",kwds_interp1, &pts, ¶meter)) {
|
||||
static const std::array<const char *, 3> kwds_interp1 {"Points", "Parameter", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "Od",kwds_interp1, &pts, ¶meter)) {
|
||||
Py::Sequence list(pts);
|
||||
std::vector<gp_Pnt> interpPoints;
|
||||
interpPoints.reserve(list.size());
|
||||
@@ -964,8 +968,8 @@ PyObject* BSplineCurvePy::getCardinalSplineTangents(PyObject *args, PyObject *kw
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
static char* kwds_interp2[] = {"Points", "Parameters", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "OO",kwds_interp2, &pts, &tgs)) {
|
||||
static const std::array<const char *, 3> kwds_interp2 {"Points", "Parameters", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "OO",kwds_interp2, &pts, &tgs)) {
|
||||
Py::Sequence list(pts);
|
||||
std::vector<gp_Pnt> interpPoints;
|
||||
interpPoints.reserve(list.size());
|
||||
@@ -1006,15 +1010,17 @@ PyObject* BSplineCurvePy::interpolate(PyObject *args, PyObject *kwds)
|
||||
PyObject* ts = nullptr; PyObject* fl = nullptr;
|
||||
PyObject* scale = Py_True;
|
||||
|
||||
static char* kwds_interp[] = {"Points", "PeriodicFlag", "Tolerance", "InitialTangent", "FinalTangent",
|
||||
"Tangents", "TangentFlags", "Parameters", "Scale", nullptr};
|
||||
static const std::array<const char *, 10> kwds_interp{"Points", "PeriodicFlag", "Tolerance", "InitialTangent",
|
||||
"FinalTangent", "Tangents", "TangentFlags", "Parameters",
|
||||
"Scale", nullptr};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O!dO!O!OOOO!",kwds_interp,
|
||||
&obj, &PyBool_Type, &periodic, &tol3d,
|
||||
&Base::VectorPy::Type, &t1,
|
||||
&Base::VectorPy::Type, &t2,
|
||||
&ts, &fl, &par, &PyBool_Type, &scale))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O|O!dO!O!OOOO!", kwds_interp,
|
||||
&obj, &PyBool_Type, &periodic, &tol3d,
|
||||
&Base::VectorPy::Type, &t1,
|
||||
&Base::VectorPy::Type, &t2,
|
||||
&ts, &fl, &par, &PyBool_Type, &scale)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
@@ -1177,9 +1183,10 @@ PyObject* BSplineCurvePy::buildFromPoles(PyObject *args)
|
||||
|
||||
PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *keywds)
|
||||
{
|
||||
static char *kwlist[] = {"poles", "mults", "knots", "periodic", "degree", "weights", "CheckRational", nullptr};
|
||||
PyObject* periodic = Py_False;
|
||||
PyObject* CheckRational = Py_True;
|
||||
static const std::array<const char *, 8> kwlist{"poles", "mults", "knots", "periodic", "degree", "weights",
|
||||
"CheckRational", nullptr};
|
||||
PyObject* periodic = Py_False; // NOLINT
|
||||
PyObject* CheckRational = Py_True; // NOLINT
|
||||
PyObject* poles = Py_None;
|
||||
PyObject* mults = Py_None;
|
||||
PyObject* knots = Py_None;
|
||||
@@ -1188,12 +1195,13 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
|
||||
int number_of_poles = 0;
|
||||
int number_of_knots = 0;
|
||||
int sum_of_mults = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "O|OOO!iOO!", kwlist,
|
||||
&poles, &mults, &knots,
|
||||
&PyBool_Type, &periodic,
|
||||
°ree, &weights,
|
||||
&PyBool_Type, &CheckRational))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "O|OOO!iOO!", kwlist,
|
||||
&poles, &mults, &knots,
|
||||
&PyBool_Type, &periodic,
|
||||
°ree, &weights,
|
||||
&PyBool_Type, &CheckRational)) {
|
||||
return nullptr;
|
||||
}
|
||||
try {
|
||||
// poles have to be present
|
||||
Py::Sequence list(poles);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
# include <GeomFill_NSections.hxx>
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "BSplineSurfacePy.h"
|
||||
@@ -1166,10 +1167,15 @@ PyObject* BSplineSurfacePy::approximate(PyObject *args, PyObject *kwds)
|
||||
Standard_Real Y0=0;
|
||||
Standard_Real dY=0;
|
||||
|
||||
static char* kwds_interp[] = {"Points", "DegMin", "DegMax", "Continuity", "Tolerance", "X0", "dX", "Y0", "dY", "ParamType", "LengthWeight", "CurvatureWeight", "TorsionWeight", nullptr};
|
||||
static const std::array<const char *, 14> kwds_interp{"Points", "DegMin", "DegMax", "Continuity", "Tolerance", "X0",
|
||||
"dX", "Y0", "dY", "ParamType", "LengthWeight",
|
||||
"CurvatureWeight", "TorsionWeight", nullptr};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|iiidddddsddd", kwds_interp, &obj, °Min, °Max, &continuity, &tol3d, &X0, &dX, &Y0, &dY, &parType, &weight1, &weight2, &weight3))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O|iiidddddsddd", kwds_interp, &obj, °Min, °Max,
|
||||
&continuity, &tol3d, &X0, &dX, &Y0, &dY, &parType, &weight1, &weight2,
|
||||
&weight3)) {
|
||||
return nullptr;
|
||||
}
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
Standard_Integer lu = list.size();
|
||||
@@ -1328,10 +1334,10 @@ PyObject* BSplineSurfacePy::interpolate(PyObject *args)
|
||||
|
||||
PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *keywds)
|
||||
{
|
||||
static char *kwlist[] = {"poles", "umults", "vmults",
|
||||
"uknots", "vknots", "uperiodic", "vperiodic", "udegree", "vdegree", "weights", nullptr};
|
||||
PyObject* uperiodic = Py_False;
|
||||
PyObject* vperiodic = Py_False;
|
||||
static const std::array<const char *, 11> kwlist{"poles", "umults", "vmults", "uknots", "vknots", "uperiodic",
|
||||
"vperiodic", "udegree", "vdegree", "weights", nullptr};
|
||||
PyObject* uperiodic = Py_False; // NOLINT
|
||||
PyObject* vperiodic = Py_False; // NOLINT
|
||||
PyObject* poles = Py_None;
|
||||
PyObject* umults = Py_None;
|
||||
PyObject* vmults = Py_None;
|
||||
@@ -1345,12 +1351,13 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
int sum_of_umults = 0;
|
||||
int sum_of_vmults = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "OOO|OOO!O!iiO", kwlist,
|
||||
&poles, &umults, &vmults, //required
|
||||
&uknots, &vknots, //optional
|
||||
&PyBool_Type, &uperiodic, &PyBool_Type, &vperiodic, //optinoal
|
||||
&udegree, &vdegree, &weights)) //optional
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "OOO|OOO!O!iiO", kwlist,
|
||||
&poles, &umults, &vmults, //required
|
||||
&uknots, &vknots, //optional
|
||||
&PyBool_Type, &uperiodic, &PyBool_Type, &vperiodic, //optional
|
||||
&udegree, &vdegree, &weights)) {
|
||||
return nullptr;
|
||||
}
|
||||
try {
|
||||
Py::Sequence list(poles);
|
||||
Standard_Integer lu = list.size();
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# include <gp_Circ.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "CirclePy.h"
|
||||
@@ -70,8 +71,8 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
// circle and distance for offset
|
||||
PyObject *pCirc;
|
||||
double dist;
|
||||
static char* keywords_cd[] = {"Circle","Distance",nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CirclePy::Type), &pCirc, &dist)) {
|
||||
static const std::array<const char *, 3> keywords_cd {"Circle", "Distance", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CirclePy::Type), &pCirc, &dist)) {
|
||||
CirclePy* pcCircle = static_cast<CirclePy*>(pCirc);
|
||||
Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast
|
||||
(pcCircle->getGeomCirclePtr()->handle());
|
||||
@@ -88,12 +89,12 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
|
||||
// center, normal and radius
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
static char* keywords_cnr[] = {"Center","Normal","Radius",nullptr};
|
||||
static const std::array<const char *, 4> keywords_cnr {"Center", "Normal", "Radius", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!d", keywords_cnr,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&dist)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!d", keywords_cnr,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&dist)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
GC_MakeCircle mc(gp_Pnt(v1.x,v1.y,v1.z),
|
||||
@@ -109,9 +110,9 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_c[] = {"Circle",nullptr};
|
||||
static const std::array<const char *, 2> keywords_c {"Circle", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(CirclePy::Type), &pCirc)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(CirclePy::Type), &pCirc)) {
|
||||
CirclePy* pcCircle = static_cast<CirclePy*>(pCirc);
|
||||
Handle(Geom_Circle) circ1 = Handle(Geom_Circle)::DownCast
|
||||
(pcCircle->getGeomCirclePtr()->handle());
|
||||
@@ -121,12 +122,12 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ppp {"Point1", "Point2", "Point3", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
Base::Vector3d v3 = static_cast<Base::VectorPy*>(pV3)->value();
|
||||
@@ -144,9 +145,9 @@ int CirclePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
}
|
||||
|
||||
// default circle
|
||||
static char* keywords_n[] = {nullptr};
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast(getGeomCirclePtr()->handle());
|
||||
circle->SetRadius(1.0);
|
||||
return 0;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "ConePy.h"
|
||||
@@ -55,22 +56,22 @@ PyObject *ConePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pytho
|
||||
// constructor method
|
||||
int ConePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
char* keywords_n[] = {nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
static const std::array<const char *, 1> keywords_n{nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom_ConicalSurface) s = Handle(Geom_ConicalSurface)::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
(getGeometryPtr()->handle());
|
||||
s->SetRadius(1.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *pV1, *pV2;
|
||||
double radius1, radius2;
|
||||
static char* keywords_pprr[] = {"Point1","Point2","Radius1","Radius2",nullptr};
|
||||
static const std::array<const char *, 5> keywords_pprr {"Point1", "Point2", "Radius1", "Radius2", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!dd", keywords_pprr,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&radius1, &radius2)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!dd", keywords_pprr,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&radius1, &radius2)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
GC_MakeConicalSurface mc(gp_Pnt(v1.x,v1.y,v1.z),
|
||||
@@ -88,13 +89,13 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
}
|
||||
|
||||
PyObject *pV3, *pV4;
|
||||
static char* keywords_pppp[] = {"Point1","Point2","Point3","Point4",nullptr};
|
||||
static const std::array<const char *, 5> keywords_pppp{"Point1", "Point2", "Point3", "Point4", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!O!", keywords_pppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3,
|
||||
&(Base::VectorPy::Type), &pV4)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!O!", keywords_pppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3,
|
||||
&(Base::VectorPy::Type), &pV4)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
Base::Vector3d v3 = static_cast<Base::VectorPy*>(pV3)->value();
|
||||
@@ -109,16 +110,16 @@ int ConePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
}
|
||||
|
||||
Handle(Geom_ConicalSurface) cone = Handle(Geom_ConicalSurface)::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
(getGeometryPtr()->handle());
|
||||
cone->SetCone(mc.Value()->Cone());
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *pCone;
|
||||
static char* keywords_c[] = {"Cone",nullptr};
|
||||
static const std::array<const char *, 2> keywords_c{"Cone", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_c,
|
||||
&(ConePy::Type), &pCone)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_c,
|
||||
&(ConePy::Type), &pCone)) {
|
||||
ConePy* pcCone = static_cast<ConePy*>(pCone);
|
||||
Handle(Geom_ConicalSurface) pcone = Handle(Geom_ConicalSurface)::DownCast
|
||||
(pcCone->getGeometryPtr()->handle());
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "CylinderPy.h"
|
||||
@@ -59,8 +60,8 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
// cylinder and distance for offset
|
||||
PyObject *pCyl;
|
||||
double dist;
|
||||
static char* keywords_cd[] = {"Cylinder","Distance",nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CylinderPy::Type), &pCyl, &dist)) {
|
||||
static const std::array<const char *, 3> keywords_cd{"Cylinder", "Distance", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(CylinderPy::Type), &pCyl, &dist)) {
|
||||
CylinderPy* pcCylinder = static_cast<CylinderPy*>(pCyl);
|
||||
Handle(Geom_CylindricalSurface) cylinder = Handle(Geom_CylindricalSurface)::DownCast
|
||||
(pcCylinder->getGeomCylinderPtr()->handle());
|
||||
@@ -76,9 +77,9 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_c[] = {"Cylinder",nullptr};
|
||||
static const std::array<const char *, 2> keywords_c {"Cylinder", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(CylinderPy::Type), &pCyl)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(CylinderPy::Type), &pCyl)) {
|
||||
CylinderPy* pcCylinder = static_cast<CylinderPy*>(pCyl);
|
||||
Handle(Geom_CylindricalSurface) cyl1 = Handle(Geom_CylindricalSurface)::DownCast
|
||||
(pcCylinder->getGeomCylinderPtr()->handle());
|
||||
@@ -89,12 +90,12 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
}
|
||||
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ppp {"Point1", "Point2", "Point3", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
Base::Vector3d v3 = static_cast<Base::VectorPy*>(pV3)->value();
|
||||
@@ -112,10 +113,10 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_cc[] = {"Circle",nullptr};
|
||||
static const std::array<const char *, 2> keywords_cc {"Circle", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pCirc;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_cc, &(CirclePy::Type), &pCirc)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_cc, &(CirclePy::Type), &pCirc)) {
|
||||
CirclePy* pcCircle = static_cast<CirclePy*>(pCirc);
|
||||
Handle(Geom_Circle) circ = Handle(Geom_Circle)::DownCast
|
||||
(pcCircle->getGeomCirclePtr()->handle());
|
||||
@@ -131,9 +132,9 @@ int CylinderPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_n[] = {nullptr};
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom_CylindricalSurface) cyl = Handle(Geom_CylindricalSurface)::DownCast
|
||||
(getGeomCylinderPtr()->handle());
|
||||
cyl->SetRadius(1.0);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "EllipsePy.h"
|
||||
@@ -53,18 +54,18 @@ PyObject *EllipsePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
|
||||
// constructor method
|
||||
int EllipsePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
char* keywords_n[] = {nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom_Ellipse) ellipse = Handle(Geom_Ellipse)::DownCast(getGeomEllipsePtr()->handle());
|
||||
ellipse->SetMajorRadius(2.0);
|
||||
ellipse->SetMinorRadius(1.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_e[] = {"Ellipse",nullptr};
|
||||
static const std::array<const char *, 2> keywords_e {"Ellipse", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pElips;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(EllipsePy::Type), &pElips)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(EllipsePy::Type), &pElips)) {
|
||||
EllipsePy* pEllipse = static_cast<EllipsePy*>(pElips);
|
||||
Handle(Geom_Ellipse) Elips1 = Handle(Geom_Ellipse)::DownCast
|
||||
(pEllipse->getGeomEllipsePtr()->handle());
|
||||
@@ -74,13 +75,13 @@ int EllipsePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ssc {"S1", "S2", "Center", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
Base::Vector3d v3 = static_cast<Base::VectorPy*>(pV3)->value();
|
||||
@@ -97,11 +98,11 @@ int EllipsePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
|
||||
static const std::array<const char *, 4> keywords_cmm {"Center", "MajorRadius", "MinorRadius", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV;
|
||||
double major, minor;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
&(Base::VectorPy::Type), &pV,
|
||||
&major, &minor)) {
|
||||
Base::Vector3d c = static_cast<Base::VectorPy*>(pV)->value();
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "Geom2d/BSplineCurve2dPy.h"
|
||||
#include "Geom2d/BSplineCurve2dPy.cpp"
|
||||
@@ -737,15 +738,17 @@ PyObject* BSplineCurve2dPy::approximate(PyObject *args, PyObject *kwds)
|
||||
double weight2 = 0;
|
||||
double weight3 = 0;
|
||||
|
||||
static char* kwds_interp[] = {"Points", "DegMax", "Continuity", "Tolerance", "DegMin", "ParamType", "Parameters",
|
||||
"LengthWeight", "CurvatureWeight", "TorsionWeight", nullptr};
|
||||
static const std::array<const char *, 11> kwds_interp{"Points", "DegMax", "Continuity", "Tolerance", "DegMin",
|
||||
"ParamType", "Parameters", "LengthWeight", "CurvatureWeight",
|
||||
"TorsionWeight", nullptr};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|isdisOddd",kwds_interp,
|
||||
&obj, °Max,
|
||||
&continuity, &tol3d, °Min,
|
||||
&parType, &par,
|
||||
&weight1, &weight2, &weight3))
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O|isdisOddd",kwds_interp,
|
||||
&obj, °Max,
|
||||
&continuity, &tol3d, °Min,
|
||||
&parType, &par,
|
||||
&weight1, &weight2, &weight3)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
@@ -850,8 +853,8 @@ PyObject* BSplineCurve2dPy::getCardinalSplineTangents(PyObject *args, PyObject *
|
||||
PyObject* tgs;
|
||||
double parameter;
|
||||
|
||||
static char* kwds_interp1[] = {"Points", "Parameter", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "Od",kwds_interp1, &pts, ¶meter)) {
|
||||
static const std::array<const char *, 3> kwds_interp1 {"Points", "Parameter", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "Od", kwds_interp1, &pts, ¶meter)) {
|
||||
Py::Sequence list(pts);
|
||||
std::vector<gp_Pnt2d> interpPoints;
|
||||
interpPoints.reserve(list.size());
|
||||
@@ -872,8 +875,8 @@ PyObject* BSplineCurve2dPy::getCardinalSplineTangents(PyObject *args, PyObject *
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
static char* kwds_interp2[] = {"Points", "Parameters", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "OO",kwds_interp2, &pts, &tgs)) {
|
||||
static const std::array<const char *, 3> kwds_interp2 {"Points", "Parameters", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "OO", kwds_interp2, &pts, &tgs)) {
|
||||
Py::Sequence list(pts);
|
||||
std::vector<gp_Pnt2d> interpPoints;
|
||||
interpPoints.reserve(list.size());
|
||||
@@ -913,15 +916,17 @@ PyObject* BSplineCurve2dPy::interpolate(PyObject *args, PyObject *kwds)
|
||||
PyObject* t1 = nullptr; PyObject* t2 = nullptr;
|
||||
PyObject* ts = nullptr; PyObject* fl = nullptr;
|
||||
|
||||
static char* kwds_interp[] = {"Points", "PeriodicFlag", "Tolerance", "InitialTangent", "FinalTangent",
|
||||
"Tangents", "TangentFlags", "Parameters", nullptr};
|
||||
static const std::array<const char *, 9> kwds_interp{"Points", "PeriodicFlag", "Tolerance", "InitialTangent",
|
||||
"FinalTangent", "Tangents", "TangentFlags", "Parameters",
|
||||
nullptr};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O!dO!O!OOO",kwds_interp,
|
||||
&obj, &PyBool_Type, &periodic, &tol3d,
|
||||
Base::Vector2dPy::type_object(), &t1,
|
||||
Base::Vector2dPy::type_object(), &t2,
|
||||
&ts, &fl, &par))
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O|O!dO!O!OOO",kwds_interp,
|
||||
&obj, &PyBool_Type, &periodic, &tol3d,
|
||||
Base::Vector2dPy::type_object(), &t1,
|
||||
Base::Vector2dPy::type_object(), &t2,
|
||||
&ts, &fl, &par)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
@@ -1085,7 +1090,8 @@ PyObject* BSplineCurve2dPy::buildFromPoles(PyObject *args)
|
||||
|
||||
PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *keywds)
|
||||
{
|
||||
static char *kwlist[] = {"poles", "mults", "knots", "periodic", "degree", "weights", nullptr};
|
||||
static const std::array<const char *, 7> kwlist{"poles", "mults", "knots", "periodic", "degree", "weights",
|
||||
nullptr};
|
||||
PyObject* periodic = Py_False;
|
||||
PyObject* poles = Py_None;
|
||||
PyObject* mults = Py_None;
|
||||
@@ -1095,11 +1101,12 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
int number_of_poles = 0;
|
||||
int number_of_knots = 0;
|
||||
int sum_of_mults = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "O|OOO!iO", kwlist,
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "O|OOO!iO", kwlist,
|
||||
&poles, &mults, &knots,
|
||||
&PyBool_Type, &periodic,
|
||||
°ree, &weights))
|
||||
°ree, &weights)) {
|
||||
return nullptr;
|
||||
}
|
||||
try {
|
||||
// poles have to be present
|
||||
Py::Sequence list(poles);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "Geom2d/Circle2dPy.h"
|
||||
#include "Geom2d/Circle2dPy.cpp"
|
||||
@@ -56,8 +57,8 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
// circle and distance for offset
|
||||
PyObject *pCirc;
|
||||
double dist;
|
||||
static char* keywords_cd[] = {"Circle","Distance",nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(Circle2dPy::Type), &pCirc, &dist)) {
|
||||
static const std::array<const char *, 3> keywords_cd {"Circle","Distance",nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cd, &(Circle2dPy::Type), &pCirc, &dist)) {
|
||||
Circle2dPy* pcCircle = static_cast<Circle2dPy*>(pCirc);
|
||||
Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast
|
||||
(pcCircle->getGeom2dCirclePtr()->handle());
|
||||
@@ -74,9 +75,9 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
|
||||
// center and radius
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
static char* keywords_cnr[] = {"Center","Radius",nullptr};
|
||||
static const std::array<const char *, 3> keywords_cnr {"Center","Radius",nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cnr,
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_cnr,
|
||||
Base::Vector2dPy::type_object(), &pV1,
|
||||
&dist)) {
|
||||
Base::Vector2d v1 = Py::toVector2d(pV1);
|
||||
@@ -91,9 +92,9 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_c[] = {"Circle",nullptr};
|
||||
static const std::array<const char *, 2> keywords_c {"Circle",nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(Circle2dPy::Type), &pCirc)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_c, &(Circle2dPy::Type), &pCirc)) {
|
||||
Circle2dPy* pcCircle = static_cast<Circle2dPy*>(pCirc);
|
||||
Handle(Geom2d_Circle) circ1 = Handle(Geom2d_Circle)::DownCast
|
||||
(pcCircle->getGeom2dCirclePtr()->handle());
|
||||
@@ -103,12 +104,12 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ppp {"Point1","Point2","Point3",nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
Base::Vector2dPy::type_object(), &pV1,
|
||||
Base::Vector2dPy::type_object(), &pV2,
|
||||
Base::Vector2dPy::type_object(), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
Base::Vector2dPy::type_object(), &pV1,
|
||||
Base::Vector2dPy::type_object(), &pV2,
|
||||
Base::Vector2dPy::type_object(), &pV3)) {
|
||||
Base::Vector2d v1 = Py::toVector2d(pV1);
|
||||
Base::Vector2d v2 = Py::toVector2d(pV2);
|
||||
Base::Vector2d v3 = Py::toVector2d(pV3);
|
||||
@@ -126,9 +127,9 @@ int Circle2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
}
|
||||
|
||||
// default circle
|
||||
static char* keywords_n[] = {nullptr};
|
||||
static const std::array<const char *, 1> keywords_n = {nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n) != 0) {
|
||||
Handle(Geom2d_Circle) circle = Handle(Geom2d_Circle)::DownCast(getGeom2dCirclePtr()->handle());
|
||||
circle->SetRadius(1.0);
|
||||
return 0;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "Geom2d/Curve2dPy.h"
|
||||
#include "Geom2d/Curve2dPy.cpp"
|
||||
@@ -293,10 +294,10 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
|
||||
double last = adapt.LastParameter();
|
||||
|
||||
// use Number kwds
|
||||
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_numPoints {"Number", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
int numPoints = -1;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
GCPnts_UniformAbscissa discretizer;
|
||||
discretizer.Initialize (adapt, numPoints, first, last);
|
||||
|
||||
@@ -318,10 +319,10 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use Distance kwds
|
||||
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Distance{"Distance", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double distance = -1;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
GCPnts_UniformAbscissa discretizer;
|
||||
discretizer.Initialize (adapt, distance, first, last);
|
||||
|
||||
@@ -343,10 +344,10 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use Deflection kwds
|
||||
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Deflection{"Deflection", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double deflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
GCPnts_UniformDeflection discretizer(adapt, deflection, first, last);
|
||||
if (discretizer.IsDone () && discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -366,12 +367,14 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use TangentialDeflection kwds
|
||||
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
|
||||
static const std::array<const char *, 6> kwds_TangentialDeflection{"Angular", "Curvature", "First", "Last",
|
||||
"Minimum", nullptr};
|
||||
PyErr_Clear();
|
||||
double angular;
|
||||
double curvature;
|
||||
int minimumPoints = 2;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection, &angular, &curvature, &first, &last, &minimumPoints)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection, &angular, &curvature,
|
||||
&first, &last, &minimumPoints)) {
|
||||
GCPnts_TangentialDeflection discretizer(adapt, first, last, angular, curvature, minimumPoints);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -391,10 +394,11 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiNumber kwds
|
||||
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiNumPoints{"QuasiNumber", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
int quasiNumPoints;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first,
|
||||
&last)) {
|
||||
GCPnts_QuasiUniformAbscissa discretizer(adapt, quasiNumPoints, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -414,10 +418,11 @@ PyObject* Curve2dPy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiDeflection kwds
|
||||
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiDeflection {"QuasiDeflection","First","Last",nullptr};
|
||||
PyErr_Clear();
|
||||
double quasiDeflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first,
|
||||
&last)) {
|
||||
GCPnts_QuasiUniformDeflection discretizer(adapt, quasiDeflection, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "Geom2d/Ellipse2dPy.h"
|
||||
#include "Geom2d/Ellipse2dPy.cpp"
|
||||
@@ -53,18 +54,18 @@ PyObject *Ellipse2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
|
||||
// constructor method
|
||||
int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
char* keywords_n[] = {nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom2d_Ellipse) ellipse = Handle(Geom2d_Ellipse)::DownCast(getGeom2dEllipsePtr()->handle());
|
||||
ellipse->SetMajorRadius(2.0);
|
||||
ellipse->SetMinorRadius(1.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_e[] = {"Ellipse",nullptr};
|
||||
static const std::array<const char *, 2> keywords_e {"Ellipse",nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pElips;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(Ellipse2dPy::Type), &pElips)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(Ellipse2dPy::Type), &pElips)) {
|
||||
Ellipse2dPy* pEllipse = static_cast<Ellipse2dPy*>(pElips);
|
||||
Handle(Geom2d_Ellipse) Elips1 = Handle(Geom2d_Ellipse)::DownCast
|
||||
(pEllipse->getGeom2dEllipsePtr()->handle());
|
||||
@@ -74,13 +75,13 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ssc {"S1", "S2", "Center", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
Base::Vector2dPy::type_object(), &pV1,
|
||||
Base::Vector2dPy::type_object(), &pV2,
|
||||
Base::Vector2dPy::type_object(), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
Base::Vector2dPy::type_object(), &pV1,
|
||||
Base::Vector2dPy::type_object(), &pV2,
|
||||
Base::Vector2dPy::type_object(), &pV3)) {
|
||||
Base::Vector2d v1 = Py::toVector2d(pV1);
|
||||
Base::Vector2d v2 = Py::toVector2d(pV2);
|
||||
Base::Vector2d v3 = Py::toVector2d(pV3);
|
||||
@@ -97,13 +98,13 @@ int Ellipse2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
|
||||
static const std::array<const char *, 4> keywords_cmm {"Center","MajorRadius","MinorRadius",nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV;
|
||||
double major, minor;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
Base::Vector2dPy::type_object(), &pV,
|
||||
&major, &minor)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
Base::Vector2dPy::type_object(), &pV,
|
||||
&major, &minor)) {
|
||||
Base::Vector2d c = Py::toVector2d(pV);
|
||||
GCE2d_MakeEllipse me(gp_Ax2d(gp_Pnt2d(c.x,c.y), gp_Dir2d(0.0,1.0)),
|
||||
major, minor);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "Geom2d/Hyperbola2dPy.h"
|
||||
#include "Geom2d/Hyperbola2dPy.cpp"
|
||||
@@ -53,18 +54,18 @@ PyObject *Hyperbola2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) /
|
||||
// constructor method
|
||||
int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
char* keywords_n[] = {nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom2d_Hyperbola) hyperbola = Handle(Geom2d_Hyperbola)::DownCast(getGeom2dHyperbolaPtr()->handle());
|
||||
hyperbola->SetMajorRadius(2.0);
|
||||
hyperbola->SetMinorRadius(1.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_e[] = {"Hyperbola",nullptr};
|
||||
static const std::array<const char *, 2> keywords_e = {"Hyperbola", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pHypr;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(Hyperbola2dPy::Type), &pHypr)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(Hyperbola2dPy::Type), &pHypr)) {
|
||||
Hyperbola2dPy* pHyperbola = static_cast<Hyperbola2dPy*>(pHypr);
|
||||
Handle(Geom2d_Hyperbola) Hypr1 = Handle(Geom2d_Hyperbola)::DownCast
|
||||
(pHyperbola->getGeom2dHyperbolaPtr()->handle());
|
||||
@@ -74,13 +75,13 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ssc {"S1", "S2", "Center", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
Base::Vector2dPy::type_object(), &pV1,
|
||||
Base::Vector2dPy::type_object(), &pV2,
|
||||
Base::Vector2dPy::type_object(), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
Base::Vector2dPy::type_object(), &pV1,
|
||||
Base::Vector2dPy::type_object(), &pV2,
|
||||
Base::Vector2dPy::type_object(), &pV3)) {
|
||||
Base::Vector2d v1 = Py::toVector2d(pV1);
|
||||
Base::Vector2d v2 = Py::toVector2d(pV2);
|
||||
Base::Vector2d v3 = Py::toVector2d(pV3);
|
||||
@@ -97,13 +98,13 @@ int Hyperbola2dPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
|
||||
static const std::array<const char *, 4> keywords_cmm {"Center", "MajorRadius", "MinorRadius", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV;
|
||||
double major, minor;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
Base::Vector2dPy::type_object(), &pV,
|
||||
&major, &minor)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
Base::Vector2dPy::type_object(), &pV,
|
||||
&major, &minor)) {
|
||||
Base::Vector2d c = Py::toVector2d(pV);
|
||||
GCE2d_MakeHyperbola me(gp_Ax2d(gp_Pnt2d(c.x,c.y), gp_Dir2d(0.0,1.0)),
|
||||
major, minor);
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#include "Geometry2d.h"
|
||||
#include "GeometrySurfacePy.h"
|
||||
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
|
||||
using namespace Part;
|
||||
|
||||
@@ -92,13 +94,14 @@ int BuildPlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
double tolCurv = 0.1;
|
||||
PyObject* anisotropy = Py_False;
|
||||
|
||||
static char* keywords[] = {"Surface", "Degree", "NbPtsOnCur", "NbIter", "Tol2d",
|
||||
"Tol3d", "TolAng", "TolCurv", "Anisotropy", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!iiiddddO!", keywords,
|
||||
&(GeometrySurfacePy::Type), &surf, °ree,
|
||||
&nbPtsOnCur, &nbIter, &tol2d, &tol3d,
|
||||
&tolAng, &tolCurv, &PyBool_Type, &anisotropy))
|
||||
static const std::array<const char *, 10> keywords{"Surface", "Degree", "NbPtsOnCur", "NbIter", "Tol2d", "Tol3d",
|
||||
"TolAng", "TolCurv", "Anisotropy", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|O!iiiddddO!", keywords,
|
||||
&(GeometrySurfacePy::Type), &surf, °ree,
|
||||
&nbPtsOnCur, &nbIter, &tol2d, &tol3d,
|
||||
&tolAng, &tolCurv, &PyBool_Type, &anisotropy)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
try {
|
||||
std::unique_ptr<GeomPlate_BuildPlateSurface> ptr(new GeomPlate_BuildPlateSurface
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "GeomPlate/CurveConstraintPy.cpp"
|
||||
#include "Geom2d/Curve2dPy.h"
|
||||
#include "GeometryCurvePy.h"
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
|
||||
using namespace Part;
|
||||
@@ -61,11 +62,13 @@ int CurveConstraintPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
// Length(), FirstParameter(), LastParameter(), ...
|
||||
// Thus, we don't allow to create an empty GeomPlate_CurveConstraint instance
|
||||
|
||||
static char* keywords[] = {"Boundary", "Order", "NbPts", "TolDist", "TolAng", "TolCurv", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|iiddd", keywords,
|
||||
&(GeometryCurvePy::Type), &bound, &order,
|
||||
&nbPts, &tolDist, &tolAng, &tolCurv))
|
||||
static const std::array<const char *, 7> keywords{"Boundary", "Order", "NbPts", "TolDist", "TolAng", "TolCurv",
|
||||
nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|iiddd", keywords,
|
||||
&(GeometryCurvePy::Type), &bound, &order,
|
||||
&nbPts, &tolDist, &tolAng, &tolCurv)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
try {
|
||||
std::unique_ptr<GeomPlate_CurveConstraint> ptr;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/VectorPy.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "GeomPlate/PointConstraintPy.h"
|
||||
#include "GeomPlate/PointConstraintPy.cpp"
|
||||
@@ -47,10 +48,11 @@ int PointConstraintPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
int order = 0;
|
||||
double tolDist = 0.0001;
|
||||
|
||||
static char* keywords[] = {"Point", "Order", "TolDist", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|id", keywords,
|
||||
&(Base::VectorPy::Type), &pt, &order, &tolDist))
|
||||
static const std::array<const char *, 4> keywords {"Point", "Order", "TolDist", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|id", keywords, &(Base::VectorPy::Type), &pt, &order,
|
||||
&tolDist)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
try {
|
||||
std::unique_ptr<GeomPlate_PointConstraint> ptr;
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "GeometryCurvePy.h"
|
||||
@@ -160,16 +161,16 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
// use Number kwds
|
||||
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_numPoints {"Number", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
uniformAbscissaPoints = true;
|
||||
}
|
||||
else {
|
||||
// use Abscissa kwds
|
||||
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Distance {"Distance", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
uniformAbscissaDistance = true;
|
||||
}
|
||||
}
|
||||
@@ -199,10 +200,10 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use Deflection kwds
|
||||
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Deflection {"Deflection", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double deflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
GCPnts_UniformDeflection discretizer(adapt, deflection, first, last);
|
||||
if (discretizer.IsDone () && discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -221,12 +222,14 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use TangentialDeflection kwds
|
||||
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
|
||||
static const std::array<const char *, 6> kwds_TangentialDeflection{"Angular", "Curvature", "First", "Last",
|
||||
"Minimum", nullptr};
|
||||
PyErr_Clear();
|
||||
double angular;
|
||||
double curvature;
|
||||
int minimumPoints = 2;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection, &angular, &curvature, &first, &last, &minimumPoints)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection, &angular, &curvature,
|
||||
&first, &last, &minimumPoints)) {
|
||||
GCPnts_TangentialDeflection discretizer(adapt, first, last, angular, curvature, minimumPoints);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -245,10 +248,11 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiNumber kwds
|
||||
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiNumPoints {"QuasiNumber", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
int quasiNumPoints;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first,
|
||||
&last)) {
|
||||
GCPnts_QuasiUniformAbscissa discretizer(adapt, quasiNumPoints, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -267,10 +271,11 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiDeflection kwds
|
||||
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiDeflection {"QuasiDeflection", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double quasiDeflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first,
|
||||
&last)) {
|
||||
GCPnts_QuasiUniformDeflection discretizer(adapt, quasiDeflection, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -554,12 +559,13 @@ PyObject* GeometryCurvePy::normal(PyObject *args)
|
||||
|
||||
PyObject* GeometryCurvePy::projectPoint(PyObject *args, PyObject* kwds)
|
||||
{
|
||||
PyObject* v;
|
||||
const char* meth = "NearestPoint";
|
||||
static char *kwlist[] = {"Point", "Method", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist,
|
||||
&Base::VectorPy::Type, &v, &meth))
|
||||
PyObject *v;
|
||||
const char *meth = "NearestPoint";
|
||||
static const std::array<const char *, 3> kwlist{"Point", "Method", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist,
|
||||
&Base::VectorPy::Type, &v, &meth)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
Base::Vector3d vec = Py::Vector(v, false).toVector();
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "GeometrySurfacePy.h"
|
||||
@@ -133,10 +134,11 @@ PyObject* GeometrySurfacePy::toShell(PyObject *args, PyObject* kwds)
|
||||
{
|
||||
PyObject* bound = nullptr;
|
||||
PyObject* segm = nullptr;
|
||||
static char *kwlist[] = {"Bounds", "Segment", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!O!", kwlist,
|
||||
&PyTuple_Type, &bound, &PyBool_Type, &segm))
|
||||
static const std::array<const char *, 3> kwlist {"Bounds", "Segment", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|O!O!", kwlist,
|
||||
&PyTuple_Type, &bound, &PyBool_Type, &segm)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
|
||||
Handle(Geom_Surface) s = Handle(Geom_Surface)::DownCast(g);
|
||||
@@ -302,10 +304,10 @@ PyObject* GeometrySurfacePy::projectPoint(PyObject *args, PyObject* kwds)
|
||||
{
|
||||
PyObject* v;
|
||||
const char* meth = "NearestPoint";
|
||||
static char *kwlist[] = {"Point", "Method", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist,
|
||||
&Base::VectorPy::Type, &v, &meth))
|
||||
static const std::array<const char *, 3> kwlist {"Point", "Method", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|s", kwlist, &Base::VectorPy::Type, &v, &meth)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
Base::Vector3d vec = Py::Vector(v, false).toVector();
|
||||
@@ -729,11 +731,13 @@ PyObject* GeometrySurfacePy::toBSpline(PyObject * args, PyObject * kwds)
|
||||
int maxDegV=Geom_BSplineSurface::MaxDegree();
|
||||
int maxSegm=1000, prec=0;
|
||||
|
||||
static char *kwlist[] = {"Tol3d", "UContinuity", "VContinuity", "MaxDegreeU", "MaxDegreeV", "MaxSegments", "PrecisCode", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|dssiiii", kwlist,
|
||||
&tol3d, &ucont, &vcont,
|
||||
&maxDegU, &maxDegV, &maxSegm, &prec))
|
||||
static const std::array<const char *, 8> kwlist{"Tol3d", "UContinuity", "VContinuity", "MaxDegreeU", "MaxDegreeV",
|
||||
"MaxSegments", "PrecisCode", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|dssiiii", kwlist,
|
||||
&tol3d, &ucont, &vcont,
|
||||
&maxDegU, &maxDegV, &maxSegm, &prec)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GeomAbs_Shape absU, absV;
|
||||
std::string uc = ucont;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "HLRBRep/HLRBRep_AlgoPy.h"
|
||||
@@ -113,12 +114,12 @@ PyObject* HLRBRep_AlgoPy::setProjector(PyObject *args, PyObject *kwds)
|
||||
PyObject* xd = nullptr;
|
||||
double focus = std::numeric_limits<double>::quiet_NaN();
|
||||
|
||||
static char *kwlist[] = {"Origin", "ZDir", "XDir", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!O!O!d", kwlist,
|
||||
&Base::VectorPy::Type, &ps,
|
||||
&Base::VectorPy::Type, &zd,
|
||||
&Base::VectorPy::Type, &xd,
|
||||
&focus)) {
|
||||
static const std::array<const char *, 4> kwlist {"Origin", "ZDir", "XDir", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|O!O!O!d", kwlist,
|
||||
&Base::VectorPy::Type, &ps,
|
||||
&Base::VectorPy::Type, &zd,
|
||||
&Base::VectorPy::Type, &xd,
|
||||
&focus)) {
|
||||
gp_Ax2 ax2;
|
||||
if (ps && zd && xd) {
|
||||
Base::Vector3d p = Py::Vector(ps,false).toVector();
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "HLRBRep/HLRBRep_PolyAlgoPy.h"
|
||||
@@ -85,12 +86,12 @@ PyObject* HLRBRep_PolyAlgoPy::setProjector(PyObject *args, PyObject *kwds)
|
||||
PyObject* xd = nullptr;
|
||||
double focus = std::numeric_limits<double>::quiet_NaN();
|
||||
|
||||
static char *kwlist[] = {"Origin", "ZDir", "XDir", nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!O!O!d", kwlist,
|
||||
&Base::VectorPy::Type, &ps,
|
||||
&Base::VectorPy::Type, &zd,
|
||||
&Base::VectorPy::Type, &xd,
|
||||
&focus)) {
|
||||
static const std::array<const char *, 4> kwlist {"Origin", "ZDir", "XDir", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|O!O!O!d", kwlist,
|
||||
&Base::VectorPy::Type, &ps,
|
||||
&Base::VectorPy::Type, &zd,
|
||||
&Base::VectorPy::Type, &xd,
|
||||
&focus)) {
|
||||
gp_Ax2 ax2;
|
||||
if (ps && zd && xd) {
|
||||
Base::Vector3d p = Py::Vector(ps,false).toVector();
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "HLRBRep/HLRToShapePy.h"
|
||||
#include "HLRBRep/HLRToShapePy.cpp"
|
||||
#include "HLRBRep/HLRBRep_AlgoPy.h"
|
||||
@@ -241,13 +243,14 @@ PyObject* HLRToShapePy::compoundOfEdges(PyObject *args, PyObject *kwds)
|
||||
PyObject* in3d = nullptr;
|
||||
PyObject* shape = nullptr;
|
||||
|
||||
static char* keywords[] = {"Type", "Visible", "In3D", "Shape", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "iO!O!|O!", keywords,
|
||||
&type,
|
||||
&PyBool_Type, &visible,
|
||||
&PyBool_Type, &in3d,
|
||||
&Part::TopoShapePy::Type, &shape))
|
||||
static const std::array<const char *, 5> keywords {"Type", "Visible", "In3D", "Shape", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "iO!O!|O!", keywords,
|
||||
&type,
|
||||
&PyBool_Type, &visible,
|
||||
&PyBool_Type, &in3d,
|
||||
&Part::TopoShapePy::Type, &shape)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (shape) {
|
||||
TopoDS_Shape input = static_cast<TopoShapePy*>(shape)->getTopoShapePtr()->getShape();
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "HyperbolaPy.h"
|
||||
@@ -53,18 +54,18 @@ PyObject *HyperbolaPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
|
||||
// constructor method
|
||||
int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
char* keywords_n[] = {nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
|
||||
hyperbola->SetMajorRadius(2.0);
|
||||
hyperbola->SetMinorRadius(1.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_e[] = {"Hyperbola",nullptr};
|
||||
static const std::array<const char *, 2> keywords_e {"Hyperbola", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pHypr;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(HyperbolaPy::Type), &pHypr)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(HyperbolaPy::Type), &pHypr)) {
|
||||
HyperbolaPy* pHyperbola = static_cast<HyperbolaPy*>(pHypr);
|
||||
Handle(Geom_Hyperbola) Hypr1 = Handle(Geom_Hyperbola)::DownCast
|
||||
(pHyperbola->getGeomHyperbolaPtr()->handle());
|
||||
@@ -74,13 +75,13 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_ssc[] = {"S1","S2","Center",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ssc{"S1", "S2", "Center", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
Base::Vector3d v3 = static_cast<Base::VectorPy*>(pV3)->value();
|
||||
@@ -97,11 +98,11 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_cmm[] = {"Center","MajorRadius","MinorRadius",nullptr};
|
||||
static const std::array<const char *, 4> keywords_cmm {"Center","MajorRadius","MinorRadius",nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV;
|
||||
double major, minor;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!dd", keywords_cmm,
|
||||
&(Base::VectorPy::Type), &pV,
|
||||
&major, &minor)) {
|
||||
Base::Vector3d c = static_cast<Base::VectorPy*>(pV)->value();
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "ParabolaPy.h"
|
||||
@@ -53,17 +54,17 @@ PyObject *ParabolaPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // P
|
||||
// constructor method
|
||||
int ParabolaPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
char* keywords_n[] = {nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
Handle(Geom_Parabola) parabola = Handle(Geom_Parabola)::DownCast(getGeomParabolaPtr()->handle());
|
||||
parabola->SetFocal(1.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_e[] = {"Parabola",nullptr};
|
||||
static const std::array<const char *, 2> keywords_e {"Parabola", nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pParab;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(ParabolaPy::Type), &pParab)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(ParabolaPy::Type), &pParab)) {
|
||||
ParabolaPy* pParabola = static_cast<ParabolaPy*>(pParab);
|
||||
Handle(Geom_Parabola) Parab1 = Handle(Geom_Parabola)::DownCast
|
||||
(pParabola->getGeomParabolaPtr()->handle());
|
||||
@@ -73,13 +74,13 @@ int ParabolaPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* keywords_ssc[] = {"Focus","Center","Normal",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ssc {"Focus","Center","Normal",nullptr};
|
||||
PyErr_Clear();
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ssc,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
Base::Vector3d focus = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d center = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
Base::Vector3d normal = static_cast<Base::VectorPy*>(pV3)->value();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include "PlanePy.h"
|
||||
@@ -61,8 +62,8 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
// plane and distance for offset
|
||||
PyObject *pPlane;
|
||||
double dist;
|
||||
static char* keywords_pd[] = {"Plane","Distance",nullptr};
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", keywords_pd, &(PlanePy::Type), &pPlane, &dist)) {
|
||||
static const std::array<const char *, 3> keywords_pd {"Plane", "Distance", nullptr};
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!d", keywords_pd, &(PlanePy::Type), &pPlane, &dist)) {
|
||||
PlanePy* pcPlane = static_cast<PlanePy*>(pPlane);
|
||||
Handle(Geom_Plane) plane = Handle(Geom_Plane)::DownCast
|
||||
(pcPlane->getGeometryPtr()->handle());
|
||||
@@ -79,10 +80,10 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
|
||||
// plane from equation
|
||||
double a,b,c,d;
|
||||
static char* keywords_abcd[] = {"A","B","C","D",nullptr};
|
||||
static const std::array<const char *, 5> keywords_abcd{"A", "B", "C", "D", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "dddd", keywords_abcd,
|
||||
&a,&b,&c,&d)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "dddd", keywords_abcd,
|
||||
&a,&b,&c,&d)) {
|
||||
GC_MakePlane mc(a,b,c,d);
|
||||
if (!mc.IsDone()) {
|
||||
PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mc.Status()));
|
||||
@@ -95,12 +96,12 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
}
|
||||
|
||||
PyObject *pV1, *pV2, *pV3;
|
||||
static char* keywords_ppp[] = {"Point1","Point2","Point3",nullptr};
|
||||
static const std::array<const char *, 4> keywords_ppp{"Point1", "Point2", "Point3", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!O!", keywords_ppp,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2,
|
||||
&(Base::VectorPy::Type), &pV3)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
Base::Vector3d v3 = static_cast<Base::VectorPy*>(pV3)->value();
|
||||
@@ -118,11 +119,11 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
}
|
||||
|
||||
// location and normal
|
||||
static char* keywords_cnr[] = {"Location","Normal",nullptr};
|
||||
static const std::array<const char *, 3> keywords_cnr {"Location", "Normal", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!O!", keywords_cnr,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!O!", keywords_cnr,
|
||||
&(Base::VectorPy::Type), &pV1,
|
||||
&(Base::VectorPy::Type), &pV2)) {
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pV1)->value();
|
||||
Base::Vector3d v2 = static_cast<Base::VectorPy*>(pV2)->value();
|
||||
GC_MakePlane mc(gp_Pnt(v1.x,v1.y,v1.z),
|
||||
@@ -137,9 +138,9 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_p[] = {"Plane",nullptr};
|
||||
static const std::array<const char *, 2> keywords_p {"Plane", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!", keywords_p, &(PlanePy::Type), &pPlane)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!", keywords_p, &(PlanePy::Type), &pPlane)) {
|
||||
PlanePy* pcPlane = static_cast<PlanePy*>(pPlane);
|
||||
Handle(Geom_Plane) plane1 = Handle(Geom_Plane)::DownCast
|
||||
(pcPlane->getGeometryPtr()->handle());
|
||||
@@ -149,9 +150,9 @@ int PlanePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* keywords_n[] = {nullptr};
|
||||
static const std::array<const char *, 1> keywords_n {nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
|
||||
// do nothing
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
#include <Base/Vector3D.h>
|
||||
|
||||
@@ -55,8 +56,9 @@ PyObject *PlateSurfacePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
|
||||
// constructor method
|
||||
int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
static char* kwds_Parameter[] = {"Surface","Points","Curves","Degree",
|
||||
"NbPtsOnCur","NbIter","Tol2d","Tol3d","TolAng","TolCurv","Anisotropie",nullptr};
|
||||
static const std::array<const char *, 12> kwds_Parameter{"Surface", "Points", "Curves", "Degree",
|
||||
"NbPtsOnCur", "NbIter", "Tol2d", "Tol3d", "TolAng",
|
||||
"TolCurv", "Anisotropie", nullptr};
|
||||
|
||||
PyObject* surface = nullptr;
|
||||
PyObject* points = nullptr;
|
||||
@@ -68,13 +70,14 @@ int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
double Tol3d = 0.0001;
|
||||
double TolAng = 0.01;
|
||||
double TolCurv = 0.1;
|
||||
PyObject* Anisotropie = Py_False;
|
||||
PyObject* Anisotropie = Py_False; // NOLINT
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!OOiiiddddO!", kwds_Parameter,
|
||||
&(GeometryPy::Type), &surface, &points, &curves,
|
||||
&Degree, &NbPtsOnCur, &NbIter, &Tol2d, &Tol3d, &TolAng, &TolCurv,
|
||||
&PyBool_Type,&Anisotropie))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|O!OOiiiddddO!", kwds_Parameter,
|
||||
&(GeometryPy::Type), &surface, &points, &curves,
|
||||
&Degree, &NbPtsOnCur, &NbIter, &Tol2d, &Tol3d, &TolAng, &TolCurv,
|
||||
&PyBool_Type, &Anisotropie)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!surface && !points && !curves) {
|
||||
PyErr_SetString(PyExc_ValueError, "set points or curves as constraints");
|
||||
@@ -137,8 +140,8 @@ int PlateSurfacePy::PyInit(PyObject* args, PyObject* kwds)
|
||||
|
||||
PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
|
||||
{
|
||||
static char* kwds_Parameter[] = {"Tol3d","MaxSegments","MaxDegree","MaxDistance",
|
||||
"CritOrder","Continuity","EnlargeCoeff",nullptr};
|
||||
static const std::array<const char *, 8> kwds_Parameter{"Tol3d", "MaxSegments", "MaxDegree", "MaxDistance",
|
||||
"CritOrder", "Continuity", "EnlargeCoeff", nullptr};
|
||||
|
||||
double tol3d=0.01;
|
||||
int maxSeg=9;
|
||||
@@ -148,9 +151,10 @@ PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
|
||||
char* cont = "C1";
|
||||
double enlargeCoeff = 1.1;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|diidisd", kwds_Parameter,
|
||||
&tol3d, &maxSeg, &maxDegree, &dmax, &critOrder, &cont, &enlargeCoeff))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|diidisd", kwds_Parameter,
|
||||
&tol3d, &maxSeg, &maxDegree, &dmax, &critOrder, &cont, &enlargeCoeff)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GeomAbs_Shape continuity;
|
||||
std::string uc = cont;
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include "ShapeUpgrade/UnifySameDomainPy.h"
|
||||
#include "ShapeUpgrade/UnifySameDomainPy.cpp"
|
||||
#include "PartPyCXX.h"
|
||||
@@ -47,17 +49,18 @@ PyObject *UnifySameDomainPy::PyMake(struct _typeobject *, PyObject *, PyObject *
|
||||
int UnifySameDomainPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
PyObject *shape;
|
||||
PyObject* unifyEdges = Py_True;
|
||||
PyObject* unifyFaces = Py_True;
|
||||
PyObject* concatBSpl = Py_False;
|
||||
PyObject *unifyEdges = Py_True; // NOLINT
|
||||
PyObject *unifyFaces = Py_True; // NOLINT
|
||||
PyObject *concatBSpl = Py_False; // NOLINT
|
||||
|
||||
static char* keywords[] = {"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
|
||||
&TopoShapePy::Type, &shape,
|
||||
&PyBool_Type, &unifyEdges,
|
||||
&PyBool_Type, &unifyFaces,
|
||||
&PyBool_Type, &concatBSpl))
|
||||
static const std::array<const char *, 5> keywords{"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
|
||||
&TopoShapePy::Type, &shape,
|
||||
&PyBool_Type, &unifyEdges,
|
||||
&PyBool_Type, &unifyFaces,
|
||||
&PyBool_Type, &concatBSpl)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
try {
|
||||
TopoDS_Shape shp = static_cast<TopoShapePy*>(shape)->getTopoShapePtr()->getShape();
|
||||
@@ -78,17 +81,18 @@ int UnifySameDomainPy::PyInit(PyObject* args, PyObject* kwds)
|
||||
PyObject* UnifySameDomainPy::initialize(PyObject *args, PyObject* kwds)
|
||||
{
|
||||
PyObject *shape;
|
||||
PyObject* unifyEdges = Py_True;
|
||||
PyObject* unifyFaces = Py_True;
|
||||
PyObject* concatBSpl = Py_False;
|
||||
PyObject *unifyEdges = Py_True;
|
||||
PyObject *unifyFaces = Py_True;
|
||||
PyObject *concatBSpl = Py_False;
|
||||
|
||||
static char* keywords[] = {"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
|
||||
&TopoShapePy::Type, &shape,
|
||||
&PyBool_Type, &unifyEdges,
|
||||
&PyBool_Type, &unifyFaces,
|
||||
&PyBool_Type, &concatBSpl))
|
||||
static const std::array<const char *, 5> keywords{"Shape", "UnifyEdges", "UnifyFaces", "ConcatBSplines", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|O!O!O!", keywords,
|
||||
&TopoShapePy::Type, &shape,
|
||||
&PyBool_Type, &unifyEdges,
|
||||
&PyBool_Type, &unifyFaces,
|
||||
&PyBool_Type, &concatBSpl)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
TopoDS_Shape shp = static_cast<TopoShapePy*>(shape)->getTopoShapePtr()->getShape();
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#endif // _PreComp_
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/Vector3D.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
@@ -493,16 +494,16 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
// use Number kwds
|
||||
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_numPoints{"Number", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
uniformAbscissaPoints = true;
|
||||
}
|
||||
else {
|
||||
// use Abscissa kwds
|
||||
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Distance{"Distance", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
uniformAbscissaDistance = true;
|
||||
}
|
||||
}
|
||||
@@ -532,10 +533,10 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use Deflection kwds
|
||||
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Deflection{"Deflection", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double deflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
GCPnts_UniformDeflection discretizer(adapt, deflection, first, last);
|
||||
if (discretizer.IsDone () && discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -554,12 +555,14 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use TangentialDeflection kwds
|
||||
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
|
||||
static const std::array<const char *, 6> kwds_TangentialDeflection {"Angular", "Curvature", "First", "Last",
|
||||
"Minimum", nullptr};
|
||||
PyErr_Clear();
|
||||
double angular;
|
||||
double curvature;
|
||||
int minimumPoints = 2;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection, &angular, &curvature, &first, &last, &minimumPoints)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection, &angular, &curvature,
|
||||
&first, &last, &minimumPoints)) {
|
||||
GCPnts_TangentialDeflection discretizer(adapt, first, last, angular, curvature, minimumPoints);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -578,10 +581,11 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiNumber kwds
|
||||
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiNumPoints{"QuasiNumber", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
int quasiNumPoints;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first,
|
||||
&last)) {
|
||||
GCPnts_QuasiUniformAbscissa discretizer(adapt, quasiNumPoints, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -600,10 +604,11 @@ PyObject* TopoShapeEdgePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiDeflection kwds
|
||||
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiDeflection{"QuasiDeflection", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double quasiDeflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection,
|
||||
&quasiDeflection, &first, &last)) {
|
||||
GCPnts_QuasiUniformDeflection discretizer(adapt, quasiDeflection, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#include <BRepOffsetAPI_MakeEvolved.hxx>
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/VectorPy.h>
|
||||
|
||||
#include <Mod/Part/App/BezierSurfacePy.h>
|
||||
@@ -442,12 +443,14 @@ PyObject* TopoShapeFacePy::makeEvolved(PyObject *args, PyObject *kwds)
|
||||
int JoinType = int(GeomAbs_Arc);
|
||||
double Tolerance = 0.0000001;
|
||||
|
||||
static char* kwds_evolve[] = {"Profile", "Join", "AxeProf", "Solid", "ProfOnSpine", "Tolerance", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|iO!O!O!d", kwds_evolve,
|
||||
&TopoShapeWirePy::Type, &Profile, &JoinType,
|
||||
&PyBool_Type, &AxeProf, &PyBool_Type, &Solid,
|
||||
&PyBool_Type, &ProfOnSpine, &Tolerance))
|
||||
static const std::array<const char *, 7> kwds_evolve{"Profile", "Join", "AxeProf", "Solid", "ProfOnSpine",
|
||||
"Tolerance", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|iO!O!O!d", kwds_evolve,
|
||||
&TopoShapeWirePy::Type, &Profile, &JoinType,
|
||||
&PyBool_Type, &AxeProf, &PyBool_Type, &Solid,
|
||||
&PyBool_Type, &ProfOnSpine, &Tolerance)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const TopoDS_Face& spine = TopoDS::Face(getTopoShapePtr()->getShape());
|
||||
BRepBuilderAPI_FindPlane findPlane(spine);
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
#include <Base/FileInfo.h>
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/MatrixPy.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
#include <Base/Rotation.h>
|
||||
#include <Base/Stream.h>
|
||||
#include <Base/Vector3D.h>
|
||||
@@ -281,14 +282,15 @@ PyObject* TopoShapePy::read(PyObject *args)
|
||||
|
||||
PyObject* TopoShapePy::writeInventor(PyObject * args, PyObject * keywds)
|
||||
{
|
||||
static char *kwlist[] = {"Mode", "Deviation", "Angle", "FaceColors", nullptr};
|
||||
static const std::array<const char *, 5> kwlist{"Mode", "Deviation", "Angle", "FaceColors", nullptr};
|
||||
|
||||
double dev=0.3, angle=0.4;
|
||||
int mode=2;
|
||||
PyObject* pylist=nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "|iddO", kwlist,
|
||||
&mode,&dev,&angle,&pylist))
|
||||
double dev = 0.3, angle = 0.4;
|
||||
int mode = 2;
|
||||
PyObject *pylist = nullptr;
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "|iddO", kwlist,
|
||||
&mode, &dev, &angle, &pylist)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<App::Color> faceColors;
|
||||
if (pylist) {
|
||||
@@ -1393,14 +1395,16 @@ PyObject* TopoShapePy::transformShape(PyObject *args)
|
||||
|
||||
PyObject* TopoShapePy::transformed(PyObject *args, PyObject *keywds)
|
||||
{
|
||||
static char *kwlist[] = {"matrix", "copy", "checkScale", "op", nullptr};
|
||||
PyObject* pymat;
|
||||
PyObject* copy = Py_False;
|
||||
PyObject* checkScale = Py_False;
|
||||
static const std::array<const char *, 5> kwlist{"matrix", "copy", "checkScale", "op", nullptr};
|
||||
PyObject *pymat;
|
||||
PyObject *copy = Py_False;
|
||||
PyObject *checkScale = Py_False;
|
||||
const char *op = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "O!|O!O!s", kwlist,
|
||||
&Base::MatrixPy::Type, &pymat, &PyBool_Type, ©, &PyBool_Type, &checkScale, &op))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "O!|O!O!s", kwlist,
|
||||
&Base::MatrixPy::Type, &pymat, &PyBool_Type, ©, &PyBool_Type,
|
||||
&checkScale, &op)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Base::Matrix4D mat = static_cast<Base::MatrixPy*>(pymat)->value();
|
||||
(void)op;
|
||||
@@ -1682,15 +1686,18 @@ PyObject* TopoShapePy::makeThickness(PyObject *args)
|
||||
|
||||
PyObject* TopoShapePy::makeOffsetShape(PyObject *args, PyObject *keywds)
|
||||
{
|
||||
static char *kwlist[] = {"offset", "tolerance", "inter", "self_inter", "offsetMode", "join", "fill", nullptr};
|
||||
static const std::array<const char *, 8> kwlist{"offset", "tolerance", "inter", "self_inter", "offsetMode", "join",
|
||||
"fill", nullptr};
|
||||
double offset, tolerance;
|
||||
PyObject* inter = Py_False;
|
||||
PyObject* self_inter = Py_False;
|
||||
PyObject* fill = Py_False;
|
||||
PyObject *inter = Py_False;
|
||||
PyObject *self_inter = Py_False;
|
||||
PyObject *fill = Py_False;
|
||||
short offsetMode = 0, join = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "dd|O!O!hhO!", kwlist, &offset, &tolerance,
|
||||
&(PyBool_Type), &inter, &(PyBool_Type), &self_inter, &offsetMode, &join, &(PyBool_Type), &fill))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "dd|O!O!hhO!", kwlist, &offset, &tolerance,
|
||||
&(PyBool_Type), &inter, &(PyBool_Type), &self_inter, &offsetMode, &join,
|
||||
&(PyBool_Type), &fill)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
TopoDS_Shape shape = this->getTopoShapePtr()->makeOffsetShape(offset, tolerance,
|
||||
@@ -1707,15 +1714,17 @@ PyObject* TopoShapePy::makeOffsetShape(PyObject *args, PyObject *keywds)
|
||||
|
||||
PyObject* TopoShapePy::makeOffset2D(PyObject *args, PyObject *keywds)
|
||||
{
|
||||
static char *kwlist[] = {"offset", "join", "fill", "openResult", "intersection", nullptr};
|
||||
static const std::array<const char *, 6> kwlist {"offset", "join", "fill", "openResult", "intersection", nullptr};
|
||||
double offset;
|
||||
PyObject* fill = Py_False;
|
||||
PyObject* openResult = Py_False;
|
||||
PyObject* inter = Py_False;
|
||||
short join = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, keywds, "d|hO!O!O!", kwlist, &offset, &join,
|
||||
&(PyBool_Type), &fill, &(PyBool_Type), &openResult, &(PyBool_Type), &inter))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, keywds, "d|hO!O!O!", kwlist, &offset, &join,
|
||||
&(PyBool_Type), &fill, &(PyBool_Type), &openResult, &(PyBool_Type),
|
||||
&inter)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
TopoDS_Shape resultShape = this->getTopoShapePtr()->makeOffset2D(offset, join,
|
||||
@@ -2047,7 +2056,8 @@ Part.show(reflect)
|
||||
*/
|
||||
PyObject* TopoShapePy::reflectLines(PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static char *kwlist[] = {"ViewDir", "ViewPos", "UpDir", "EdgeType", "Visible", "OnShape", nullptr};
|
||||
static const std::array<const char *, 7> kwlist{"ViewDir", "ViewPos", "UpDir", "EdgeType", "Visible", "OnShape",
|
||||
nullptr};
|
||||
|
||||
char* type="OutLine";
|
||||
PyObject* vis = Py_True;
|
||||
@@ -2055,10 +2065,12 @@ PyObject* TopoShapePy::reflectLines(PyObject *args, PyObject *kwds)
|
||||
PyObject* pPos = nullptr;
|
||||
PyObject* pUp = nullptr;
|
||||
PyObject *pView;
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!O!sO!O!", kwlist,
|
||||
&Base::VectorPy::Type, &pView, &Base::VectorPy::Type, &pPos, &Base::VectorPy::Type,
|
||||
&pUp, &type, &PyBool_Type, &vis, &PyBool_Type, &in3d))
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|O!O!sO!O!", kwlist,
|
||||
&Base::VectorPy::Type, &pView, &Base::VectorPy::Type, &pPos,
|
||||
&Base::VectorPy::Type,
|
||||
&pUp, &type, &PyBool_Type, &vis, &PyBool_Type, &in3d)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
HLRBRep_TypeOfResultingEdge t;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <BRepOffsetAPI_MakeEvolved.hxx>
|
||||
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
#include <Base/PyWrapParseTupleAndKeywords.h>
|
||||
|
||||
#include <Mod/Part/App/BSplineCurvePy.h>
|
||||
#include <Mod/Part/App/TopoShapeFacePy.h>
|
||||
@@ -316,12 +317,14 @@ PyObject* TopoShapeWirePy::makeEvolved(PyObject *args, PyObject *kwds)
|
||||
int JoinType = int(GeomAbs_Arc);
|
||||
double Tolerance = 0.0000001;
|
||||
|
||||
static char* kwds_evolve[] = {"Profile", "Join", "AxeProf", "Solid", "ProfOnSpine", "Tolerance", nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|iO!O!O!d", kwds_evolve,
|
||||
&TopoShapeWirePy::Type, &Profile, &JoinType,
|
||||
&PyBool_Type, &AxeProf, &PyBool_Type, &Solid,
|
||||
&PyBool_Type, &ProfOnSpine, &Tolerance))
|
||||
static const std::array<const char *, 7> kwds_evolve{"Profile", "Join", "AxeProf", "Solid", "ProfOnSpine",
|
||||
"Tolerance", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|iO!O!O!d", kwds_evolve,
|
||||
&TopoShapeWirePy::Type, &Profile, &JoinType,
|
||||
&PyBool_Type, &AxeProf, &PyBool_Type, &Solid,
|
||||
&PyBool_Type, &ProfOnSpine, &Tolerance)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const TopoDS_Wire& spine = TopoDS::Wire(getTopoShapePtr()->getShape());
|
||||
BRepBuilderAPI_FindPlane findPlane(spine);
|
||||
@@ -392,9 +395,10 @@ PyObject* TopoShapeWirePy::approximate(PyObject *args, PyObject *kwds)
|
||||
double tol3d = 0.0001;
|
||||
int maxseg=10, maxdeg=3;
|
||||
|
||||
static char* kwds_approx[] = {"Tol2d","Tol3d","MaxSegments","MaxDegree",nullptr};
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ddii", kwds_approx, &tol2d, &tol3d, &maxseg, &maxdeg))
|
||||
static const std::array<const char *, 5> kwds_approx{"Tol2d", "Tol3d", "MaxSegments", "MaxDegree", nullptr};
|
||||
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|ddii", kwds_approx, &tol2d, &tol3d, &maxseg, &maxdeg)) {
|
||||
return nullptr;
|
||||
}
|
||||
try {
|
||||
BRepAdaptor_CompCurve adapt(TopoDS::Wire(getTopoShapePtr()->getShape()));
|
||||
auto hcurve = adapt.Trim(adapt.FirstParameter(),
|
||||
@@ -444,16 +448,16 @@ PyObject* TopoShapeWirePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
// use Number kwds
|
||||
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_numPoints{"Number", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
uniformAbscissaPoints = true;
|
||||
}
|
||||
else {
|
||||
// use Abscissa kwds
|
||||
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Distance{"Distance", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
uniformAbscissaDistance = true;
|
||||
}
|
||||
}
|
||||
@@ -483,10 +487,10 @@ PyObject* TopoShapeWirePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use Deflection kwds
|
||||
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_Deflection{"Deflection", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double deflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
GCPnts_UniformDeflection discretizer(adapt, deflection, first, last);
|
||||
if (discretizer.IsDone () && discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -505,12 +509,14 @@ PyObject* TopoShapeWirePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use TangentialDeflection kwds
|
||||
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
|
||||
static const std::array<const char *, 6> kwds_TangentialDeflection{"Angular", "Curvature", "First", "Last",
|
||||
"Minimum", nullptr};
|
||||
PyErr_Clear();
|
||||
double angular;
|
||||
double curvature;
|
||||
int minimumPoints = 2;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection, &angular, &curvature, &first, &last, &minimumPoints)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "dd|ddi", kwds_TangentialDeflection,
|
||||
&angular, &curvature, &first, &last, &minimumPoints)) {
|
||||
GCPnts_TangentialDeflection discretizer(adapt, first, last, angular, curvature, minimumPoints);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -529,10 +535,11 @@ PyObject* TopoShapeWirePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiNumber kwds
|
||||
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiNumPoints{"QuasiNumber", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
int quasiNumPoints;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints,
|
||||
&quasiNumPoints, &first, &last)) {
|
||||
GCPnts_QuasiUniformAbscissa discretizer(adapt, quasiNumPoints, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
@@ -551,10 +558,11 @@ PyObject* TopoShapeWirePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
// use QuasiDeflection kwds
|
||||
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
|
||||
static const std::array<const char *, 4> kwds_QuasiDeflection{"QuasiDeflection", "First", "Last", nullptr};
|
||||
PyErr_Clear();
|
||||
double quasiDeflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
|
||||
if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection,
|
||||
&quasiDeflection, &first, &last)) {
|
||||
GCPnts_QuasiUniformDeflection discretizer(adapt, quasiDeflection, first, last);
|
||||
if (discretizer.NbPoints () > 0) {
|
||||
Py::List points;
|
||||
|
||||
Reference in New Issue
Block a user