boy1dr / 3DWriter

Use your 3D Printer with a pen to write letters, birthday cards etc
166 stars 42 forks source link

How to automate #33

Open Jacob-CZ opened 2 months ago

Jacob-CZ commented 2 months ago

Hello, I would like to automate this in a webhook process. So that my backend can send the job to my printer using Octoprint is there any easy way to not have to use the GUI and hit some endpoint to get the gcode?

boy1dr commented 2 months ago

Hello @Jacob-CZ This shouldn't be too difficult, i remixed that project into client side java script https://3dwriter.io/ https://github.com/boy1dr/3DWriterWeb

The code is a bit messy but can be adapted to a webhook easy enough. Might be easier to directly integrate tho :/

3DWriter data structure

render_gcode(
 pen_offset_x,
 pen_offset_y,
 bed_x,     //bed width
 bed_y,     //bed depth
 home_x, home_y, home_z,
 dry_run,   //boolean
 travel_speed,  // mm/s
 draw_speed,    // mm/s
 pen_up,    // mm
 pen_down,  // mm
 text_blocks: [
    {
    words,
    height_mm,
    letter_spacing,
    line_spacing,
    line_angle,
    font_name,
    position_x,
    position_y
    }
 ]
)

Will see if i can add something in soon, no promises though, kinda flat out these days.

Jacob-CZ commented 2 months ago

@boy1dr Thanks I am almost finished, but I have ran into another problem Is there any easy way to add support for Czech chars? ie. ěščřžýáíé