Comment by dubcanada

2 years ago

Not sure what you are looking at but https://ciechanow.ski/js/airfoil.js is the JS that contains the code for the graphics/visuals. And it is completely readable.

The 2d part though is probably generated.

Yeah, the "draw_car" snippet quoted by parent is from the JS file that you linked.

It looks like maybe an SVG file converted into JS? Do you know if there is some standard tooling that generates this?

  • SVG paths translate pretty directly to canvas commands. If you have an SVG path parser, it's pretty straightforward to walk it and output the equivalent js.

    • But for that many paths it seems... tedious. Wondering if they had a better way.