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

Function newell

src/ifcgeom/kernels/cgal/CgalConversionResult.cpp:34–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace {
33 template <typename Facet>
34 CGAL::Direction_3<Kernel_> newell(Facet& face) {
35 typename Kernel_::FT a(0), b(0), c(0);
36 CGAL::Polyhedron_3<Kernel_>::Halfedge_around_facet_const_circulator current_halfedge = face.facet_begin();
37 do {
38 auto& curr = current_halfedge->vertex()->point();
39 auto& next = current_halfedge->next()->vertex()->point();
40 a += (curr.y() - next.y()) * (curr.z() + next.z());
41 b += (curr.z() - next.z()) * (curr.x() + next.x());
42 c += (curr.x() - next.x()) * (curr.y() + next.y());
43 } while (++current_halfedge != face.facet_begin());
44 return CGAL::Direction_3<Kernel_>(a, b, c);
45 }
46
47 struct Plane_equation {
48 template <typename Facet>

Callers 2

operator()Method · 0.70
CgalShapeMethod · 0.70

Calls 2

vertexMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected