Assembly3 preview

Discussion about the development of the Assembly workbench.
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Postby catman » Mon Oct 26, 2020 9:41 am

realthunder wrote:
Sun Oct 25, 2020 11:18 pm
catman wrote:
Sun Oct 25, 2020 1:58 pm
I have a little constraint puzzle.
...
It will be much easier if you model the tubes using PartDesign body
Thanks for the info. Not allowing to have multiple bodies from a sketch was among the first FreeCAD limitations I've came across coming from another CAD tool, I remember well. This eats a lot of productivity when dealing with a face with holes, threads and pockets that could easily go in one sketch. Today I am using master sketches with cross-referencing, but its not really the same. Interesting that you found a different way. I'll have a look at your AppImage.


I should have said that the file above contains a reduced case made for reproducing the issue. In my actual model I am using PartDesign not Part WB, but for the problem Part tube yields a more simple tree.
Actually, the model above is not sufficiently constraint at all. It really falls apart after re-orienting a part, so its not even a good workaround. I am trying to understand better how to solve this because I would like to add info to the Assembly3 wiki page. The "tubes" use case is particulary interesting because its the first case where I felt totally lost with my typically used Asm3 constraint set.
Glad for any advice.

One other thing
The "Multiple Parallel" constraint does not work on cylinders, correct?. I wondered, what is the difference between an axis line defined by a cylinder and an edge line defined by a face edge? Isn't the solver algorithm the same for making 2 tubes parallel in 3D than for making 2 faces parallel?
(Sorry if I may have missed documentation on the single constraints).
User avatar
M4x
Posts: 281
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Assembly3 preview

Postby M4x » Mon Oct 26, 2020 10:45 am

catman wrote:
Mon Oct 26, 2020 9:41 am
[...] This eats a lot of productivity when dealing with a face with holes, threads and pockets that could easily go in one sketch. [...]
This could be misunderstood easily. I'm not if this is the case regarding your workflow too. It's not a problem at all to add several holes at once with only one sketch. Just make sure that you still have only one solid within a PartDesign body.
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Postby catman » Mon Oct 26, 2020 11:39 am

M4x wrote:
Mon Oct 26, 2020 10:45 am
This could be misunderstood easily. I'm not if this is the case regarding your workflow too. It's not a problem at all to add several holes at once with only one sketch. Just make sure that you still have only one solid within a PartDesign body.
You mean "holes" not "pockets", right? And of course holes with different diameters, tolerances, threaded or non threaded - I am not aware that this is possible. Can you tell me how? For example a plate with 2xM4 and 2xM8 threads from a single sketch without cross-referencing
User avatar
M4x
Posts: 281
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Assembly3 preview

Postby M4x » Mon Oct 26, 2020 12:05 pm

Ah okay you'd like to only use certain parts of a sketch for different operations. That's not possible indeed. This has nothing to do with the assembly3 workbench but could Sketcher_CarbonCopy be useful for you?
realthunder
Posts: 1810
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Mon Oct 26, 2020 12:31 pm

catman wrote:
Mon Oct 26, 2020 9:41 am
Actually, the model above is not sufficiently constraint at all. It really falls apart after re-orienting a part, so its not even a good workaround. I am trying to understand better how to solve this because I would like to add info to the Assembly3 wiki page. The "tubes" use case is particulary interesting because its the first case where I felt totally lost with my typically used Asm3 constraint set.
Glad for any advice.
You can consult this tutorial for ideas. This tube assembly can be easily convert to a 2D constraining problem. The tutorial shows how to use those less common 2D constraints in asm3. You can of course have more than one sketch to constrain tubes in different planes.

The "Multiple Parallel" constraint does not work on cylinders, correct?. I wondered, what is the difference between an axis line defined by a cylinder and an edge line defined by a face edge? Isn't the solver algorithm the same for making 2 tubes parallel in 3D than for making 2 faces parallel?
(Sorry if I may have missed documentation on the single constraints).
That should be an easy fix. I'll support that in next release.
Try Assembly3 (latest version 0.11) along 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
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Postby catman » Mon Oct 26, 2020 4:42 pm

