Skip to content

Commit

Permalink
Implement product matric access in Python wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
aothms committed Apr 10, 2024
1 parent 6d5a9f8 commit 7589e0b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ifcwrap/IfcGeomWrapper.i
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
%}
};

Expand Down

0 comments on commit 7589e0b

Please sign in to comment.