Refactors alignment geometry

This commit is contained in:
Richard Brice
2025-01-02 11:10:56 -08:00
committed by GitHub
parent bb9be861c8
commit 26ba761c68
23 changed files with 948 additions and 555 deletions
@@ -19,7 +19,7 @@
#include "mapping.h"
#include "../profile_helper.h"
#include "../piecewise_function_evaluator.h"
#include "../function_item_evaluator.h"
#define mapping POSTFIX_SCHEMA(mapping)
using namespace ifcopenshell::geometry;
@@ -28,11 +28,15 @@ using namespace ifcopenshell::geometry;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcPointByDistanceExpression* inst) {
auto u = (*inst->DistanceAlong()->as<IfcSchema::IfcLengthMeasure>()) * length_unit_;
//auto basis_curve = inst->BasisCurve();
//auto item = map(basis_curve);
//auto pw_curve = ifcopenshell::geometry::piecewise_from_item(item);
auto pw_curve = taxonomy::dcast<taxonomy::piecewise_function>(map(inst->BasisCurve()));
piecewise_function_evaluator evaluator(pw_curve,&settings_);
auto basis_curve = map(inst->BasisCurve());
taxonomy::function_item::ptr curve = taxonomy::dcast<taxonomy::function_item>(basis_curve);
if (!curve) {
// if the basis curve is not a function_item, the cast it to piecewise_function. the casting operator
// calls loop_to_piecewise_function_upgrade and will convert loops to a piecewise function
curve = taxonomy::dcast<taxonomy::piecewise_function>(basis_curve);
}
function_item_evaluator evaluator(settings_,curve);
auto m = evaluator.evaluate(u);
auto o = m.col(3).head<3>();