New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

three-geojson-geometry

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-geojson-geometry - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

example/graticules/index.html

2

dist/three-geojson-geometry.js

@@ -1,2 +0,2 @@

// Version 0.1.0 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
// Version 0.2.0 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
(function (global, factory) {

@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three')) :

@@ -1,2 +0,2 @@

// Version 0.1.0 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
// Version 0.2.0 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],t):t((e=e||self).THREE=e.THREE||{},e.THREE)}(this,(function(e,t){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var u,x=e[Symbol.iterator]();!(r=(u=x.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==x.return||x.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i=u,o=u;function u(e,t,n){n=n||2;var r,i,o,u,v,c,s,y=t&&t.length,h=y?t[0]*n:e.length,g=x(e,0,h,n,!0),m=[];if(!g||g.next===g.prev)return m;if(y&&(g=function(e,t,n,r){var i,o,u,a,v,c=[];for(i=0,o=t.length;i<o;i++)u=t[i]*r,a=i<o-1?t[i+1]*r:e.length,(v=x(e,u,a,r,!1))===v.next&&(v.steiner=!0),c.push(d(v));for(c.sort(p),i=0;i<c.length;i++)l(c[i],n),n=f(n,n.next);return n}(e,t,g,n)),e.length>80*n){r=o=e[0],i=u=e[1];for(var Z=n;Z<h;Z+=n)(v=e[Z])<r&&(r=v),(c=e[Z+1])<i&&(i=c),v>o&&(o=v),c>u&&(u=c);s=0!==(s=Math.max(o-r,u-i))?1/s:0}return a(g,m,n,r,i,s),m}function x(e,t,n,r,i){var o,u;if(i===z(e,t,n,r)>0)for(o=t;o<n;o+=r)u=E(o,e[o],e[o+1],u);else for(o=n-r;o>=t;o-=r)u=E(o,e[o],e[o+1],u);return u&&b(u,u.next)&&(j(u),u=u.next),u}function f(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!b(r,r.next)&&0!==Z(r.prev,r,r.next))r=r.next;else{if(j(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,i,o,u){if(e){!u&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=h(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,u,x,f,a=1;do{for(n=e,e=null,o=null,u=0;n;){for(u++,r=n,x=0,t=0;t<a&&(x++,r=r.nextZ);t++);for(f=a;x>0||f>0&&r;)0!==x&&(0===f||!r||n.z<=r.z)?(i=n,n=n.nextZ,x--):(i=r,r=r.nextZ,f--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,a*=2}while(u>1)}(i)}(e,r,i,o);for(var x,p,l=e;e.prev!==e.next;)if(x=e.prev,p=e.next,o?c(e,r,i,o):v(e))t.push(x.i/n),t.push(e.i/n),t.push(p.i/n),j(e),e=p.next,l=p.next;else if((e=p)===l){u?1===u?a(e=s(e,t,n),t,n,r,i,o,2):2===u&&y(e,t,n,r,i,o):a(f(e),t,n,r,i,o,1);break}}}function v(e){var t=e.prev,n=e,r=e.next;if(Z(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(g(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Z(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function c(e,t,n,r){var i=e.prev,o=e,u=e.next;if(Z(i,o,u)>=0)return!1;for(var x=i.x<o.x?i.x<u.x?i.x:u.x:o.x<u.x?o.x:u.x,f=i.y<o.y?i.y<u.y?i.y:u.y:o.y<u.y?o.y:u.y,a=i.x>o.x?i.x>u.x?i.x:u.x:o.x>u.x?o.x:u.x,v=i.y>o.y?i.y>u.y?i.y:u.y:o.y>u.y?o.y:u.y,c=h(x,f,t,n,r),s=h(a,v,t,n,r),y=e.prevZ,p=e.nextZ;y&&y.z>=c&&p&&p.z<=s;){if(y!==e.prev&&y!==e.next&&g(i.x,i.y,o.x,o.y,u.x,u.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,p!==e.prev&&p!==e.next&&g(i.x,i.y,o.x,o.y,u.x,u.y,p.x,p.y)&&Z(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;y&&y.z>=c;){if(y!==e.prev&&y!==e.next&&g(i.x,i.y,o.x,o.y,u.x,u.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;p&&p.z<=s;){if(p!==e.prev&&p!==e.next&&g(i.x,i.y,o.x,o.y,u.x,u.y,p.x,p.y)&&Z(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function s(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!b(i,o)&&w(i,r,r.next,o)&&M(i,o)&&M(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return r}function y(e,t,n,r,i,o){var u=e;do{for(var x=u.next.next;x!==u.prev;){if(u.i!==x.i&&m(u,x)){var v=G(u,x);return u=f(u,u.next),v=f(v,v.next),a(u,t,n,r,i,o),void a(v,t,n,r,i,o)}x=x.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function l(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,u=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var x=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(x<=i&&x>u){if(u=x,x===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===u)return n.prev;var f,a=n,v=n.x,c=n.y,s=1/0;r=n.next;for(;r!==a;)i>=r.x&&r.x>=v&&i!==r.x&&g(o<c?i:u,o,v,c,o<c?u:i,o,r.x,r.y)&&((f=Math.abs(o-r.y)/(i-r.x))<s||f===s&&r.x>n.x)&&M(r,e)&&(n=r,s=f),r=r.next;return n}(e,t)){var n=G(t,e);f(n,n.next)}}function h(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function g(e,t,n,r,i,o,u,x){return(i-u)*(t-x)-(e-u)*(o-x)>=0&&(e-u)*(r-x)-(n-u)*(t-x)>=0&&(n-u)*(o-x)-(i-u)*(r-x)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&w(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&M(e,t)&&M(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function Z(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function b(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,n,r){return!!(b(e,t)&&b(n,r)||b(e,r)&&b(n,t))||Z(e,t,n)>0!=Z(e,t,r)>0&&Z(n,r,e)>0!=Z(n,r,t)>0}function M(e,t){return Z(e.prev,e,e.next)<0?Z(e,t,e.next)>=0&&Z(e,e.prev,t)>=0:Z(e,t,e.prev)<0||Z(e,e.next,t)<0}function G(e,t){var n=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function E(e,t,n,r){var i=new A(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function z(e,t,n,r){for(var i=0,o=t,u=n-r;o<n;o+=r)i+=(e[u]-e[o])*(e[o+1]+e[u+1]),u=o;return i}function S(e,n){t.Geometry.call(this),this.type="GeoJsonGeometry",this.parameters={geoJson:e,radius:n},this.fromBufferGeometry(new O(e,n)),this.mergeVertices()}function O(e,r){var o=this;t.BufferGeometry.call(this),this.type="GeoJsonBufferGeometry",this.parameters={geoJson:e,radius:r},r=r||1;var u=({Point:v,MultiPoint:function(e,t){var r={vertices:[],indices:[]};return e.map((function(e){return v(e,t)})).forEach((function(e){var t=n(e,1)[0];P(r,t)})),[r]},LineString:c,MultiLineString:function(e,t){var r={vertices:[],indices:[]};return e.map((function(e){return c(e,t)})).forEach((function(e){var t=n(e,1)[0];P(r,t)})),[r]},Polygon:s,MultiPolygon:function(e,t){var r={vertices:[],indices:[]},i={vertices:[],indices:[]};e.map((function(e){return s(e,t)})).forEach((function(e){var t=n(e,2),o=t[0],u=t[1];P(r,o),u&&P(i,u)}));var o=[r];return i.vertices.length&&o.push(i),o}}[e.type]||function(){return[]})(e.coordinates,r),x=[],f=[],a=0;function v(e,t){return[{vertices:B(e[1],e[0],t),indices:[]}]}function c(e,t){for(var r=e.map((function(e){var r=n(e,2),i=r[0];return B(r[1],i,t)})),o=i.flatten([r]).vertices,u=Math.round(o.length/3),x=[],f=1;f<u;f++)x.push(f-1,f);return[{vertices:o,indices:x}]}function s(e,t){for(var r=e.map((function(e){return e.map((function(e){var r=n(e,2),i=r[0];return B(r[1],i,t)}))})),o=i.flatten(r),u=o.vertices,x=o.holes,f=x[0]||1/0,a=u.slice(0,f),v=u.slice(f),c=new Set(x),s=Math.round(u.length/3),y=[],p=[],l=1;l<s;l++)c.has(l)||(l<f?y.push(l-1,l):p.push(l-1-f,l-f));var h=[{indices:y,vertices:a}];return x.length&&h.push({indices:p,vertices:v}),h}u.forEach((function(e){var t=x.length;P({indices:x,vertices:f},e),o.addGroup(t,x.length-t,a++)})),x.length&&this.setIndex(x),f.length&&this.addAttribute("position",new t.Float32BufferAttribute(f,3))}function P(e,t){var n,i,o=Math.round(e.vertices.length/3);(n=e.vertices).push.apply(n,r(t.vertices)),(i=e.indices).push.apply(i,r(t.indices.map((function(e){return e+o}))))}function B(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}u.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,u=Math.abs(z(e,0,o,n));if(i)for(var x=0,f=t.length;x<f;x++){var a=t[x]*n,v=x<f-1?t[x+1]*n:e.length;u-=Math.abs(z(e,a,v,n))}var c=0;for(x=0;x<r.length;x+=3){var s=r[x]*n,y=r[x+1]*n,p=r[x+2]*n;c+=Math.abs((e[s]-e[p])*(e[y+1]-e[s+1])-(e[s]-e[y])*(e[p+1]-e[s+1]))}return 0===u&&0===c?0:Math.abs((c-u)/u)},u.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var u=0;u<t;u++)n.vertices.push(e[i][o][u]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},i.default=o,S.prototype=Object.create(t.Geometry.prototype),S.prototype.constructor=S,O.prototype=Object.create(t.BufferGeometry.prototype),O.prototype.constructor=O,e.GeoJsonBufferGeometry=O,e.GeoJsonGeometry=S,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "three-geojson-geometry",
"version": "0.1.0",
"version": "0.2.0",
"description": "ThreeJS geometry for stroking GeoJSON objects on a sphere",

@@ -5,0 +5,0 @@ "unpkg": "dist/three-geojson-geometry.min.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc