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!
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

wandererfan wrote: Sun Sep 16, 2018 8:35 pm
manuelkrause wrote: Sun Sep 16, 2018 4:23 pm I get this "Uploads are disabled: File uploads require push access to this repository." when accessing over the web GUI although I' logged in.
Can you please check or clarify on how to push properly.
You should get an email with an "invitation link". When you click on the link, it will add you to the collaborators list.
Many thanks for clarifying... Now it seemed to have worked :-)
I mostly stayed with your naming scheme to keep it consistent. Feel free to change my additions.

Btw., I've re-done the piston(s) in order to improve the engine assembly, maintaining the original functional features. And additionally to the pocket-through-all issue I've re-ordered the lock rings in PD. Don't know why I haven't realized it before. Piston's file size is almost halved and the assembly's size reduced by ~1/3. Quite astonishing result IMO.
EskiBrew
Posts: 100
Joined: Fri Apr 24, 2015 10:21 am

Re: Another approach to assembly solver (A2plus)

Post by EskiBrew »

Hi all, Manuel kindly pointed me here after I asked about the current state of the different assembly workbenches.

Is there a "getting started" post for A2Plus? - I can see there are 104 pages of comments here. I could read through all them but that will take quite some time :?

I thought I'd just jump in - created a new empty document and then in the A2plus workbench, I can click the "add Part from external file" icon but rather than add it to my new document, it seems to open the part. If I click it again, selecting a different part, it just opens that part in another new window too rather than adding it to my existing window. Can't seem to see what I am doing wrong there...It does not seem to do the same thing as Assembly2.

I thought instead I'd open an assembly created with Assembly2 - that opens ok and I deleted all Assembly2 constraints and added some new ones but I can't seem to get the new constraints to work - I tried adding an axialConstraint and also a planeCoincident constraint - they do not seem to do anything. What am I missing?

I tried the "convert part to A2plus form", not understanding what that was for but that does not seem to help.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

EskiBrew wrote: Tue Sep 18, 2018 9:42 am Hi all, Manuel kindly pointed me here after I asked about the current state of the different assembly workbenches.

Is there a "getting started" post for A2Plus? - I can see there are 104 pages of comments here. I could read through all them but that will take quite some time :?
You can have a look at the bottom of this page: https://github.com/kbwbe/A2plus#usage-o ... -workbench
There is a brief explanation about what each button does.
(I just noticed that we have to update it a little bit...)

I thought I'd just jump in - created a new empty document and then in the A2plus workbench, I can click the "add Part from external file" icon but rather than add it to my new document, it seems to open the part. If I click it again, selecting a different part, it just opens that part in another new window too rather than adding it to my existing window. Can't seem to see what I am doing wrong there...It does not seem to do the same thing as Assembly2.
Regarding this I'm really confused... This is not intended.
Do you get some error messages in either Report view or Python console?
We definitely need more info to debug this.

I thought instead I'd open an assembly created with Assembly2 - that opens ok and I deleted all Assembly2 constraints and added some new ones but I can't seem to get the new constraints to work - I tried adding an axialConstraint and also a planeCoincident constraint - they do not seem to do anything. What am I missing?
Most likely you haven't set one (e.g. the first) part as "fixed Position" = true. The current solver depends on it to build up the dependencies to the other parts.

I tried the "convert part to A2plus form", not understanding what that was for but that does not seem to help.
This is from the code description: "changes a regular FreeCAD object into an A2plus importedPart, adds the importedPart to the document and removes the FreeCAD object from the document".
EskiBrew
Posts: 100
Joined: Fri Apr 24, 2015 10:21 am

Re: Another approach to assembly solver (A2plus)

Post by EskiBrew »

manuelkrause wrote: Tue Sep 18, 2018 10:38 am You can have a look at the bottom of this page: https://github.com/kbwbe/A2plus#usage-o ... -workbench
There is a brief explanation about what each button does.
(I just noticed that we have to update it a little bit...)
Excellent, I should have thought to look there myself! :roll:
Regarding this I'm really confused... This is not intended.
Do you get some error messages in either Report view or Python console?
We definitely need more info to debug this.
Ok, yes. I start a new document and then add a simple part (a cylinder created in the part workbench) - the error is:

Code: Select all

Running the Python command 'a2p_ImportPart' failed:
Traceback (most recent call last):
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 310, in Activated
    importedObject = importPartFromFile(doc, filename)
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 180, in importPartFromFile
    importableObjects.extend(getImpPartsFromDoc(importDoc))            #visible parts only
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 102, in getImpPartsFromDoc
    impPartList = filterImpParts(obj)
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 133, in filterImpParts
    elif obj.hasExtension("App::GroupExtension"):     # App::Part container.  GroupEx contents are already in list,

'Part.Feature' object has no attribute 'hasExtension'
and my setup is:

Code: Select all

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7744 (Git)
Build type: Unknown
Branch: occt7
Hash: fee4ade78217a581a6ea17011e39364e5ff7732f
Python version: 2.7.11+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Most likely you haven't set one (e.g. the first) part as "fixed Position" = true. The current solver depends on it to build up the dependencies to the other parts.
Brilliant! - that sorted it. I did have the main part set as fixed but I was trying to work on two other parts, neither of which were constrained to the fixed part. Once I constrained one of them to the fixed part, they suddenly behaved themselves. 8-)
This is from the code description: "changes a regular FreeCAD object into an A2plus importedPart, adds the importedPart to the document and removes the FreeCAD object from the document".
Thanks for the description - unfortunately I have no idea why I'd want to do that? :oops:
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

EskiBrew wrote: Tue Sep 18, 2018 11:15 am
manuelkrause wrote: Tue Sep 18, 2018 10:38 am Regarding this I'm really confused... This is not intended.
Do you get some error messages in either Report view or Python console?
We definitely need more info to debug this.
Ok, yes. I start a new document and then add a simple part (a cylinder created in the part workbench) - the error is:

