KiCad PCB EDA Suite
sg_helpers.cpp File Reference
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <utility>
#include <wx/log.h>
#include "3d_cache/sg/sg_helpers.h"
#include "3d_cache/sg/sg_node.h"

Go to the source code of this file.

Functions

static void calcTriad (glm::dvec3 *pts, glm::dvec3 &tri)
 

Function Documentation

static void calcTriad ( glm::dvec3 *  pts,
glm::dvec3 &  tri 
)
static

Definition at line 368 of file sg_helpers.cpp.

References S3D::degenerate().

Referenced by S3D::CalcTriangleNormals().

369 {
370  if( S3D::degenerate( pts ) )
371  {
372  // degenerate points should contribute nothing to the result
373  tri = glm::dvec3( 0.0, 0.0, 0.0 );
374  return;
375  }
376 
377  // normal * 2 * area
378  tri = glm::cross( pts[1] - pts[0], pts[2] - pts[0] );
379 
380  return;
381 }
bool degenerate(glm::dvec3 *pts)
Definition: sg_helpers.cpp:339