mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Don't construct transformation from matrix, but use original data.
This commit is contained in:
@@ -40,19 +40,7 @@ void OpenCascadeBasedSerializer::write(const IfcGeom::BRepElement<double>* o) {
|
|||||||
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->geometry().begin(); it != o->geometry().end(); ++ it) {
|
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->geometry().begin(); it != o->geometry().end(); ++ it) {
|
||||||
gp_GTrsf gtrsf = it->Placement();
|
gp_GTrsf gtrsf = it->Placement();
|
||||||
|
|
||||||
const std::vector<double>& matrix = o->transformation().matrix().data();
|
const gp_Trsf& o_trsf = o->transformation().data();
|
||||||
|
|
||||||
// Convert the matrix back into a transformation object. The tolerance values
|
|
||||||
// are taken into consideration to reconstruct the form of the transformation.
|
|
||||||
gp_Trsf o_trsf;
|
|
||||||
o_trsf.SetValues(
|
|
||||||
matrix[0], matrix[3], matrix[6], matrix[ 9],
|
|
||||||
matrix[1], matrix[4], matrix[7], matrix[10],
|
|
||||||
matrix[2], matrix[5], matrix[8], matrix[11]
|
|
||||||
#if OCC_VERSION_HEX < 0x60800
|
|
||||||
, Precision::Angular(), Precision::Confusion()
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
gtrsf.PreMultiply(o_trsf);
|
gtrsf.PreMultiply(o_trsf);
|
||||||
|
|
||||||
const TopoDS_Shape& s = it->Shape();
|
const TopoDS_Shape& s = it->Shape();
|
||||||
|
|||||||
@@ -217,17 +217,7 @@ void SvgSerializer::write(const IfcGeom::BRepElement<double>* o) {
|
|||||||
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->geometry().begin(); it != o->geometry().end(); ++ it) {
|
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = o->geometry().begin(); it != o->geometry().end(); ++ it) {
|
||||||
gp_GTrsf gtrsf = it->Placement();
|
gp_GTrsf gtrsf = it->Placement();
|
||||||
|
|
||||||
gp_Trsf o_trsf;
|
const gp_Trsf& o_trsf = o->transformation().data();
|
||||||
const std::vector<double>& matrix = o->transformation().matrix().data();
|
|
||||||
o_trsf.SetValues(
|
|
||||||
matrix[0], matrix[3], matrix[6], matrix[ 9],
|
|
||||||
matrix[1], matrix[4], matrix[7], matrix[10],
|
|
||||||
matrix[2], matrix[5], matrix[8], matrix[11]
|
|
||||||
#if OCC_VERSION_HEX < 0x60800
|
|
||||||
, Precision::Angular(), Precision::Confusion()
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
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