Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

three-conic-polygon-geometry

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-conic-polygon-geometry - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

dist/three-conic-polygon-geometry.js

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

// Version 1.1.3 three-conic-polygon-geometry - https://github.com/vasturiano/three-conic-polygon-geometry
// Version 1.1.4 three-conic-polygon-geometry - https://github.com/vasturiano/three-conic-polygon-geometry
(function (global, factory) {

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

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

// Version 1.1.3 three-conic-polygon-geometry - https://github.com/vasturiano/three-conic-polygon-geometry
// Version 1.1.4 three-conic-polygon-geometry - https://github.com/vasturiano/three-conic-polygon-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 x,u=e[Symbol.iterator]();!(r=(x=u.next()).done)&&(n.push(x.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.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=x,o=x;function x(e,t,n){n=n||2;var r,i,o,x,y,v,l,p=t&&t.length,s=p?t[0]*n:e.length,d=u(e,0,s,n,!0),m=[];if(!d||d.next===d.prev)return m;if(p&&(d=function(e,t,n,r){var i,o,x,a,y,v=[];for(i=0,o=t.length;i<o;i++)x=t[i]*r,a=i<o-1?t[i+1]*r:e.length,(y=u(e,x,a,r,!1))===y.next&&(y.steiner=!0),v.push(g(y));for(v.sort(c),i=0;i<v.length;i++)h(v[i],n),n=f(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=x=e[1];for(var Z=n;Z<s;Z+=n)(y=e[Z])<r&&(r=y),(v=e[Z+1])<i&&(i=v),y>o&&(o=y),v>x&&(x=v);l=0!==(l=Math.max(o-r,x-i))?1/l:0}return a(d,m,n,r,i,l),m}function u(e,t,n,r,i){var o,x;if(i===T(e,t,n,r)>0)for(o=t;o<n;o+=r)x=j(o,e[o],e[o+1],x);else for(o=n-r;o>=t;o-=r)x=j(o,e[o],e[o+1],x);return x&&w(x,x.next)&&(z(x),x=x.next),x}function f(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!w(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(z(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,i,o,x){if(e){!x&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=d(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,x,u,f,a=1;do{for(n=e,e=null,o=null,x=0;n;){for(x++,r=n,u=0,t=0;t<a&&(u++,r=r.nextZ);t++);for(f=a;u>0||f>0&&r;)0!==u&&(0===f||!r||n.z<=r.z)?(i=n,n=n.nextZ,u--):(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(x>1)}(i)}(e,r,i,o);for(var u,c,h=e;e.prev!==e.next;)if(u=e.prev,c=e.next,o?v(e,r,i,o):y(e))t.push(u.i/n),t.push(e.i/n),t.push(c.i/n),z(e),e=c.next,h=c.next;else if((e=c)===h){x?1===x?a(e=l(f(e),t,n),t,n,r,i,o,2):2===x&&p(e,t,n,r,i,o):a(f(e),t,n,r,i,o,1);break}}}function y(e){var t=e.prev,n=e,r=e.next;if(b(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function v(e,t,n,r){var i=e.prev,o=e,x=e.next;if(b(i,o,x)>=0)return!1;for(var u=i.x<o.x?i.x<x.x?i.x:x.x:o.x<x.x?o.x:x.x,f=i.y<o.y?i.y<x.y?i.y:x.y:o.y<x.y?o.y:x.y,a=i.x>o.x?i.x>x.x?i.x:x.x:o.x>x.x?o.x:x.x,y=i.y>o.y?i.y>x.y?i.y:x.y:o.y>x.y?o.y:x.y,v=d(u,f,t,n,r),l=d(a,y,t,n,r),p=e.prevZ,c=e.nextZ;p&&p.z>=v&&c&&c.z<=l;){if(p!==e.prev&&p!==e.next&&m(i.x,i.y,o.x,o.y,x.x,x.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,c!==e.prev&&c!==e.next&&m(i.x,i.y,o.x,o.y,x.x,x.y,c.x,c.y)&&b(c.prev,c,c.next)>=0)return!1;c=c.nextZ}for(;p&&p.z>=v;){if(p!==e.prev&&p!==e.next&&m(i.x,i.y,o.x,o.y,x.x,x.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;c&&c.z<=l;){if(c!==e.prev&&c!==e.next&&m(i.x,i.y,o.x,o.y,x.x,x.y,c.x,c.y)&&b(c.prev,c,c.next)>=0)return!1;c=c.nextZ}return!0}function l(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!w(i,o)&&M(i,r,r.next,o)&&B(i,o)&&B(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),z(r),z(r.next),r=e=o),r=r.next}while(r!==e);return f(r)}function p(e,t,n,r,i,o){var x=e;do{for(var u=x.next.next;u!==x.prev;){if(x.i!==u.i&&Z(x,u)){var y=E(x,u);return x=f(x,x.next),y=f(y,y.next),a(x,t,n,r,i,o),void a(y,t,n,r,i,o)}u=u.next}x=x.next}while(x!==e)}function c(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,x=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var u=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>x){if(x=u,u===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===x)return n;var f,a=n,y=n.x,v=n.y,l=1/0;r=n;do{i>=r.x&&r.x>=y&&i!==r.x&&m(o<v?i:x,o,y,v,o<v?x:i,o,r.x,r.y)&&(f=Math.abs(o-r.y)/(i-r.x),B(r,e)&&(f<l||f===l&&(r.x>n.x||r.x===n.x&&s(n,r)))&&(n=r,l=f)),r=r.next}while(r!==a);return n}(e,t)){var n=E(t,e);f(n,n.next)}}function s(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}function d(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 g(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 m(e,t,n,r,i,o,x,u){return(i-x)*(t-u)-(e-x)*(o-u)>=0&&(e-x)*(r-u)-(n-x)*(t-u)>=0&&(n-x)*(o-u)-(i-x)*(r-u)>=0}function Z(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&&M(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(B(e,t)&&B(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)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||w(e,t)&&b(e.prev,e,e.next)>0&&b(t.prev,t,t.next)>0)}function b(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function w(e,t){return e.x===t.x&&e.y===t.y}function M(e,t,n,r){var i=A(b(e,t,n)),o=A(b(e,t,r)),x=A(b(n,r,e)),u=A(b(n,r,t));return i!==o&&x!==u||(!(0!==i||!G(e,n,t))||(!(0!==o||!G(e,r,t))||(!(0!==x||!G(n,e,r))||!(0!==u||!G(n,t,r)))))}function G(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function A(e){return e>0?1:e<0?-1:0}function B(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function E(e,t){var n=new H(e.i,e.x,e.y),r=new H(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 j(e,t,n,r){var i=new H(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 z(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 H(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 T(e,t,n,r){for(var i=0,o=t,x=n-r;o<n;o+=r)i+=(e[x]-e[o])*(e[o+1]+e[x+1]),x=o;return i}x.deviation=function(e,t,n,r){var i=t&&t.length,o=i?t[0]*n:e.length,x=Math.abs(T(e,0,o,n));if(i)for(var u=0,f=t.length;u<f;u++){var a=t[u]*n,y=u<f-1?t[u+1]*n:e.length;x-=Math.abs(T(e,a,y,n))}var v=0;for(u=0;u<r.length;u+=3){var l=r[u]*n,p=r[u+1]*n,c=r[u+2]*n;v+=Math.abs((e[l]-e[c])*(e[p+1]-e[l+1])-(e[l]-e[p])*(e[c+1]-e[l+1]))}return 0===x&&0===v?0:Math.abs((v-x)/x)},x.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 x=0;x<t;x++)n.vertices.push(e[i][o][x]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},i.default=o;var S=window.THREE?window.THREE:{BufferGeometry:t.BufferGeometry,Float32BufferAttribute:t.Float32BufferAttribute,Geometry:t.Geometry};function O(e,t,n,r,i,o){S.Geometry.call(this),this.type="ConicPolygonGeometry",this.parameters={polygonGeoJson:e,startHeight:t,endHeight:n,closedBottom:r,closedTop:i,includeSides:o},this.fromBufferGeometry(new P(e,t,n,r,i,o)),this.mergeVertices()}function P(e,t,o,x,u,f){S.BufferGeometry.call(this),this.type="ConicPolygonBufferGeometry",this.parameters={polygonGeoJson:e,startHeight:t,endHeight:o,closedBottom:x,closedTop:u,includeSides:f},o=o||1,x=void 0===x||x,u=void 0===u||u,f=void 0===f||f;var a=Z(t=t||0),y=a.vertices,v=a.holes,l=Z(o).vertices,p=Math.round(l.length/3),c=[].concat(r(l),r(y)),h=[],s=0;if(f){var d=h.length;h=h.concat(function(){for(var e=new Set(v),t=0,n=[],r=0;r<p;r++){var i=r+1;if(i===p)i=t;else if(e.has(i)){var o=i;i=t,t=o}n.push(r,r+p,i+p),n.push(i+p,i,r)}return n}()),this.addGroup(d,h.length-d,s++)}if(x){var g=h.length;h=h.concat(b(!1)),this.addGroup(g,h.length-g,s++)}if(u){var m=h.length;h=h.concat(b(!0)),this.addGroup(m,h.length-m,s++)}function Z(t){var r=e.map((function(e){return e.map((function(e){var r=n(e,2),i=r[0];return function(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)]}(r[1],i,t)}))}));return i.flatten(r)}function b(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=i(i.flatten(e).vertices,v,2);return!t&&(n=n.map((function(e){return e+p}))),n}this.setIndex(h),this.setAttribute("position",new S.Float32BufferAttribute(c,3))}O.prototype=Object.create(S.Geometry.prototype),O.prototype.constructor=O,P.prototype=Object.create(S.BufferGeometry.prototype),P.prototype.constructor=P,e.ConicPolygonBufferGeometry=P,e.ConicPolygonGeometry=O,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "three-conic-polygon-geometry",
"version": "1.1.3",
"version": "1.1.4",
"description": "ThreeJS geometry for drawing polygons on a sphere",

@@ -46,3 +46,3 @@ "unpkg": "dist/three-conic-polygon-geometry.min.js",

"peerDependencies": {
"three": "*"
"three": ">=0.110.0"
},

@@ -49,0 +49,0 @@ "devDependencies": {

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