Work towards v1.0 data model with encapsulated weak_ptr as basis for instances

This commit is contained in:
Thomas Krijnen
2026-01-04 10:40:02 +01:00
parent f09ca658f1
commit 7098beb819
210 changed files with 28269 additions and 26471 deletions
@@ -24,22 +24,22 @@ using namespace ifcopenshell::geometry;
#ifdef SCHEMA_HAS_IfcExtrudedAreaSolidTapered
#define mapping POSTFIX_SCHEMA(mapping)
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcExtrudedAreaSolidTapered* inst) {
const double height = inst->Depth() * length_unit_;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcExtrudedAreaSolidTapered& inst) {
const double height = inst.Depth() * length_unit_;
if (height < settings_.get<settings::Precision>().get()) {
Logger::Message(Logger::LOG_ERROR, "Non-positive extrusion height encountered for:", inst);
return nullptr;
}
taxonomy::direction3::ptr dir = taxonomy::cast<taxonomy::direction3>(map(inst->ExtrudedDirection()));
taxonomy::direction3::ptr dir = taxonomy::cast<taxonomy::direction3>(map(inst.ExtrudedDirection()));
Eigen::Affine3d af3d(Eigen::Translation3d(height * dir->ccomponents()));
Eigen::Matrix4d end_profile = af3d.matrix();
auto loft = taxonomy::make<taxonomy::loft>();
loft->axis = nullptr;
loft->children = {
taxonomy::cast<taxonomy::face>(map(inst->SweptArea())),
taxonomy::cast<taxonomy::face>(map(inst->EndSweptArea()))
taxonomy::cast<taxonomy::face>(map(inst.SweptArea())),
taxonomy::cast<taxonomy::face>(map(inst.EndSweptArea()))
};
if (!loft->children.back()->matrix) {
@@ -51,10 +51,10 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcExtrudedAreaSolidTapered* in
taxonomy::matrix4::ptr matrix;
bool has_position = true;
#ifdef SCHEMA_IfcSweptAreaSolid_Position_IS_OPTIONAL
has_position = inst->Position() != nullptr;
has_position = !!inst.Position();
#endif
if (has_position) {
matrix = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
matrix = taxonomy::cast<taxonomy::matrix4>(map(inst.Position()));
}
loft->matrix = matrix;