Assembly 2 workbench for FreeCAD v0.15
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Assembly 2 workbench for FreeCAD v0.15
Hi Everyone,
I have written an assembly workbench for FreeCAD v0.15, which I am posting here for everyone's perusal.
The assembly2 wb is available together with a detailed description at
https://github.com/hamish2014/FreeCAD_assembly2
I realize that there is mostly likely heavy development on FreeCAD's inbuilt assembly wb, which i could have just used for my assembly needs.
However since FreeCAD provides such an excellent environment for building custom wbs, I decided to rather write my own wb exactly tailored to my needs.
Writing the assembly2 wb furthermore gave me a chance to play around with the maths behind CAD assembly codes, math which I have always wondered about...
Hope someone else finds the assembly2 wb useful
I have written an assembly workbench for FreeCAD v0.15, which I am posting here for everyone's perusal.
The assembly2 wb is available together with a detailed description at
https://github.com/hamish2014/FreeCAD_assembly2
I realize that there is mostly likely heavy development on FreeCAD's inbuilt assembly wb, which i could have just used for my assembly needs.
However since FreeCAD provides such an excellent environment for building custom wbs, I decided to rather write my own wb exactly tailored to my needs.
Writing the assembly2 wb furthermore gave me a chance to play around with the maths behind CAD assembly codes, math which I have always wondered about...
Hope someone else finds the assembly2 wb useful
-
- Posts: 395
- Joined: Fri Oct 07, 2011 8:58 pm
- Location: Beaverton,Oregon, USA
- Contact:
Re: Assembly 2 workbench for FreeCAD v0.15
I have been using this today and have found it to have some features that I like. I wasn't able to get any of the constraints to work and I do have numpy and scipy installed. But, I really like the import part and reload part commands that you have. That has been very useful for me today. Just being able to import FreeCAD objects into my assembly file and being able to reload them after I have edited them in their original file is very nice.
I did comment out lines 61 through 64 (the lines that randomly place the part on import) in importPart.py because since I couldn't get assembly constraints to work, I prefer to know where my parts are located to begin with.
Good job.
I did comment out lines 61 through 64 (the lines that randomly place the part on import) in importPart.py because since I couldn't get assembly constraints to work, I prefer to know where my parts are located to begin with.
Good job.
-
- Posts: 395
- Joined: Fri Oct 07, 2011 8:58 pm
- Location: Beaverton,Oregon, USA
- Contact:
Re: Assembly 2 workbench for FreeCAD v0.15
This was the error that I got when trying to constrain two planes on two parts that had been imported using your new commands:
Code: Select all
creating planeConstraint01
assembly2solver parsing planeConstraint01
violated constraints: planeConstraint01
objects associated to these constraints: Unnamed_import01, block2_import01
repective connectivety [1, 1]
variableManager.getValues() [6.84337598002, 3.18146, 93.4783563956, 0.0, 0.0, 0.0]
{'imode': 9, 'smode': 'Iteration limit exceeded', 'fOpt': nan, 'iter': 161, 'xOpt': [nan, nan, nan, nan, nan, nan]}
{'imode': 9, 'smode': 'Iteration limit exceeded', 'fOpt': nan, 'iter': 161, 'xOpt': [nan, nan, nan, nan, nan, nan]}
{'imode': 9, 'smode': 'Iteration limit exceeded', 'fOpt': nan, 'iter': 161, 'xOpt': [nan, nan, nan, nan, nan, nan]}
{'imode': 9, 'smode': 'Iteration limit exceeded', 'fOpt': nan, 'iter': 161, 'xOpt': [nan, nan, nan, nan, nan, nan]}
{'imode': 9, 'smode': 'Iteration limit exceeded', 'fOpt': nan, 'iter': 161, 'xOpt': [nan, nan, nan, nan, nan, nan]}
{'imode': 9, 'smode': 'Iteration limit exceeded', 'fOpt': nan, 'iter': 161, 'xOpt': [nan, nan, nan, nan, nan, nan]}
{'imode': 9, 'smode': 'Iteration limit exceeded', 'fOpt': nan, 'iter': 161, 'xOpt': [nan, nan, nan, nan, nan, nan]}
UNABLE TO SOLVE ASSEMBLY CONSTRAINTS. Info:
optimization algorithm could not minimize the norm of constraint errors
optimization algorithm used : scipy.optimize.fmin_slsqp (Sequential Least SQuares Programming)
optimization warning message : Iteration limit exceeded
imode: 9
smode: Iteration limit exceeded
fOpt: nan
iter: 161
xOpt: [nan, nan, nan, nan, nan, nan]
UNABLE TO SOLVE ASSEMBLY CONSTRAINTS. refer to the Report View window for info
Re: Assembly 2 workbench for FreeCAD v0.15
Hi danielfalck, glad you found the wb useful
Regarding the constraint solver breaking down, please pm FreeCAD assembly file with the parts already imported and the constraints setup. I will then see if i can fix the bug.
Regarding the constraint solver breaking down, please pm FreeCAD assembly file with the parts already imported and the constraints setup. I will then see if i can fix the bug.
Re: Assembly 2 workbench for FreeCAD v0.15
Hi Hamish
Can I offer you a tip on using Git? Its best to keep you "master" branch in your repository in sync with official FreeCAD master, and then do all your development in a branch.
Jim
Can I offer you a tip on using Git? Its best to keep you "master" branch in your repository in sync with official FreeCAD master, and then do all your development in a branch.
Jim
Re: Assembly 2 workbench for FreeCAD v0.15
very intuitive! worked perfect on first try.
Re: Assembly 2 workbench for FreeCAD v0.15
Once again, amazing work hamish! Now I am getting afraid, what will be the next workbench that you will attack
Re: Assembly 2 workbench for FreeCAD v0.15
lol, thanks yorik. Do not think of them as attacks but rather as suggestions for the next version of FreeCAD...
Also thank jim for git the advice, but i will leave things as they are for the moment, falling quite far behind with my work ...
Also thank jim for git the advice, but i will leave things as they are for the moment, falling quite far behind with my work ...
Re: Assembly 2 workbench for FreeCAD v0.15
Of course, only joking. But it's always cool to see someone else think over a problem in a new way and solve it in a simple manner...hamish wrote:Do not think of them as attacks but rather as suggestions for the next version of FreeCAD...
Re: Assembly 2 workbench for FreeCAD v0.15
I gave it a try. It is quite intuitive. I had problems though trying to align to circular faces to their corresponding axes... probably I did not dedicate enough time to it... looking forward for more!!