I really like how the API is structured similarly to how someone designing a visualization would think about what they actually want to do (i.e. "Connect one end of the line to the box, and the other end to wherever the pointer is").
Super excited to delve into this! I've read over the documents and examples and it's obviously very well thought out and well-abstracted.
In particular I really like a lot of the decisions made in regards the point object: using Float32Array, making it the primary abstraction, and keeping the number of dimensions unspecified. I've been working through some ideas on ways to implement a Vectorpark style psuedo-3d projection engine and pts.js seems to have almost all the basic tools I needed to build and then some.
At first glance, it seems to support geometrical operations that neither of those have built in. Things like "draw the incircle of this triangle" and "draw a perpendicular from a line to this point" and "find the intersection of these circles." So if you can construct your figure using compass-and-straightedge, you can probably cobble it together using the existing API without touching trigonometry or vector manipulations at all.
p5 and pixi seem to be more on the "just tell me where to put it, and I'll draw it for you" line. Pts has a whole bunch of higher-level abstractions where you can define mathematical and geometric operations to apply to your points: https://ptsjs.org/guide/op-0400
Great observations. That always felt like part of what was missing in other libraries. Sometimes just drawing a triangle was a long process that felt kind of hacky.
> Ganja.js is a Geometric Algebra code generator for javascript. It generates Clifford algebras and sub-algebras of any signature and implements operator overloading and algebraic constants. > (Mathematically, an algebra generated by ganja.js is a graded exterior (Grassmann) algebra (or one of its subalgebras) with a non-metric outer product, extended (Clifford) with geometric and contraction inner products, a Poincare duality operator and the main involutions and morphisms.) > (Technically, ganja.js is a code generator producing classes that reificate algebraic literals and expressions by using reflection, a built-in tokenizer and a simple AST translator to rewrite functions containing algebraic constructs to their procedural counterparts.) > (Practically, ganja.js enables real math syntax inside javascript, with element, vector and matrix operations over reals, complex numbers, dual numbers, quaternions, or any other Clifford Algebra.)
Just want to say, I really loved that you used the monaco editor. Such a nice user experience when you can use a world class editor that supports code completion, indents and error squigglies.
Comments (71) 27 threads
Earlier commentsIn particular I really like a lot of the decisions made in regards the point object: using Float32Array, making it the primary abstraction, and keeping the number of dimensions unspecified.
I've been working through some ideas on ways to implement a Vectorpark style psuedo-3d projection engine and pts.js seems to have almost all the basic tools I needed to build and then some.
p5 and pixi seem to be more on the "just tell me where to put it, and I'll draw it for you" line. Pts has a whole bunch of higher-level abstractions where you can define mathematical and geometric operations to apply to your points:
https://ptsjs.org/guide/op-0400
https://github.com/enkimute/ganja.js
> Ganja.js is a Geometric Algebra code generator for javascript. It generates Clifford algebras and sub-algebras of any signature and implements operator overloading and algebraic constants.
> (Mathematically, an algebra generated by ganja.js is a graded exterior (Grassmann) algebra (or one of its subalgebras) with a non-metric outer product, extended (Clifford) with geometric and contraction inner products, a Poincare duality operator and the main involutions and morphisms.)
> (Technically, ganja.js is a code generator producing classes that reificate algebraic literals and expressions by using reflection, a built-in tokenizer and a simple AST translator to rewrite functions containing algebraic constructs to their procedural counterparts.)
> (Practically, ganja.js enables real math syntax inside javascript, with element, vector and matrix operations over reals, complex numbers, dual numbers, quaternions, or any other Clifford Algebra.)
Continue this thread — 1 reply
I felt right at home being an avid VScode user.
All comments shown.
Couldn't load more comments. Check your connection and try again.