Graph operation within octopi

What is the problem?
I would like to ask if graph operation can be handled in octopi. That is, if some functions, such as drawing a graph, display a picture and so on, can be supported by octopi? If yes, may I ask there are any plugins that can be installed in octopi to implement these operations?

What did you already try to solve it?
I install octopi on raspberry pi 3B to control a chocolate 3D printer. What I want to do next is to develop a function that stick figure drawn by user can be directly sliced by CuraEngine and printed by the printer. Moreover, some graphic models can be displayed on front interface. Octopi is light version of raspbian. So I am not sure if octopi can support these functions?

The version of the octopi I used is Raspbian GNU/Linux 9

Hi @yuan,
hmmmm... I don't understand your question.

  • What kind of graph to you want to draw ?
  • Add more lines to the temp-graph or create totally new graph based on different sensors/values?
  • Do you want to create a "mathematical formular" like for an cone or a mesh and Octoprint should print such shape?
    image
  • Or do you want to add the 3d model to a selected file, like the UFP-Plugin
    image

Please provide more details...maybe some sketches.

It sounds like he wants the user to be able to crudely draw a stickman in 2D and to have something extrude this to 3D, create an object file, slice it and print it (in extruded chocolate).

I really wouldn't do this as an OctoPrint plugin. In a kiosk situation, I'd add a second Pi computer and have it run from the non-OctoPrint Pi's programmatic control. The Pi which is attached to the display sends the gcode (once sliced) over to the OctoPrint Pi for processing.

Hi OllisGit, Thank you for your reply.
What I mean above is a drawingboard function that I want to combine with octoprint on octopi so that user can draw and printe a 2D picture on a chocolate printer, just like the following picture. I has found some drawboard programes developed by js, canvas. So I want to develope a similar function on ocotprint.
image
I think it can be realized because octoprint is a web project that should support html5 application.
I also want to add a 3D model view for gcode file, does UFP plugin support the gcode file generated from stl file?

Thank you, OutsourcedGuru!
May I ask if what you worry about is that on a same Pi, this function would affect the performance of octoprint? Or Octopi has some limitations for realizing such function?

ahhh...I read "chocolate 3D printer" and thought that is the brand name, like ANET or Creality...now it makes sense...yummi.

I think UFP format is only created by CURA, so the Plugin itself doesn't generate stuff it only receives the uploaded *.ufp (its a zip-file) from cura and extracts the included content (gcode + image)

1 Like

Correct. And that is Ultimaker Cura, the desktop application. Not the Legacy CuraEngine plugin in OctoPrint.

1 Like

The slicing engine has been removed from OctoPrint (by default). It can be added back in but it's a really old engine version of Cura which won't be updated, I'm guessing.

So, it feels like generating the object file and then slicing it on the same Pi sounds like a lot of add-ons. When you do all this, you then add risk that OctoPrint updates in the future might break everything else. You get locked into a certain setup and afraid to update. By splitting this to two Pi computers then you have good separation of activities.

I have in the past generated object code in NodeJS, for what it's worth. You're talking about a basic extrusion of a 2D array of points to create a 3D object. In this case, I'd assume a set height. You might want to review that project. I would consider this server-side since I've done a lot of work to magically create a DOM/window/canvas. But if you were doing this client-side in the browser then things become much simpler.

I see, by using the Cura, UFP can be generated automatically at first, and then uploaded to octoprint. With the plugin, the image infromation contained in the file can be displayed as a form of 3D picture, is it? and there is a question is that if this UFP file can only be created by some special versions of Cura, like Cura 3.5.1?

Or if using Cura's OctoPrint Connect plugin in combination with the UFP plugin it will automatically transfer the file to OctoPrint in UFP format.

Yes, it's a png file that is generated by Cura when exporting to UFP format. The OctoPrint plugin just extracts out the gcode and png preview image and allows it to be displayed within OctoPrint.

Not sure which version of Cura began this export format, but it is definitely in the newer versions.

1 Like

If you go the route of developing a drawingboard, I would look into what the options are with three.js as that has stl export functionality, which you could then use to slice.

https://threejs.org/examples/misc_exporter_stl.html

OK, Thank you for your reply!
So the targeted function should be developed as a seperate project, rather than a integrated plugin of octoprint, shouldn't it? then, does the developed project can be supported by octopi? Or other linux OS should be applied, such as Raspbian, Ubuntu? Would you tell me which kind of OS is the best?

Thank you very much for the detailed reply.
Yes, I see, I need to realize stl export function on drawingboard code, or I have to combine octoprint with Cura not CuraEngine. I will check the js, maybe I can integrate it to the code directly, thank you!

Thank you for your supplement. Does Octoprint only can support old version? Does the version of Legacy CuraEngine plugin in OctoPrint is 15.04.6?

CuraEngine is the (command line) part of Cura that actually does the slicing of 3d models. You can have the slicing of 3d models happen on the OctoPrint device. For this you could use CuraEngine, but only the 15.04.06 version. But that should still work.

Cura is the full desktop UI application that lets you load objects, change settings, slice and monitor prints. It has a plugin that will let you send files directly to OctoPrint, with or without a thumbnail.

Now to what you want to achieve. You have a 2d shape that you want to extrude, and then have it sliced, right? Why not skip the whole slicing part? Every layer will be the same, just a bit higher each time. I would go from 2d (vector-)shape directly to gcode if I were you. You could start out with this: https://svgjs.com/svg.draw.js/demo/index.html in combination with
https://github.com/avwuff/SVG-to-GCode

1 Like

For the sake of simplicity, for the second Pi I would again use Raspbian Buster Desktop (almost the same as the OctoPi image of OctoPrint). This assumes that you're trying to build a kiosk of some kind.

Having written something to allow a 2D image to be drawn on the screen and sliced by Cura (CuraEngine) then this Pi would upload it to the OctoPrint instance on the other Pi. Or you could support software other than OctoPrint, in theory.

Thank you a lot! You really me a new think, seperating the two kind of slicing from stl file and svg file. For stl file, I can use CuraEngine plugin, and for svg file from drawing code, I can directly transfer it to Gcode, without the whole CuraEngine things. For the two suggested code, I have to study them further to see if I can integrate them with octoprint.

Thank you a lot, but I'd like to do them on only one pi. From your word, although octopi image is special for running octoprint, it is also able to support the drawing and handling of 2D image, isn't it ? Do I need to apply a more complete Raspbian to combine these codes together, like drawing, slicing, octoprint?

:shrugs:

Maybe it will work by mixing and matching lots of code from here and there, loading up the x windows (Desktop), add a browser on top of that, run OctoPrint, your plugin(s), talk to the TFT display. If it's just a pet project then go for it. If it's a commercial product then I wouldn't recommend it.