KiCad PCB EDA Suite
croundsegment2d.h File Reference
#include "cobject2d.h"

Go to the source code of this file.

Classes

class  CROUNDSEGMENT2D
 

Functions

bool Is_segment_a_circle (const SFVEC2F &aStart, const SFVEC2F &aEnd)
 Segment_is_a_circle - check if segment start and end is very close to each other should used to check if the segment should be converted to a circle instead. More...
 

Variables

static const float s_min_dot = (FLT_EPSILON * 4.0f)
 

Function Documentation

bool Is_segment_a_circle ( const SFVEC2F aStart,
const SFVEC2F aEnd 
)
inline

Segment_is_a_circle - check if segment start and end is very close to each other should used to check if the segment should be converted to a circle instead.

Parameters
aStart
aEnd
Returns
true is it is better to convert the segment to circle

Definition at line 97 of file croundsegment2d.h.

References s_min_dot.

Referenced by CINFO3D_VISU::AddShapeWithClearanceToContainer(), CINFO3D_VISU::AddSolidAreasShapesToContainer(), addTextSegmToContainer(), CINFO3D_VISU::buildPadShapeThickOutlineAsSegments(), CINFO3D_VISU::createNewPadDrill(), CINFO3D_VISU::createNewPadWithClearance(), CINFO3D_VISU::createNewTrack(), and CINFO3D_VISU::TransformArcToSegments().

98 {
99  const SFVEC2F vec = aEnd - aStart;
100 
101  return (aStart == aEnd) ||
102  // This is the same as calc the lenght squared (without the sqrt)
103  // and compare with a small value
104  ( glm::dot( vec, vec ) <= s_min_dot );
105 }
static const float s_min_dot
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45

Variable Documentation

const float s_min_dot = (FLT_EPSILON * 4.0f)
static

Definition at line 88 of file croundsegment2d.h.

Referenced by Is_segment_a_circle().