A rudimentary shape library.
type Point = { x: number, y: number, z: number };
type Line = [ Point, Point ];
type Vertices = [ Point, Point, Point ];
type Planes = Vertices[];
type Constitution = Point | Vertices | Planes;
Circle
constitution: Point
material: string
radius: number
Polygon
constitution: Vertices
material: string
CircleToThreeJsAdapter
let myCircle = new Circle(point(0,0,0), "ff0000", 3);
let circle = new CircleToThreeJsAdapter(myCircle).call();
PolygonToThreeJsAdapter
let myPoly = new Polygon([
point(-2, 0, 0),
point(-2, -2, 0),
point(3, -2, 0),
point(3, 0, 0),
], "ffffff");
let poly = new PolygonToThreeJsAdapter(myPoly).call();
- Aaron Moradi - Initial work - amoradi
MIT, see LICENSE.md for details.