Jump to content
Ultimaker Community of 3D Printing Experts
  • Sign Up
SamGoldFisher

Cura GUI and command line

Recommended Posts

Posted · Cura GUI and command line

Hello,

 

I would like to automate the production of 3D printed part.

Cura could be useful for few reasons: -when you open a file with cura, it automatically center and orient the part on the bed

 

Here is the command I use:

cura cube. stl

 

But then I don't know and didn't find any resources to save this file back to a .stl, which will be positionned and ready to be sliced with a good position and orientation.

 

Is is possible to do that:

open a file, center it, orienting the .stl and save it bakc to an .stl file?

 

I did have a look to few posts about command line using Cura (here for example) but I didn't found what I was looking for

 

Let me know if you have any idea 😉

 

 

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line

Sounds like a 3mf project file would achieve this.

 

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line

What is the link with using command line?

How is this related to running a script to slice different files one after another?

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line

Perhaps I have misunderstood what you mean. Are you able to explain in more detail how and why you'd like to do it this way?

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line
1 hour ago, SamGoldFisher said:

Is is possible to do that:

open a file, center it, orienting the .stl and save it bakc to an .stl file?

 

 

In my opinion this is not possible. The STL file itself just describes your model, ok with orientation but not where it is placed on the build plate. The definition if it is centered or not is done by Cura during slicing and "saved" in the gcode. So there is no way to save it back to the STL, also not in Cura itself. You can save it as 3mf or gcode, but not as STL with the information you want.

 

Maybe I am wrong and there is a solution, but I don't think so.

Share this post


Link to post
Share on other sites
Posted (edited) · Cura GUI and command line

Of course @maht:

-let say you have lots of 3D printer and lots of parts to print. All your printer have ejection system so each 3D printer can print continuously one part after another.

In order to print all your parts, you need to know which parts need to be print with which machine.

In order to do that, you need to slice all files and attribute them to a machine in order to be 3D printed.

Then, every printer print is queue of parts in order to realize the whole production.

 

I feel like I am not good at explaining. In the attached file I did an illustration that may help.

 

To put it another way: you want to slice a bunch of parts, one at a time,  automatically and you want to use the front end of cura to realize the positionning and the automatic orientation of each parts. Can you do it in command line using Cura.

intro.pdf

Edited by SamGoldFisher
I didn't quote someone. So he didn't know I answered... Sorry

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line
1 hour ago, Smithy said:

 

In my opinion this is not possible. The STL file itself just describes your model, ok with orientation but not where it is placed on the build plate. The definition if it is centered or not is done by Cura during slicing and "saved" in the gcode. So there is no way to save it back to the STL, also not in Cura itself. You can save it as 3mf or gcode, but not as STL with the information you want.

 

Maybe I am wrong and there is a solution, but I don't think so.

 

Hello @Smithy,

Actually when you open a file in Cura, it does take the stl file and center it in the middle of the bed. From that I assume it as this capability.

For the orientation, the plug in auto-orientation can also work automatically when you import an stl file. 

Once done, you can save your positionned and oriented stl back to an stl. 

 

You can try it with a simple cube that is firstly not oriented with Automatic orientation activated. You will see it getting a good orientation. Then you can save it back as an stl.

 

So now that we know we can do it, is it possible to make it using command line?

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line

Ok, I was not aware that this is possible to save it back to STL.

Keep in mind that Cura as application is more than the command line tool. So the Cura GUI uses the engine (cmd tool) to slice the file. So the question is which part is responsible to place the part on the center of the bed. The GUI or the engine. If it is the GUI or a plugin, then this functionality is not available in the command line tool.

 

But I am just guessing, maybe I am wrong....

  • Like 1

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line
35 minutes ago, Smithy said:

Ok, I was not aware that this is possible to save it back to STL.

Keep in mind that Cura as application is more than the command line tool. So the Cura GUI uses the engine (cmd tool) to slice the file. So the question is which part is responsible to place the part on the center of the bed. The GUI or the engine. If it is the GUI or a plugin, then this functionality is not available in the command line tool.

 

