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!
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

Here is a demo of updating the part. At the end of the video I show that all of the constraints are still in the assembly.
Dan
phpBB [video]
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Post by MRx »

dan-miel wrote: Mon Jul 27, 2020 3:12 am
MRx wrote: Sun Jul 26, 2020 5:37 pm I usually remove the constraints and update the objects. After that I'll re-apply the constraints (because just updating the objects doesn't seem to work properly - or in some cases I'm modifying the objects too much).
The problem is if you have a bigger design, there are too many of those popups.

Unzip the file. Copy the directory to you "mod" directory and restart FreeCAD. Right click in the icon rows to add the new buttons to your customized dash.


Dan
Hi,

I did that. Although my design is a bit big.

I propose to print this message after all the other checks, and not during the check.
I have 126 parts in my design at the moment and many rules it takes quite some time to go through the checks. (the conflictfinder takes > 30 Minutes)

msg = '''
The highlighted parts were not moved. They are
not constrained (also over constraint chains)
to a fixed part!
'''
# QtGui.QMessageBox.information(
# QtGui.QApplication.activeWindow(),
# "Could not move some parts",
# msg
# )

the issues should be collected and displayed at the end, this is just stopping the check and waiting for user input.

I'm not into all that, is there a way to update the script without having to restart FreeCAD?
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

MRx wrote: Thu Aug 06, 2020 6:11 am the conflictfinder takes > 30 Minutes
Copy/paste the A2plusupdater file into the mod/A2plusmore folder. The conflictfinder will not run. After the updater runs if there are missing features the viewer will open.
MRx wrote: Thu Aug 06, 2020 6:11 am msg = '''
The highlighted parts were not moved. They are
not constrained (also over constraint chains)
to a fixed part!
'''
# QtGui.QMessageBox.information(
# QtGui.QApplication.activeWindow(),
# "Could not move some parts",
# msg
# )
I see that you remarked out Lines 518 - 522. I would need to add code to the solver file which would get wiped out each time a2plus was updated so I try to leave those files alone. That error is created because the two parts are not constrained to a fixed part. I'm not even sure if that is really an error, I think a note at the end would suffice. A lot of times when I get that error I just fix one of the parts.
MRx wrote: Mon Jul 27, 2020 4:03 am I absolutely understand your concerns about updating, I think this should be solved on a higher level allowing to attach the labels to an object (eg. explicitly adding a "Front" label to a Face)
It would be nice to have this solved at a higher level but I find it to much of a pain to remove all the constraints and redo them so I'm tackling it at this lower level.

I hope this helps.
Dan
Attachments
A2plusupdater.py
(22.65 KiB) Downloaded 109 times
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Post by MRx »

Hi,

could you allow multiselect for adding some rules? eg. "add a plane coincident constraint"

A direct use case is following:
dragchains.png
dragchains.png (7.38 KiB) Viewed 2752 times
Smiling_user
Posts: 196
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Post by Smiling_user »

MRx wrote: Mon Aug 17, 2020 2:54 pm Hi, could you allow multiselect for adding some rules? eg. "add a plane coincident constraint"
A direct use case is following: dragchains.png
There actually is a "planeCooincident constraint" already (a2P v 0.4.47d)

Maybe explain your usage procedure to make it clear of preconditions and outcomes.
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Post by MRx »

Yes the feature is there, but it doesn't allow multiselect. It would be very helpful to align all elements at once instead of one after each other.

All elements should depend on the first selected element to be aligned properly.

Another but yet open topic would be the joint between the links but that might be scriptable.
Smiling_user
Posts: 196
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Post by Smiling_user »

Suppose, that multi-select - align. might be possible to solve by adding the CTRL to separate source from target.
Like select multiple sources - press CTRL - select target -> constrain.

And maybe the more required option would be to disable popup: set multiple constraints without having the "Set / solve " constraint popup.
Smiling_user
Posts: 196
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Post by Smiling_user »

QUESTION:
In the imported parts there is a property Fixed Position = true/false
In the properties editor it is possible to add new property (or via python scripting)
How to add <Fixed Position = true> property to a sketch, so that A2P solver would consider the position of sketch - fixed??
Would be efficient in A2P to have a constrain-tool-button [AddFixedPositionPropertyToObject]


And also a very needed tool is: Apply <fixedPosition = true> to constrain-positioned parts.
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

MRx wrote: Mon Aug 17, 2020 2:54 pm could you allow multiselect for adding some rules? eg. "add a plane coincident constraint"
For muti select it is #10 in the PDF file or "Keep 1"
Smiling_user wrote: Tue Aug 18, 2020 6:18 pm And maybe the more required option would be to disable popup: set multiple constraints without having the "Set / solve " constraint popup.
There is no pop up in this workbench. Select two surfaces you have your constraint. If you want a different constraint select it before you select the second feature.
MRx wrote: Tue Aug 18, 2020 8:30 am All elements should depend on the first selected element to be aligned properly.
Smiling_user wrote: Tue Aug 18, 2020 6:18 pm And maybe the more required option would be to disable popup: set multiple constraints without having the "Set / solve " constraint popup.
Everything your asking for is write your own or (third party). My write my own is below and Yes there are bugs. I have the program on this machine but I haven't tried it on my other machine. Let me know if it works or not.
Smiling_user wrote: Wed Aug 19, 2020 6:06 am In the properties editor it is possible to add new property (or via python scripting)
Look in autoconstrainA2.py for "newcon.addProperty("App::PropertyPlacement","Placement2","LocateDan").Placement2 = ob2.Placement"
Attachments
FullAuto Plane.JPG
FullAuto Plane.JPG (35.32 KiB) Viewed 2520 times
Full auto directions ver002.pdf
(80.1 KiB) Downloaded 64 times
A2plusmore ver002.zip
(223.43 KiB) Downloaded 79 times
Smiling_user
Posts: 196
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Post by Smiling_user »

Question is: how to import a detail with a2plusmore into asm?
What is the general work-flow with this workbench?
And else, could you, please, provide a dependency graph of the project files?

After trying o use:
- convenient.
- but guidelines still must depend on an imported part (no option to set fixedPosition = true)

Need an option to start solving based on guidelines located in the assembly file.
And also, seems that at this moment the best would be a combination of tools/toolbars from A2P and A2P-more.

And to get it working I had to copy some files from A2P folder.

In the attached files - there is a detail->guidelines dependency assembly made with A2P 0.4.47d
A2P-more did not accept guidelines.
And what I'm willing to have: guidelines -> detail dependency
Attachments
det2.FCStd
(3.69 KiB) Downloaded 98 times
det1.FCStd
(3.69 KiB) Downloaded 93 times
Asm2PM2.FCStd
(9.99 KiB) Downloaded 60 times
Post Reply