Demo: https://muffinman.io/linea
This is an attempt to port Michael Fogleman's ln, 3d line engine to JavaScript (well, TypeScript).
I used it to generate and plot a couple of drawings:
I'm not really maintaining it anymore, so you might want to check similar projects:
- https://github.com/fogleman/ln - original (in go) that I tried to port to javascript
- https://github.com/aweary/ln.js - more complete js port
- https://github.com/abey79/lines - python version
The name of the port is inspired by the Italian cartoon from the 70s, La Linea.
Install node 18.2.0 and run:
npm install
npm start
Then visit http://localhost:1234/
npm test
- axis.go
- box.go - done but depends on the missing class
Triangle
- common.go
- cone.go - WIP
- csg.go
- cube.go
- cylinder.go
- filter.go
- function.go
- hit.go
- matrix.go
- mesh.go
- obj.go
- path.go - missing
WriteTo*
methods, I think we should abstract it a little bit differently - plane.go
- ray.go
- scene.go
- shape.go
- sphere.go
- stl.go
- tree.go
- triangle.go
- util.go
- vector.go
The first SVG rendered by linea:
And the skyscrapers example (please note that this one uses code commented out in source/cube.ts
):