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 »

New bug fix version released, with the above mentioned new settings.
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
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Post by easyw-fc »

realthunder wrote: Wed Jun 13, 2018 7:42 am New bug fix version released, with the above mentioned new settings.
Hi @realthunder
this is much better... very good!

I'm attaching a comparison on GPU use of FC main branch and A3 branch.
Now frame rates are similar and GPU is well involved in both branches.

Still FC main branch has a bit gain in frame rates and GPU occupation
I get 48fps and almost 80-90% of GPU use in main branch
compared to 38fps and 60-75% of GPU use in A3 branch (tested both with On and Auto cache)

EDIT: I also noticed that if I stop the rotation in A3 and restart it, fps falls down to 20fps (almost half of the first result), in main branch it re-gains the previous value.

FC main branch
fps-fc-018.gif
fps-fc-018.gif (401.86 KiB) Viewed 3263 times

A3 branch
fps-a3-064-cache-auto.gif
fps-a3-064-cache-auto.gif (388.83 KiB) Viewed 3263 times

PS I'm using Open Hardware Monitor to test GPU load.
User avatar
OakLD
Posts: 131
Joined: Fri Jan 12, 2018 7:38 pm
Location: Brno

Re: Assembly3 preview

Post by OakLD »

Hello Realthunder and the team!

There was a quiet period and then I just blinked and there's so much happening here...

I did a new CUBE alignment test in 0.6.4 and I have to conclude, that it was mostly SUCCESSFUL.

First I tried simple PlaneCoincident constraint and it mostly workded as expected (and it was working in previous releases too). The only trouble was with setting Offset X and Y; I'm not sure how it supposed to work, but it kind of rotated the upper cube on the bottom one. My guess is, that it tried to offset it in X, but it took different coordinate system to align against.

Then I tried the simple treble Plane/Plane constraint (called PlaneAlignment in ASM3), which is the most common constraint in real assembly design and did not work in older releases. Mostly I got solver errors when applying the 2nd constraint. With the 0.6.4 I did get warnings like:

Code: Select all

	<asm3.sys> 631.943 - sys_slvs.py(49): redundant constraints

...but the solver was stable and readily applied required parameters to the cubes position in any given order.
ATest_PlaneAligmnment.PNG
ATest_PlaneAligmnment.PNG (59.1 KiB) Viewed 3243 times
Then after about less then 10 random changes (in PlateAlignment/001/002 Offset parameter), I got some errors:

Code: Select all

	<asm3.sys> 16.163 - solver.py(111): List of failed constraint:
	"Constraint001(PlaneAlignment)"<PlaneAlignment>, handle: 1
	"Constraint001(PlaneAlignment)"<PlaneAlignment>, handle: 2
	"Constraint002(PlaneAlignment001)"<PlaneAlignment>, handle: 3
	"Constraint002(PlaneAlignment001)"<PlaneAlignment>, handle: 4
	"Constraint003(PlaneAlignment002)"<PlaneAlignment>, handle: 5
	"Constraint003(PlaneAlignment002)"<PlaneAlignment>, handle: 6
	<asm3.gui> 4189.622 - gui.py(226): command "asm3CmdSolve" exception
	Traceback (most recent call last):
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\FCADLogger.py", line 106, in report
		return func(*args,**kargs)
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\solver.py", line 348, in solve
		return _solve(*args,**kargs)
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\solver.py", line 318, in _solve
		Solver(assembly,reportFailed,dragPart,recompute,rollback)
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\solver.py", line 113, in __init__
		objName(assembly),e.message))
	RuntimeError: Failed to solve "Assembly": inconsistent constraints

	<asm3.sys> 90.811 - solver.py(111): List of failed constraint:
	"Constraint001(PlaneAlignment)"<PlaneAlignment>, handle: 1
	"Constraint001(PlaneAlignment)"<PlaneAlignment>, handle: 2
	"Constraint002(PlaneAlignment001)"<PlaneAlignment>, handle: 3
	"Constraint002(PlaneAlignment001)"<PlaneAlignment>, handle: 4
	"Constraint003(PlaneAlignment002)"<PlaneAlignment>, handle: 5
	"Constraint003(PlaneAlignment002)"<PlaneAlignment>, handle: 6
	<asm3.gui> 90.806 - gui.py(226): command "asm3CmdSolve" exception
	Traceback (most recent call last):
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\FCADLogger.py", line 106, in report
		return func(*args,**kargs)
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\solver.py", line 348, in solve
		return _solve(*args,**kargs)
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\solver.py", line 318, in _solve
		Solver(assembly,reportFailed,dragPart,recompute,rollback)
	  File "C:\Users\Dub\Downloads\FreeCAD-asm3-20180613-2d3e9d57-3427dc0-Win64\Ext\freecad\asm3\solver.py", line 113, in __init__
		objName(assembly),e.message))
	RuntimeError: Failed to solve "Assembly": inconsistent constraints

...and the cubes froze, as the solver failed to resolve constraints. After few changes and recompute sequenses it started to work again. I have to say, that all the time I had vlaues within [-2,-9] range for X and Y and [0,5] for the Z axis. So there should be no singularity or any other issues in the calculation and it is pretty strange that the solver stopped working and resumed again.

Anyhow, I see a great improvement! Great job! Now I can do some tests on real and more complicated assemblies :-)
Regards,

Oak
jhk1968
Posts: 7
Joined: Thu Feb 15, 2018 8:46 am

Re: Assembly3 preview

Post by jhk1968 »

Hello to all you bussy programmers and testers and users,
first of all I want to say big thanks to all of you, making this big and useful cad-tool possible.

I tried to make assembly using separate models, bringing them together with "projekt zusammenführen".
I tried this with assembly, assembly2 and with assembly3 and I could find a way to make under keeping the relationchip to the separate models.
This means if I modify the separate model I have to delete and newly to insert into the assembly.

