diff --git a/build/Geometrize.js b/build/Geometrize.js index 678e0fb..60745a3 100644 --- a/build/Geometrize.js +++ b/build/Geometrize.js @@ -2,14 +2,14 @@ * Geometrize * computational geometry and rendering library for JavaScript * -* @version 0.9.10 (2023-02-20 11:14:57) +* @version 0.9.10 (2023-02-20 11:19:38) * https://github.com/foo123/Geometrize * **//** * Geometrize * computational geometry and rendering library for JavaScript * -* @version 0.9.10 (2023-02-20 11:14:57) +* @version 0.9.10 (2023-02-20 11:19:38) * https://github.com/foo123/Geometrize * **/ @@ -738,7 +738,7 @@ var Object2D = makeClass(null, merge(null, { return false; }, /**[DOC_MD] - * * `intersects(other): Point2D[]|Bool` return array of intersection points of object with itself or false + * * `intersectsSelf(): Point2D[]|Bool` return array of intersection points of object with itself or false [/DOC_MD]**/ intersectsSelf: function() { return false; diff --git a/build/Geometrize.min.js b/build/Geometrize.min.js index 51f0eb1..46e7de5 100644 --- a/build/Geometrize.min.js +++ b/build/Geometrize.min.js @@ -2,7 +2,7 @@ * Geometrize * computational geometry and rendering library for JavaScript * -* @version 0.9.10 (2023-02-20 11:14:57) +* @version 0.9.10 (2023-02-20 11:19:38) * https://github.com/foo123/Geometrize * **/!function(t,n,e){"use strict";"object"==typeof module&&module.exports?(module.$deps=module.$deps||{})&&(module.exports=module.$deps[n]=e.call(t)):"function"==typeof define&&define.amd&&"function"==typeof require&&"function"==typeof require.specified&&require.specified(n)?define(n,["module"],function(n){return e.moduleUri=n.uri,e.call(t)}):n in t||(t[n]=e.call(t)||1)&&"function"==typeof define&&define.amd&&define(function(){return t[n]})}("undefined"!=typeof self?self:this,"Geometrize",function(){"use strict";var x=Object.prototype.hasOwnProperty,t=Object.prototype.toString,C=Object.defineProperty,_=Math,$=_.abs,w=_.sqrt,l=_.pow,P=_.PI,S=2*P,a=1e-6,A=P/4,r=w(2),c=w(3),f=20,h=.01,g={},y=function(){},n="undefined"!=typeof global&&"[object global]"===t.call(global),p="undefined"!=typeof window&&"[object Window]"===t.call(window),d=(n?global:p&&window,{VERSION:"0.9.10",Math:{},Geometry:{}});function e(n,t,e){arguments.length<2&&(t=n,n=null);var r,i,o,u=x.call(t,"constructor")?t.constructor:function(){};for(r in n?(u.prototype=Object.create(n.prototype),u.prototype.$super=(i=n,o={},function(n,t){var e=":"+n;return 1===o[e]?(i.prototype.$super||y).call(this,n,t):(o[e]=1,t=("constructor"===n?i:i.prototype[n]||y).apply(this,t||[]),o[e]=0,t)})):u.prototype.$super=y,u.prototype.constructor=u,t)x.call(t,r)&&"constructor"!==r&&(u.prototype[r]=t[r]);if(e)for(r in e)x.call(e,r)&&(u[r]=e[r]);return u}var i={$changed:!1,$cb:null,dispose:function(){this.$cb=null},isChanged:function(n){return arguments.length?(this.$changed=!!n,this):this.$changed},onChange:function(n,t){var e,r=this;return!1===t&&(xt(n)||ht(n))?r.$cb&&-1!==(e=(ht(n)?r.$cb.map(function(n){return at(n.id)}):r.$cb).indexOf(n))&&r.$cb.splice(e,1):xt(n)&&(r.$cb||(r.$cb=[]),-1===(e=r.$cb.indexOf(n))&&r.$cb.push(n)),r},triggerChange:function(){var t=this;return t.$cb&&t.$cb.forEach(function(n){n(t)}),t}},o=e(null,Jn(null,{constructor:function n(t){var e=this,r=null,i=null;return t instanceof n?t:e instanceof n?(i=Jn(r=n.Properties,{},n.Defaults),yt(t)&&(i=Jn(r,i,t)),r.forEach(function(t){C(e,t,{get:function(){return i[t]},set:function(n){i[t]!==n&&(i[t]=n,e.isChanged(!0),e.triggerChange())},enumerable:!0,configurable:!1})}),e.toObj=function(){return r.reduce(function(n,t){return n[t]=i[t],n},{})},void e.isChanged(!0)):new n(t)},clone:function(){return new o(this.toObj())},toSVG:function(){var e=this.toObj();return Object.keys(e).reduce(function(n,t){return n+t+":"+at(e[t])+";"},"")},toCanvas:function(n){var t=this;return n.lineCap=t["stroke-linecap"],n.lineJoin=t["stroke-linejoin"],n.lineWidth=t["stroke-width"],n.fillStyle="none"===t.fill?"transparent":t.fill,n.strokeStyle=t.stroke,n}},i),{Properties:["stroke-width","stroke","stroke-opacity","stroke-linecap","stroke-linejoin","fill","fill-opacity","fill-rule"],Defaults:{"stroke-width":1,stroke:"#000000","stroke-opacity":1,"stroke-linecap":"butt","stroke-linejoin":"miter",fill:"none","fill-opacity":1,"fill-rule":"evenodd"}});d.Style=o;var G=e(null,Jn(null,{constructor:function e(r){var i=this;return r instanceof e?r:i instanceof e?(r=lt(r),i.dispose=function(){r=null,e.prototype.dispose.call(i)},i.clone=function(){return new e(r)},i.val=function(n){if(arguments.length){n=n instanceof e?n.val():lt(n);var t=!Un(r,n);return r=n,t&&(i.isChanged(!0),i.triggerChange()),i}return r},i.valueOf=function(){return r.valueOf()},i.toString=function(){return at(r)},void i.isChanged(!0)):new e(r)},clone:null,val:null,valueOf:null,toString:null},i)),m=e(null,{constructor:function n(t,e,r,i,o,u){var s=this;return t instanceof n?t:s instanceof n?void(gt(t)&&6<=t.length?(s.$00=lt(t[0]),s.$01=lt(t[1]),s.$02=lt(t[2]),s.$10=lt(t[3]),s.$11=lt(t[4]),s.$12=lt(t[5])):(s.$00=t,s.$01=e,s.$02=r,s.$10=i,s.$11=o,s.$12=u)):new n(t,e,r,i,o,u)},$00:1,$01:0,$02:0,$10:0,$11:1,$12:0,clone:function(){var n=this;return new m(n.$00,n.$01,n.$02,n.$10,n.$11,n.$12)},eq:function(n){if(n instanceof m){var t=this;return Un(t.$00,n.$00)&&Un(t.$01,n.$01)&&Un(t.$02,n.$02)&&Un(t.$10,n.$10)&&Un(t.$11,n.$11)&&Un(t.$12,n.$12)}return!1},add:function(n){var t=this;return n instanceof m?new m(t.$00+n.$00,t.$01+n.$01,t.$02+n.$02,t.$10+n.$10,t.$11+n.$11,t.$12+n.$12):(n=lt(n),new m(t.$00+n,t.$01+n,t.$02+n,t.$10+n,t.$11+n,t.$12+n))},mul:function(n){var t=this,e=t.$00,r=t.$01,i=t.$02,o=t.$10,u=t.$11,s=t.$12;if(n instanceof m){var a=n.$00,l=n.$01,c=n.$02,f=n.$10,h=n.$11,t=n.$12;return new m(e*a+r*f,e*l+r*h,e*c+r*t+i,o*a+u*f,o*l+u*h,o*c+u*t+s)}return n=lt(n),new m(e*n,r*n,i*n,o*n,u*n,s*n)},det:function(){var n=this,t=n.$00,e=n.$01,r=(n.$02,n.$10),i=n.$11;n.$12;return t*i-e*r},inv:function(){var n,t,e,r=this,i=r.$00,o=r.$01,u=r.$02,s=r.$10,a=r.$11,l=r.$12,c=i*a-o*s;return Fn(c,0)?null:new m(n=a/c,t=-o/c,-n*u-t*l,e=-s/c,r=i/c,-e*u-r*l)},transform:function(n,t){var e=this,r=n.x,i=n.y,n=e.$00*r+e.$01*i+e.$02,e=e.$10*r+e.$11*i+e.$12;return t?(t.x=n,t.y=e):t=new j(n,e),t},getTranslation:function(){return{x:this.$02,y:this.$12}},getRotationAngle:function(){return _.atan2(this.$10,this.$00)},getScale:function(){var n=this.$00,t=-this.$01,e=this.$10,r=this.$11;return{x:Zn(n)*Bn(n,e),y:Zn(r)*Bn(t,r)}},toArray:function(){var n=this;return[n.$00,n.$01,n.$02,n.$10,n.$11,n.$12,0,0,1]},toSVG:function(){var n=this;return"matrix("+at(n.$00)+" "+at(n.$10)+" "+at(n.$01)+" "+at(n.$11)+" "+at(n.$02)+" "+at(n.$12)+")"},toCSS:function(){var n=this;return"matrix("+at(n.$00)+","+at(n.$10)+","+at(n.$01)+","+at(n.$11)+","+at(n.$02)+","+at(n.$12)+")"},toCanvas:function(n){var t=this;return n.transform(t.$00,t.$10,t.$01,t.$11,t.$02,t.$12),n},toTex:function(){return m.arrayTex(this.toArray(),3,3)},toString:function(){return m.arrayString(this.toArray(),3,3)}},{eye:function(){return new m(1,0,0,0,1,0)},translate:function(n,t){return new m(1,0,lt(n),0,1,lt(t))},rotate:function(n,t,e){e=lt(e||0),t=lt(t||0),n=lt(n||0);var r=_.cos(n),n=_.sin(n);return new m(r,-n,t-r*t+n*e,n,r,e-r*e-n*t)},scale:function(n,t,e,r){return r=lt(r||0),e=lt(e||0),n=lt(n),t=lt(t),new m(n,0,-n*e+e,0,t,-t*r+r)},reflectX:function(){return new m(-1,0,0,0,1,0)},reflectY:function(){return new m(1,0,0,0,-1,0)},shearX:function(n){return new m(1,lt(n),0,0,1,0)},shearY:function(n){return new m(1,0,0,lt(n),1,0)},arrayTex:function(n,t,e){for(var r="\\begin{pmatrix}",i=0;iP,fs:0t.x?n:t),(!l&&(dt.y?n:t),{ymin:y.y,xmin:g.x,ymax:h.y,xmax:s.x}}),configurable:!1}),C(l,"_hull",{get:function(){var t,n,e,r,i,o,u,s;return null==b&&(t=l.center,n=l.rX,e=l.rY,r=l.theta,i=l.dtheta,o=l.start,u=l.end,s=_.abs(i)+A=S&&n.closePath()},toTex:function(){var n=this;return"\\text{Arc: }\\left("+[ct(n.start),ct(n.end),at(n.radiusX),at(n.radiusY),at(n.angle)+"\\text{°}",at(n.largeArc?1:0),at(n.sweep?1:0)].join(",")+"\\right)"},toString:function(){var n=this;return"Arc("+[at(n.start),at(n.end),at(n.radiusX),at(n.radiusY),at(n.angle)+"°",at(n.largeArc),at(n.sweep)].join(",")+")"}});d.Arc=k;var O=e(n,{constructor:function n(t){var e,r=this,i=null,o=null,u=null;return t instanceof n?t:r instanceof n?(r.$super("constructor",[t]),C(r,"length",{get:function(){return null==i&&(i=gn(r._lines)),i},enumerable:!0,configurable:!1}),C(r,"_bbox",{get:function(){return null==o&&(o=e(r._points)),o},enumerable:!(e=function(t){var n=pn(t[0].x-2*t[1].x+t[2].x,t[1].x-t[0].x),e=!1===n?[t[1]]:n.map(function(n){return 0<=n&&n<=1?Sn(n,t):t[1]}),r=pn(t[0].y-2*t[1].y+t[2].y,t[1].y-t[0].y),n=!1===r?[t[1]]:r.map(function(n){return 0<=n&&n<=1?Sn(n,t):t[1]}),r=_.min.apply(_,e.concat([t[0],t[2]]).map(Hn)),e=_.max.apply(_,e.concat([t[0],t[2]]).map(Hn));return{ymin:_.min.apply(_,n.concat([t[0],t[2]]).map(Wn)),xmin:r,ymax:_.max.apply(_,n.concat([t[0],t[2]]).map(Wn)),xmax:e}}),configurable:!1}),C(r,"_hull",{get:function(){return null==u&&(u=zn(r._points,e).map(j)),u},enumerable:!1,configurable:!1}),void(r.isChanged=function(n){return!0===n&&(u=o=i=null),r.$super("isChanged",arguments)})):new n(t)},name:"QBezier",clone:function(){return new O(this.points.map(function(n){return n.clone()}))},transform:function(t){return new O(this.points.map(function(n){return n.transform(t)}))},f:function(n){return Sn(n,this._points)},hasPoint:function(n){return function(n,t){var e;if(!(e=dn(t[0].x-2*t[1].x+t[2].x,-2*t[0].x+2*t[1].x,t[0].x-n.x)))return!1;1"+at(r)+"":"/>");return t}function nt(u,s,a,i){if(xt(u.onChange))return u;function l(t){u.$cb.forEach(function(n){n(t)})}var c=!0;i=i||et;var f=function(n,t){for(var e=n;e