But I am just guessing, maybe I am wrong....

Actually what you say make perfect sense.

I think that if it work the way you say, I would have to create a tool within the GUI to run the known function (center and optimize the orientation and export).

 

PS: I did illustrate the previous talk about exporting back into a stl and the auto-orientation plugin into this little gif 😉

Hnet-image.gif

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line

Thanks for the gif, good to know that it works.

BTW nice and funny avatar 😃

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line
21 hours ago, Smithy said:

 

In my opinion this is not possible. The STL file itself just describes your model, ok with orientation but not where it is placed on the build plate. The definition if it is centered or not is done by Cura during slicing and "saved" in the gcode. So there is no way to save it back to the STL, also not in Cura itself. You can save it as 3mf or gcode, but not as STL with the information you want.

 

Maybe I am wrong and there is a solution, but I don't think so.

 

Hello,

 

I add another look about using cura in command line.

Cura can be executed with command line with the following syntax (as example):

curaengine slice -j my_printer.def.json -o test.gcode -l cube_v3.stl

 

here:

  • my_printer.def.json:    is the definition of the printer. It does use another file: my_extruder.def.json which is the definition of the extruder
  • test.gcode:    it's the output of the slicing
  • cube_v3.stl:    it's the file to be sliced

What I do remark, it's that at the end of the definition file of the 3D printer, there is a section about centering the part (in the attached file). The first try didn't ended well but it will be the subject of another topic.

 

It doesn't solve the orientation problem but it might solve the positionning problem using only command line ;-). I will go a bit further in this direction.

 

For the orientation problem. It might be easier to execute a script in a CAD software rather than in Cura, and then use the oriented stl to do the slicing...

 

If someone have informations that I don't have or any idea it will be more than welcome 😉

 

 

 

Capture.PNG

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line

The Mesh Rotation Matrix will let you rotate the mesh. What more do you need?

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line

Hello,

 

I'm absolutly not sure of that but using -s option ?   like

-s mesh_rotation_matrix="[[1,0,0], [0,1,0], [0,0,1]]"

 

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line
12 minutes ago, ahoeben said:

The Mesh Rotation Matrix will let you rotate the mesh. What more do you need?

Hello,

 

@ahoeben, I feel a bit of agressivity in your message, am I wrong?

 

And how does that help if you don't the rotation you need to apply: every geometry is different, the advantages of the auto-orientation plug in is to have a good orientation to 3D print the model. Is it more clear?

 

Share this post


Link to post
Share on other sites
Posted (edited) · Cura GUI and command line

  

5 minutes ago, SamGoldFisher said:

I feel a bit of agressivity in your message, am I wrong?

 

At the risk of sounding agressive: YOU ARE WRONG!

Euh, no agressivity intended.

 

Sorry, your GIF is very small (in this forum), and skips over what you do in Cura very quickly.

It looks like you are using this plugin: https://marketplace.ultimaker.com/app/cura/plugins/nallath/OrientationPlugin

 

Plugins like this run in Cura, not in CuraEngine. You could look at the source of the plugin and extract what you need to create a rotation matrix to feed into CuraEngine.

Edited by ahoeben
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted · Cura GUI and command line
2 minutes ago, ahoeben said:

  

 

At the risk of sounding agressive: YOU ARE WRONG!

Euh, no agressivity intended.

 

Sorry, your GIF is very small (in this forum), and skips over what you do in Cura very quickly.

It looks like you are using this plugin: https://marketplace.ultimaker.com/app/cura/plugins/nallath/OrientationPlugin

 

Plugins like this run in Cura, not in CuraEngine. You could look at the source of the plugin and extract what you need to create a rotation matrix to feed into CuraEngine.

 

Actually the gif was a good try but a bad idea: next time I will give the link to a not referenced video on youtube which will make think simpler.

 

Extract the matrix from the plugin could be a good idea (thanks 😉 ).

Share this post


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

×
×
  • Create New...