OCCT 3D model export: fix copper fusing issues on StickHub GND and #20515

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20515
This commit is contained in:
Alex Shvartzkop
2025-04-14 00:15:46 +03:00
parent dfb66e2fdb
commit 2cebea3b04
2 changed files with 17 additions and 2 deletions
+6
View File
@@ -171,6 +171,9 @@ bool EXPORTER_STEP::buildFootprint3DShapes( FOOTPRINT* aFootprint, VECTOR2D aOri
SHAPE_POLY_SET holePoly;
holeShape->TransformToPolygon( holePoly, maxError, ERROR_INSIDE );
// This helps with fusing
holePoly.Deflate( m_platingThickness / 2, CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError );
for( PCB_LAYER_ID pcblayer : pad->GetLayerSet().Seq() )
{
if( pad->IsOnLayer( pcblayer ) )
@@ -421,6 +424,9 @@ bool EXPORTER_STEP::buildTrack3DShape( PCB_TRACK* aTrack, VECTOR2D aOrigin )
SHAPE_POLY_SET holePoly;
holeShape->TransformToPolygon( holePoly, maxError, ERROR_INSIDE );
// This helps with fusing
holePoly.Deflate( m_platingThickness / 2, CORNER_STRATEGY::ROUND_ALL_CORNERS, maxError );
LSET layers( via->GetLayerSet() & m_layersToExport );
PCB_LAYER_ID top_layer, bot_layer;
+11 -2
View File
@@ -785,6 +785,7 @@ STEP_PCB_MODEL::~STEP_PCB_MODEL()
bool STEP_PCB_MODEL::AddPadShape( const PAD* aPad, const VECTOR2D& aOrigin, bool aVia )
{
const double c_padExtraThickness = 0.005;
bool success = true;
std::vector<TopoDS_Shape> padShapes;
@@ -806,9 +807,9 @@ bool STEP_PCB_MODEL::AddPadShape( const PAD* aPad, const VECTOR2D& aOrigin, bool
{
// Pad surface as a separate face for FEM simulations.
if( pcb_layer == F_Cu )
thickness += 0.005;
thickness += c_padExtraThickness;
else if( pcb_layer == B_Cu )
thickness -= 0.005;
thickness -= c_padExtraThickness;
}
TopoDS_Shape testShape;
@@ -860,6 +861,14 @@ bool STEP_PCB_MODEL::AddPadShape( const PAD* aPad, const VECTOR2D& aOrigin, bool
double b_pos, b_thickness;
getLayerZPlacement( F_Cu, f_pos, f_thickness );
getLayerZPlacement( B_Cu, b_pos, b_thickness );
if( !aVia )
{
// Pad surface is slightly thicker
f_thickness += c_padExtraThickness;
b_thickness -= c_padExtraThickness;
}
double top = std::max( f_pos, f_pos + f_thickness );
double bottom = std::min( b_pos, b_pos + b_thickness );