ifdefs around geometry handling for 4.3 rc schemas #6710

This commit is contained in:
Thomas Krijnen
2025-05-17 16:01:28 +02:00
parent 22f10e5549
commit 4bc88eac2f
7 changed files with 51 additions and 14 deletions
+6 -1
View File
@@ -53,7 +53,12 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcGradientCurve* inst) {
// Get starting position of gradient curve, which is relative to the base curve
// The gradient curve can start before or after the start of the base curve
auto first_segment = *(segments->begin());
auto p = taxonomy::cast<taxonomy::matrix4>(map(first_segment->as<IfcSchema::IfcCurveSegment>()->Placement()));
taxonomy::matrix4::ptr p;
#ifdef SCHEMA_IfcCurveSegment_HAS_Placement
p = taxonomy::cast<taxonomy::matrix4>(map(first_segment->as<IfcSchema::IfcCurveSegment>()->Placement()));
#else
throw std::runtime_error("Unsupported schema");
#endif
const Eigen::Matrix4d& m = p->ccomponents();
double gradient_start = m(0, 3); // start of vertical (row 0, col 3) - "Distance Along" horizontal curve