Fix placements

This commit is contained in:
Thomas Krijnen
2019-09-01 13:36:46 +02:00
parent 2e7c43f590
commit 816c0d3618
5 changed files with 21 additions and 8 deletions
+10
View File
@@ -223,6 +223,15 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcPolyLoop* inst) {
taxonomy::item* mapping::map_impl(const IfcSchema::IfcCartesianPoint* inst) {
auto coords = inst->Coordinates();
return new taxonomy::point3(
coords.size() >= 1 ? coords[0] * length_unit_ : 0.,
coords.size() >= 2 ? coords[1] * length_unit_ : 0.,
coords.size() >= 3 ? coords[2] * length_unit_ : 0.
);
}
taxonomy::item* mapping::map_impl(const IfcSchema::IfcDirection* inst) {
auto coords = inst->DirectionRatios();
return new taxonomy::direction3(
coords.size() >= 1 ? coords[0] : 0.,
coords.size() >= 2 ? coords[1] : 0.,
coords.size() >= 3 ? coords[2] : 0.
@@ -320,6 +329,7 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcLocalPlacement* inst) {
break;
}
}
return m4;
}
IfcSchema::IfcProduct::list::ptr mapping::products_represented_by(const IfcSchema::IfcRepresentation* representation) {
+1 -1
View File
@@ -118,7 +118,7 @@ BIND(IfcPolyLoop);
#endif
BIND(IfcCartesianPoint);
// BIND(IfcDirection);
BIND(IfcDirection);
// BIND(IfcAxis2Placement2D);
BIND(IfcAxis2Placement3D);
// BIND(IfcAxis1Placement);
@@ -42,6 +42,9 @@ ifcopenshell::geometry::NativeElement* ifcopenshell::geometry::Converter::create
// @todo decide how to get placement from product
auto placement = (taxonomy::geom_item*) mapping_->map(product);
if (placement == nullptr) {
return nullptr;
}
kernel_->convert(rep_item, shapes);
shape = new ifcopenshell::geometry::Representation::BRep(s, representation_id_builder.str(), shapes);
+2 -2
View File
@@ -53,8 +53,8 @@ struct matrix4 : public item {
auto Z = z.normalized();
components <<
X(0), Y(0), Z(0), o(0),
X(1), Y(1), Z(1), o(0),
X(2), Y(2), Z(2), o(0),
X(1), Y(1), Z(1), o(1),
X(2), Y(2), Z(2), o(2),
0, 0, 0, 1.;
}