realthunder wrote:
Mon Oct 26, 2020 12:31 pm
You can consult this tutorial for ideas. This tube assembly can be easily convert to a 2D constraining problem.
I fact I saw the tutorial and tried that way but somehow failed to transfer it to my this case. So its good to know that that approach should work. I tried again and this time I got 2 tubes attached by the "Axial alignment" constraint.
TubesConstraintIssue2.png
TubesConstraintIssue2.png (134.46 KiB) Viewed 380 times
Tubes file with a 2D Rectangle in a workplane for positioning

I have two issues still.
a) I could not resolve it with all tubes attached. After two it gets very unstable and I keep getting "inconsistent constraints". I managed to get three connected, but after moving anything it got me back to "inconsistent constraints".
b) when the left tube was attached to the sketch I could not move it sideways. Is there a way to have the rectangle behave as it would be flexible, as in the Sketcher? I would like to use "point on Line" constraint between tube and sketch vertical on the left side too, but this gives me a "inconsistent constraints" error.

The "Multiple Parallel" constraint does not work on cylinders, correct?.
That should be an easy fix. I'll support that in next release.

Excellent. Thanks.

BTW: A very well suited candidate for complementing the 3D constraint set would be "Line in Plane".
Here is the argumentation for it:
Currently there is "Point in Plane" reducing 1DOF (transl.), "Point on Line" reducing 2DOF (transl.) and "Point on Circle" reducing 3DOF (transl.). A "Line in Plane" would recude 2DOF, but a translation and a rotation. There are not many constraints locking one rotation DOF.
In theory "Line in Plane" could be emulated with 2x "Point on Plane", but I could not get it to solve in the 0.19pre AppImage. However, sometimes it is not easy to find a second point, but its easy to find an axis. For example a bent tube has a (different) axis at each end, but finding a two points for one axis is hard: There is only the cross section center point at the end. So I think this would be a very helpful addition.
Attachments
TubesConstraint2.FCStd
(37.63 KiB) Downloaded 4 times
Last edited by catman on Mon Oct 26, 2020 5:46 pm, edited 1 time in total.
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Postby catman » Mon Oct 26, 2020 4:54 pm

M4x wrote:
Mon Oct 26, 2020 12:05 pm
Ah okay you'd like to only use certain parts of a sketch for different operations. That's not possible indeed. This has nothing to do with the assembly3 workbench but could Sketcher_CarbonCopy be useful for you?
Indeed, it has nothing to do with Assembly3, I just mentioned it as an example.

Thanks for the hint. Actually I use Carbon Copy, somtimes. I think of it as the opposite of "create link to external geometry". With one I start with nothing and import one bit at a time and re-draw what I need. With the other I get everything and start deleting what I don't need. Sometimes instead of deleting I change parts work geometry.
But its all the same, the trouble starts after changing the master sketch (which is a bit the idea to have a master sketch in the first place). Anything that is not modified in size, but replaced spoils the sketches linked with external geometry or carbon copy. The great thing with carbon copy is that deleting and re-doing a cross-referenced sketch is really quite fast.
realthunder
Posts: 1810
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Tue Oct 27, 2020 8:06 am

catman wrote:
Mon Oct 26, 2020 4:42 pm
I have two issues still.
a) I could not resolve it with all tubes attached. After two it gets very unstable and I keep getting "inconsistent constraints". I managed to get three connected, but after moving anything it got me back to "inconsistent constraints".
b) when the left tube was attached to the sketch I could not move it sideways. Is there a way to have the rectangle behave as it would be flexible, as in the Sketcher? I would like to use "point on Line" constraint between tube and sketch vertical on the left side too, but this gives me a "inconsistent constraints" error.
I have already add support for cylindrical face for parallel constraint. If you are using upstream image, your can manually clone my asm3 repository to your user directory. For Linux, it is /home/<username>/.FreeCAD/Mod. The AppImage will prefer the repo in the user directory. If it is Windows, then just find the asm3 directory inside your FreeCAD directory, and replace it with your own clone.

The basic idea is to use a master sketch to control the position. Or better, it can also be used to control the length the tube if you want. Below is an example sketch. You can name the 1000mm length constraint in the sketch, and then bind the TubeMaster.Height to this length. Add the sketch to the assembly, and lock any of its edge. This will be your base part. Add the tubes. Constraint each tube to an edge with two constraints, one PointCoincidence and one MultiParallel (cylinderical parallel to the sketch edge). That's it. You can easily change the sketch to re-configure the whole tube assembly without needing to touch anything else.
Screenshot from 2020-10-27 15-48-18.png
Screenshot from 2020-10-27 15-48-18.png (10.08 KiB) Viewed 336 times

