Added geometries for vertices and linear edges.

This commit is contained in:
Markus Lampert
2020-09-03 19:35:21 -07:00
committed by sliptonic
parent bbd2c049a9
commit 8f16b94669
9 changed files with 146 additions and 9 deletions

View File

@@ -140,6 +140,20 @@ Py::Object VoronoiVertexPy::getIncidentEdge() const {
return Py::asObject(new VoronoiEdgePy(new VoronoiEdge(v->dia, v->ptr->incident_edge())));
}
PyObject* VoronoiVertexPy::getGeom(PyObject *args)
{
double z = 0.0;
if (!PyArg_ParseTuple(args, "|d", &z)) {
throw Py::RuntimeError("single argument of type double accepted");
}
VoronoiVertex *v = getVoronoiVertexPtr();
if (v->isBound()) {
return new Base::VectorPy(new Base::Vector3d(v->ptr->x(), v->ptr->y(), z));
}
Py_INCREF(Py_None);
return Py_None;
}
// custom attributes get/set
PyObject* VoronoiVertexPy::getCustomAttributes(const char* /*attr*/) const