Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
dan-miel
Posts: 158
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Tue Jul 28, 2020 11:09 am

MRx wrote:
Mon Jul 27, 2020 4:03 am
So I'm mixing a2plus objects and regular partdesign objects (the ones with the blue bricks).
As far as I've learned it's not possible to mix partdesign objects with a2plus objects, however it would still be valuable to be able to align surfaces of partdesign objects with a2plus objects (even without creating rules).
Currently I look at the coordinates and move such items manually.
----
Update 2:
it is possible to define rules for "Partdesign Objects" however they're placed outside of the object and cause weird issues (I remember I had those issues also when I started with a2plus). At that stage seems like I've nailed down all my issues.
What do you mean that you are mixing a2plus with partdesign objects? And that the part design are outside of the object and you move them manually? Everything I work with is inside the assembly file. If you have things 'outside' of the assembly file the programs may not work as intended. If you would, please send me an assembly and I would like to see what results I get with my programs.
MRx wrote:
Mon Jul 27, 2020 4:03 am
I hope I did not misunderstood your post when you wrote about labels, did you mean faces?
If you are referring to the last line of the message I mean that an actual label will appear at the location.
Is the code working? I am recovering from some surgery I had last week so I am home all day and have some time to look at it.
Dan
dan-miel
Posts: 158
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Tue Jul 28, 2020 3:41 pm

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: 18
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Postby MRx » Thu Aug 06, 2020 6:11 am

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: 158
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Thu Aug 06, 2020 10:32 am

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 21 times
MRx
Posts: 18
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Postby MRx » 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
dragchains.png (7.38 KiB) Viewed 737 times
Smiling_user
Posts: 172
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Postby Smiling_user » Tue Aug 18, 2020 7:57 am

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: 18
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Postby MRx » Tue Aug 18, 2020 8:30 am

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: 172
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Postby Smiling_user » Tue Aug 18, 2020 6:18 pm

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: 172
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Postby Smiling_user » Wed Aug 19, 2020 6:06 am

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: 158
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Fri Aug 21, 2020 1:08 pm

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 505 times
Full auto directions ver002.pdf
(80.1 KiB) Downloaded 11 times
A2plusmore ver002.zip
(223.43 KiB) Downloaded 11 times