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.
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.
Yeah, that's the file I was looking at. I was wondering how that file got created. By hand, or generated somehow?
I asked him on Twitter about one of his previous articles, he said he writes all that JS by hand.
https://twitter.com/BCiechanowski/status/1522067904522428417