From 7589e0bd40fb238abd37f21c41589fd68089108a Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 10 Apr 2024 21:22:13 +0200 Subject: [PATCH] Implement product matric access in Python wrapper --- src/ifcwrap/IfcGeomWrapper.i | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 0b8eb5ecc6..6c92ec3e43 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -398,9 +398,16 @@ struct ShapeRTTI : public boost::static_visitor */ %extend IfcGeom::Transformation { + PyObject* matrix_() const { + auto result = PyTuple_New(16); + for (int i = 0; i < 16; ++i) { + PyTuple_SET_ITEM(result, i, PyFloat_FromDouble(self->data()->ccomponents().data()[i])); + } + return result; + } %pythoncode %{ # Hide the getters with read-only property implementations - matrix = property(data) + matrix = property(matrix_) %} };