Address comment by @RickBrice

This commit is contained in:
Thomas Krijnen
2024-03-13 13:17:40 +01:00
parent e926f002ac
commit 681a229860
@@ -53,10 +53,19 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcFixedReferenceSweptAreaSolid
} }
} }
#endif #endif
auto len = end - start; auto curve_length = end - start;
auto nsteps = (size_t)ceil(len); auto param_type = settings_.get<ifcopenshell::geometry::settings::PiecewiseStepType>().get();
for (size_t i = 0; i <= nsteps; ++i) { auto param = settings_.get<ifcopenshell::geometry::settings::PiecewiseStepParam>().get();
auto m4 = pwf->evaluate(start + len / nsteps * i); size_t num_steps = 0;
if (param_type == ifcopenshell::geometry::settings::PiecewiseStepMethod::MAXSTEPSIZE) {
// parameter is max step size
num_steps = (size_t) std::ceil(curve_length / param);
} else {
// parameter is minimum number of steps
num_steps = (size_t) std::ceil(param);
}
for (size_t i = 0; i <= num_steps; ++i) {
auto m4 = pwf->evaluate(start + curve_length / num_steps * i);
/* /*
std::stringstream ss; std::stringstream ss;