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
@@ -53,8 +53,13 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSegmentedReferenceCurve* ins
// Get starting position of cant curve, relative to the gradient curve.
// The cant curve can start before or after the start of the gradient curve
auto first_segment = *(segments->begin());
auto p = taxonomy::cast<taxonomy::matrix4>(map(first_segment->as<IfcSchema::IfcCurveSegment>()->Placement()));
const Eigen::Matrix4d& m = p->ccomponents();
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 cant_start = m(0, 3); // start of cant curve
auto cant = taxonomy::make<taxonomy::piecewise_function>(cant_start,spans);