Assembly3 preview

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
freecad-heini-1
Veteran
Posts: 7788
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Assembly3 preview

Post by freecad-heini-1 »

Gentlemen, nice to see your teamwork in such a constructive manner.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

easyw-fc wrote: Fri Jun 08, 2018 1:44 pm For a better comparison, would it be possible to have also an option to convert the Links to only Part containers when exporting the file?
For exporting, there is no need to change object type, just call Part::getTopoShape(), which is the work horse behind python Part.getShape(). But then that means I'll have to change upstream exporter code. But what exactly do you want to compare by doing this?
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: Fri Jun 08, 2018 2:52 pm For exporting, there is no need to change object type, just call Part::getTopoShape(), which is the work horse behind python Part.getShape(). But then that means I'll have to change upstream exporter code. But what exactly do you want to compare by doing this?
I would like to let both exporters cohabit till the new branch get a full stability with a larger user audience.

freecad-heini-1 wrote: Fri Jun 08, 2018 2:23 pm Gentlemen, nice to see your teamwork in such a constructive manner.
may be we are too involved into FC to keep this at a non emotional level
Image
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

easyw-fc wrote: Fri Jun 08, 2018 3:17 pm I would like to let both exporters cohabit till the new branch get a full stability with a larger user audience.
In that case, I'd suggestion using a macro. I'll modify the script you passed to me tomorrow. BTW, the hang problem is fixed. Any other problem you found?
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: Fri Jun 08, 2018 3:37 pm In that case, I'd suggestion using a macro. I'll modify the script you passed to me tomorrow.
thx, I'll appreciate it :D
realthunder wrote: Fri Jun 08, 2018 3:37 pm BTW, the hang problem is fixed. Any other problem you found?
Just started testing, but it seems many issue have gone :)
I noticed that in some case, some of the STEP objects get strange colors... (here a test with arietta imported with both modes)
arietta-color-comparison.png
arietta-color-comparison.png (225.85 KiB) Viewed 2201 times

I think this A3 branch would add a new 'STEP' improvement for CAD interoperability, apart the other big one on the assembly and constraints wb that was still missing ;)

EDIT
frame rate is still better in FC mainstream with VBO enabled...
a part the fps displayed, you can see that the FC mainstream board is turning faster than the A3 branch one...
I'm using the following code for spinning comparison

Code: Select all

FreeCADGui.ActiveDocument.ActiveView.startAnimating(0,1,0,0.2)
May be you can get some useful reference here:
https://forum.freecadweb.org/viewtopic. ... 7&start=20
frame-rate-comparison.gif
frame-rate-comparison.gif (876.68 KiB) Viewed 2190 times
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

easyw-fc wrote: Fri Jun 08, 2018 3:55 pm I noticed that in some case, some of the STEP objects get strange colors... (here a test with arietta imported with both modes)
STEP file can save colors for both edge and face. And this particular STEP file sets both face and edge color with the same value. It is weird when displayed in FC. I'll ignore the edge color in case the shape has face, and the face color is the same as edge color.
May be you can get some useful reference here:
https://forum.freecadweb.org/viewtopic. ... 7&start=20
Thanks, I'll check later.


Here is script for copying linked objects. You can select any object(s) in any document(s), and switch to a new document before calling this function to copy the object(s) into that document.

Code: Select all

