Ticket #3834 - Loss of coordinate systems during .stp (AP214) import/export

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!
whocares
Posts: 9
Joined: Tue Feb 12, 2019 6:15 am

Ticket #3834 - Loss of coordinate systems during .stp (AP214) import/export

Post by whocares »

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)

Hello,
iam new to FreeCAD and run into an issue.
I have one Part with multiple coordinate systems to build a millingtool.
The coordinate systems be called PCS,MCS,CSW.
If i set them and export them to .stp (AP214) they got lost.
Also if i set them in a other CAD-System they will not be imported.

Thanks for usefull suggestions.
Last edited by Kunda1 on Fri Oct 04, 2019 12:58 am, edited 1 time in total.
Reason: Added ticket number to thread title
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by wmayer »

If i set them and export them to .stp (AP214) they got lost.
Also if i set them in a other CAD-System they will not be imported.
Where and how do you set your coordinate systems? Is a "coordinate system" a special entity in the STEP format?
whocares
Posts: 9
Joined: Tue Feb 12, 2019 6:15 am

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by whocares »

Source is Siemens NX12
2019-02-12 12_01_39-Window.png
2019-02-12 12_01_39-Window.png (40.29 KiB) Viewed 2669 times
Picture shows 3 different coordinate systems.
Exporting them from NX to .stp and reimporting to NX works fine.
Importing the .stp to FreeCAD, they are gone.

Maybe the Siteadmin can move this to the right Topic.
Example STEP File added.
Attachments
model2.stp
Step with named coordinate systems PCS,MCS,CSW -> #4082=AXIS2_PLACEMENT_3D('MCS',#5744,#4567,#4568);
(369.86 KiB) Downloaded 118 times
Export.stp
(48.92 KiB) Downloaded 49 times
Last edited by whocares on Wed Feb 13, 2019 8:55 am, edited 2 times in total.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by Jee-Bee »

This is not a announcements or new Feature(s).
So you should ask in the help forum or if it is a bug in the open discussion forum. Also add your (example) step file.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by easyw-fc »

whocares wrote: Tue Feb 12, 2019 12:03 pm Source is Siemens NX12

Picture shows 3 different coordinate systems.
Exporting them from NX to .stp and reimporting to NX works fine.
Importing the .stp to FreeCAD, they are gone.

Example STEP File added.
it seems the method is supported in OCC STEP kernel
https://www.opencascade.com/doc/occt-6. ... ement.html
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by wmayer »

When opening the file in a text editor then you will find a few hundred AXIS2_PLACEMENT_3D elements but only three of them has names. So, I guess it's up to the application to only consider them.

Nevertheless, the ignorance of the AXIS2_PLACEMENT_3D is not a bug but might be a feature to implement for v0.19 (if even possible).
whocares
Posts: 9
Joined: Tue Feb 12, 2019 6:15 am

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by whocares »

wmayer wrote: Wed Feb 13, 2019 11:05 am When opening the file in a text editor then you will find a few hundred AXIS2_PLACEMENT_3D elements but only three of them has names. So, I guess it's up to the application to only consider them.

Nevertheless, the ignorance of the AXIS2_PLACEMENT_3D is not a bug but might be a feature to implement for v0.19 (if even possible).
Thank you for your Response.

Iam not that familiar with FreeCAD, CATIA exports these DatumPlanes the same Way.
I have added an Example Step File with only the DatumPlanes in it.
Maybe its usefull.
Attachments
DatumPlaneOnly.stp
(3.55 KiB) Downloaded 61 times
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by wmayer »

I found a way to find the named placements:

Code: Select all

    Handle(Interface_InterfaceModel) Model = aReader.Reader().Model();
    Standard_Integer nb = Model->NbEntities();
    for (Standard_Integer i = 1; i <= nb; i ++) {
        Handle(Standard_Transient) enti = Model->Value(i);
        if (enti->IsKind(STANDARD_TYPE(StepGeom_Placement))) {
            Handle(StepGeom_Placement) plm = Handle(StepGeom_Placement)::DownCast(enti);
            if (plm->Name()->Length() > 0) {
               // do something with it
            }
        }
    }
The question however is what does OCCT's OCAF framework with them? I am not sure that the objects are transferred from the STEP model to the OCAF document. And this makes it tricky to add them to a FreeCAD document.

Btw, the file Export.stp shows the data of the screen shot you posted. Also it contains 45 AXIS2_PLACEMENT_3D objects but none of them has the labels "PCS", "MCS" or "CSW". Would it be possible to upload the STEP file that is shown in the screen shot that includes the named AXIS2_PLACEMENT_3D objects?
Thanks!
whocares
Posts: 9
Joined: Tue Feb 12, 2019 6:15 am

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by whocares »

Example uploaded.
Thank you for the effort.
Attachments
exportwithnamedplanes.stp
(35.06 KiB) Downloaded 65 times
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Loss of coordinate systems during .stp (AP214) import/export

Post by wmayer »

Here is a code snippet to add the placements after loading the file:

Code: Select all

plm=App.ActiveDocument.addObject("App::Placement","CSW")
plm.Placement.Base=App.Vector(31.8244952147467,33.7921260930763,-162.824495214746)
plm=App.ActiveDocument.addObject("App::Placement","MCS")
plm.Placement.Base=App.Vector(15.925,31.8500000000002,-82.48178698)
plm=App.ActiveDocument.addObject("App::Placement","PCS")
plm.Placement.Base=App.Vector(7.105427357601E-15,1.04449782156735E-12,1.4210854715202E-13)
It respects only the position but not the orientation.
Post Reply