BTW: A very well suited candidate for complementing the 3D constraint set would be "Line in Plane".
Line in Plane can be achieved using PointInPlane and MultiParallel (i.e. Line Plane Parallel)
Try Assembly3 (latest version 0.11) along 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
C_h_o_p_i_n
Posts: 154
Joined: Fri Apr 26, 2019 3:14 pm

Re: Assembly3 preview

Postby C_h_o_p_i_n » Tue Oct 27, 2020 9:38 am

Hi,

I'd like to suggest to use a different symbol to show the Constraint is "part" of a "multiparallel" one - e.g. three horizontal lines with a numbering "n/x" with "n" as the number of the first of the concurrent constraints and "x" to identify the running numbering of the constraint itself.

Regards,
Stefan
catman
Posts: 277
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly3 preview

Postby catman » Tue Oct 27, 2020 10:35 am

realthunder wrote:
Tue Oct 27, 2020 8:06 am
have already add support for cylindrical face for parallel constraint. If you are using upstream image, your can manually clone my asm3 repository to your user directory. For Linux, it is /home/<username>/.FreeCAD/Mod. The AppImage will prefer the repo in the user directory.
Great. I was not aware that this would work (its better than switching AppImages). I thought your upstream WB depends on a lot of additional core changes, so a part of the features would not work at all or make the model incompatible. But if that works, I wonder - wouldn't that be the same as adding your WB to the AddonManager and install it into the user/Mod folder? With the 0.19pre AppImage adding the Asm3 WB with the Addon Manager I'd get your Upstream version, deleting it again I'd get back to the 0.19pre version.

The basic idea is to use a master sketch to control the position. Or better, it can also be used to control the length the tube if you want. Below is an example sketch. You can name the 1000mm length constraint in the sketch, and then bind the TubeMaster.Height to this length. Add the sketch to the assembly, and lock any of its edge. This will be your base part. Add the tubes. Constraint each tube to an edge with two constraints, one PointCoincidence and one MultiParallel (cylinderical parallel to the sketch edge). That's it. You can easily change the sketch to re-configure the whole tube assembly without needing to touch anything else.
Screenshot from 2020-10-27 15-48-18.png
Marvellous. Thanks!
Thats exactly what I was trying to get when I thought about an efficient approach. I did not expect that I could use an expression link to the master of a linked group that gets filled with the individual data. I can see that by not using two PointCoincidents for both ends but fixing one end only the solver does not get conflicting length data. The key is to have MuliParallel working with axes. For the first item I would be using PointCoincidence+MultiParallel, for the others PointOnLine+MultiParallel.
Maybe that saves complexity with rectangular tube frames as well - as you say - even in 3D using several sketches. Once the sketch is set up, its 2 constraints per tube/profile instead of 9 (2 sides with 3 alignments each).

For using sketches more intensively I'm afraid I need to ask about the workplanes. Its not clear to me what they refer to. There are 3 choices "Workplane", "WorkplaneXZ" and "WorkplaneYZ". I was assuming that "Workplane" actually means "WorkplaneXY", but I thnik that is wrong because not in all cases they create 3 orthogonal planes, e.g. selecting a tube I my example got 2 planes with the same orientation. I noted that I need to select either the whole assembly, a part or an element to be able to add a workplane, because it defines the origin. But what defines the orientation is not obvious. The properties do not show a link to the selected part and they do not move with the part but with the assembly work space. Currenlty its unpredictable to me which plane will result, so I'm, adding all of them and delete the ones I do not need :oops:. The additional options "placement" and "origin" add what is expected, but I have no clue why I would want to use those - probably not seeing the obvious :oops:
Its helpful if you could confirm if any of my assumptions are correct. For any further hint about the function I would be very grateful, of course


Line in Plane can be achieved using PointInPlane and MultiParallel (i.e. Line Plane Parallel)
Yes, that should work now with your added support for cylinders. So when that is merged back into 0.19pre, it should be available for anyone. Until then I will use your daily AppImage and copy the WB as described above.