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

Post here for help on using FreeCAD's graphical user interface (GUI).
whocares
Posts: 8
Joined: Tue Feb 12, 2019 6:15 am

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

Postby whocares » Tue Feb 12, 2019 8:43 am

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.
wmayer
Site Admin
Posts: 13603
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » Tue Feb 12, 2019 9:25 am

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: 8
Joined: Tue Feb 12, 2019 6:15 am

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

Postby whocares » Tue Feb 12, 2019 12:03 pm

Source is Siemens NX12
2019-02-12 12_01_39-Window.png
2019-02-12 12_01_39-Window.png (40.29 KiB) Viewed 225 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 2 times
Export.stp
(48.92 KiB) Downloaded 4 times
Last edited by whocares on Wed Feb 13, 2019 8:55 am, edited 2 times in total.
Jee-Bee
Posts: 1520
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

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

Postby Jee-Bee » Tue Feb 12, 2019 12:31 pm

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
Posts: 2209
Joined: Thu Jul 09, 2015 9:34 am

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

Postby easyw-fc » Wed Feb 13, 2019 9:20 am

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
Site Admin
Posts: 13603
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » 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).
whocares
Posts: 8
Joined: Tue Feb 12, 2019 6:15 am

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

Postby whocares » Wed Feb 13, 2019 12:20 pm

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 2 times
wmayer
Site Admin
Posts: 13603
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » Wed Feb 13, 2019 2:16 pm

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: 8
Joined: Tue Feb 12, 2019 6:15 am

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

Postby whocares » Wed Feb 13, 2019 2:44 pm

Example uploaded.
Thank you for the effort.
Attachments
exportwithnamedplanes.stp
(35.06 KiB) Downloaded 5 times
wmayer
Site Admin
Posts: 13603
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » Wed Feb 13, 2019 5:13 pm

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.