KiCad PCB EDA Suite
edgeshrink.cpp File Reference

The edgeShrink function was found in the project clip2tri by the: Bitfighter project (http://bitfighter.org) https://github.com/raptor/clip2tri https://github.com/raptor/clip2tri/blob/f62a734d22733814b8a970ed8a68a4d94c24fa5f/clip2tri/clip2tri.cpp#L150. More...

#include <plugins/3dapi/xv3d_types.h>
#include <vector>

Go to the source code of this file.

Macros

#define S_INC   1
 

Functions

void EdgeShrink (std::vector< SFVEC2I64 > &aPath)
 

Detailed Description

Macro Definition Documentation

#define S_INC   1

Definition at line 72 of file edgeshrink.cpp.

Referenced by EdgeShrink().

Function Documentation

void EdgeShrink ( std::vector< SFVEC2I64 > &  aPath)

Definition at line 74 of file edgeshrink.cpp.

References S_INC.

Referenced by Convert_shape_line_polygon_to_triangles().

75 {
76  unsigned int prev = aPath.size() - 1;
77 
78  for( unsigned int i = 0; i < aPath.size(); i++ )
79  {
80  // Adjust coordinate by 1 depending on the direction
81  (aPath[i].x - aPath[prev].x) > 0 ? aPath[i].x -= S_INC :
82  aPath[i].x += S_INC;
83 
84  (aPath[i].y - aPath[prev].y) > 0 ? aPath[i].y -= S_INC :
85  aPath[i].y += S_INC;
86 
87  prev = i;
88  }
89 }
#define S_INC
Definition: edgeshrink.cpp:72