mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
Work on unit issues with step and iges files
This commit is contained in:
@@ -46,6 +46,7 @@ public:
|
|||||||
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {
|
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {
|
||||||
const char* symbol = getSymbolForUnitMagnitude(magnitude);
|
const char* symbol = getSymbolForUnitMagnitude(magnitude);
|
||||||
if (symbol) {
|
if (symbol) {
|
||||||
|
Interface_Static::SetCVal("xstep.cascade.unit", symbol);
|
||||||
Interface_Static::SetCVal("write.iges.unit", symbol);
|
Interface_Static::SetCVal("write.iges.unit", symbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,12 @@ void OpenCascadeBasedSerializer::write(const IfcGeom::BRepElement<double>* o) {
|
|||||||
const gp_Trsf& o_trsf = o->transformation().data();
|
const gp_Trsf& o_trsf = o->transformation().data();
|
||||||
gtrsf.PreMultiply(o_trsf);
|
gtrsf.PreMultiply(o_trsf);
|
||||||
|
|
||||||
|
if (o->geometry().settings().convert_back_units()) {
|
||||||
|
gp_Trsf scale;
|
||||||
|
scale.SetScaleFactor(1.0 / o->geometry().settings().unit_magnitude());
|
||||||
|
gtrsf.PreMultiply(scale);
|
||||||
|
}
|
||||||
|
|
||||||
const TopoDS_Shape& s = it->Shape();
|
const TopoDS_Shape& s = it->Shape();
|
||||||
|
|
||||||
bool trsf_valid = false;
|
bool trsf_valid = false;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {
|
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {
|
||||||
const char* symbol = getSymbolForUnitMagnitude(magnitude);
|
const char* symbol = getSymbolForUnitMagnitude(magnitude);
|
||||||
if (symbol) {
|
if (symbol) {
|
||||||
|
Interface_Static::SetCVal("xstep.cascade.unit", symbol);
|
||||||
Interface_Static::SetCVal("write.step.unit", symbol);
|
Interface_Static::SetCVal("write.step.unit", symbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user