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

Function newell

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

Source from the content-addressed store, hash-verified

565
566namespace {
567 cgal_direction_t newell(const std::vector<cgal_point_t> & loop) {
568 Kernel_::FT a(0.0), b(0.0), c(0.0);
569 for (size_t i = 0; i < loop.size(); ++i) {
570 auto & curr = loop[i];
571 auto & next = loop[(i + 1) % loop.size()];
572 a += (curr.y() - next.y()) * (curr.z() + next.z());
573 b += (curr.z() - next.z()) * (curr.x() + next.x());
574 c += (curr.x() - next.x()) * (curr.y() + next.y());
575 }
576 return cgal_direction_t(a, b, c);
577 }
578}
579
580namespace {

Callers 4

face_to_poly_with_holesFunction · 0.70
convertMethod · 0.70
process_extrusionMethod · 0.70
process_as_2d_polygonMethod · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected