Browse Source

STEP exporter: fix Z position of 3D shapes.

Previously the Z pos was the position of dielectric body. Now it is the position
of top of copper layers, like in the 3D viewer.
jobs
jean-pierre charras 1 year ago
parent
commit
e6f9907246
  1. 9
      pcbnew/exporters/step/step_pcb_model.cpp

9
pcbnew/exporters/step/step_pcb_model.cpp

@ -2641,6 +2641,15 @@ bool STEP_PCB_MODEL::getModelLocation( bool aBottom, VECTOR2D aPosition, double
double top = std::max( boardZPos, boardZPos + boardThickness );
double bottom = std::min( boardZPos, boardZPos + boardThickness );
// 3D step models are placed on the top of copper layers.
// This is true for SMD shapes, and perhaps not always true for TH shapes,
// but we use this Z position for any 3D shape.
double f_pos, f_thickness;
getLayerZPlacement( F_Cu, f_pos, f_thickness );
top += f_thickness;
getLayerZPlacement( B_Cu, f_pos, f_thickness );
bottom += f_thickness; // f_thickness is < 0 for B_Cu layer
gp_Trsf lRot;
if( aBottom )

Loading…
Cancel
Save