Implement product matric access in Python wrapper

This commit is contained in:
Thomas Krijnen
2024-04-10 21:22:13 +02:00
parent 6d5a9f8716
commit 7589e0bd40
+8 -1
View File
@@ -398,9 +398,16 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
*/
%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_)
%}
};