diff --git a/build/Geometrize.js b/build/Geometrize.js index 42a01f9..51d177a 100644 --- a/build/Geometrize.js +++ b/build/Geometrize.js @@ -2,14 +2,14 @@ * Geometrize * computational geometry and rendering library for JavaScript * -* @version 0.2.0 (2022-12-02 20:56:48) +* @version 0.2.0 (2022-12-02 23:51:44) * https://github.com/foo123/Geometrize * **//** * Geometrize * computational geometry and rendering library for JavaScript * -* @version 0.2.0 (2022-12-02 20:56:48) +* @version 0.2.0 (2022-12-02 23:51:44) * https://github.com/foo123/Geometrize * **/ @@ -617,6 +617,8 @@ var Primitive = makeClass(null, merge(null, { toSVGPath: function(svg) { return arguments.length ? svg : ''; }, + toCanvas: function(ctx) { + }, toTex: function() { return '\\text{Primitive}'; }, @@ -1509,7 +1511,7 @@ var Bezier1 = makeClass(Bezier, { }, toBezier3: function() { return [ - [this.f(0), this.f(1/3), this.f(2/3), this.f(1)] + [this.f(0), this.f(0.5), this.f(0.5), this.f(1)] ]; }, toSVG: function(svg) { @@ -1532,6 +1534,15 @@ var Bezier1 = makeClass(Bezier, { 'style': [this.style.toSVG(), this.style.isChanged()] }, svg) : path; }, + toCanvas: function(ctx) { + var p1 = this._points[0], p2 = this._points[1]; + ctx.beginPath(); + ctx.lineWidth = this.style['stroke-width']; + ctx.strokeStyle = this.style['stroke']; + ctx.moveTo(p1.x, p1.y); + ctx.lineTo(p2.x, p2.y); + ctx.stroke(); + }, toTex: function() { var p1 = this.start, p2 = this.end; return '\\text{Line: }'+signed(p2.y - p1.y, false)+' \\cdot x '+signed(p1.x - p2.x)+' \\cdot y '+signed(p2.x*p1.y - p1.x*p2.y)+'\\text{, }'+Str(stdMath.min(p1.x, p2.x))+' \\le x \\le '+Str(stdMath.max(p1.x, p2.x))+'\\text{, }'+Str(stdMath.min(p1.y, p2.y))+' \\le y \\le '+Str(stdMath.max(p1.y, p2.y)); @@ -1753,6 +1764,15 @@ var Polyline = makeClass(Curve, { 'style': [this.style.toSVG(), this.style.isChanged()] }, svg) : path; }, + toCanvas: function(ctx) { + var p = this._points, n = p.length; + ctx.beginPath(); + ctx.lineWidth = this.style['stroke-width']; + ctx.strokeStyle = this.style['stroke']; + ctx.moveTo(p[0].x, p[0].y); + for (var i=1; i + + + + +Geometrize Intersections + + +

Geometrize Intersections

+ +
+ + + diff --git a/test/test.html b/test/test.html deleted file mode 100644 index cd787b0..0000000 --- a/test/test.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -Geometrize - - -

Geometrize

-
- - - diff --git a/test/tween.html b/test/tween.html index d79f607..f31a6c3 100644 --- a/test/tween.html +++ b/test/tween.html @@ -3,9 +3,9 @@ -Geometrize +Geometrize Tween -

Geometrize

- -
+

Geometrize Tween

+ +