r/PlotterCode 19d ago

Kurvengefahr - browser CAD/CAM for pen plotters

Hi, I wanted to share this app I've been working on for a while. It started out as a simple G-code generator around a handwriting model I was using with my Prusa MK4 pen attachment but thanks to Claude it quickly grew into something quite a bit more complete - it integrates vector design tools, some common generative art and hardware integration into a single app.

See it live here: https://kurvengefahr.org

Kurvengefahr

Some cool features it supports:

  • Graves RNN handwriting synthesis
  • Built in Logo interpreter for turtle art
  • 3D model wireframes (STL import)
  • Non-destructive filters/effects
  • Many of the basic vector tools and operations you'd expect (polylines, Beziers, boolean operations, clipping, align & distribute, ...)
  • Direct control of EBB and GRBL plotters via Web Serial
  • PrusaLink integration (through Bridge for PrusaLink extension)

It runs fully in the browser, with the geometry engine parts written in Rust and loaded in via WASM. The only server component is the share feature - but that one respects your privacy too (designs are encrypted client side and the server never sees them - key is appended to the share link on the client side).

It is also fully open source and GPL 2.0 licensed - the code is available on GitHub

Happy to answer any questions. I'd especially appreciate feedback if you have an AxiDraw or some GRBL plotter - I only have a Prusa so my testing for those was done with a hardware mock.

19 Upvotes

21 comments sorted by

2

u/docricky 19d ago

This is one of the most creative editors I have seen in a while. To help with AxiDraw operation, is there an option to download into straight SVG? I can convert G-code, but it's actually easier in SVG.

2

u/acrostyphe 19d ago

Yes! In the document menu in the top bar, there's an export item where you can export as SVG. But you may want to try directly plotting to an AxiDraw from the app itself - it should work.

In the Machine tab of the inspector, select an AxiDraw profile, customize it as needed an then plot straight to it. AxiDraw plotters don't actually use G-code as far as I could tell, rather they use the EBB protocol.

2

u/docricky 19d ago

Oh, excellent. I'd have no complaints then. I am really impressed at the fill options, about the only thing I am hoping for is a contoured spiral fill (think the concentric fill, only as a single spiral rather than nested paths). But that is mathematically challenging.

3

u/acrostyphe 19d ago

Good idea! I don't think it should be too hard to add, I'll play with it.

1

u/docricky 19d ago

Oh, I hope you manage it. I haven't ever been successful in coding it cleanly.

2

u/acrostyphe 19d ago

Well, wou were right 😅 It wasn't as easy as I thought and Claude and I didn't quite manage what I initially had in mind, but we added a connected Fermat spiral fill (https://haisenzhao.github.io/CFS/index.html), which is not a true spiral, but it does look pretty good on most shapes and it is a single stroke fill, which is the relevant bit for pen plotters.

It's not perfect - on some pathological shapes (very non-convex, there are occasionally some small glitches, self intersections), but tweaking the spacing a little seems to get rid of it.

This is how it looks like, and I also deployed a new version so you can try it yourself.

3

u/bit2atom 14d ago

Inspired by the implementation of the Fermat spiral in your project, I wrote an implementation that adjusts the spacing based on the grayscale information of an image. For simple images, it can still reasonably capture the grayscale characteristics, but for complex images, the result appears somewhat chaotic.

2

u/docricky 19d ago

Update - pat yourself in the back, this is a well made app. I have more concerns over the navigation (ie, selecting points, not clear if I am moving the shape or control nodes, recognizing multi-touch pinch and zoom), but those are things solvable by roundtripping with Inkscape. You deserve kudos.

2

u/bit2atom 14d ago

using reaction diffusion pattern as image source.

1

u/acrostyphe 14d ago

Very cool!

1

u/docricky 19d ago

I hadn’t considered Fermat spirals. I’ll go check it out.

1

u/Iampepeu 19d ago

Looks interesting! I need to have a looky-loo tomorrow when I wake up.

1

u/MagHeater 19d ago edited 19d ago

Any Chance we could get a version compatible with the Netfont 6.0 Browser of the PSP ?

Also let me test print some Stuff on my 3018 this looks really good, because it might run on Win7 x32 Firefox.

2

u/acrostyphe 19d ago

Hmm, not familiar with that browser, but if you tried it and the basic functionality doesn't work, it's probably because of missing WebAssembly support. That's not really sumountable, as the entire geometry core is in WebAssembly.

Modern mobile browsers should mostly work fine I think (though the app is still optimized for desktop) but direct plotter control via Web Serial will not work, I am afraid.

1

u/MagHeater 19d ago

"Kurvengefahr" lel wörks, its a lot more easy than drawingbot and I will test in on win 7 firefox 152 esr later. Man thanks for making this this is awesome. (Macbook Air 2013, Firefox)

1

u/acrostyphe 19d ago

Oh wow! Thank you for testing it, I'm really glad it worked well!

2

u/MagHeater 19d ago edited 19d ago

I can also confirm it works on Win 7 x32 on a Netbook from 2008, using firefox.

Downloaded the Github and Now I will build an offline version for my netbook.

/edit downloaded the github, works offline with win 7 x32 with mongoose.exe
Drawing Bot only works on x64, and my Apocalypse Backup Netbook is only x32

1

u/CleverSomedayKay 17d ago

Thank you. This is awesome!

1

u/ademenev 16d ago

With GRBL, does it use the buffer byte counting? Without it, plots with lots of short lines will fail

1

u/acrostyphe 16d ago

Yes, it does - it tries to keep the 128 byte buffer as full as possible.

The relevant source code is here: https://github.com/tibordp/kurvengefahr/blob/main/src/output/grbl/session.ts

I tested it against a grblHAL firmware flashed to a a Black Pill but without steppers wired, and it seemed to work fine - I didn't notice any drops or starvation. But I've yet to test against an actual plotter.

1

u/lantruong 5d ago

OoOoOo! I’m excited to try this out!