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

Function project_onto_plane

src/ifcgeom/kernels/cgal/CgalKernel.cpp:1791–1805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1789namespace {
1790 template <typename It, typename Fn>
1791 void project_onto_plane(const taxonomy::plane& p, It i, It j, Fn fn) {
1792 auto mi = p.matrix->ccomponents().inverse();
1793 Eigen::Vector4d v;
1794 std::for_each(i, j, [&mi, &v, &fn](const cgal_shape_t& shp) {
1795 for (auto& vv : vertices(shp)) {
1796 auto& p = vv->point();
1797 v = Eigen::Vector4d(CGAL::to_double(p.cartesian(0)),
1798 CGAL::to_double(p.cartesian(1)),
1799 CGAL::to_double(p.cartesian(2)),
1800 1.);
1801 v = mi * v;
1802 fn(v.head<3>());
1803 }
1804 });
1805 }
1806}
1807
1808bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, ConversionResults& results) {

Callers 1

convert_implMethod · 0.85

Calls 3

fnFunction · 0.85
inverseMethod · 0.80
to_doubleFunction · 0.70

Tested by

no test coverage detected