Don't mutate conversion result placement. Breaks combination of world coords + optimized model.

This commit is contained in:
Thomas Krijnen
2023-12-05 21:11:36 +01:00
parent c595adfb7b
commit 4cd327f711
2 changed files with 12 additions and 8 deletions
+10
View File
@@ -8,3 +8,13 @@ IfcGeom::Representation::Triangulation * IfcGeom::ConversionResultShape::Triangu
Triangulate(settings, iden, t, -1);
return t;
}
using namespace ifcopenshell::geometry::taxonomy;
void IfcGeom::ConversionResult::append(ifcopenshell::geometry::taxonomy::matrix4::ptr trsf) {
placement_ = make<matrix4>(placement_->ccomponents() * trsf->ccomponents());
}
void IfcGeom::ConversionResult::prepend(ifcopenshell::geometry::taxonomy::matrix4::ptr trsf) {
placement_ = make<matrix4>(trsf->ccomponents() * placement_->ccomponents());
}
+2 -8
View File
@@ -245,14 +245,8 @@ namespace IfcGeom {
ConversionResult(int id, ConversionResultShape* shape)
: id(id), placement_(ifcopenshell::geometry::taxonomy::make<ifcopenshell::geometry::taxonomy::matrix4>()), shape_(shape)
{}
void append(ifcopenshell::geometry::taxonomy::matrix4::ptr trsf) {
// @todo verify order
placement_->components() = placement_->ccomponents() * trsf->ccomponents();
}
void prepend(ifcopenshell::geometry::taxonomy::matrix4::ptr trsf) {
// @todo verify order
placement_->components() = trsf->ccomponents() * placement_->ccomponents();
}
void append(ifcopenshell::geometry::taxonomy::matrix4::ptr trsf);
void prepend(ifcopenshell::geometry::taxonomy::matrix4::ptr trsf);
std::shared_ptr<ConversionResultShape> Shape() const { return shape_; }
ifcopenshell::geometry::taxonomy::matrix4::ptr Placement() const { return placement_; }
bool hasStyle() const { return !!style_; }