Avoid scaling unity models

There is no benefit to applying the identity transformation to models
when exporting the board to STEP

Fixes https://gitlab.com/kicad/code/kicad/issues/12036
This commit is contained in:
Seth Hillbrand 2022-07-19 10:35:31 -07:00
parent f78671fc2e
commit 98431eed79
1 changed files with 13 additions and 10 deletions

View File

@ -1379,7 +1379,6 @@ TDF_Label PCBMODEL::transferModel( Handle( TDocStd_Document )& source,
Handle( TDocStd_Document )& dest, TRIPLET aScale )
{
// transfer data from Source into a top level component of Dest
gp_GTrsf scale_transform;
scale_transform.SetVectorialPart( gp_Mat( aScale.x, 0, 0,
0, aScale.y, 0,
@ -1411,9 +1410,12 @@ TDF_Label PCBMODEL::transferModel( Handle( TDocStd_Document )& source,
TopoDS_Shape shape = s_assy->GetShape( frshapes.Value( id ) );
if( !shape.IsNull() )
{
TopoDS_Shape scaled_shape( shape );
if( aScale.x != 1.0 || aScale.y != 1.0 || aScale.z != 1.0 )
{
brep.Perform( shape, Standard_False );
TopoDS_Shape scaled_shape;
if( brep.IsDone() )
{
@ -1425,6 +1427,7 @@ TDF_Label PCBMODEL::transferModel( Handle( TDocStd_Document )& source,
scaled_shape = shape;
}
}
TDF_Label niulab = d_assy->AddComponent( component, scaled_shape, Standard_False );