CuraEngine Plugin

Need help, or want to share a macro? Post here!
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: CuraEngine Plugin

Postby shoogen » Thu May 15, 2014 8:44 am

cblt2l wrote:For some reason it does not reload some of the macro files automatically.
This a python design issue. The normal way to work around this, is to import the module once again, to make sure to have a reference to them in the local namespace. Then one can issue the "reload" command with the reference (name) of the module.
This really aids development, as long as all modules are designed to handle this correctly.
When it comes to working with FreeCAD Python Features. The Proxies of those are not updated automatically and their initialization is often not designed to be changed.
User avatar
quick61
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: CuraEngine Plugin

Postby quick61 » Thu May 15, 2014 6:06 pm

On the subject of the machine parameters, I'm wondering how important is is to define what Gcode flavor one wishes to use with CuraEngine. In Cura's GUI > Machine > Machine settings... It gives you the choice of RepRap (Marlin/Sprinter), UltiGCoad, or MakerBot. If it is defaulting to something other than RepRap (Marlin/Sprinter), what I am using, this might explain why the arc and circle travel is not near as smooth as with other slicers or Cura 13.x

Might be one of the first things you add to MachineDef or maybe just SlicerPanel if it would make things simpler.

Other than that, Everything is still working great with the latest push you made. Once things get settled in a bit more, might want to hit Jim ( jmaustpc) up for a couple of Icons. He is very good at those, unless you have some in mind.

Mark

Edit - I ran the Gcode from both the CuraEngine output from FreeCAD and the output from Cura it's self and they both work about the same. If anything, the output of CuraEngine from FreeCAD might be a bit better. So maybe no worries? :?
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Re: CuraEngine Plugin

Postby cblt2l » Fri May 16, 2014 3:31 am

shoogen wrote:This a python design issue. The normal way to work around this, is to import the module once again, to make sure to have a reference to them in the local namespace. Then one can issue the "reload" command with the reference (name) of the module.
Thanks for the tip shoogen. Can you point me to an example of where this is done in a freecad workbench?
quick61 wrote:On the subject of the machine parameters, I'm wondering how important is is to define what Gcode flavor one wishes to use with CuraEngine. In Cura's GUI > Machine > Machine settings... It gives you the choice of RepRap (Marlin/Sprinter), UltiGCoad, or MakerBot. If it is defaulting to something other than RepRap (Marlin/Sprinter), what I am using, this might explain why the arc and circle travel is not near as smooth as with other slicers or Cura 13.x
That's a good point Mark. I think as long as your using Marlin or Sprinter firmware you shouldn't have an issue since thats what curaengine defaults to, but the Ultimaker and Makerbot firmwares apparently do things a little different. Here's an excerpt from settings.h in curaengine:

Code: Select all

/**
 * RepRap flavored GCode is Marlin/Sprinter/Repetier based GCode.
 *  This is the most commonly used GCode set.
 *  G0 for moves, G1 for extrusion.
 *  E values give mm of filament extrusion.
 *  Retraction is done on E values with G1. Start/end code is added.
 *  M106 Sxxx and M107 are used to turn the fan on/off.
 **/
    GCODE_FLAVOR_REPRAP = 0,
/**
 * UltiGCode flavored is Marlin based GCode.
 *  UltiGCode uses less settings on the slicer and puts more settings in the firmware. This makes for more hardware/material independed GCode.
 *  G0 for moves, G1 for extrusion.
 *  E values give mm^3 of filament extrusion. Ignores the filament diameter setting.
 *  Retraction is done with G10 and G11. Retraction settings are ignored. G10 S1 is used for multi-extruder switch retraction.
 *  Start/end code is not added.
 *  M106 Sxxx and M107 are used to turn the fan on/off.
 **/
    GCODE_FLAVOR_ULTIGCODE = 1,
/**
 * Makerbot flavored GCode.
 *  Looks a lot like RepRap GCode with a few changes. Requires MakerWare to convert to X3G files.
 *   Heating needs to be done with M104 Sxxx T0
 *   No G21 or G90
 *   Fan ON is M126 T0 (No fan strength control?)
 *   Fan OFF is M127 T0
 *   Homing is done with G162 X Y F2000
 **/
    GCODE_FLAVOR_MAKERBOT = 2,

/**
 * Bits From Bytes GCode.
 *  BFB machines use RPM instead of E. Which is coupled to the F instead of independed. (M108 S[deciRPM])
 *  Need X,Y,Z,F on every line.
 *  Needs extruder ON/OFF (M101, M103), has auto-retrection (M227 S[2560*mm] P[2560*mm])
 **/
    GCODE_FLAVOR_BFB = 3,

/**
 * MACH3 GCode
 *  MACH3 is CNC control software, which expects A/B/C/D for extruders, instead of E.
 **/
    GCODE_FLAVOR_MACH3 = 4,
/**
 * RepRap volumatric flavored GCode is Marlin based GCode.
 *  Volumatric uses less settings on the slicer and puts more settings in the firmware. This makes for more hardware/material independed GCode.
 *  G0 for moves, G1 for extrusion.
 *  E values give mm^3 of filament extrusion. Ignores the filament diameter setting.
 *  Retraction is done with G10 and G11. Retraction settings are ignored. G10 S1 is used for multi-extruder switch retraction.
 *  M106 Sxxx and M107 are used to turn the fan on/off.
 **/
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: CuraEngine Plugin

Postby shoogen » Fri May 16, 2014 8:23 am

cblt2l wrote:Can you point me to an example of where this is done in a freecad workbench?
Say I changed anything in ModDraft/importSVG.py

Code: Select all

import importSVG
reload(importSVG)
But there is no guarantee that this will work with any module. For example i had to modify the redefinition of 'open' to deal with repeated invocation. IMHO this is a development shortcut and should not be used programmability.
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Re: CuraEngine Plugin

Postby cblt2l » Sat May 17, 2014 3:16 am

Ok, thanks for clearing that up. It would be nice to not have to restart freecad every time I make a little change in one of the python files. I'll play around and see how it works.
User avatar
quick61
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: CuraEngine Plugin

Postby quick61 » Wed May 21, 2014 4:00 am

The new UiLoader approach seems to be working here, at least on first look. Will be able to say more in a day or so.

So, does this mean things are back on track? Machine Parameters needs to save it's data, if you hadn't seen that yet. ;)

Oh, and while I'm typing, adding the spiralize option at some point might be nice. So far, this is my go-to slicer for most everything. no need to export the stl to Cure or anything else anymore. Just switch workbenches and write out the Gcode.

What would be real nice to have, again, sense I'm typing, is an option in the Workbench to "Save Copy Of Gcode To..." or just a "Save Gcode To", where the user could provide a path to the SD storage device or dedicated folder. It would save the step of opening the file browser of console and coping the file afterwards.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
quick61
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: CuraEngine Plugin

Postby quick61 » Thu May 22, 2014 11:09 pm

Quick Update - The UiLoader seems to of done the trick. The Workbench has been very stable for me. sliced several parts and did a lot of changing values, colsing the dialog, reponeing, slicing again, etc.

0.0 crashes. :)

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Re: CuraEngine Plugin

Postby cblt2l » Mon Jun 09, 2014 4:33 am

I made some fairly large changes today. Here's the rundown.

First, the printbed & printvolume are no longer cantered on the origin. They now lie in quadrant one so all X and Y values are positive. The new parameters X-Offset and Y-Offset represent the distance from your origin to the edge of your printbed. Basically now the coordinate system of freecad and the 3D Printer should be the same.

In addition to that, the Cura plugin now uses the position of the part(s) for gcode generation instead of having to manually position them with the spin boxes. Long story short, this means that the parts should be printed exactly how they appear on the printbed in freecad (assuming your machine definition parameters are correct). I changed the old part position spin boxes over to overrides, so you can go back to manually placing parts if the need arises.

I did some testing with multiple parts and everything seems to be working ok.
User avatar
quick61
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: CuraEngine Plugin

Postby quick61 » Mon Jun 09, 2014 5:49 pm

Those are some changes. I haven't had a chance to run all the way through it yet, but from what I see so far, looks good. No crashing or buggy behavior, and that's always a good sign. Lets hope it stays as rock solid as it has been sense your last commit.

I see you also created a Miscellaneous section in the Settings tab and placed Sprialize there. Much better place for it than in the Start/End tab. Looks like there is plenty of room there to add the Infill options, and maybe the Fix horrible tick boxes, but I would think that would be of a lower priority than the saving Gcode options.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
quick61
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: CuraEngine Plugin

Postby quick61 » Tue Jun 17, 2014 3:33 pm

A couple of things.

First, I'v been kicking around a few ideas of icons for the workbench. I have one for the printer definition but am kind of stuck on what the one for the slicer engine should be. I am kind of thinking a "sliced piston" but I sure would not mind some more ideas if you , (or anyone), has any. Used Tango colors and tried to hang with the overall theme. Use it or not, no big deal either way. It's my very first attempt at doing a "real" icon so...

Here is the one for the machine -
machine.svg
(32.31 KiB) Downloaded 144 times
machine64.png
64X64
machine64.png (3.4 KiB) Viewed 3171 times
machine32.png
32x32
machine32.png (1.46 KiB) Viewed 3171 times
machine16.png
16x16
machine16.png (662 Bytes) Viewed 3171 times
Item 2 - Found a bug -

I tried to use the support function last night for a print and it failed quite handily. Using CuraEngine 14.03 any attempt to include support results in a solid block that is so finely laced that the result is the printer nozzle wiggling back and forth almost in place while a glob of plastic builds up. :shock: Not good. Cura adds the support and works just fine, so I'm pretty sure it's in the settings. Anyway, it's something you might want to take a look at when you have a minute. I do notice that Cura 14.03 has a few more variables for support than the settings in the workbench. Could that be the problem, it's not getting all the info it needs?

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?