Export board STEP file does not scale/shift parts

Bug #1784257 reported by Leandro Heck on 2018-07-30
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
KiCad
Medium
Unassigned

Bug Description

STEP file does not represent my board.
Components scale/shift not being applied.

Nick Østergaard (nickoe) wrote :

Please add version information and a demo project.

Changed in kicad:
status: New → Incomplete
tags: added: export step
AWa. (awa-wp) wrote :

Application: kicad
Version: (5.0.0), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011
Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Pcbnew -> File -> Export -> STEP...

The component in the exported step file have scale factor set to 1.00 no to current scale factor from component properties (Footprint Properties -> 3D Settings -> Scale).

VRML export - component size ok.
STEP export - incorrect component size.

Best regards,
AWa.

Nick Østergaard (nickoe) wrote :

Scaling is not supported for step or iges models

AWa. (awa-wp) wrote :

So maybe at least warning about not supporting scaling for step export should be shown.
This can result as a really big consequences when you will make some housing with step model which isn't real model of your PCB.
In this project we had to redesign housing because PCB was bigger then step model.

AWa.

Seth Hillbrand (sethh) wrote :

We should be applying the scale transformation when STEP models are not scaled to 1.0

ShapeCustom::ScaleShape
    TopoDS_Shape ShapeCustom::ScaleShape(const TopoDS_Shape& S, const Standard_Real scale);

Changed in kicad:
status: Incomplete → Confirmed
importance: Undecided → Medium
milestone: none → 5.1.0
Wayne Stambaugh (stambaughw) wrote :

@Seth, it looks like the electrolytic capacitor model shown in supplied image was just scaled in the vertical axis. I'm guessing your solution would scale the model in all three axis which would not be correct in this case. Is there a function:

TopoDS_Shape ShapeCustom::ScaleShape(const TopoDS_Shape& S,
    const Standard_Real scale_x, const Standard_Real scale_y, const Standard_Real scale_z);

that we could use to scale each axis individually? Each axis can be scaled independently in Pcbnew.

Leandro Heck (leoheck) wrote :

Hi guys, I totally forgot about this issue.

Just tested it again using nightly version and it is an issue there too.

Application: kicad
Version: 6.0.0-rc1-unknown-d9d0051~84~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-33-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Seth Hillbrand (sethh) wrote :

That's a good call, Wayne.

There's a more general transformation class:

gp_GTrsf transform;
gp_Mat scale_mat( x_scale, 0, 0, 0, y_scale, 0, 0, 0, z_scale );
transform.SetVectorialPart( scale_mat );
BRepBuilderAPI_GTransform geom_transformation( shape, transform, true );
TopoDS_Shape new_shape = geom_transformation.Shape();

Not as pretty, but it'll get the job done. Just recording here for my notes when I get around to digging into this (unless someone else gets there first :)

Andy Peters (devel-latke) wrote :

Just to add -- I noticed this, too. I exported a board to STEP, and some of the transformations were botched, and one part model was not included in the export at all.

Application: kicad
Version: (5.0.0-3-g5ebb6b6), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Platform: Mac OS X (Darwin 17.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.51.0
    Compiler: Clang 8.0.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Nick Østergaard (nickoe) wrote :

I think this is not important for 5.1.0, I think we could postprone the milestone to v6

Wayne Stambaugh (stambaughw) wrote :

I'm fine with pushing this off to v6. I think we have enough issues to resolve for 5.1.

Changed in kicad:
milestone: 5.1.0 → 6.0.0-rc1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments