mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Reconstruct the form of the transformation to improve the output of the OpenCascade-based serializers
This commit is contained in:
@@ -38,14 +38,17 @@ void OpenCascadeBasedSerializer::writeShapeModel(const IfcGeomObjects::IfcGeomSh
|
|||||||
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->mesh().begin(); it != o->mesh().end(); ++ it) {
|
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->mesh().begin(); it != o->mesh().end(); ++ it) {
|
||||||
gp_GTrsf gtrsf = it->Placement();
|
gp_GTrsf gtrsf = it->Placement();
|
||||||
|
|
||||||
// TODO:
|
// Convert the matrix back into a transformation object. The tolerance values
|
||||||
gp_GTrsf o_trsf;
|
// are taken into consideration to reconstruct the form of the transformation.
|
||||||
int k = 0;
|
gp_Trsf o_trsf;
|
||||||
for( int i = 1; i < 5; ++ i )
|
o_trsf.SetValues(
|
||||||
for ( int j = 1; j < 4; ++ j )
|
o->matrix()[0], o->matrix()[3], o->matrix()[6], o->matrix()[ 9],
|
||||||
o_trsf.SetValue(j, i, o->matrix()[k++]);
|
o->matrix()[1], o->matrix()[4], o->matrix()[7], o->matrix()[10],
|
||||||
|
o->matrix()[2], o->matrix()[5], o->matrix()[8], o->matrix()[11],
|
||||||
|
1e-5, 1e-5
|
||||||
|
);
|
||||||
gtrsf.PreMultiply(o_trsf);
|
gtrsf.PreMultiply(o_trsf);
|
||||||
|
|
||||||
const TopoDS_Shape& s = it->Shape();
|
const TopoDS_Shape& s = it->Shape();
|
||||||
|
|
||||||
bool trsf_valid = false;
|
bool trsf_valid = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user