Can annyone point out where I have to read in the instruction manual ore anywhere else or what I have to do to keep the relationchip between the separate part model and the assembly ?

Thank in previous and a nice evening
Jörg
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

jhk1968 wrote: Wed Jun 13, 2018 5:58 pm Can annyone point out where I have to read in the instruction manual ore anywhere else or what I have to do to keep the relationchip between the separate part model and the assembly ?
You can follow this tutorial to find out how to create assembly with external parts.

Speaking of modification of external models, you just reminded me that I haven't added auto correction of missing geometry element reference yet. I'll do that in the next release. Anyway, for a good practice, you should always create a local assembly in each model file that you want to use as part. You don't have to add any relation/constraint to that assembly. It serves to limit the damaging effect of geometry element reference change due to model change.

Once you've modified you model, please check under Elements group, and make sure all its element are referencing the correct geometry element. See here for an explanation of the concepts of Element.
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 bug fix version released. Hopefully the last one.

I think I have finally figured out how Coin render cache works. Coin manages the render cache using SoSeparator node, yes, we know that. But the document is not clear how the cache is handled in a hierarchy, i.e when a SoSeparator node has child/children of Soseparator. Here is (I think) how it works, by the look of its source code. SoSeparator's cache only works when all its children node's GLRender() produces valid cacheable results. The problem, is that once a child SoSeparator's cache is established, it will deactivate its parent's cache. That has obvious negative effect on scene graph with deep hierarchy. Because in order to get the cache, the render code still has to traverse deep into the hierarchy.

So, in order to maximize the caching benefit, we actually need to disable all intermediate SoSeparator caching, and only turn on the cache at the scene graph root node. This centralized cache means almost no traversing is required. It still can't beat a simple shape rendering time (you can use Part's simple copy command to test), because the cache is basically recording all OpenGL calls into the graphics memory, and replay it at server side, so obviously hierarchical rendering involves a lot more calls.

The previous exposed render cache setting has changed its meaning, and is not really that important any more. I'd suggest to leave it as auto. I have changed 3d viewer to automatically turn off intermediate caching when doing animation, spinning, panning and zooming. Intermediate, or in other word, distributed caching is still useful, as it allows quick localized cache update without affecting the whole scene. Whenever you move mouse over some shape, the preselection highlight will cause cache update.

PS. this intermediate caching auto turning off only works for view providers derived from Part. Python objects that adding their own SoSeparator nodes must disable its own cache manually.
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
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Post by easyw-fc »

realthunder wrote: Thu Jun 14, 2018 3:20 pm New bug fix version released. Hopefully the last one.

I think I have finally figured out how Coin render cache works.
I think so... the GPU goes till 99% :D

I noticed only a different behavior compared to main branch when handling a big model like i.e.
00_server-tla_25ou-barreleye_asm.stp 7zipped

Both branches are very responsive when the model get moved by the code (EDIT: A3 is even faster on a better GPU pc /EDIT)

Code: Select all

FreeCADGui.ActiveDocument.ActiveView.startAnimating(0,1,0,0.2)

or by clicking on the main views (Front, Top, Bottom etc.)

But if I use the mouse and I drag the object view to rotate the viewing, the main branch is quite responsive but the A3 branch freezes for a while before react to the dragging.
Please feel free to ask if you need more details or a screenshot of the behavior.

Thx
Last edited by easyw-fc on Thu Jun 14, 2018 6:22 pm, edited 1 time in total.
freecad-heini-1
Veteran
Posts: 7788
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Assembly3 preview

Post by freecad-heini-1 »

easyw-fc wrote: Thu Jun 14, 2018 5:50 pm I noticed only a different behavior compared to main branch when handling a big model like i.e.
[url=https://github.com/sgrogan/FreeCAD/rele ... teptest.7z]00_server-tla_25ou-barreleye_asm.stp 7zipped[/url
My computer is curently loading this file since 1 hour 45 minutes and the viewport still is blank.

@maurice, how long will it take to load this file?
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Post by easyw-fc »

freecad-heini-1 wrote: Thu Jun 14, 2018 5:58 pm
easyw-fc wrote: Thu Jun 14, 2018 5:50 pm I noticed only a different behavior compared to main branch when handling a big model like i.e.
[url=https://github.com/sgrogan/FreeCAD/rele ... teptest.7z]00_server-tla_25ou-barreleye_asm.stp 7zipped[/url
My computer is curently loading this file since 1 hour 45 minutes and the viewport still is blank.

@maurice, how long will it take to load this file?
it is about 360 seconds on my PC...
I have an SSD, so loading may be faster than with a normal HD.

But I cannot load at all the very huge file of 1GB...
freecad-heini-1
Veteran
Posts: 7788
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Assembly3 preview

Post by freecad-heini-1 »

easyw-fc wrote: Thu Jun 14, 2018 6:01 pm
freecad-heini-1 wrote: Thu Jun 14, 2018 5:58 pm
easyw-fc wrote: Thu Jun 14, 2018 5:50 pm I noticed only a different behavior compared to main branch when handling a big model like i.e.
[url=https://github.com/sgrogan/FreeCAD/rele ... teptest.7z]00_server-tla_25ou-barreleye_asm.stp 7zipped[/url
My computer is curently loading this file since 1 hour 45 minutes and the viewport still is blank.

@maurice, how long will it take to load this file?
it is about 360 seconds on my PC...
I have an SSD, so loading may be faster than with a normal HD.

But I cannot load at all the very huge file of 1GB...
Sorry, this is not the 1GB file. Currently I try to open the 1GB file since almost 1:57.
Do you know if there is a possibility so check how many percent are already loaded?
Post Reply