mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
settings: DeferProcessingFirstElement, MaxOffset, MaxOffsetDeviation, ApplyOffset; taxonomy: centroid funcs; iterator get_tasks + items() funcs; geom.map_shape()
This commit is contained in:
@@ -952,6 +952,21 @@ typedef item const* ptr;
|
||||
auto v = std::make_tuple(static_cast<size_t>(LOOP), hash_elements(), external ? *external ? 2 : 1 : 0, closed ? *closed ? 2 : 1 : 0);
|
||||
return boost::hash<decltype(v)>{}(v);
|
||||
}
|
||||
|
||||
// nb only takes into account explicit points
|
||||
taxonomy::point3::ptr centroid() const {
|
||||
Eigen::Vector3d c(0, 0, 0);
|
||||
for (auto& e : children) {
|
||||
if (e->start.which() == 1) {
|
||||
c += boost::get<point3::ptr>(e->start)->ccomponents();
|
||||
}
|
||||
if (e->end.which() == 1) {
|
||||
c += boost::get<point3::ptr>(e->end)->ccomponents();
|
||||
}
|
||||
}
|
||||
c /= static_cast<double>(children.size());
|
||||
return make<taxonomy::point3>(c);
|
||||
}
|
||||
};
|
||||
|
||||
struct face : public collection_base<loop> {
|
||||
@@ -992,6 +1007,25 @@ typedef item const* ptr;
|
||||
auto v = std::make_tuple(static_cast<size_t>(SHELL), hash_elements(), closed ? *closed ? 2 : 1 : 0);
|
||||
return boost::hash<decltype(v)>{}(v);
|
||||
}
|
||||
|
||||
// nb only takes into account explicit points
|
||||
taxonomy::point3::ptr centroid() const {
|
||||
Eigen::Vector3d c(0, 0, 0);
|
||||
for (auto& f : children) {
|
||||
for (auto& l : f->children) {
|
||||
for (auto& e : l->children) {
|
||||
if (e->start.which() == 1) {
|
||||
c += boost::get<point3::ptr>(e->start)->ccomponents();
|
||||
}
|
||||
if (e->end.which() == 1) {
|
||||
c += boost::get<point3::ptr>(e->end)->ccomponents();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
c /= static_cast<double>(children.size());
|
||||
return make<taxonomy::point3>(c);
|
||||
}
|
||||
};
|
||||
|
||||
struct solid : public collection_base<shell> {
|
||||
|
||||
Reference in New Issue
Block a user