27 lines
13 KiB
JavaScript
27 lines
13 KiB
JavaScript
![]() |
/**
|
||
|
* @license
|
||
|
* Cesium - https://github.com/CesiumGS/cesium
|
||
|
* Version 1.109
|
||
|
*
|
||
|
* Copyright 2011-2022 Cesium Contributors
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*
|
||
|
* Columbus View (Pat. Pend.)
|
||
|
*
|
||
|
* Portions licensed separately.
|
||
|
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
||
|
*/
|
||
|
|
||
|
import{a as ue}from"./chunk-Y5NK5HSS.js";import{b as he,c as pe,d as ne}from"./chunk-A4RD4IQP.js";import{d as w}from"./chunk-5EDTRNG5.js";import{a as te}from"./chunk-IO6LETQ6.js";import{a as p,b as ee,c as Se}from"./chunk-C6Y3PRDH.js";import{a as Y}from"./chunk-LI57NJAL.js";import{a as le}from"./chunk-IBAO62UG.js";import{a as K}from"./chunk-P44SUSQU.js";import{b}from"./chunk-FUATUYJ3.js";import{c as We,d as Ge,e as D}from"./chunk-ODUTJJQ5.js";var Oe=We((st,de)=>{"use strict";de.exports=xe;de.exports.default=xe;function xe(e,n,t){t=t||2;var u=n&&n.length,r=u?n[0]*t:e.length,i=Ce(e,0,r,t,!0),s=[];if(!i||i.next===i.prev)return s;var o,f,c,l,y,v,g;if(u&&(i=ke(e,n,i,t)),e.length>80*t){o=c=e[0],f=l=e[1];for(var h=t;h<r;h+=t)y=e[h],v=e[h+1],y<o&&(o=y),v<f&&(f=v),y>c&&(c=y),v>l&&(l=v);g=Math.max(c-o,l-f),g=g!==0?32767/g:0}return re(i,s,t,o,f,g,0),s}function Ce(e,n,t,u,r){var i,s;if(r===ge(e,n,t,u)>0)for(i=n;i<t;i+=u)s=Ae(i,e[i],e[i+1],s);else for(i=t-u;i>=n;i-=u)s=Ae(i,e[i],e[i+1],s);return s&&ae(s,s.next)&&(oe(s),s=s.next),s}function N(e,n){if(!e)return e;n||(n=e);var t=e,u;do if(u=!1,!t.steiner&&(ae(t,t.next)||A(t.prev,t,t.next)===0)){if(oe(t),t=n=t.prev,t===t.next)break;u=!0}else t=t.next;while(u||t!==n);return n}function re(e,n,t,u,r,i,s){if(e){!s&&i&&qe(e,u,r,i);for(var o=e,f,c;e.prev!==e.next;){if(f=e.prev,c=e.next,i?Ie(e,u,r,i):$e(e)){n.push(f.i/t|0),n.push(e.i/t|0),n.push(c.i/t|0),oe(e),e=c.next,o=c.next;continue}if(e=c,e===o){s?s===1?(e=He(N(e),n,t),re(e,n,t,u,r,i,2)):s===2&&Ne(e,n,t,u,r,i):re(N(e),n,t,u,r,i,1);break}}}}function $e(e){var n=e.prev,t=e,u=e.next;if(A(n,t,u)>=0)return!1;for(var r=n.x,i=t.x,s=u.x,o=n.y,f=t.y,c=u.y,l=r<i?r<s?r:s:i<s?i:s,y=o<f?o<c?o:c:f<c?f:c,v=r>i?r>s?r:s:i>s?i:s,g=o>f?o>c?o:c:f>c?f:c,h=u.next;h!==n;){if(h.x>=l&&h.x<=v&&h.y>=y&&h.y<=g&&V(r,o,i,f,s,c,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Ie(e,n,t,u){var r=e.prev,i=e,s=e.next;if(A(r,i,s)>=0)return!1;for(var o=r.x,f=i.x,c=s.x,l=r.y,y=i.y,v=s.y,g=o<f?o<c?o:c:f<c?f:c,h=l<y?l<v?l:v:y<v?y:v,T=o>f?o>c?o:c:f>c?f:c,L=l>y?l>v?l:v:y>v?y:v,z=ye(g,h,n,t,u),F=ye(T,L,n,t,u),x=e.prevZ,a=e.nextZ;x&&x.z>=z&&a&&a.z<=F;){if(x.x>=g&&x.x<=T&&x.y>=h&&x.y<=L&&x!==r&&x!==s&&V(o,l,f,y,c,v,x.x,x.y)&&A(x.prev,x,x.next)>=0||(x=x.prevZ,a.x>=g&&a.x<=T&&a.y>=h&&a.y<=L&&a!==r&&a!==s&&V(o,l,f,y,c,v,a.x,a.y)&&A(a.prev,a,a.next)>=0))return!1;a=a.nextZ}for(;x&&x.z>=z;){if(x.x>=g&&x.x<=T&&x.y>=h&&x.y<=L&&x!==r&&x!==s&&V(o,l,f,y,c,v,x.x,x.y)&&A(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;a&&a.z<=F;){if(a.x>=g&&a.x<=T&&a.y>=h&&a.y<=L&&a!==r&&a!==s&&V(o,l,f,y,c,v,a.x,a.y)&&A(a.prev,a,a.next)>=0)return!1;a=a.nextZ}return!0}function He(e,n,t){var u=e;do{var r=u.prev,i=u.next.next;!ae(r,i)&&be(r,u,u.next,i)&&ie(r,i)&&ie(i,r)&&(n.push(r.i/t|0),n.push(u.i/t|0),n.push(i.i/t|0),oe(u),oe(u.next),u=e=i),u=u.next}while(u!==e);return N(u)}function Ne(e,n,t,u,r,i){var s=e;do{for(var o=s.next.next;o!==s.prev;){if(s.i!==o.i&&je(s,o)){var f=Ee(s,o);s=N(s,s.next),f=N(f,f.next),re(s,n,t,u,r,i,0),re(f,n,t,u,r,i,0);return}o=o.next}s=s.next}while(s!==e)}function ke(e,n,t,u){var r=[],i,s,o,f,c;for(i=0,s=n.length;i<s;i++)o=n[i]*u,f=i<s-1?n[i+1]*u:e.length,c=Ce(e,o,f,u,!1),c===c.next&&(c.steiner=!0),r.push(Qe(c));for(r.sort(Ue),i=0;i<r.length;i++)t=_e(r[i],t);return t}function Ue(e,n){return e.x-n.x}function _e(e,n){var t=Ke(e,n);if(!t)return n;var u=Ee(t,e);return N(u,u.next),N(t,t.next)}function Ke(e,n){var t=n,u=e.x,r=e.y,i=-1/0,s;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){var o=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(o<=u&&o>i&&(i=o,s=t.x<t.next.x?t:t.next,o===u))return s}t=t.next}while(t!==n);if(!s)return null;var f=s,c=s.x,l=s.y,y=1/0,v;t=s;do u>=t.x&&t.x>=c&&u!==t.x&&V(r<l?u:i,r,c,l,r<l?i:u,r,t.x,t.y)&&(v=Math.abs(r-t.y)/(u-t.x),ie(t,e)&&(v<y||v===y&&(t.x>s.x||t.x===s.x&&Ve(s,t)))&&(s=t,y=v)),t=t.next;while(t!==f);return s}function Ve(e,n){return A(e.prev,e,n.prev)<0&&A(n.next,e,e.next)<0}function qe(e,n,t,u){var r=e;do r.z===0&&(r.z=ye(r.x,r.y,n,t,u)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,Je(r)}function Je(e){var n,t
|