YAML Workspace

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
User avatar
mambix
Posts: 6
Joined: Tue Jan 30, 2018 3:53 pm

YAML Workspace

Postby mambix » Mon Feb 05, 2018 10:16 am

Last year I created new YAML Workspace as I needed to quickly import STL files into FreeCAD for pre-fabrication check. I design a lot of parts that need to be cut from plywood with CO2 laser cutter. To avoid fixing errors in design I have python scripts that create STL files from my DXF designs. And YAML workspace allows me to easily import parts and check them in 3D space for correct fit.

GitHub: https://github.com/Mambix/FreeCAD-yaml-workspace

Hopefully it makes more sense after looking at this short video:
phpBB [video]


In first part I manually import parts, move them, apply colour and transparency.
In last part of the video I use my YAML Workspace to automate the process.

So next time I fix something in my DXF files and recreate STL files. I can discard FreeCAD document and import it again with new shape.

Hope this tools comes handy to more people that look to automate their design and manufacturing process.
User avatar
Kunda1
Posts: 4290
Joined: Thu Jan 05, 2017 9:03 pm

Re: YAML Workspace

Postby Kunda1 » Mon Feb 05, 2018 4:07 pm

Very cool. Does this work on Linux/MacOS as well ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
mambix
Posts: 6
Joined: Tue Jan 30, 2018 3:53 pm

Re: YAML Workspace

Postby mambix » Mon Feb 05, 2018 4:48 pm

I will try on macOS.

I'm having issues with this on Linux atm. FreeCAD freezes on import. Did not figure out yet why. I need to investigate it more and then file a bug if it turns out to be one in FreeCAD. Don't think it has anything to do with the workspace code at this point.
User avatar
Kunda1
Posts: 4290
Joined: Thu Jan 05, 2017 9:03 pm

Re: YAML Workspace

Postby Kunda1 » Mon Feb 05, 2018 5:09 pm

mambix wrote:
Mon Feb 05, 2018 4:48 pm
I'm having issues with this on Linux atm. FreeCAD freezes on import. Did not figure out yet why. I need to investigate it more and then file a bug if it turns out to be one in FreeCAD. Don't think it has anything to do with the workspace code at this point.
debugging
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: YAML Workspace

Postby NormandC » Tue Feb 06, 2018 3:46 am

Hello mambix,

Just saying, it's not called a workspace in FreeCAD-speak, but a workbench. ;) Workbenches
User avatar
microelly2
Posts: 4247
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: YAML Workspace

Postby microelly2 » Tue Feb 06, 2018 6:37 am

Nice idea.
I have started an interpreter for a special syntax which merges yaml and the kivy language.
I called it miki. there are some improvements against yaml, so I can repeat keys
my idea was to have the same syntax for qt gui, part design and assembly and inventor scenes.


http://freecadbuch.de/doku.php?id=blog: ... g_erzeugen
https://kivy.org/docs/api-kivy.lang.html

Image
User avatar
mambix
Posts: 6
Joined: Tue Jan 30, 2018 3:53 pm

Re: YAML Workspace

Postby mambix » Tue Feb 06, 2018 11:41 am

Kunda1 wrote:
Mon Feb 05, 2018 5:09 pm
mambix wrote:
Mon Feb 05, 2018 4:48 pm
I'm having issues with this on Linux atm. FreeCAD freezes on import. Did not figure out yet why. I need to investigate it more and then file a bug if it turns out to be one in FreeCAD. Don't think it has anything to do with the workspace code at this point.
debugging
MacOS: I had to manually copy PyYAML files to FreeCAD's internal python2.7 to make it work.
User avatar
mambix
Posts: 6
Joined: Tue Jan 30, 2018 3:53 pm

Re: YAML Workspace

Postby mambix » Tue Feb 06, 2018 11:44 am

NormandC wrote:
Tue Feb 06, 2018 3:46 am
Hello mambix,

Just saying, it's not called a workspace in FreeCAD-speak, but a workbench. ;) Workbenches

Ok, but I don't want to rename the whole thing again :lol:

As long as ppl find it useful no one cares right 8-)
User avatar
mambix
Posts: 6
Joined: Tue Jan 30, 2018 3:53 pm

Re: YAML Workspace

Postby mambix » Tue Feb 06, 2018 11:47 am

microelly2 wrote:
Tue Feb 06, 2018 6:37 am
Nice idea.
I have started an interpreter for a special syntax which merges yaml and the kivy language.
I called it miki. there are some improvements against yaml, so I can repeat keys
my idea was to have the same syntax for qt gui, part design and assembly and inventor scenes.


http://freecadbuch.de/doku.php?id=blog: ... g_erzeugen
https://kivy.org/docs/api-kivy.lang.html
Nice!

I need to add support for simple objects too. And I'm planning to add the option to specify STL files by URL so you can add objects that you can find models you can find on the web. Download and store them locally, next import just use the local stored copy of that model.

Comes handy when designing 3d printers and PC cases as you can import motherboard or GPU models to see how it fits.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: YAML Workspace

Postby NormandC » Thu Feb 08, 2018 3:18 am

mambix wrote:
Tue Feb 06, 2018 11:44 am
As long as ppl find it useful no one cares right 8-)
Some of us do care about consistency in naming.

But it's your work, you are free to do as you please.