mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
Refactors alignment geometry
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user