MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / evaluation_points

Method evaluation_points

src/ifcgeom/function_item_evaluator.cpp:251–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251std::vector<double> function_item_evaluator::evaluation_points() const {
252 if (!eval_points_.has_value()) {
253 double curve_length = fn_evaluator_->length();
254
255 auto param_type = fn_evaluator_->settings_.get<ifcopenshell::geometry::settings::FunctionStepType>().get();
256 auto param = fn_evaluator_->settings_.get<ifcopenshell::geometry::settings::FunctionStepParam>().get();
257 unsigned num_steps = 0;
258 if (param_type == ifcopenshell::geometry::settings::FunctionStepMethod::MAXSTEPSIZE) {
259 // parameter is max step size
260 num_steps = (unsigned)std::ceil(curve_length / param);
261 } else {
262 // parameter is minimum number of steps
263 num_steps = (unsigned)std::ceil(param);
264 }
265
266 eval_points_ = evaluation_points(fn_evaluator_->start(), fn_evaluator_->end(), num_steps);
267 }
268 return *eval_points_;
269}
270
271std::vector<double> function_item_evaluator::evaluation_points(double ustart, double uend, unsigned nsteps) const {
272 double curve_length = fn_evaluator_->length();

Callers 1

map_implMethod · 0.80

Calls 6

reserveMethod · 0.80
push_backMethod · 0.80
lengthMethod · 0.45
getMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected