Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

Turro75 wrote:
manuelkrause wrote:
wandererfan wrote:
Devel branch has been modified...
- absolute/relative pathes for imported parts can be switched on preferences page
- bugfix: editPart did not switch to correct window, if it was already open

@Turro75,
please test whether it is working for you on windows or not...

@manuelkrause,
i am not quiet sure changes are working regarding py3. Please test on your py3 system.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

kbwbe wrote: Tue Oct 02, 2018 1:28 pm
Turro75 wrote:
manuelkrause wrote:
wandererfan wrote:
Devel branch has been modified...
- absolute/relative pathes for imported parts can be switched on preferences page
- bugfix: editPart did not switch to correct window, if it was already open

@Turro75,
please test whether it is working for you on windows or not...

@manuelkrause,
i am not quiet sure changes are working regarding py3. Please test on your py3 system.
Thank you for your work!

Adding "absolute/relative paths" to the general preferences is not usable as a general setting IMO. It should be choosable for each assembly in a WB icon or at least in the WB menu. I know, then user is in extra charge, but user must be aware of many relevant things in FC, me meaning, that this is only a little addition.
I've found several assemblies where I want to leave the absolute path and also several where I want to make it portable, e.g by relative paths.

Please think about it.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

@kbwbe:
Regarding the edit Part there I get a:
command 'a2p_editImportedPart' failed:
Traceback (most recent call last):
File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 579, in Activated
name = docs[idx].Name

'dict_values' object does not support indexing

That is new, please, review,
Thx
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

manuelkrause wrote: Tue Oct 02, 2018 2:00 pm Adding "absolute/relative paths" to the general preferences is not usable as a general setting IMO. It should be choosable for each assembly in a WB icon or at least in the WB menu. I know, then user is in extra charge, but user must be aware of many relevant things in FC, me meaning, that this is only a little addition.
I've found several assemblies where I want to leave the absolute path and also several where I want to make it portable, e.g by relative paths.
Hi Manuel,
there is still the possibility to create all your assemblies with absolute path and convert it with the tool in menu to relative ones, if you decide to have the assembly portable.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

manuelkrause wrote: Tue Oct 02, 2018 2:20 pm @kbwbe:
Regarding the edit Part there I get a:
command 'a2p_editImportedPart' failed:
Traceback (most recent call last):
File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 579, in Activated
name = docs[idx].Name

'dict_values' object does not support indexing

That is new, please, review,
Thx
Bug is fixed. (devel)
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

kbwbe wrote: Tue Oct 02, 2018 2:38 pm
manuelkrause wrote: Tue Oct 02, 2018 2:00 pm Adding "absolute/relative paths" to the general preferences is not usable as a general setting IMO. It should be choosable for each assembly in a WB icon or at least in the WB menu. I know, then user is in extra charge, but user must be aware of many relevant things in FC, me meaning, that this is only a little addition.
I've found several assemblies where I want to leave the absolute path and also several where I want to make it portable, e.g by relative paths.
Hi Manuel,
there is still the possibility to create all your assemblies with absolute path and convert it with the tool in menu to relative ones, if you decide to have the assembly portable.
Hi Klaus,
of course you're right somehow.
I also tried to re-set an existing relative to an absolute path in the right property field, and it works fine for an unchanged file in same folder position upon reload imported files.

My mentioned concerns only regard usability of this absolute vs. runtime changeable setting. You may have your reasons for your decisions, and my opinion is definitely no fixed one, so let's wait for other users' opinions.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

kbwbe wrote: Tue Oct 02, 2018 2:54 pm
manuelkrause wrote: Tue Oct 02, 2018 2:20 pm @kbwbe:
Regarding the edit Part there I get a:
command 'a2p_editImportedPart' failed:
Traceback (most recent call last):
File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 579, in Activated
name = docs[idx].Name

'dict_values' object does not support indexing

That is new, please, review,
Thx
Bug is fixed. (devel)
I can confirm issue FIXED in current devel branch.

Thanks!
Turro75
Posts: 179
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Post by Turro75 »

kbwbe wrote: Tue Oct 02, 2018 1:28 pm
@Turro75,
please test whether it is working for you on windows or not...
Ok it is working on Win10,
I still get the error if the edited obj hasn't closed

Code: Select all

Running the Python command 'a2p_updateImportedParts' failed:
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_importpart.py", line 443, in Activated
    updateImportedParts(doc)
  File "C:\Users\xxxx\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_importpart.py", line 413, in updateImportedParts
    importPartFromFile(doc, absPath, importToCache=True) # the version is now in the cache
  File "C:\Users\xxxx\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_importpart.py", line 171, in importPartFromFile
    importDoc = FreeCAD.openDocument(filename)

The project 'C:\Users\xxxxreplacement\cubo1.FCStd' is already open!

@Manuel

the importer is ignoring the color of the single face, it imports only the whole shape color. May be I miss something in the previous posts, it is an intended behavior?

cubo1 is fully green while cubo2 has a violet face over a green shape. both are imported as green only.


regarding the complete FC version output: menu help->about FreeCAD -> copy to clipboard
then paste in a text field.
Attachments
cubo2.FCStd
(10.68 KiB) Downloaded 44 times
cubo1.FCStd
(9.03 KiB) Downloaded 40 times
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

Hi @Turro75 !

Turro75 wrote: Wed Oct 03, 2018 7:36 am
kbwbe wrote: Tue Oct 02, 2018 1:28 pm
@Turro75,
please test whether it is working for you on windows or not...
Ok it is working on Win10,
I still get the error if the edited obj hasn't closed

Code: Select all

Running the Python command 'a2p_updateImportedParts' failed:
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_importpart.py", line 443, in Activated
    updateImportedParts(doc)
  File "C:\Users\xxxx\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_importpart.py", line 413, in updateImportedParts
    importPartFromFile(doc, absPath, importToCache=True) # the version is now in the cache
  File "C:\Users\xxxx\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_importpart.py", line 171, in importPartFromFile
    importDoc = FreeCAD.openDocument(filename)

The project 'C:\Users\xxxxreplacement\cubo1.FCStd' is already open!
I still don't get this error on my system. Thanks to @Turro75's help I can now provide my versions, somehow openSUSE doesn't compile in the FC version number:

Code: Select all

OS: "openSUSE Tumbleweed"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.Unknown
Build type: Release
Python version: 3.6.5
Qt version: 5.11.1
Coin version: 3.1.3
OCC version: 7.3.0
Locale: English/Denmark (en_DK)

Turro75 wrote: Wed Oct 03, 2018 7:36 am @Manuel

the importer is ignoring the color of the single face, it imports only the whole shape color. May be I miss something in the previous posts, it is an intended behavior?

cubo1 is fully green while cubo2 has a violet face over a green shape. both are imported as green only.


regarding the complete FC version output: menu help->about FreeCAD -> copy to clipboard
then paste in a text field.
Do you refer to current devel branch? If so, @kbwbe removed my color-import approach for the release in master & devel.

And even with my approach it wouldn't preserve single-face colors, I assume. My main goal was only to preserve imported part's color & transparency, set in the final shape of the part, and therefore, although processing each face, it would only recalculate faces' values from the whole shape color & transparency of the object into a usable diffuseColor for FC 017. (At least that's my understanding of what I coded.) The same result can be achieved with the simplified and faster code for the compound shape (although data volume remains the same and single-face colors aren't preserved, either). https://github.com/kbwbe/A2plus/issues/96

I don't know, when we follow the toponaming idea to the end, if we'd be able to attach color & transparency to the corresponding faces.
And I also don't know if we want this? Guys, what's your opinion about it?

@wandererfan:
I'm not used to compound shapes. Would it be able to keep per face color & transparency info for the single faces - in combination with the proper toponaming relative info?
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

Hi @Turro75, @manuelkrause, @wandererfan,

i tried to fix Turro's issue on win10 regarding updateImportedParts(). Working on this, i found another unicode issue during duplicating parts. Both things are hopefully fixed now. Devel branch has been updated again.

Please test, as i want to update master-branch as soon as possible. @wandererfan 's improvements regarding display modes are inside of devel, but not in master. So it will be good to update master soon.

@manuelkrause:
Hi Manuel,
just at moment i am not working on file importer, as there is still no decision how to handle basic topological naming. I will need some time. Because this, there is no activity ATM regarding improved color management.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Post Reply