From 256d84480123b6c5bdf26f4f843a81377b84df36 Mon Sep 17 00:00:00 2001 From: Sebastian Hoogen Date: Mon, 1 Sep 2014 10:27:52 +0200 Subject: [PATCH] python property Continuity of GeometrySurface --- src/Mod/Part/App/GeometrySurfacePy.xml | 8 ++++++ src/Mod/Part/App/GeometrySurfacePyImp.cpp | 34 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/Mod/Part/App/GeometrySurfacePy.xml b/src/Mod/Part/App/GeometrySurfacePy.xml index 3492d28b3..3090e5cb0 100644 --- a/src/Mod/Part/App/GeometrySurfacePy.xml +++ b/src/Mod/Part/App/GeometrySurfacePy.xml @@ -38,6 +38,14 @@ + + + + Returns the global continuity of the surface. + + + + Returns true if this patch is periodic in the given parametric direction. diff --git a/src/Mod/Part/App/GeometrySurfacePyImp.cpp b/src/Mod/Part/App/GeometrySurfacePyImp.cpp index d2772205d..d8dc41626 100644 --- a/src/Mod/Part/App/GeometrySurfacePyImp.cpp +++ b/src/Mod/Part/App/GeometrySurfacePyImp.cpp @@ -311,6 +311,40 @@ PyObject* GeometrySurfacePy::VPeriod(PyObject * args) } } +Py::String GeometrySurfacePy::getContinuity(void) const +{ + GeomAbs_Shape c = Handle_Geom_Surface::DownCast + (getGeometryPtr()->handle())->Continuity(); + std::string str; + switch (c) { + case GeomAbs_C0: + str = "C0"; + break; + case GeomAbs_G1: + str = "G1"; + break; + case GeomAbs_C1: + str = "C1"; + break; + case GeomAbs_G2: + str = "G2"; + break; + case GeomAbs_C2: + str = "C2"; + break; + case GeomAbs_C3: + str = "C3"; + break; + case GeomAbs_CN: + str = "CN"; + break; + default: + str = "Unknown"; + break; + } + return Py::String(str); +} + PyObject* GeometrySurfacePy::toBSpline(PyObject * args) { double tol3d;