| 249 | } |
| 250 | |
| 251 | std::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 | |
| 271 | std::vector<double> function_item_evaluator::evaluation_points(double ustart, double uend, unsigned nsteps) const { |
| 272 | double curve_length = fn_evaluator_->length(); |