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

Method length

src/ifcgeom/taxonomy.cpp:502–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500double piecewise_function::start() const { return start_; }
501double piecewise_function::end() const { return start_ + length(); }
502double piecewise_function::length() const {
503 return std::accumulate(spans_.begin(), spans_.end(), 0.0, [](const auto& v, const auto& s) { return v + s->length(); });
504
505 // this is a secondary option where we only compute length once and cache it.
506 // mutex is needed to prevent interruption of the accumulation if there is multi-threading
507 // skipping this detail for now and just adding up the span lengths every time
508 //if (!length_.has_value()) {
509 // length_ = std::accumulate(spans_.begin(), spans_.end(), 0.0, [](const auto& v, const auto& s) { return v + s->length(); });
510 //}
511 //return *length_;
512}
513
514
515gradient_function::gradient_function(piecewise_function::const_ptr horizontal, piecewise_function::const_ptr vertical, const IfcUtil::IfcBaseInterface* instance) :

Callers 4

get_spanMethod · 0.45
evaluation_pointsMethod · 0.45
make_loftMethod · 0.45
orientSceneMethod · 0.45

Calls 3

accumulateFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected