MCPcopy Create free account
hub / github.com/cutdigital/mcut / polygon_normal

Function polygon_normal

source/math.cpp:110–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108
109#if 0
110 void polygon_normal(vec3& normal, const vec3* vertices, const int num_vertices)
111 {
112 normal = vec3(0.0);
113 for (int i = 0; i < num_vertices; ++i) {
114 normal = normal + cross_product(vertices[i] - vertices[0], vertices[(i + 1) % num_vertices] - vertices[0]);
115 }
116 normal = normalize(normal);
117 }
118#endif
119
120 int compute_polygon_plane_coefficients(vec3& normal, double& d_coeff,

Callers

nothing calls this directly

Calls 3

cross_productFunction · 0.85
normalizeFunction · 0.85
vec3Class · 0.50

Tested by

no test coverage detected