Objects lose position values after saving to step file

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
marmni
Posts: 45
Joined: Sat Nov 30, 2013 3:53 pm

Objects lose position values after saving to step file

Post by marmni »

Hello,
after saving file as step with colors and again opening in FC (not only in FC) object lose their original position value in space (X, Y, Z) - everything is set to 0. This problem disappear, when we save file as step without colors. There is some reason why we lose that information in step with colors, or it is some kind of a bug?
There is also no problem with importing stp (file created in other software) that contain colors to FC without losing original parts positions - so there is a problem with saving as step with colors in FC.

In attachment You can find two files: asd.stp (step file with colors) and asd2.stp (without colors). Both files are result of exporting object from one base file (file created in FreeCAD).

Tested on version 0.14 and 0.16.

OS: Debian GNU/Linux 8.0 (jessie)
Word size: 32-bit
Version: 0.14.3702 (Git)
Branch: releases/FreeCAD-0-14
Hash: b3368125c63289ec8ce9faec2b2ae4c78d436406
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0

OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.4674 (Git)
Branch: master
Hash: 77fe619fa9a841c35197a1d4baac1ebf3bfafe14
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0
Attachments
stp_test.7z
(21.05 KiB) Downloaded 65 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Objects lose position values after saving to step file

Post by NormandC »

The objects in both your STEP files have the exact same placement. The coordinates of the bottom left vertex of E$002 are (4.235, 2.400, 1.505).

Behavior is identical in the last "stable" release and master from a few commits behind.

OS: Ubuntu 14.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4664 (Git)
Branch: master
Hash: 4e41e535ff01d39b650add123f42629e1a8d6b05
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1

OS: Ubuntu 14.04.2 LTS
Word size: 64-bit
Version: 0.14.3705 (Git)
Branch: FreeCAD-0-14
Hash: f25e6e4716fb63ef3ac618ce9e552761bbc1b4b1
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.1
marmni
Posts: 45
Joined: Sat Nov 30, 2013 3:53 pm

Re: Objects lose position values after saving to step file

Post by marmni »

Hello,
sorry probably I make myself not very clear. Yes in space they are in same position (original position), but their SO are in different places. Load files from attachment and check Placement values.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Objects lose position values after saving to step file

Post by NormandC »

Sorry, I hadn't noticed. I witness the same thing for the placement values of objects.
mariusz.ciszewski
Posts: 10
Joined: Sun Mar 15, 2015 7:47 pm

Re: Objects lose position values after saving to step file

Post by mariusz.ciszewski »

Hello!

I checked this topic very deep and I have to confirm this issue / FreeCAD bug:


Test environment:

Native design FreeCAD contains component contained their own origin and this component is multiplicated many times in different x,y,z positions in a 3D space.

Image



Result of test

1. If this native FreeCAD design has been exported to step with colours:

Image

then after import into CAD we can see all components are placed in one system origin (0,0,0) (origins = blue arrows):

Image


2. If this native FreeCAD design has been exported to step without colours:

Image

Image

then after import into CAD we can see all components have origins in it's own (proper) position place (origins = blue arrows):

Image

Test summary:

1. If step without colors imported into CAD, then a lot of "temporary" components is created (every of them have different internal origin) and componenrs on PCB (in assembly) they all are placed in system coordinate (0,0,0) - internal coordinates (different for every single component) makes an illusion that components are placed based on PCB on their coordinates

2. If step without colors imported into CAD, then only one "temporary" component is created and this component is duplicated many times on different x,y,z position on PCB
Attachments
freeCAD_008.png
freeCAD_008.png (25.54 KiB) Viewed 4221 times
fcad_005.png
fcad_005.png (6.68 KiB) Viewed 4221 times
fcad_003.png
fcad_003.png (6.94 KiB) Viewed 4221 times
fcad_002.png
fcad_002.png (21.02 KiB) Viewed 4221 times
fcad_001.png
fcad_001.png (51.85 KiB) Viewed 4221 times
mariusz.ciszewski
Posts: 10
Joined: Sun Mar 15, 2015 7:47 pm

Re: Objects lose position values after saving to step file

Post by mariusz.ciszewski »

Could someone please repair this FreeCAD bug?

After export into step with colours then during impont into CAD there are a lot of components created - every of them have got different origin inside.

For example fot this capacitor:
fcad_006.png
fcad_006.png (5.44 KiB) Viewed 4220 times
internal origin is:
fcad_007.png
fcad_007.png (2.51 KiB) Viewed 4220 times
And the result ot placement this component @ (0,0,0) is:
fcad_008.png
fcad_008.png (5.42 KiB) Viewed 4220 times

And that makes this result all components are placed in system origin (0,0,0) but (bacause every of them has got different internal origin) it looks they are placed every on different coordinate... (but it's only illusion in fact).

It mean's for me that @ FreeCAD

1. export to step without colours works perfectly
2. export to step with colours is broken.

Please doublecheck and if someone could inform me if / when it is done it would be great!

Thank you very much

Best regards
Mariusz
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Objects lose position values after saving to step file

Post by PrzemoF »

There are 2 different readers in use [1]: STEPControl_Reader [2][4] and STEPCAFControl_Reader [3][5].

The problem could be a feature/setting/bug of OpenCASCADE, but a more experienced person is required to answer that question.

I can't find what SHUO mode and GDT mode in OpenCASCADE are doing - maybe it's worth to check it? Or switch off:

Code: Select all

                aReader.SetColorMode(true);
                aReader.SetNameMode(true);
                aReader.SetLayerMode(true);
in [3] and check if it changes the behaviour.

[1] https://github.com/FreeCAD/FreeCAD_sf_m ... d.cpp#L664
[2] https://github.com/FreeCAD/FreeCAD_sf_m ... ep.cpp#L90
[3] https://github.com/FreeCAD/FreeCAD_sf_m ... y.cpp#L134
[4] http://dev.opencascade.org/doc/refman/h ... eader.html
[5] http://dev.opencascade.org/doc/refman/h ... eader.html
marmni
Posts: 45
Joined: Sat Nov 30, 2013 3:53 pm

Re: Objects lose position values after saving to step file

Post by marmni »

Hi,
I just compiled FreeCAD and it looks like that everything works fine- thanks.

OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.4988 (Git)
Build type: Release
Branch: master
Hash: 9431d301d38da931dafb4d2f478de0e403c18885
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0
Post Reply