import FreeCAD, FreeCADGui, Part
def copy_obj(parentObj=None,doc=None,subname=''):
    if not doc:
        # 'doc' allows you to copy object into another document.
        # If not give, then use the current document.
        doc = FreeCAD.ActiveDocument

    if not parentObj:
        # If no object is given, then obtain selection from all opened document
        parentObj = []
        for sel in FreeCADGui.Selection.getSelectionEx('*'):
            parentObj.append(sel.Object)
        if not parentObj:
            return
    if isinstance(parentObj,(tuple,list)):
        if len(parentObj) == 1:
            copy = copy_obj(parentObj[0],doc)
        else:
            part = doc.addObject('App::Part','Part')
            for o in parentObj:
                copy = copy_obj(o,doc)
                if copy:
                    part.addObject(copy)
            copy = part
        if copy:
            FreeCADGui.SendMsgToActiveView("ViewFit")
            copy.recompute(True)
        return copy

    obj,matrix = parentObj.getSubObject(subname,1,FreeCAD.Matrix(),not subname)
    if not obj:
        return
    # getSubObjects() is the API for getting child of a group. It returns a list
    # of subnames, and the subname inside may contain more than one levels of
    # hierarchy. Assembly uses this API to skip hierarchy to PartGroup.
    subs = obj.getSubObjects()
    if not subs:
        # Non group object will return empty subs
        shape = Part.getShape(obj,transform=False)
        if shape.isNull():
            return
        shape.transformShape(matrix,False,True)
        copy = doc.addObject('Part::Feature',obj.Name)
        copy.Label = obj.Label
        copy.Shape = shape
        copy.ViewObject.mapShapeColors(obj.Document)
        return copy

    part = doc.addObject('App::Part',obj.Name)
    part.Label = obj.Label
    part.Placement = FreeCAD.Placement(matrix)
    for sub in subs:
        sobj,parent,childName,_ = obj.resolve(sub)
        if not sobj:
            continue
        copy = copy_obj(obj,doc,sub)
        if not copy:
            continue
        vis = parent.isElementVisible(childName)
        if vis < 0:
            copy.Visibility = sobj.Visibility
        else:
            copy.Visibility = vis>0
        part.addObject(copy)
    return part
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 »

I have trace the code for VBO rendering, at least on Linux, my code has no effect on VBO. That is really a mystery, and I really want to know why it behave like that on your machine. Here is a screencast showing the effect of VBO active and inactive. Rendering transparency disables VBO. The 17fps is about the same for App::Part on my machine.

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
kwahoo
Posts: 680
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Assembly3 preview

Post by kwahoo »

Excuse me interrupting your (interesting!) rendering discussion, but I have to report something confusing me in 0.6.2 release;)

Is offset property in the PlaneAlignment constraint supposed to work?

If I set "Offset" value to eg. 10mm it gives me an error:

Code: Select all

<asm3.gui> 846.976399 - gui.py(226): command "asm3CmdSolve" exception
Traceback (most recent call last):
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/FCADLogger.py", line 106, in report
    return func(*args,**kargs)
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/solver.py", line 348, in solve
    return _solve(*args,**kargs)
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/solver.py", line 318, in _solve
    Solver(assembly,reportFailed,dragPart,recompute,rollback)
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/solver.py", line 67, in __init__
    ret = Constraint.prepare(cstr,self)
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/constraint.py", line 469, in prepare
    return mcs.getProxy(obj).prepare(obj,solver)
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/constraint.py", line 907, in prepare
    return super(BaseCascade,cls).prepare(obj,solver)
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/constraint.py", line 895, in prepare
    h = func(*params,group=solver.group)
  File "/tmp/.mount_FreeCAF9bJ5F/usr/lib/freecad-daily/Ext/freecad/asm3/system.py", line 233, in addPlaneAlignment
    d, pln2.origin.entity, pln1.entity.entity, group=group))
AttributeError: 'int' object has no attribute 'entity'
zawieszenie.fcstd
(34.77 KiB) Downloaded 68 times

Code: Select all

OS: Ubuntu 18.04 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.5235 (Git shallow) AppImage
Build type: None
Branch: LinkStage3
Hash: ccaa87e12aaadbd3106607fc503542a863b742da
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Polish/Poland (pl_PL)
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Post by easyw-fc »

realthunder wrote: Sat Jun 09, 2018 3:11 pm Here is script for copying linked objects. You can select any object(s) in any document(s), and switch to a new document before calling this function to copy the object(s) into that document.
Thanks a lot! it works perfectly!
realthunder wrote: Sat Jun 09, 2018 4:52 pm I have trace the code for VBO rendering, at least on Linux, my code has no effect on VBO. That is really a mystery, and I really want to know why it behave like that on your machine. Here is a screencast showing the effect of VBO active and inactive. Rendering transparency disables VBO. The 17fps is about the same for App::Part on my machine.
I see your result ... this is strange...
I'm going to see if I can find the e-mails I had with Jean Marie about our VBO testing to get some tips...

BTW I made some test also on STEP with external references and the results are very good... an other very big STEP ahead!
Thx
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Assembly3 preview

Post by Kunda1 »

BTW, will Assembly3 solve issue #2462 ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply