Assembly3 preview

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

triplus wrote: Sat Dec 09, 2017 5:32 pm Can you confirm adding more than one Assembly relation between 2 parts will not work (successfully resolved by solver) ATM?
It should work. Any particular problem you have? It's better to attach a file to show the problem. Because SolveSpace is a numerical solver, it is sensitive to over constraint and initial condition. Sometimes, you need to manually align the feature close to your desired position before the solver being able to find a solution. See the screencast below. I added an axial and angle constraint. As you can see, the solver failed at first. I had to drag the feature a bit to get the snap. BTW, I will be constantly adding new commits to fix any problem in my development, in both my FC branch and Assembly3 itself. So be sure to sync with them from time to time.
Image
triplus wrote: Sat Dec 09, 2017 5:32 pm Therefore in what condition would you imagine Link functionality (as a standalone feature) is currently? I could for example see Create a link and Create a link group commands added to FreeCAD. Including the Python API? Would prefer if at final stages you would try to reach some consensus in a separate thread. If the user facing term Link is what works best for the end users.
My branch of FC has literally tens of thousands lines changed against the upstream. Although the design principle is to make sure every changes are backward compatible, there is really not enough tests to back that statement. It is kind of a chicken and egg scenario. We need more people to test the branch to make sure nothing is broken, but then it's hard to get people to test it without merging it to upstream. One big reason for me to start Assembly3 is to test my branch, and attract more others to test it as well.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Assembly3 preview

Post by triplus »

realthunder wrote: Sun Dec 10, 2017 12:12 am Any particular problem you have? It's better to attach a file to show the problem. Because SolveSpace is a numerical solver, it is sensitive to over constraint and initial condition. Sometimes, you need to manually align the feature close to your desired position before the solver being able to find a solution.
Simply try inserting 2 Part Cubes. With one relation everything looks OK. But any combination of relations simply doesn't work on my side. I tired the "workaround" as i read about it in the documentation already. Therefore first i placed 2 cubes manually. To fit them precisely as they would be assembled (one on top of another). Adding more then 1 relation and hitting on the Solve button always results in issues. Just one relation more or less always works as expected.

I have installed both solvers. How can i see which one is being used?
BTW, I will be constantly adding new commits to fix any problem in my development, in both my FC branch and Assembly3 itself. So be sure to sync with them from time to time.
Did that before the tests today.
My branch of FC has literally tens of thousands lines changed against the upstream. Although the design principle is to make sure every changes are backward compatible, there is really not enough tests to back that statement. It is kind of a chicken and egg scenario. We need more people to test the branch to make sure nothing is broken, but then it's hard to get people to test it without merging it to upstream. One big reason for me to start Assembly3 is to test my branch, and attract more others to test it as well.
Yes some sensible strategy to tackle this will for sure be needed. As you are trying to address around four to five (and up) big areas. That is why i thought it likely would make sense to first tackle the Link feature. As a standalone feature. Could a Link feature related PR be made against upstream in a rather straightforward fashion? It's a new feature. Such feature doesn't yet exists in FreeCAD and therefore i do imagine it shouldn't hit against any concepts already implemented in FreeCAD 0.17 cycle. Therefore things like usefulness of feature, code quality ... could be reviewed in less stressful manner.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

triplus wrote: Sun Dec 10, 2017 12:56 am Simply try inserting 2 Part Cubes. With one relation everything looks OK. But any combination of relations simply doesn't work on my side.
Could you please attach a file for me to have a look?

triplus wrote: Sun Dec 10, 2017 12:56 am I have installed both solvers. How can i see which one is being used?
The Assembly container has a property named 'SolverType'

triplus wrote: Sun Dec 10, 2017 12:56 am Yes some sensible strategy to tackle this will for sure be needed. As you are trying to address around for to five (and up) big areas. That is why i thought it likely would make sense to first tackle the Link feature. As a standalone feature. Could a Link feature related PR be made against upstream in a rather straightforward fashion? It's a new feature. Such feature doesn't yet exists in FreeCAD and therefore i do imagine it shouldn't hit against any concepts already implemented in FreeCAD 0.17 cycle. Therefore things like usefulness of feature, code quality ... could be reviewed in less stressful manner.
I am afraid it's not that simple. I originally divided my changes into three set of patches. The first set of patches is currently pending as a PR in upstream. It mainly deals with modification of Gui.Selection, and Coin rendering so that linked identical objects can be properly selected without ambiguous. The second set of patches add a few APIs for future link to support local coordinate. Yes, each link provides a local coordinate, because each link can have its own independent placement than the linked object. The patches also introduce major upgrade of tree view in order to support linked child visibility control and external objects. There is also the modification of recomputation logic to account for external objects. It is only after all these are in place can we apply the final patch set for the actual App::Link. Otherwise, it just won't work. My argument with ickby was about the behavior of App::Part at that time that prohibits the usage of Link inside it. But since then, he introduced a new concept of scoped link property, which I think can make App::Part and App::Link coexist to some extent, although I haven't tested it yet.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Assembly3 preview

