Part module preference option not activated at startup ?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
triplus
Posts: 8799
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part module preference option not activated at startup ?

Postby triplus » Thu Jul 13, 2017 4:06 pm

Anyway i doubt much upstream developer related bypassing will be going on before someone pulls the plug. Therefore for completeness' sake lets say you are a frequent STEP user and do always want to have STEP related settings available in preferences.

Autoload

The solution therefore is one checkbox click away (Part workbench).
User avatar
easyw-fc
Posts: 2692
Joined: Thu Jul 09, 2015 9:34 am

Re: Part module preference option not activated at startup ?

Postby easyw-fc » Thu Jul 13, 2017 4:26 pm

triplus wrote:
Thu Jul 13, 2017 4:06 pm
Autoload

The solution therefore is one checkbox click away (Part workbench).
+1 Like ;)
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Part module preference option not activated at startup ?

Postby vejmarie » Thu Jul 13, 2017 6:00 pm

triplus wrote:
Thu Jul 13, 2017 4:06 pm
Anyway i doubt much upstream developer related bypassing will be going on before someone pulls the plug. Therefore for completeness' sake lets say you are a frequent STEP user and do always want to have STEP related settings available in preferences.

Autoload

The solution therefore is one checkbox click away (Part workbench).
Ok you have the right to believe I am totally crazy, but I think I might be able to apply what yorik has made a few months ago to the Part / STEP parameters. I just made some tests this afternoon on the C++ code size and can adapt it pretty "easily" now. I think it is a good idea to put Import/Export parameter at the highest level of FreeCAD preference tree.

By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
triplus
Posts: 8799
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part module preference option not activated at startup ?

Postby triplus » Thu Jul 13, 2017 7:07 pm

vejmarie wrote:
Thu Jul 13, 2017 6:00 pm
Ok you have the right to believe I am totally crazy, but I think I might be able to apply what yorik has made a few months ago to the Part / STEP parameters.
I know (at least in Python) it should be easy to load something by default on FreeCAD start. I just tried to explained what is the current situation/guidelines regarding this. I doubt you will get much complaints if you will do it just for STEP importer/exporter preferences purpose. But there are some issues involved if this would be done more frequently. For example enable all options in Autoload and restart FreeCAD. It should become obvious on why such guidelines exist. ;)
By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
If i remember correctly first there was one STEP importer/exporter and after another one was made. And as 100% feature parity wasn't achieved both where preserved. Likely your work resulted in STEP importer/exporter that does everything previous two solution did and more. Therefore indeed having just this new one from now on makes the most sense.
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Part module preference option not activated at startup ?

Postby vejmarie » Thu Jul 13, 2017 8:23 pm

Ok, I will try to make some cleanup because I just tried the importer into the Part workbench and it is super basic things. I think we shall merge everything into a single importer/exporter. Could take me some time to implement all of this.
wmayer
Site Admin
Posts: 14999
Joined: Thu Feb 19, 2009 10:32 am

Re: Part module preference option not activated at startup ?

Postby wmayer » Fri Jul 14, 2017 8:18 am

By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
I don't think the "Import Step" in Part should be removed because:
  • it still allows to import/export a rather lightweight data set if needed
  • it can be used as reference for the high-level STEP import/export to find out erroneous behaviour
Saying the latter I have found a couple of major regressions with the latest changes:
  • when exporting a single object (which is not inside a Part container) placement is lost
    Create a cube -> change its placement -> export -> import -> it's now at a different location
  • Color information is not read any more in some cases
    Load the model asd.stp from this posting https://forum.freecadweb.org/viewtopic. ... 221#p82369 The black and white parts are set to the default color. And even if a manually set the colors again, export and import they don't come back.
    Not sure if this is an issue as well but with previous versions it had four objects in the tree view while now it's a single object.
User avatar
easyw-fc
Posts: 2692
Joined: Thu Jul 09, 2015 9:34 am

Re: Part module preference option not activated at startup ?

Postby easyw-fc » Fri Jul 14, 2017 8:50 am

wmayer wrote:
Fri Jul 14, 2017 8:18 am
By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
I don't think the "Import Step" in Part should be removed because:
  • it still allows to import/export a rather lightweight data set if needed
  • it can be used as reference for the high-level STEP import/export to find out erroneous behaviour
