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 »

dan-miel wrote: Sat Sep 05, 2020 10:19 pm I need to do better testing and put up a better version in a few days.
Here is the better version. In addition to listing the last constraint made it has a dropdown listing the last 15 so you can select and edit them. I also attached a picture showing the Find w label function.
To install it extract the a2plusmore folder from the zip, drop it into your mod folder and restart FC, select the work bench and select the full auto program. More info is in the pdf.
Dan
Attachments
add.jpg
add.jpg (30.82 KiB) Viewed 4126 times
A2plusmore with Full auto Vers 0010.zip
(524.37 KiB) Downloaded 97 times
Smiling_user
Posts: 196
Joined: Tue Jul 28, 2020 7:31 am

Re: Another approach to assembly solver (A2plus)

Post by Smiling_user »

by jmmartin » Fri Sep 18, 2020 6:58 pm
Hi I'm new to A2Plus, I don't know if this is correct place to ask for help (sorry if not). Im not being able to find correct constraints to put the selected part centered to the holes.
coliso.png
coliso.png (129.78 KiB) Viewed 3993 times
jmmartin, the place is right.

In your case: holes on the hook side are not round. So the AxisCenter-constraint is not applicable.
But this depends on the position: maybe is possible to constrain as arc-to arc using one side of hole?
Maybe, the positioning will require
-- either to prepare some additional lines inside the base sketch of the hook and apply the constraint to it.
-- or to position with "planeCoincident" -> move under constraints -> set FixedPosition:= true.

If your file is less than 1 mb - try to attach it. if larger -try using external file-sharing service.

// If interested, as a new user of FC, - try seeing the topic https://forum.freecadweb.org/viewtopic.php?f=3&t=49220
And please leave a comment whether it is helpful or not.
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 »

Smiling_user wrote: Fri Sep 18, 2020 9:12 pm Im not being able to find correct constraints to put the selected part centered to the holes.
Hi jmmartin
I put my answer to your question in a different post so that people who are searching for it might have a better chance on finding it since I'm guessing the search engines only look at the title of the post.
My guess is to draw a sketch and constraint to the sketch. The video shows how I did it.
Dan

https://forum.freecadweb.org/viewtopic.php?f=20&t=50409
User avatar
openfablab
Posts: 62
Joined: Wed Nov 02, 2016 4:42 pm
Contact:

Re: Another approach to assembly solver (A2plus)

Post by openfablab »

Many thanks for a great workbench! :)

I want to suggest one little addition to make it more convenient: backlinks to parent assembly.

When we add part to assembly, let's add some link to this assembly into the part/subassembly file. If this file is used through several assemblies, let there be list of [annotated] links.

Then, in the part file we can use this link for the next extremely useful purposes:

* Tracking where also this part is used (full list of its super-assemblies)
* Navigation upwards through assemblies - opening files by e.g. Ctrl+ clicking corresponding links
* Visualisation of contexts: when one press spacebar on link, corresponding superassembly is imported as simple body and visualised. This is an easy way to see all contexts where this part is used, reference them and even use them as the base for ShapeBinder objects.
* We can use MasterSketch or MasterVolume workflows easily and simultaneously this way: simple including of them to assembly makes them accessible to all its 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 »

openfablab wrote: Tue Sep 22, 2020 5:28 pm I want to suggest one little addition to make it more convenient: backlinks to parent assembly.

When we add part to assembly, let's add some link to this assembly into the part/subassembly file. If this file is used through several assemblies, let there be list of [annotated] links.
I don't think you want all of the links in the part or assembly files. If the part was replaced with a newer version the links would disappear. You're describing a PDM (product data management). it's a database that tracks where the files are used, revisions and all other information related to the files.
Dan,
User avatar
openfablab
Posts: 62
Joined: Wed Nov 02, 2016 4:42 pm
Contact:

Re: Another approach to assembly solver (A2plus)

Post by openfablab »

dan-miel wrote: Wed Sep 23, 2020 8:31 pm I don't think you want all of the links in the part or assembly files. If the part was replaced with a newer version the links would disappear. You're describing a PDM (product data management). it's a database that tracks where the files are used, revisions and all other information related to the files.
Dan,
Yes, but I have no idea how to integrate database to FreeCAD. It could be possible if we could store FreeCAD data in such database with IDs instead of file paths. Can somebody point to any direction where I could experiment with code about it?

If we delete old part and replace it with new, and then save assembly, all looks logical: backlink is deleted from replaced part and added to new part. If backlink was not deleted from part, next time when we open it, backlinks are checked and marked as inactive or auto-deleted.

I think about Assembly as a basic case of PDM. Thus it is probably a general direction of all Assembly workbenches evolution.
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 »