Post by triplus »

realthunder wrote: Sun Dec 10, 2017 1:31 am Could you please attach a file for me to have a look?
C'mon. Two Part Cubes + 2 relations (without counting the Lock one) between them. Couldn't make it work with SolveSpace in multiple tests. If there is any scenario that works for you just confirm and i will test it further. I don't mind spending some time on it. As i see there is a lot of options and over time i plan to test them all anyway.
The Assembly container has a property named 'SolverType'
Indeed. And among the algorithms i see some familiar names as seen in Sketcher workbench. Will test that tomorrow. Should for example Perpendicular work when not using SolveSpace? As after a few quick tests it looks like i do get Python AttributeError in such case.
I am afraid it's not that simple...
I see. Therefore likely a few months of back and forth before we get to anywhere is inevitable. Well it was worth a try! ;)
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

triplus wrote: Sun Dec 10, 2017 2:23 am C'mon. Two Part Cubes + 2 relations (without counting the Lock one) between them. Couldn't make it work with SolveSpace in multiple tests. If there is any scenario that works for you just confirm and i will test it further. I don't mind spending some time on it. As i see there is a lot of options and over time i plan to test them all anyway.
The attached file has two cubes, one plane coincidence, and one angle constraint.

Some of the constraints on toolbars are in fact composite constraints, meaning that they consists of multiple SolveSpace base constraints. It is possible that I didn't formulate the constraints in best way resulting over constraint when used together. It will be better if you can either attached the file, or describe your steps in details, so that I can analyse the problem. I may need to trace into SolveSpace code to find out the root cause.
Attachments
cube.fcstd
(9.69 KiB) Downloaded 133 times
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

New support of origin and datum feature, for use with PartDesign body. You'll need to sync both my FC branch and asm3. In the screencast below, the cyliner and cube are simply Part features, the datum plane and origin are from a PartDesign body.

Image
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
fosselius
Posts: 381
Joined: Sat Apr 23, 2016 10:03 am
Contact:

Re: Assembly3 preview

Post by fosselius »

Can you get information about DOF between each objrct from the solver?

I am working on a "RobotCreator" workbench where the user manually place links and joints and define limits and orientation for the joints. Right now it exports a SDF file that you can load in Gazebo (robot simulator). I am currently working on having PyBullet simulate the SDF file directly in freecad. It would be great if I could get enough information from the assembly/solver to generate a URDF or SDF.

I have built your branch but not had time to play around with it yet.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Assembly3 preview

Post by triplus »

realthunder wrote: Sun Dec 10, 2017 3:31 am The attached file has two cubes, one plane coincidence, and one angle constraint.
Yesterday i tried out combinations like:
  • Lock, Plane, PlaneOrientation
  • Lock, Plane, SameOrientation
  • Lock, Plane, MultiParallel
  • ...
And couldn't get it to work regardless of selection combination and initial manual position alignment. Can confirm Lock, Plane, Angle combination works. And i could succeed with another one Lock, Perpendicular, Angle. That is good enough for me for now. To see it can be done! ;)
Some of the constraints on toolbars are in fact composite constraints, meaning that they consists of multiple SolveSpace base constraints. It is possible that I didn't formulate the constraints in best way resulting over constraint when used together.
Thanks for the explanation. I am sure that over time when more users do some testing you will get more of such feedback.
New support of origin and datum feature, for use with PartDesign body. You'll need to sync both my FC branch and asm3. In the screencast below, the cyliner and cube are simply Part features, the datum plane and origin are from a PartDesign body.

  • I can confirm i was able to add Plane relation between Part Cube Face and Datum Plane inside PartDesign Body.
  • Selecting origin (single plane) of the PartDesign Body (Body being inside Assembly) doesn't look like it is working on my side. No relations offered after.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Assembly3 preview

Post by sgrogan »

Hey realthunder,
I have some problem compiling your https://github.com/realthunder/FreeCAD/tree/LinkStage3 branch on Windows.

Code: Select all

Error	9	error C2280: 'std::unique_ptr<Gui::LinkView::Element,std::default_delete<_Ty>> &std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility	2045	1	FreeCADGui
"fight the good fight"
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Post by easyw-fc »

sgrogan wrote: Sun Dec 10, 2017 9:01 pm Hey realthunder,
I have some problem compiling your https://github.com/realthunder/FreeCAD/tree/LinkStage3 branch on Windows.
Yeah @sgrogan ! I was looking forward to see your build for windows coming to town! I will follow you ;)
That would be a very easy way to test the new A3!

Maurice
Post Reply