Code: Select all

Running the Python command 'a2p_ImportPart' failed:
Traceback (most recent call last):
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 310, in Activated
    importedObject = importPartFromFile(doc, filename)
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 180, in importPartFromFile
    importableObjects.extend(getImpPartsFromDoc(importDoc))            #visible parts only
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 102, in getImpPartsFromDoc
    impPartList = filterImpParts(obj)
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 133, in filterImpParts
    elif obj.hasExtension("App::GroupExtension"):     # App::Part container.  GroupEx contents are already in list,

'Part.Feature' object has no attribute 'hasExtension'
and my setup is:

Code: Select all

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7744 (Git)
Build type: Unknown
Branch: occt7
Hash: fee4ade78217a581a6ea17011e39364e5ff7732f
Python version: 2.7.11+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
This is from the code description: "changes a regular FreeCAD object into an A2plus importedPart, adds the importedPart to the document and removes the FreeCAD object from the document".
Thanks for the description - unfortunately I have no idea why I'd want to do that? :oops:
Thank you for adding the error messages. Unfortunately I cannot reproduce this behaviour with the same steps you mentioned. Is there anything special about your FreeCAD installation? Libraries up-to-date or something too 'bleeding-edge'?

I have no idea what's going wrong, we'll need to wait for the developers to have a look.
kbwbe wrote: ping
Turro75 wrote: ping
wandererfan wrote: ping
Regarding "convert Part" I can't tell you more, I haven't needed it so far, but surely there will be cases where it'll be useful.

Thank you very much for testing A2plus!
I'm sure, we'll find a solution.
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Another approach to assembly solver (A2plus)

Post by wandererfan »

EskiBrew wrote: Tue Sep 18, 2018 11:15 am Ok, yes. I start a new document and then add a simple part (a cylinder created in the part workbench) - the error is:
...
'Part.Feature' object has no attribute 'hasExtension'.
I tried importing a simple Part Module Cylinder to an empty file in:
- the current master branch
- the previous master
- the current devel branch and
- the previous devl,
and in all cases the cylinder is imported correctly and there is no failure.

Are you using a branch other than master or devl?

If you're using one of these 4 branches, then I'm not understanding your instructions for replicating the error.

wf
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 EskiBrew,
have same difficulties to reproduce this as wandererfan too...
EskiBrew wrote: Tue Sep 18, 2018 11:15 am

Code: Select all

Running the Python command 'a2p_ImportPart' failed:
Traceback (most recent call last):
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 310, in Activated
    importedObject = importPartFromFile(doc, filename)
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 180, in importPartFromFile
    importableObjects.extend(getImpPartsFromDoc(importDoc))            #visible parts only
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 102, in getImpPartsFromDoc
    impPartList = filterImpParts(obj)
  File "/home/martin/snap/freecad/4/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 133, in filterImpParts
    elif obj.hasExtension("App::GroupExtension"):     # App::Part container.  GroupEx contents are already in list,

'Part.Feature' object has no attribute 'hasExtension'
this looks like an error due to recent changes of fileimporter. I tried to reproduce it, created a cylinder with part WB, also created a cylinder with PartDesign WB and imported both. Unfortunately i could not reproduce the error. Tested with recent master branch. Please post your cylinder.fcstd, which is not importable, so that we can have a look for the problem.
Thank you...
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
EskiBrew
Posts: 100
Joined: Fri Apr 24, 2015 10:21 am

Re: Another approach to assembly solver (A2plus)

Post by EskiBrew »

manuelkrause wrote: Tue Sep 18, 2018 1:00 pm Thank you for adding the error messages. Unfortunately I cannot reproduce this behaviour with the same steps you mentioned. Is there anything special about your FreeCAD installation? Libraries up-to-date or something too 'bleeding-edge'?
Hmmm - not that I'm aware of. The version in the snap package is a little out of date in that it does not include the addon manager but that's not a big problem.
wandererfan wrote: Tue Sep 18, 2018 1:19 pm Are you using a branch other than master or devl?

Code: Select all

git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
kbwbe wrote: Tue Sep 18, 2018 1:27 pm this looks like an error due to recent changes of fileimporter. I tried to reproduce it, created a cylinder with part WB, also created a cylinder with PartDesign WB and imported both. Unfortunately i could not reproduce the error. Tested with recent master branch. Please post your cylinder.fcstd, which is not importable, so that we can have a look for the problem.
Thank you...
Ok, I've attached it. Tried creating a new one too and that shows the same thing...

I'm happy to do some debugging this end. I've had a look in a2p_importpart.py but I don't currently understand the internal data structure ("App::GroupExtension") so I'm not much use yet...
Attachments
shaft.fcstd
(2.7 KiB) Downloaded 42 times
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 »

EskiBrew wrote: Tue Sep 18, 2018 2:05 pm
Hi EskiBrew,
i could import the "shaft.fcstd" without problems to freshly created assembly.
I noticed your FreeCAD has a really old release number. Recent release of FC17 is 13541, your version is somewhat above 7000... Perhaps better you should update FreeCAD first. It seems to be a preview.

See screenshot after import...
Shaft-import.png
Shaft-import.png (104.88 KiB) Viewed 1352 times
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 »

@EskiBrew:
Maybe you can also try to import a file (the attached one) from me and report back. Nothing special, a cylinder like you said. Made with Part WB, FC 0.17, Linux 64bit.

I also have no problems importing your .fcstd file.
Like @kbwbe I assume a software failure, too, due to an outdated installation.
Attachments
cylinder.1.fcstd
(2.98 KiB) Downloaded 49 times
Post Reply