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

◆ calcTriad()

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

Definition at line 338 of file sg_helpers.cpp.

339 {
340  if( S3D::degenerate( pts ) )
341  {
342  // degenerate points should contribute nothing to the result
343  tri = glm::dvec3( 0.0, 0.0, 0.0 );
344  return;
345  }
346 
347  // normal * 2 * area
348  tri = glm::cross( pts[1] - pts[0], pts[2] - pts[0] );
349 }
bool degenerate(glm::dvec3 *pts) noexcept
Definition: sg_helpers.cpp:309

References S3D::degenerate().

Referenced by S3D::CalcTriangleNormals().