mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 06:09:16 +00:00
Properly read the CONVERT_BACK_UNITS setting for serialized elements
This commit is contained in:
@@ -35,10 +35,10 @@ IfcGeom::Representation::Serialization::Serialization(const BRep& brep)
|
|||||||
TopoDS_Compound compound;
|
TopoDS_Compound compound;
|
||||||
BRep_Builder builder;
|
BRep_Builder builder;
|
||||||
builder.MakeCompound(compound);
|
builder.MakeCompound(compound);
|
||||||
for ( IfcGeom::IfcRepresentationShapeItems::const_iterator it = brep.begin(); it != brep.end(); ++ it ) {
|
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = brep.begin(); it != brep.end(); ++ it) {
|
||||||
const TopoDS_Shape& s = it->Shape();
|
const TopoDS_Shape& s = it->Shape();
|
||||||
gp_GTrsf trsf = it->Placement();
|
gp_GTrsf trsf = it->Placement();
|
||||||
if (convert_back_units) {
|
if (settings().convert_back_units()) {
|
||||||
gp_Trsf scale;
|
gp_Trsf scale;
|
||||||
scale.SetScaleFactor(1.0 / settings().unit_magnitude());
|
scale.SetScaleFactor(1.0 / settings().unit_magnitude());
|
||||||
trsf.PreMultiply(scale);
|
trsf.PreMultiply(scale);
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ namespace IfcGeom {
|
|||||||
class Serialization : public Representation {
|
class Serialization : public Representation {
|
||||||
private:
|
private:
|
||||||
int _id;
|
int _id;
|
||||||
bool convert_back_units;
|
|
||||||
std::string _brep_data;
|
std::string _brep_data;
|
||||||
public:
|
public:
|
||||||
int id() const { return _id; }
|
int id() const { return _id; }
|
||||||
|
|||||||
Reference in New Issue
Block a user