Assembly3 preview
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 7790
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: Assembly3 preview
Gentlemen, nice to see your teamwork in such a constructive manner.
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Assembly3 preview
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?
Re: Assembly3 preview
I would like to let both exporters cohabit till the new branch get a full stability with a larger user audience.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?
may be we are too involved into FC to keep this at a non emotional levelfreecad-heini-1 wrote: ↑Fri Jun 08, 2018 2:23 pm Gentlemen, nice to see your teamwork in such a constructive manner.
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Assembly3 preview
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?
Re: Assembly3 preview
thx, I'll appreciate itrealthunder 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.
Just started testing, but it seems many issue have gonerealthunder wrote: ↑Fri Jun 08, 2018 3:37 pm BTW, the hang problem is fixed. Any other problem you found?
I noticed that in some case, some of the STEP objects get strange colors... (here a test with arietta imported with both modes)
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)
https://forum.freecadweb.org/viewtopic. ... 7&start=20
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Assembly3 preview
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.
Thanks, I'll check later.May be you can get some useful reference here:
https://forum.freecadweb.org/viewtopic. ... 7&start=20
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
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Assembly3 preview
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.
Re: Assembly3 preview
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:
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'
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)
Re: Assembly3 preview
Thanks a lot! it works perfectly!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.
I see your result ... this is strange...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'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
Re: Assembly3 preview
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
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