qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/CoplanarPolygonGeometryLibr...

2 lines
1.5 KiB
JavaScript
Raw Normal View History

2023-11-07 10:04:37 +08:00
define(["exports","./Cartesian2-bd414876","./Cartesian3-e0307675","./Check-741c5f3c","./Matrix4-4c545f70","./OrientedBoundingBox-c5d2adb7"],(function(n,t,e,r,a,i){"use strict";const o={},u=new e.Cartesian3,s=new e.Cartesian3,c=new e.Cartesian3,C=new e.Cartesian3,m=new i.OrientedBoundingBox;function d(n,r,a,i,o){const s=e.Cartesian3.subtract(n,r,u),c=e.Cartesian3.dot(a,s),C=e.Cartesian3.dot(i,s);return t.Cartesian2.fromElements(c,C,o)}o.validOutline=function(n){const t=i.OrientedBoundingBox.fromPoints(n,m).halfAxes,r=a.Matrix3.getColumn(t,0,s),o=a.Matrix3.getColumn(t,1,c),u=a.Matrix3.getColumn(t,2,C),d=e.Cartesian3.magnitude(r),g=e.Cartesian3.magnitude(o),l=e.Cartesian3.magnitude(u);return!(0===d&&(0===g||0===l)||0===g&&0===l)},o.computeProjectTo2DArguments=function(n,t,r,o){const u=i.OrientedBoundingBox.fromPoints(n,m),d=u.halfAxes,g=a.Matrix3.getColumn(d,0,s),l=a.Matrix3.getColumn(d,1,c),f=a.Matrix3.getColumn(d,2,C),x=e.Cartesian3.magnitude(g),B=e.Cartesian3.magnitude(l),M=e.Cartesian3.magnitude(f),P=Math.min(x,B,M);if(0===x&&(0===B||0===M)||0===B&&0===M)return!1;let h,w;return P!==B&&P!==M||(h=g),P===x?h=l:P===M&&(w=l),P!==x&&P!==B||(w=f),e.Cartesian3.normalize(h,r),e.Cartesian3.normalize(w,o),e.Cartesian3.clone(u.center,t),!0},o.createProjectPointsTo2DFunction=function(n,t,e){return function(r){const a=new Array(r.length);for(let i=0;i<r.length;i++)a[i]=d(r[i],n,t,e);return a}},o.createProjectPointTo2DFunction=function(n,t,e){return function(r,a){return d(r,n,t,e,a)}},n.CoplanarPolygonGeometryLibrary=o}));