mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Decouples evaluation of a piecewise_function from the function itself (#5344)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
using namespace ifcopenshell::geometry;
|
||||
|
||||
#include "../../ifcgeom/profile_helper.h"
|
||||
#include "../piecewise_function_evaluator.h"
|
||||
|
||||
#include <boost/range/combine.hpp>
|
||||
|
||||
@@ -114,7 +115,8 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSectionedSolidHorizontal* in
|
||||
// @todo currently only the case is handled where directrix returns a piecewise_function
|
||||
// @todo this "if" statement is not really required because the function returns at the start if the Directrix is not a piecewise function
|
||||
if (pwf) {
|
||||
double start = std::max(0., cross_sections.front().dist_along);
|
||||
piecewise_function_evaluator evaluator(pwf, &settings_);
|
||||
double start = std::max(0., cross_sections.front().dist_along);
|
||||
double end = std::min(pwf->length(), cross_sections.back().dist_along);
|
||||
|
||||
if (end - start < 1.e-9) {
|
||||
@@ -232,7 +234,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSectionedSolidHorizontal* in
|
||||
}
|
||||
}
|
||||
|
||||
auto m4 = pwf->evaluate(dist_along);
|
||||
auto m4 = evaluator.evaluate(dist_along);
|
||||
/* {
|
||||
std::wcout << "#" << pwf->instance->data().id() << " " << dist_along << ": " << m4.col(3).row(2).value() << std::endl;
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user