flatten-js
Version:
Javascript library for 2d geometry
1 lines • 2.36 kB
JSON
{"dependencies":[{"name":"C:\\Users\\alexbol\\WebstormProjects\\flatten-js\\package.json","includedInParent":true,"mtime":1520238055570}],"generated":{"js":"\"use strict\";var t=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}();function n(t,n){if(!(t instanceof n))throw new TypeError(\"Cannot call a class as a function\")}module.exports=function(e){var r=e.Point,i=e.Segment,o=e.Line,a=(e.Circle,e.Arc),u=e.Box,c=e.Vector;e.Ray=function(){function s(){n(this,s),this.pt=new r;for(var t=arguments.length,i=Array(t),o=0;o<t;o++)i[o]=arguments[o];if(0!=i.length)if(1==i.length&&i[0]instanceof r)this.pt=i[0].clone();else{if(2!=i.length||\"number\"!=typeof i[0]||\"number\"!=typeof i[1])throw e.Errors.ILLEGAL_PARAMETERS;this.pt=new r(i[0],i[1])}}return t(s,[{key:\"clone\",value:function(){return new s(this.pt)}},{key:\"intersect\",value:function(t){return t instanceof i?this.intersectRay2Segment(this,t):t instanceof a?this.intersectRay2Arc(this,t):void 0}},{key:\"intersectRay2Segment\",value:function(t,n){var r=[];if(t.box.notIntersect(n.box))return r;var i=new o(t.start,t.norm),a=i.intersect(n),u=!0,c=!1,s=void 0;try{for(var l,f=a[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var y=l.value;e.Utils.GE(y.x,t.start.x)&&r.push(y)}}catch(t){c=!0,s=t}finally{try{!u&&f.return&&f.return()}finally{if(c)throw s}}return 2==a.length&&1==r.length&&t.start.on(i)&&r.push(t.start),r}},{key:\"intersectRay2Arc\",value:function(t,n){var r=[];if(t.box.notIntersect(n.box))return r;var i=new o(t.start,t.norm).intersect(n),a=!0,u=!1,c=void 0;try{for(var s,l=i[Symbol.iterator]();!(a=(s=l.next()).done);a=!0){var f=s.value;e.Utils.GE(f.x,t.start.x)&&r.push(f)}}catch(t){u=!0,c=t}finally{try{!a&&l.return&&l.return()}finally{if(u)throw c}}return r}},{key:\"box\",get:function(){return new u(this.pt.x,this.pt.y,Number.POSITIVE_INFINITY,this.pt.y)}},{key:\"start\",get:function(){return this.pt}},{key:\"norm\",get:function(){return new c(0,1)}}]),s}(),e.ray=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return new(Function.prototype.bind.apply(e.Ray,[null].concat(n)))}};"},"hash":"2050035d3c25efee193ce19139256d56","cacheData":{"env":{}}}