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

Function centroid

src/ifcgeom/taxonomy.h:976–988  ·  view source on GitHub ↗

nb only takes into account explicit points

Source from the content-addressed store, hash-verified

974
975 // nb only takes into account explicit points
976 taxonomy::point3::ptr centroid() const {
977 Eigen::Vector3d c(0, 0, 0);
978 for (auto& e : children) {
979 if (e->start.which() == 1) {
980 c += boost::get<point3::ptr>(e->start)->ccomponents();
981 }
982 if (e->end.which() == 1) {
983 c += boost::get<point3::ptr>(e->end)->ccomponents();
984 }
985 }
986 c /= static_cast<double>(children.size());
987 return make<taxonomy::point3>(c);
988 }
989 };
990
991 struct IFC_GEOM_API face : public collection_base<loop> {

Callers 3

set_point_insideMethod · 0.85
operator()Method · 0.85
remove_thicknessMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected