Jump to content
UltiMaker Community of 3D Printing Experts

Start working with cura engine !


amirps
 Share

Recommended Posts

Posted · Start working with cura engine !

Hi ,

I'm developing an automation system for printing object directly from internet .

On the local host side, I need a program that read .STL files from a folder and do the following :

1.Generate G-Code from .stl file.

2.Generate a thumbnail view of model .

3.Estimate the price (I need printing meter,time,grams, like in cura)

:::

printer: Ultimaker .

OS:win 7 .

Experience with c++ and c# (intermediate ).

:::

My questions are :

1-Does CuraEngine provide above mentioned information ?

2-When I generate the G-code does CuraEngine has a routine to send it to the ultimaker ?

3-It's a bit vague for me, for example if we have a 4MB g-code file ,how does it transfer to the device ?

4-is there a help document on CuraEngine ? I dont want to read all the codes and figure it out myself I need to know how to use CuraEngine just to get the above mentioned information :|

thanks in advance :)

 

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The cura engine can transform stl models to G-code. Thats the main function of it all :)

    Depending on the branch that you use, the model is either excepted through pipes, or via a (local) socket. It will use those to return any G-Code it computes. The socket or pipe is also used to recieve settings.

    The engine does not transfer anything to the device. That is the task of the GUI. The engine only accepts models & settings and only returns a set of g-codes.

    All the documentation out there is on the github page or inside Daid's head (and a tiny bit in mine, as it's not my project).

    Your best bet would be to hack into the Cura python code, rip out the graphical stuff and use that to call the engine with the settings & model(s). Cura (Python part) can then send it to the printer.

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The cura engine can transform stl models to G-code. Thats the main function of it all :)

    Depending on the branch that you use, the model is either excepted through pipes, or via a (local) socket. It will use those to return any G-Code it computes. The socket or pipe is also used to recieve settings.

    The engine does not transfer anything to the device. That is the task of the GUI. The engine only accepts models & settings and only returns a set of g-codes.

    All the documentation out there is on the github page or inside Daid's head (and a tiny bit in mine, as it's not my project).

    Your best bet would be to hack into the Cura python code, rip out the graphical stuff and use that to call the engine with the settings & model(s). Cura (Python part) can then send it to the printer.

     

    Dear Nallath,

    thanks for your reply, actually after creating this topic ,I start examining the cureEngine and found out that it will only fulfill my first need (Gcode) !

    then I saw in a video(ultimaker-evening video) ,that david said the Cura estimation is not precise he said and I quote "this guess can be off by 20% ",So I write a program that reads a Gcode (that CuraEngine creates) and return some useful parameter such as

     

    • exact head movement during the print

    • total layers of the object

    • 2d plots of head movement in each layer

     

    here is a sample of head movement, it's the first layer of "3D Printable Wrench "

    image.jpg

    to calculate the price ,I need total time as well, but I have some problem calculating the time :

    for example consider these two lines of a Gcode :

     

    
    

    G1 F6000 X30.31 Y106.31 E2303.94952

    G0 F9000 X30.87 Y106.31

    the Gcode says(correct me if I'm wrong) : from point (30.31,106.31) rapidly moves to (30.87,106.31) with the speed of 9000mm per minute, SO

    I calculate the Euclidean distance by :

     

    
    

    distance=sqrt(((PointA(1)-PointB(1)))^2+((PointA(2)-PointB(2))^2));

    which is 0.5600mm for this example ,

    for calculating the time I have

     

    
    

    this_move_time=this_move_distance/9000;

    that gives me 6.2222e-05 min

    I do this for all head movement but it seems that it's wrong!

    for the previous mentioned model Cura give me 2hours/12 minutes

    my code return 1hour/26 minutes

    I would really appreciate your feedback and any comments on this subject :)

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    You didn't take into account acceleration or jerk settings. These are complicated. For any polygon movement, acceleration is infinite at each vertex unless the head comes to a complete stop. To make it so the head doesn't stop at every vertex there is a "jerk" settting which is not truly "jerk" but instead the maximum instantaneous speed change. This is typically 20mm/sec. So going from 20mm/sec to 0mm/sec is allowed at a vertex. Or going from 10mm/sec in one direction to -10mm/sec an instant later is also allowed. Or at a 90 degree corner, the speed will slow to 14mm/sec (total XY magnitude instantaneous speed change is 20mm/sec on 90 degree corner).

    The latest Cura takes care of this very well and now gives very very good estimates of how long a print will take.

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    Actually, that video is quite old and the estimate is a lot better these days.

     

    Dear Daid,

    I'm glad that you improved time estimation on Cura :)

    but the problem is I'm writing an app to generate a Gcode using CuraEngine and I have to calculate the time and the price myself ,I don't think it's possible to use cura(I mean your python scripts) in my application to get precise time estimation(or is it ?! ) , so I want some guidance on how to estimate precise time of the print from a single Gcode file ! is it achievable or it's just a far-fetched idea?!

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The precise time estimation is in the engine, not the python code.

    https://github.com/Ultimaker/CuraEngine/blob/master/src/gcodeExport.cpp#L388

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    The precise time estimation is in the engine, not the python code.

    https://github.com/Ultimaker/CuraEngine/blob/master/src/gcodeExport.cpp#L388

     

    wow ,thanks !!! I use -v and get the time !

    (still have problem using config.ini )

    the only problem remaining is how to transfer gcode to the printer ! would you please tell me which script of python code does this task ?

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    You'll want to look at the Cura/util/machineCom.py

    (The config ini code was contributed. I'm not using it myself, so I have no idea how/if it works)

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    does this command line gcode sender work with ultimaker ?!

    http://forums.reprap.org/read.php?156,61227

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    wow ,thanks !!! I use -v and get the time !

    (still have problem using config.ini )

    the only problem remaining is how to transfer gcode to the printer ! would you please tell me which script of python code does this task ?

     

    Could you send the whole command to calculate print time , weight vs ... from STL code with spesific settings ?

    Thanks

     

  • Link to post
    Share on other sites

    Posted · Start working with cura engine !

    Could you send the whole command to calculate print time , weight vs ... from STL code with spesific settings ?

    Thanks

     

    dear Raytrace Nomad,

    I use curaengine.exe in c# here is a code I use to read size and p-time :

     

    
    

    StreamReader myStreamReader = Cura.StandardError;

    string myString = myStreamReader.ReadToEnd();

    foreach (string line in myString.Split('\n'))

    {

    string[] parts = line.Split(':');

    if (parts.Length < 2)

    continue;

    switch (parts[0].Trim())

    {

    case "Size":

    log("Size " + parts[1]);

    break;

    case "Print time":

    log("PTime " + parts[1]);

    break;

    default:

    break;

    }

    }

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    • Our picks

      • Here it is. The new UltiMaker S7
        The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.
         
         
        So what’s new?
        The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.
         
        The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.
         
        The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.
         

         
        The UltiMaker S7 also includes quality of life improvements:
        Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more  
        Curious to see the S7 in action?
        We’re hosting a free tech demo on February 7.
        It will be live and you can ask any questions to our CTO, Miguel Calvo.
        Register here for the Webinar
          • Like
        • 10 replies
      • UltiMaker Cura 5.3.0-Alpha 🎄 Tree Support Spotlight 🎄
        Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
         
        We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.  
          • Like
        • 16 replies
      • New here? Get ahead with a free onboarding course
        Hi,
         
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 14 replies
    ×
    ×
    • Create New...