KiCad PCB EDA Suite
Loading...
Searching...
No Matches
polygon_2d.h File Reference
#include "object_2d.h"
#include "../accelerators/container_2d.h"
#include <geometry/shape_poly_set.h>
#include <vector>

Go to the source code of this file.

Classes

struct  POLYSEGMENT
 
struct  SEG_NORMALS
 
struct  SEGMENT_WITH_NORMALS
 
struct  OUTERS_AND_HOLES
 Handle a subset of a polygon. More...
 
class  POLYGON_2D
 Represent a sub polygon block. More...
 
class  DUMMY_BLOCK_2D
 A dummy block defined by a 2d box size. More...
 

Typedefs

typedef std::vector< POLYSEGMENTSEGMENTS
 
typedef std::vector< SEGMENT_WITH_NORMALSSEGMENTS_WIDTH_NORMALS
 List used to test ray2d intersections.
 

Functions

void ConvertPolygonToBlocks (const SHAPE_POLY_SET &aMainPath, CONTAINER_2D_BASE &aDstContainer, float aBiuTo3dUnitsScale, float aDivFactor, const BOARD_ITEM &aBoardItem, int aPolyIndex)
 Use a polygon in the format of the ClipperLib::Path and process it and create multiple 2d objects (POLYGON_2D and DUMMY_BLOCK_2D) that can be used to represent this polygon area.
 
void Polygon2d_TestModule ()
 

Typedef Documentation

◆ SEGMENTS

typedef std::vector< POLYSEGMENT > SEGMENTS

Definition at line 61 of file polygon_2d.h.

◆ SEGMENTS_WIDTH_NORMALS

List used to test ray2d intersections.

It will be a subset of an original polygon. The normals will be passed already interpolated.

Definition at line 69 of file polygon_2d.h.

Function Documentation

◆ ConvertPolygonToBlocks()

void ConvertPolygonToBlocks ( const SHAPE_POLY_SET aMainPath,
CONTAINER_2D_BASE aDstContainer,
float  aBiuTo3dUnitsScale,
float  aDivFactor,
const BOARD_ITEM aBoardItem,
int  aPolyIndex 
)

Use a polygon in the format of the ClipperLib::Path and process it and create multiple 2d objects (POLYGON_2D and DUMMY_BLOCK_2D) that can be used to represent this polygon area.

Parameters
aMainPaththe polygon are that was converted from the pcb board
aDstContainerthe destination container to put the created sub blocks
aBiuTo3dUnitsScalethe rendering target 3d scale
aDivFactora division factor (in 3Dunits) to divide the polygon plane, 0.0f will use the internal polygon segm statistics

Definition at line 378 of file polygon_2d.cpp.

References CONTAINER_2D_BASE::Add(), SHAPE_POLY_SET::AddOutline(), SHAPE_POLY_SET::BooleanIntersection(), SHAPE_POLY_SET::COutline(), extractPathsFrom(), BOX2< Vec >::GetBottom(), BBOX_2D::GetExtent(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), OUTERS_AND_HOLES::m_Holes, OUTERS_AND_HOLES::m_Outers, POLYSEGMENT::m_Start, SEGMENT_WITH_NORMALS::m_Start, BBOX_2D::Max(), MAX_NR_DIVISIONS, BBOX_2D::Min(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), path, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, polygon_Convert(), polygon_IsPointInside(), BBOX_2D::Reset(), BBOX_2D::ScaleNextUp(), SHAPE_LINE_CHAIN::SetClosed(), BBOX_2D::Union(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by RENDER_3D_RAYTRACE_BASE::Reload().

◆ Polygon2d_TestModule()

void Polygon2d_TestModule ( )