KiCad PCB EDA Suite
Loading...
Searching...
No Matches
VIA_CROSS_SECTION_GEOMETRY Class Reference

The shapes of a schematic via cross section, worked out from its protection and machining settings with no drawing surface involved, so they can be checked without one. More...

#include <via_cross_section_geometry.h>

Classes

struct  BODY
 
struct  PIECE
 
struct  POINT
 
struct  POST_MACHINING
 A cut at the mouth of the hole. More...
 
struct  STATE
 

Public Types

enum class  MATERIAL {
  SOLDER_MASK , CORE , PLUG , COPPER ,
  COVER
}
 The materials, in the order they are painted. More...
 
enum class  CLIP { UNDER_MASK , OVER_MASK }
 What is clipped out of a body. More...
 

Public Member Functions

 VIA_CROSS_SECTION_GEOMETRY (const STATE &aState)
 
double GridHeight () const
 
int InnerLayers () const
 
double LayerCentre (int aOrdinal) const
 Grid height of the centre of a copper layer, by ordinal.
 
const std::vector< PIECE > & Bores () const
 
const std::vector< PIECE > & Cuts () const
 
const std::vector< BODY > & Bodies () const
 
const BODY & Body (MATERIAL aMaterial) const
 

Static Public Member Functions

static double GridHeightFor (int aInnerLayers)
 Grid height for a board with the given number of inner copper layers.
 
static int SetLayersFromStackup (STATE &aState, const BOARD_STACKUP &aStackup, int aCopperLayerCount)
 Fill the layer depths and thicknesses from a stackup, or leave them empty when it does not match the copper layer count.
 

Static Public Attributes

static constexpr double GRID_W = 220.0
 

Private Member Functions

void build (const STATE &aState)
 

Private Attributes

int m_innerLayers
 
double m_gridHeight
 
std::vector< double > m_layerCentres
 
std::vector< PIECE > m_bores
 
std::vector< PIECE > m_cuts
 
std::vector< BODY > m_bodies
 

Detailed Description

The shapes of a schematic via cross section, worked out from its protection and machining settings with no drawing surface involved, so they can be checked without one.

The drawing sits on a grid GRID_W wide and GridHeight() tall, y downwards, that the widget scales to its own size. Layer positions and cut depths are to scale with the board thickness and widths are relative to the hole. Copper and mask thickness are exaggerated.

A value left unset in the state is mixed across a selection, and the shapes it produces are marked mixed so they can be drawn hatched.

Definition at line 41 of file via_cross_section_geometry.h.

Member Enumeration Documentation

◆ CLIP

What is clipped out of a body.

Air is never painted: a backdrill is clipped out of everything under the mask, and a post machining cut out of the mask and cover as well.

Enumerator
UNDER_MASK 

bores and cuts

OVER_MASK 

cuts only

Definition at line 106 of file via_cross_section_geometry.h.

◆ MATERIAL

The materials, in the order they are painted.

Each later body's outline lands on the ones before it.

Enumerator
SOLDER_MASK 
CORE 
PLUG 
COPPER 
COVER 

Definition at line 95 of file via_cross_section_geometry.h.

Constructor & Destructor Documentation

◆ VIA_CROSS_SECTION_GEOMETRY()

VIA_CROSS_SECTION_GEOMETRY::VIA_CROSS_SECTION_GEOMETRY ( const STATE & aState)
explicit

Member Function Documentation

◆ Bodies()

const std::vector< BODY > & VIA_CROSS_SECTION_GEOMETRY::Bodies ( ) const
inline

Definition at line 157 of file via_cross_section_geometry.h.

References m_bodies.

Referenced by VIA_CROSS_SECTION_PREVIEW::onPaint().

◆ Body()

const BODY & VIA_CROSS_SECTION_GEOMETRY::Body ( MATERIAL aMaterial) const

Definition at line 157 of file via_cross_section_geometry.cpp.

References m_bodies.

◆ Bores()

const std::vector< PIECE > & VIA_CROSS_SECTION_GEOMETRY::Bores ( ) const
inline

Definition at line 155 of file via_cross_section_geometry.h.

References m_bores.

Referenced by VIA_CROSS_SECTION_PREVIEW::onPaint().

◆ build()

void VIA_CROSS_SECTION_GEOMETRY::build ( const STATE & aState)
private

Definition at line 163 of file via_cross_section_geometry.cpp.

