STEP importer out of date?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
plaes
Posts: 11
Joined: Tue Dec 15, 2015 10:35 am

STEP importer out of date?

Postby plaes » Wed Dec 16, 2015 2:57 pm

Hi!

I recently had to import some STEP models made with some other CADs and noticed that FreeCAD's STEP importer doesn't do the grouping of the subelements.

Then I digged into the sources a bit and noticed it to be using code from http://stepcode.org/ with github repository here: https://github.com/stepcode/stepcode

Unfortunately I haven't yet figured out how FreeCAD and stepcode work together.

I also filed bug report with sample file here: http://freecadweb.org/tracker/view.php?id=2369
ickby
Posts: 2918
Joined: Wed Oct 05, 2011 7:36 am

Re: STEP importer out of date?

Postby ickby » Wed Dec 16, 2015 4:11 pm

Freecad does not use stepcode but the occ step importer. And it does not group the imports because there is no functionality for that available in Freecad, hence groups are ignored.
plaes
Posts: 11
Joined: Tue Dec 15, 2015 10:35 am

Re: STEP importer out of date?

Postby plaes » Wed Dec 16, 2015 4:37 pm

ickby wrote:Freecad does not use stepcode but the occ step importer. And it does not group the imports because there is no functionality for that available in Freecad, hence groups are ignored.
Ok, thanks for the info.

I was looking at the files under src/Mod/Import/App which caused the confusion.
wmayer
Site Admin
Posts: 14776
Joined: Thu Feb 19, 2009 10:32 am

Re: STEP importer out of date?

Postby wmayer » Wed Dec 16, 2015 6:21 pm

In FreeCAD there is a hidden function to get the structure of a STEP or IGES file (or better the structure of the ocaf document). You can load it with:

Code: Select all

import ImportGui
ImportGui.ocaf("arietta.step")
which shows a tree with all the content. Does anybody know how to get the grouping information out of this?
@plaes in the bug report you said that SW shows the grouping properly. How many groups are there and how many levels? Maybe an image would help.

I tried the file with CADExchanger which shows also some group structure but they are labeled "=> [0:1:1:2]" and so on but not "Board", "C57", ...
plaes
Posts: 11
Joined: Tue Dec 15, 2015 10:35 am

Re: STEP importer out of date?

Postby plaes » Wed Dec 16, 2015 7:30 pm

I added screenshot to the bug.

Tree looks basically like this:

1. Board
2. C57 (open)
2.1 61005408<1> (closed)
2.2 603788960<1> (open)
2.2.1 Extruded_2
2.3 603788960<2> (closed)
2.4 61005280
2.5 61005408
3. C56 (closed)
4. C55 (closed)
...
wmayer
Site Admin
Posts: 14776
Joined: Thu Feb 19, 2009 10:32 am

Re: STEP importer out of date?

Postby wmayer » Wed Dec 16, 2015 8:24 pm

OK, thanks.
User avatar
easyw-fc
Posts: 2626
Joined: Thu Jul 09, 2015 9:34 am

Re: STEP importer out of date?

Postby easyw-fc » Tue Dec 22, 2015 11:39 pm

hi @plaes,
I know that will not solve the prob of previous exported files, but if you create a union of each part model, instead of group, your assemblies will be easier handled...

I create a script to export kicad boards to MCAD STEP model, and to have a sort of hierarchical assembly, I use to model each part as a single fused obj...
the you will have board and parts
If you download the kicad stepup demo
http://sourceforge.net/projects/kicadstepup/
there you can find a self contained prj, with a board and assemblies generated in FreeCAD as a pseudo hierarchical structure...
and here a picture of the structure in solidworks
Image
User avatar
Kunda1
Posts: 5481
Joined: Thu Jan 05, 2017 9:03 pm

Re: STEP importer out of date?

Postby Kunda1 » Tue Jul 11, 2017 11:04 am

wmayer wrote:
Wed Dec 16, 2015 6:21 pm
In FreeCAD there is a hidden function to get the structure of a STEP or IGES file (or better the structure of the ocaf document). You can load it with:

Code: Select all

import ImportGui
ImportGui.ocaf("arietta.step")
which shows a tree with all the content. Does anybody know how to get the grouping information out of this?
@plaes in the bug report you said that SW shows the grouping properly. How many groups are there and how many levels? Maybe an image would help.

I tried the file with CADExchanger which shows also some group structure but they are labeled "=> [0:1:1:2]" and so on but not "Board", "C57", ...
vejmarie wrote:ping
@vejmarie can you weigh in on this?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: STEP importer out of date?

Postby vejmarie » Tue Jul 11, 2017 12:57 pm

Kunda1 wrote:
Tue Jul 11, 2017 11:04 am
wmayer wrote:
Wed Dec 16, 2015 6:21 pm
In FreeCAD there is a hidden function to get the structure of a STEP or IGES file (or better the structure of the ocaf document). You can load it with:

Code: Select all

import ImportGui
ImportGui.ocaf("arietta.step")
which shows a tree with all the content. Does anybody know how to get the grouping information out of this?
@plaes in the bug report you said that SW shows the grouping properly. How many groups are there and how many levels? Maybe an image would help.

I tried the file with CADExchanger which shows also some group structure but they are labeled "=> [0:1:1:2]" and so on but not "Board", "C57", ...
vejmarie wrote:ping
@vejmarie can you weigh in on this?
I think this stuff shall be addressed with PR #871. Let's wait to see if it could be merged in master and if the issue is still there. OCAF is a great document format to manage STEP, took me some time to learn it but this is efficient. the [0:1:1:2] is a coding for a tree. Like 0-> Root node ->1 first element at level 1 -> 1 first element at level 2 -> second element at level 3.
User avatar
easyw-fc
Posts: 2626
Joined: Thu Jul 09, 2015 9:34 am

Re: STEP importer out of date?

Postby easyw-fc » Tue Jul 11, 2017 2:02 pm

plaes wrote:
Wed Dec 16, 2015 2:57 pm
I recently had to import some STEP models made with some other CADs and noticed that FreeCAD's STEP importer doesn't do the grouping of the subelements.
in general if the problem is that the importer is not grouping elements, loading those in FLAT mode, the STEP importer has solved this issue already with previous PRs. Moreover the latest PR is solving also the Hierarchy in exporting the file.
Unfortunately the OP didn't upload the file to test, but at this post
https://forum.freecadweb.org/viewtopic.php?f=9&t=23371
I'm going to load the screenshots displaying exactly the hierarchy both in loading and writing STEP files

Maurice