I agree that having a reference for a comparison in STEP loading with the old method (used in so many user cases) can be a feature
wmayer wrote:
Fri Jul 14, 2017 8:18 am
Saying the latter I have found a couple of major regressions with the latest changes:
  • when exporting a single object (which is not inside a Part container) placement is lost
    Create a cube -> change its placement -> export -> import -> it's now at a different location
  • Color information is not read any more in some cases
    Load the model asd.stp from this posting https://forum.freecadweb.org/viewtopic. ... 221#p82369 The black and white parts are set to the default color. And even if a manually set the colors again, export and import they don't come back.
    Not sure if this is an issue as well but with previous versions it had four objects in the tree view while now it's a single object.
the color issue is related to this discussion
https://forum.freecadweb.org/viewtopic. ... 00#p182203
@vejmarie is going to add a var (something like 'WriteShapeCompoundMode') that will allow to enable/disable compound management... that will enable colors or simplify the compound for faster handling
it is inside the
freecad-hierarchy\src\Mod\Import\App\ImportOCAF.cpp file line 204
https://github.com/vejmarie/FreeCAD/com ... d0ae348696

Maurice
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Part module preference option not activated at startup ?

Postby vejmarie » Fri Jul 14, 2017 11:39 am

wmayer wrote:
Fri Jul 14, 2017 8:18 am
By the way, there is an Import module, I think I might just put that stuff there. I think we also need to change Part -> Import STEP code to the Import->Step code, as there is no reason to have 2 differents path to do that.
I don't think the "Import Step" in Part should be removed because:
  • it still allows to import/export a rather lightweight data set if needed
  • it can be used as reference for the high-level STEP import/export to find out erroneous behaviour
Saying the latter I have found a couple of major regressions with the latest changes:
  • when exporting a single object (which is not inside a Part container) placement is lost
    Create a cube -> change its placement -> export -> import -> it's now at a different location
  • Color information is not read any more in some cases
    Load the model asd.stp from this posting https://forum.freecadweb.org/viewtopic. ... 221#p82369 The black and white parts are set to the default color. And even if a manually set the colors again, export and import they don't come back.
    Not sure if this is an issue as well but with previous versions it had four objects in the tree view while now it's a single object.
I might be wrong but why does it allow to import/export a rather lightweight dataset that the regular importer/exporter can't do ?
I will check the placement issue you reported, that shall be "easy" to fix.

The Color information is not lost as well as the shapes, this is just an acceleration for "big" model which should happen only on user selectable action. I soon have a fix for that, it is not pushed to master yet, as I am trying to sort out how to handle parameters to STEP importer/exporter, which has been written original 15 years ago.

I loved to see a single code running the step importation, I got some users who are totally lost on why we do have different behavior happening currently. The importer into part is importing shapes without color support at all, while the importer into the file menu is supporting colors and get hierarchies.

I think we shall have ways at least to identify the expected behavior of each action, currently they are named the same way, or we should perhaps propose to the end user within the preference menu if he wants basic import or "full" import, allowing us to keep both codes and avoiding to get end user lost.
User avatar
easyw-fc
Posts: 2692
Joined: Thu Jul 09, 2015 9:34 am

Re: Part module preference option not activated at startup ?

Postby easyw-fc » Fri Jul 14, 2017 1:04 pm

vejmarie wrote:
Fri Jul 14, 2017 11:39 am
or we should perhaps propose to the end user within the preference menu if he wants basic import or "full" import, allowing us to keep both codes and avoiding to get end user lost.
Actually there is an option when filtering extensions to import in Part CAD import
with the double selection:
STEP
or
STEP with colors
PartImport-filtering.png
PartImport-filtering.png (22.11 KiB) Viewed 608 times
This could be an easy option to be chosen each time the file is going to be imported, instead of fixing the mode in the preference menu,
but applied to File Import Menu
or a checkbox for 'full STEP' or 'basic STEP' import in the same Import Dialog
User avatar
yorik
Site Admin
Posts: 11584
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Part module preference option not activated at startup ?

Postby yorik » Fri Jul 14, 2017 1:31 pm

I also vote to leave the old, plain Part step importer in place. That's one of the great features of FreeCAD to have several importers/exporters for a file type. It would be a pity to cut into that!