openfablab wrote: Thu Sep 24, 2020 6:14 am It could be possible if we could store FreeCAD data in such database with IDs instead of file paths. Can somebody point to any direction where I could experiment with code about it?
:
A pdm doesn’t track a file by its name or address. Instead it renames it to its own naming convention. Let’s say you have a file named bolt and you add it to the database. It is the first file in the database so the database renames it as PDM1. The name is unique and will never change. It might have something like the following attributes applied to it. “Name”, Description, Revision, Location, etc. All of these can be changed but only one “Name” is allowed in the database. So if you wanted to put another “bolt” into the PDM database you would have to rename it, maybe “BOLT 10mmx30mm”. You could then change the name of your first bolt to “BOLT 8mmx30mm” PDM is still tracking it as PDM1. If you wanted to replace the file, you would tell PDM to replace “BOLT 8mmx30mm” but to PDM it is replacing the file PDM1 because the “Name” is only an attribute. Often at this point the revision is increased by 1 but that is for the engineer to decide.
For an assembly file one of the attributes would be a list of the files used in the assembly. I suppose for a part file you could make a list of where used but it might be just as good to search the assembly file’s list of parts to find the ‘where used’ of a part file. Of course the list of where used in the PDM’s mind would be PDM09, PDM67, PDM209, but we would receive a list of the file’s “Name” attribute.
This is simplified but I hope this explains how a PDM database works.
Dan
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 »

openfablab wrote: Thu Sep 24, 2020 6:14 am Yes, but I have no idea how to integrate database to FreeCAD. It could be possible if we could store FreeCAD data in such database with IDs instead of file paths. Can somebody point to any direction where I could experiment with code about it?
Like Dan, i do not like a lot of backlinks within a FCStd file. This is a job to be done by a database. Connecting python modules to a DB is not so difficult. For Python, there exists a DB2-API definition and many databases provide compliant python modules. I for myself have gathered some experience with connecting python code to Firebird databases. But using the API, many other databases should work. License, i think, does not really matter, as the the database management could be placed to an external module or workbech.

The work, which has to be done, is to call the database interface at all relevant commands of a workbench, in this case A2p. At first look, this is a doable job.

As most databases are able to store BLOB objects, it also should be possible to put some FreeCAD stuff inside. E.G. a shape can be represented as a string.
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
openfablab
Posts: 62
Joined: Wed Nov 02, 2016 4:42 pm
Contact:

Re: Another approach to assembly solver (A2plus)

Post by openfablab »

dan-miel wrote: Thu Sep 24, 2020 3:22 pm A pdm doesn’t track a file by its name or address. Instead it renames it to its own naming convention. Let’s say you have a file named bolt and you add it to the database. It is the first file in the database so the database renames it as PDM1.
kbwbe wrote: Thu Sep 24, 2020 5:20 pm Like Dan, i do not like a lot of backlinks within a FCStd file. This is a job to be done by a database. Connecting python modules to a DB is not so difficult. For Python, there exists a DB2-API definition and many databases provide compliant python modules. I for myself have gathered some experience with connecting python code to Firebird databases. But using the API, many other databases should work. License, i think, does not really matter, as the the database management could be placed to an external module or workbech.
The work, which has to be done, is to call the database interface at all relevant commands of a workbench, in this case A2p. At first look, this is a doable job.
As most databases are able to store BLOB objects, it also should be possible to put some FreeCAD stuff inside. E.G. a shape can be represented as a string.
You are right, database is more straightforward solution than networks of mutual links. I think, database keeping FreeCAD objects instead of BLOB files
is very good idea, because if we have access to Parts and Bodies, etc across all designs, we can build different useful data models around it, e.g. trace system requirements, manage PBS, functional and structural decomposition through hierarchies. Now I use Archimate to deal with all this stuff, but if we could one day manage it from FreeCAD workbench (or startpage)- with direct link between FreeCAD objects and networks of custom cross-file abstract objects - this would be very good. And keeping "All my FreeCAD data" in one file is of course more compact and nice.

May be, for a first time we do not need to call database at all relevant commands, but only on filesystem-related (open and save). I.e just redirect reading and writing files from filesystem to database API.

While this looks like not very hard load on database, I think we could experiment with database engine with FreeCAD compatible license, with hope to make it in future part of official releases.
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Another approach to assembly solver (A2plus)

Post by kkremitzki »

For spatial and geographic data there is PostGIS, a PostgreSQL extension: https://postgis.net/

A while back I thought it would be interesting to wrap OpenCASCADE functionality in a PostgreSQL extension as well; then PG servers running that extension could serve as model backends for FreeCAD, and you'd get all the functionality of PG and its ecosystem, for example permissions & access model, locking, transactions, replication, sharding, etc. -- PostCAD.

As I looked more and more into this, though, it'd be really hard! Not really something I could do in my free time just yet.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
Post Reply