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 339 of file sg_helpers.cpp.

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

References S3D::degenerate().

Referenced by S3D::CalcTriangleNormals().