Skip to content

Commit

Permalink
python property Continuity of GeometrySurface
Browse files Browse the repository at this point in the history
  • Loading branch information
5263 committed Sep 1, 2014
1 parent f647f25 commit 256d844
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Mod/Part/App/GeometrySurfacePy.xml
Expand Up @@ -38,6 +38,14 @@
</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Continuity" ReadOnly="true">
<Documentation>
<UserDocu>
Returns the global continuity of the surface.
</UserDocu>
</Documentation>
<Parameter Name="Continuity" Type="String"/>
</Attribute>
<Methode Name="isUPeriodic">
<Documentation>
<UserDocu>Returns true if this patch is periodic in the given parametric direction.</UserDocu>
Expand Down
34 changes: 34 additions & 0 deletions src/Mod/Part/App/GeometrySurfacePyImp.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 256d844

Please sign in to comment.