Assembly3 preview

Discussion about the development of the Assembly workbench.
User avatar
OficineRobotica
Posts: 192
Joined: Thu Feb 21, 2019 8:17 am

Re: Assembly3 preview

Postby OficineRobotica » Thu Jun 25, 2020 6:30 am

realthunder wrote:
Tue Jun 23, 2020 12:47 pm
When you increase the element count, the parent Link becomes a group like object hosting all the child links. Therefore, the scale is applied after each child Link's own transformation. So, what you want is to apply the scale to each child link instead.
Thank you. Such a simple solution and I didn't see it.

I'm facing allot of complete freezes of your FC branch with the file attached. It doesn't completely crash just freezes. I intentionally left the last beam to be aligned for testing purpose. This doesn't happen with FC trunk with asm3 embeded.
freeze.jpeg
freeze.jpeg (415.55 KiB) Viewed 855 times
How to reproduce:
-select the 2 highlited faces
-click attachment constraint
-select something in the tree = instant freeze

But it happens at random with other constraints also.

Your FC version used for testing

Code: Select all

OS: KDE neon User Edition 5.19 (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21300 +2367 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: daf93f78cc3809ec0b63f8da8ee9002750f5f169
Python version: 3.7.6
Qt version: 5.12.1
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Trunk FC version used for testing

Code: Select all

OS: KDE neon User Edition 5.19 (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21622 (Git) AppImage
Build type: Release
Branch: master
Hash: f5a5bf7900e9a5cdbb5f7f82fcf5123b27c9703f
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

The truth is that this is not the first time that I try asm3 but I always gave up on it because of one simple problem. Even with the low body count present in this file , the transform tool becomes unbearably slow. I'vd done the CNC in asm2+ and the hexapod assembly in asm4 and during assembly I always find my self moving stuff with the manipulator for my visual reference or to aid the solver in finding the neded match. Can this issue be solved in some way? Your's is the most complete and integrated WB but it slows down the workflow to a crawl when using the manipulator. Even for bodies that have yet no constraints set. Please take a look at this.
textOutline4.jpeg
textOutline4.jpeg (380.13 KiB) Viewed 855 times
Thank you for your hard work. Cheers.
asm3cnc_2.FCStd
(115.9 KiB) Downloaded 8 times
User avatar
Zolko
Posts: 935
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly3 preview

Postby Zolko » Thu Jun 25, 2020 7:03 pm

OficineRobotica wrote:
Thu Jun 25, 2020 6:30 am
your UI is really slick, well-done. I see you use KDE, how do you do the menu bar on top of the screen ?
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
OficineRobotica
Posts: 192
Joined: Thu Feb 21, 2019 8:17 am

Re: Assembly3 preview

Postby OficineRobotica » Fri Jun 26, 2020 4:57 am

Zolko wrote:
Thu Jun 25, 2020 7:03 pm
your UI is really slick, well-done. I see you use KDE, how do you do the menu bar on top of the screen ?
I like it too aspect wise but it also frees allot of vertical space that is never enough on a 16:9 aspect ratio screen.
If you want a menubar in the top panel first of all you need to create a parameter under Tools -> Edit parameters ... -> BaseApp -> Preferences -> MainWindow. It should be a new Boolean item named ClearMenuBar and it should be set to true. This circumvents a bug on macos and linux wher the menu gets inflated when changing workbenches.

The fast route in kde plasma is to add a empty top panel and add a global menu widget to it. It is present by default in kde plasma( right click on the desktop->add widget. You will also need the active window control widget for the window controls in the top panel. https://store.kde.org/p/998910/

Instead I use Latte dock with adaptive coloring based on the overall active window theme. You will need :
-Latte Dock present in the default kde neon repositories
-window title applet https://store.kde.org/p/1274218 (needs compiling)
-window appmenu applet https://store.kde.org/p/1274218 (needs compiling)
-latte window colors available in kde's settings->window managment->kwin scripts->get new scripts
It really worth the effort.

https://www.youtube.com/watch?v=JVbIuZp3VFQ

Sorry admins. We finished playing (hijacking the thread) :D
User avatar
OficineRobotica
Posts: 192
Joined: Thu Feb 21, 2019 8:17 am

Re: Assembly3 preview

Postby OficineRobotica » Sat Jun 27, 2020 4:46 am

Ok, this might be stupid on my side but I figured out that enabling "skip recomputes" in the file right click menu in the tree brings back the reactivness of the 3d manipulator. But I don't really understand what does that mean for the file when working with assemblies. When moving a body with the manipulator , FC does a bunch of recomputes along the way. But this happens only when using asm3. The recomputes don't trigger when using the manipulator outside of asm3. Wouldn't it be better if asm3 triggered a recompute only on mouse release when using the manipulator?

I still get freesez when using asm3 in the LinkStage3 branch but the screenshots with the shadows always look killer lol.

CNC progress:
cnc_progress.jpeg
cnc_progress.jpeg (393.71 KiB) Viewed 605 times
cnc.jpeg
cnc.jpeg (440.05 KiB) Viewed 605 times
asm3cnc_1.FCStd
(325.48 KiB) Downloaded 10 times
realthunder
Posts: 1591
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Sun Jun 28, 2020 10:02 am

OficineRobotica wrote:
Thu Jun 25, 2020 6:30 am
I'm facing allot of complete freezes of your FC branch with the file attached. It doesn't completely crash just freezes. I intentionally left the last beam to be aligned for testing purpose. This doesn't happen with FC trunk with asm3 embeded.
I see the same temporary freeze when selecting the link array object. Is this what you are experiencing. This freeze is caused by building geometries and generate new topological names, which is why it does not happen in upstream. And this problem only surface when you use link with scale, worse link array with scale. Because link does not have geometry, normal link can simply forward the linked object's geometry, while scale has to generate new geometries. I am aware of this issue, and added a bunch for shape caches to lessen the problem. But apparently there is some problem with the cache. I'll look into it.
OficineRobotica wrote:
Thu Jun 25, 2020 6:30 am
The truth is that this is not the first time that I try asm3 but I always gave up on it because of one simple problem. Even with the low body count present in this file ,
First, make sure you are using the latest asm3. I mean the assembly3 workbench. If you've previously clone my asm3 module in your FreeCAD user directory, my AppImage will load that instead of the embedded one. Simply delete the module in your user directory will do.

You can skip auto solving by pressing CTRL while moving. But it will still perform recompute to update all the attached element geometries. I'll add another shortcut like pressing SHIFT key to skip recompute entirely on moving.
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
User avatar
Zolko
Posts: 935
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly3 preview

Postby Zolko » Sun Jun 28, 2020 10:52 am

realthunder wrote:
Sun Jun 28, 2020 10:02 am
And this problem only surface when you use link with scale, worse link array with scale. Because link does not have geometry, normal link can simply forward the linked object's geometry, while scale has to generate new geometries. I am aware of this issue, and added a bunch for shape caches to lessen the problem.
This being about open-source, there is a big question about maintenability: adding code complexity must bring benefit. This scaling thing is something we have talked a lot about before, and each time I see something about it confirms that this is indeed a very questionable feature.

Did you ever make a comparison cost/benefit of this functionality ?
What are the real-world use-cases for this ?
Isn't there another way to achieve the desired goal ?
Should this really be part of FreeCAD v0.19 ?

wmayer wrote:
Sun Jun 28, 2020 10:41 am
ping
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
OficineRobotica
Posts: 192
Joined: Thu Feb 21, 2019 8:17 am

Re: Assembly3 preview

Postby OficineRobotica » Sun Jun 28, 2020 11:21 am

This is my humble simple user opinion. Since I discovered scale I find myself using it in one million ways. See the less than likely use case that I have found scaling the beams of the Cnc only in one axis. Also the lateral steel reinforcements are 1 link for right and a -1 scaled link for the left side. Another example is for me the F16 landing gear. After I have modelled the fuselage to scale and imported the landing gear assembly I realised that compared to the blueprints the landing gear wasn't to scale. Simple solution....use the link scale. Not something to display during an engineering exam but a solution none the less. It's like having classes in programming.

I am not a coder and I can only imagine the complexity of managing links but please do not remove this feature. If it can give problems just hide it under the "show all" menu so only the users that really want to use it will use it.
wmayer
Site Admin
Posts: 15971
Joined: Thu Feb 19, 2009 10:32 am

Re: Assembly3 preview

Postby wmayer » Sun Jun 28, 2020 12:03 pm

Did you ever make a comparison cost/benefit of this functionality ?
What are the real-world use-cases for this ?
Isn't there another way to achieve the desired goal ?
Should this really be part of FreeCAD v0.19 ?
What I can tell you is that the project founder JRiegel was absolutely against a scaling function and most of the very experienced CAD engineers agreed with him. The recommended way is to change the parameters of the features instead.

https://forum.freecadweb.org/viewtopic.php?t=1341
https://forum.freecadweb.org/viewtopic. ... 515#p33262
https://forum.freecadweb.org/viewtopic. ... 271#p58833
https://forum.freecadweb.org/viewtopic.php?t=40055

In OCC there are two scaling functions implemented:
BRepBuilderAPI_Transform
OCCT wrote: //! Geometric transformation on a shape.
//! The transformation to be applied is defined as a
//! gp_Trsf transformation, i.e. a transformation which does
//! not modify the underlying geometry of shapes.
//! The transformation is applied to:
//! - all curves which support edges of a shape, and
//! - all surfaces which support its faces.
//! A Transform object provides a framework for:
//! - defining the geometric transformation to be applied,
//! - implementing the transformation algorithm, and
//! - consulting the results.
BRepBuilderAPI_GTransform
OCCT wrote: //! Geometric transformation on a shape.
//! The transformation to be applied is defined as a gp_GTrsf
//! transformation. It may be:
//! - a transformation equivalent to a gp_Trsf transformation, the
//! most common case: you should , however, use a BRepAPI_Transform
//! object to perform this kind of transformation; or
//! - an affinity, or
//! - more generally, any type of point transformation which may
//! be defined by a three row, four column matrix of transformation.
//! In the last two cases, the underlying geometry of the
//! following shapes may change:
//! - a curve which supports an edge of the shape, or
//! - a surface which supports a face of the shape;
//! For example, a circle may be transformed into an ellipse when
//! applying an affinity transformation.
//! The transformation is applied to:
//! - all the curves which support edges of the shape, and
//! - all the surfaces which support faces of the shape.
//! A GTransform object provides a framework for:
//! - defining the geometric transformation to be applied,
//! - implementing the transformation algorithm, and
//! - consulting the result.
With BRepBuilderAPI_Transform only uniform scaling works well. When trying to do non-uniform scaling it may produce garbage. BRepBuilderAPI_GTransform supports non-uniform scaling but it always replaces the underlying geometry with b-spline curves or surfaces, even simple geometries like lines or planes. In the past a model with many b-spline surfaces was known to often cause problems with boolean operations. I don't know if or how much this has been improved.
FCuser2019
Posts: 37
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly3 preview

Postby FCuser2019 » Sun Jun 28, 2020 9:45 pm

OficineRobotica wrote:
Sun Jun 28, 2020 11:21 am
...
I am not a coder and I can only imagine the complexity of managing links but please do not remove this feature. If it can give problems just hide it under the "show all" menu so only the users that really want to use it will use it.
Hello, I agree with OficineRobotica: the possibility to use the -1 scale on a certain axis to obtain the reflection of the linked object is very useful and, since I discovered it, I use it a lot. Please do not eliminate this very useful feature.
Thanks .
User avatar
Gregory son of Carl
Posts: 50
Joined: Mon Apr 06, 2020 7:42 pm
Location: California

Re: Assembly3 preview

Postby Gregory son of Carl » Tue Jun 30, 2020 3:14 am

Zolko wrote:
Sun Jun 28, 2020 10:52 am
What are the real-world use-cases for this ?
I think the scaling parameters are useful for modelling assemblies with elastically deformed components. For example, a car suspension system contains springs that are compressed under the weight of the car while in a resting state. The springs are only shorter while in the car suspension assembly, so it's nice to be able to represent this without creating a separate model just for the assembly. Linear scaling doesn't perfectly represent how a spring deforms, but it's a step up from having it stick out awkwardly.