flatten-js
Version:
Javascript library for 2d geometry
1 lines • 2.35 kB
JSON
{"dependencies":[{"name":"C:\\Users\\alexbol\\WebstormProjects\\flatten-js\\package.json","includedInParent":true,"mtime":1520238055570}],"generated":{"js":"var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function e(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}module.exports=function(n){n.Edge=function(){function i(t){e(this,i),this.shape=t,this.next,this.prev,this.face,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}return t(i,[{key:\"middle\",value:function(){return this.shape.middle()}},{key:\"contains\",value:function(t){return this.shape.contains(t)}},{key:\"setInclusion\",value:function(t){if(void 0!==this.bv)return this.bv;if(void 0===this.bvStart&&(this.bvStart=n.ray_shoot(t,this.start)),void 0===this.bvEnd&&(this.bvEnd=n.ray_shoot(t,this.end)),this.bvStart===n.OUTSIDE||this.bvEnd==n.OUTSIDE)this.bv=n.OUTSIDE;else if(this.bvStart===n.INSIDE||this.bvEnd==n.INSIDE)this.bv=n.INSIDE;else{var e=n.ray_shoot(t,this.middle());this.bv=e}return this.bv}},{key:\"svg\",value:function(){if(this.shape instanceof n.Segment)return\" L\"+this.shape.end.x+\",\"+this.shape.end.y;if(this.shape instanceof n.Arc){var t=this.shape,e=void 0,i=t.counterClockwise?\"1\":\"0\";if(n.Utils.EQ(t.sweep,2*Math.PI)){var s=t.counterClockwise?1:-1,r=new n.Arc(t.pc,t.r,t.startAngle,t.startAngle+s*Math.PI,t.counterClockwise),h=new n.Arc(t.pc,t.r,t.startAngle+s*Math.PI,t.endAngle,t.counterClockwise);return e=\"0\",\" A\"+r.r+\",\"+r.r+\" 0 \"+e+\",\"+i+\" \"+r.end.x+\",\"+r.end.y+\"\\n A\"+h.r+\",\"+h.r+\" 0 \"+e+\",\"+i+\" \"+h.end.x+\",\"+h.end.y}return e=t.sweep<=Math.PI?\"0\":\"1\",\" A\"+t.r+\",\"+t.r+\" 0 \"+e+\",\"+i+\" \"+t.end.x+\",\"+t.end.y}}},{key:\"toJSON\",value:function(){var t=this.shape.clone();return t.name=this.shape.constructor.name,t}},{key:\"start\",get:function(){return this.shape.start}},{key:\"end\",get:function(){return this.shape.end}},{key:\"length\",get:function(){return this.shape.length}},{key:\"box\",get:function(){return this.shape.box}}]),i}()};"},"hash":"8f65cfb823a657a42aaf9dcee36ae9db","cacheData":{"env":{}}}