Skip to content

Comment on Things I would have told myself before building an autorouter

Comments

I am a strong proponent of visualisations. I also have a tendency to write things in JavaScript that others might choose a different language. I'm now wondering if those things are related. Having the browser to provide an interface can make that a lot easier. Recently I have been doing a fair bit of transformer and NNet stuff so consequently Python. I have found it a bit of a step back when it comes to visualisations. It's easy to used canned techniques to plot data, but not as easy to knock up a custom interactive visualisation.

Hmm, I wonder what python raylib is like, that might be the ticket.

Visualization is actually one of the reasons I've been successful with my current project (creating a 3D modeling library which uses 3D tool representations and movement as afforded by G-code to write out G-code or DXFs) --- the tool which makes it possible is:

https://pythonscad.org/

Being able to just plot something and see the algorithm on-screen has been an incredible benison.

I'm hopeful OpenPythonSCAD will be merged into OpenSCAD presently.

So you are working on a way to generate toolpath gcode from python? I need that.

I have a python workflow for my laser cutter, I can make a drawing with drawsvg and then cut it with lightburn.

I have used build123d to make 3d models in python but not yet found a way to generate toolpaths for my milling machine.

Yes.

Give the code a try!

https://github.com/WillAdams/gcodepreview

If you can describe a simple part I can work it up for you and add it to the examples.

EDIT: Alternately, try pyCAM, or Kiri:Moto w/ an STL?

I'd love to see what is the easiest way, for a hardcore backend guy with completely dumb part of brain responsible for visuals, to quickly visualize things in JS. I would pay for a "d3/p5 tutorial".

Author here. I would recommend booting up React Cosmos[1] and prompting Claude to "generate a react app that...". You can visualize inside of Claude then when you're finished, drop the output of Claude into React Cosmos as a file. This is great for prototyping algorithms and recording the progression.

For example you might say "generate an interactive react app that implements a simple pathfinder that uses A* with a penalty for going near edges". You can also just drop in a paper or pseudo code of an algorithm you're ideating on.

Here's an example how we use react cosmos for our autorouter[2]

[1] https://reactcosmos.org/docs [2] https://unraveller.vercel.app/?fixtureId=%7B%22path%22%3A%22...

This is why I use python with Jupyter notebooks.

Though admittedly animations are quite arduous.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.