Skip to content

Stanko/linea

Repository files navigation

linea

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:

The name of the port is inspired by the Italian cartoon from the 70s, La Linea.

Setup

Install node 18.2.0 and run:

npm install

npm start

Then visit http://localhost:1234/

Tests

npm test

Progress

  • 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):