References BARREL_LEFT, BARREL_RIGHT, BOARD_LEFT, BOARD_RIGHT, VIA_PROTECTION_RULES::CapAllowed(), COPPER_THICKNESS, coreHeightFor(), COUNTERBORE, COUNTERSINK, COVER_OVERHANG, COVER_THICKNESS, VIA_PROTECTION_RULES::CoverAllowed(), HOLE_LEFT, HOLE_RIGHT, INNER_THICKNESS, LayerCentre(), VIA_CROSS_SECTION_GEOMETRY::STATE::m_BackdrillBackLayers, VIA_CROSS_SECTION_GEOMETRY::STATE::m_BackdrillBackWidthRatio, VIA_CROSS_SECTION_GEOMETRY::STATE::m_BackdrillFrontLayers, VIA_CROSS_SECTION_GEOMETRY::STATE::m_BackdrillFrontWidthRatio, m_bodies, m_bores, VIA_CROSS_SECTION_GEOMETRY::STATE::m_BottomLayer, VIA_CROSS_SECTION_GEOMETRY::STATE::m_Capped, VIA_CROSS_SECTION_GEOMETRY::STATE::m_CoverBack, VIA_CROSS_SECTION_GEOMETRY::STATE::m_CoverFront, m_cuts, VIA_CROSS_SECTION_GEOMETRY::POST_MACHINING::m_DepthFraction, VIA_CROSS_SECTION_GEOMETRY::STATE::m_Filled, m_innerLayers, m_layerCentres, VIA_CROSS_SECTION_GEOMETRY::STATE::m_LayerDepths, VIA_CROSS_SECTION_GEOMETRY::STATE::m_LayerThicknesses, VIA_CROSS_SECTION_GEOMETRY::POST_MACHINING::m_Mode, VIA_CROSS_SECTION_GEOMETRY::STATE::m_PadRatio, VIA_CROSS_SECTION_GEOMETRY::STATE::m_PlugBack, VIA_CROSS_SECTION_GEOMETRY::STATE::m_PlugFront, VIA_CROSS_SECTION_GEOMETRY::STATE::m_PostMachiningBack, VIA_CROSS_SECTION_GEOMETRY::STATE::m_PostMachiningFront, VIA_CROSS_SECTION_GEOMETRY::STATE::m_RingLayers, VIA_CROSS_SECTION_GEOMETRY::STATE::m_TentBack, VIA_CROSS_SECTION_GEOMETRY::STATE::m_TentFront, VIA_CROSS_SECTION_GEOMETRY::STATE::m_TopLayer, VIA_CROSS_SECTION_GEOMETRY::POST_MACHINING::m_WidthRatio, MASK_CLEARANCE, MASK_THICKNESS, MAX_HALF_WIDTH, OUTER_TOP, PLUG_DEPTH, PLUG_ROUND, VIA_PROTECTION_RULES::PlugAllowed(), polygon(), rect(), and RING_GAP.

Referenced by VIA_CROSS_SECTION_GEOMETRY().

◆ Cuts()

const std::vector< PIECE > & VIA_CROSS_SECTION_GEOMETRY::Cuts ( ) const
inline

Definition at line 156 of file via_cross_section_geometry.h.

References m_cuts.

Referenced by VIA_CROSS_SECTION_PREVIEW::onPaint().

◆ GridHeight()

double VIA_CROSS_SECTION_GEOMETRY::GridHeight ( ) const
inline

Definition at line 149 of file via_cross_section_geometry.h.

References m_gridHeight.

Referenced by VIA_CROSS_SECTION_PREVIEW::onPaint().

◆ GridHeightFor()

double VIA_CROSS_SECTION_GEOMETRY::GridHeightFor ( int aInnerLayers)
static

Grid height for a board with the given number of inner copper layers.

Definition at line 96 of file via_cross_section_geometry.cpp.

References COPPER_THICKNESS, coreHeightFor(), and OUTER_TOP.

Referenced by VIA_CROSS_SECTION_GEOMETRY().

◆ InnerLayers()

int VIA_CROSS_SECTION_GEOMETRY::InnerLayers ( ) const
inline

Definition at line 150 of file via_cross_section_geometry.h.

References m_innerLayers.

◆ LayerCentre()

double VIA_CROSS_SECTION_GEOMETRY::LayerCentre ( int aOrdinal) const

Grid height of the centre of a copper layer, by ordinal.

Definition at line 151 of file via_cross_section_geometry.cpp.

References m_innerLayers, and m_layerCentres.

Referenced by build().

◆ SetLayersFromStackup()

int VIA_CROSS_SECTION_GEOMETRY::SetLayersFromStackup ( STATE & aState,
const BOARD_STACKUP & aStackup,
int aCopperLayerCount )
static

Fill the layer depths and thicknesses from a stackup, or leave them empty when it does not match the copper layer count.

Returns the board thickness in internal units.

Definition at line 102 of file via_cross_section_geometry.cpp.

References BS_ITEM_TYPE_COPPER, BS_ITEM_TYPE_DIELECTRIC, BOARD_STACKUP::GetList(), VIA_CROSS_SECTION_GEOMETRY::STATE::m_LayerDepths, and VIA_CROSS_SECTION_GEOMETRY::STATE::m_LayerThicknesses.

Referenced by DIALOG_TRACK_VIA_PROPERTIES::updateViaPreview(), and PANEL_SETUP_BOARD_FINISH::updateViaPreview().

Member Data Documentation

◆ GRID_W

double VIA_CROSS_SECTION_GEOMETRY::GRID_W = 220.0
staticconstexpr

Definition at line 138 of file via_cross_section_geometry.h.

Referenced by VIA_CROSS_SECTION_PREVIEW::onPaint().

◆ m_bodies

std::vector<BODY> VIA_CROSS_SECTION_GEOMETRY::m_bodies
private

Definition at line 169 of file via_cross_section_geometry.h.

Referenced by Bodies(), Body(), and build().

◆ m_bores

std::vector<PIECE> VIA_CROSS_SECTION_GEOMETRY::m_bores
private

Definition at line 167 of file via_cross_section_geometry.h.

Referenced by Bores(), and build().

◆ m_cuts

std::vector<PIECE> VIA_CROSS_SECTION_GEOMETRY::m_cuts
private

Definition at line 168 of file via_cross_section_geometry.h.

Referenced by build(), and Cuts().

◆ m_gridHeight

double VIA_CROSS_SECTION_GEOMETRY::m_gridHeight
private

Definition at line 165 of file via_cross_section_geometry.h.

Referenced by GridHeight(), and VIA_CROSS_SECTION_GEOMETRY().

◆ m_innerLayers

int VIA_CROSS_SECTION_GEOMETRY::m_innerLayers
private

◆ m_layerCentres

std::vector<double> VIA_CROSS_SECTION_GEOMETRY::m_layerCentres
private

Definition at line 166 of file via_cross_section_geometry.h.

Referenced by build(), and LayerCentre().


The documentation for this class was generated from the following files: