Part: Expose Geometry::isSame() to Python
This commit is contained in:
@@ -53,6 +53,14 @@ It describes the common behavior of these objects when:
|
||||
<UserDocu>Create a clone of this geometry with the same Tag</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isSame" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
isSame(geom, tol, angulartol) -> boolean
|
||||
|
||||
Compare this geometry to another one</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="hasExtensionOfType" Const="true">
|
||||
<Documentation>
|
||||
<UserDocu>Returns a boolean indicating whether a geometry extension of the type indicated as a string exists.</UserDocu>
|
||||
|
||||
@@ -203,6 +203,20 @@ PyObject* GeometryPy::clone(PyObject *args)
|
||||
return cpy;
|
||||
}
|
||||
|
||||
PyObject* GeometryPy::isSame(PyObject *args)
|
||||
{
|
||||
PyObject* other {};
|
||||
double tol {};
|
||||
double angular {};
|
||||
if (!PyArg_ParseTuple(args, "O!dd", &GeometryPy::Type, &other, &tol, &angular)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Part::Geometry* geom = this->getGeometryPtr();
|
||||
bool same = geom->isSame(*static_cast<GeometryPy*>(other)->getGeometryPtr(), tol, angular);
|
||||
return Py::new_reference_to(Py::Boolean(same));
|
||||
}
|
||||
|
||||
PyObject* GeometryPy::setExtension(PyObject *args)
|
||||
{
|
||||
PyObject* o;
|
||||
|
||||
Reference in New Issue
Block a user