You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
1.4 KiB
6 lines
1.4 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define(["exports"],function(v){class c{static local(){null===c.instance&&(c.instance=new c);return c.instance}execute(a,b,e,n,p){return new y(a,b,e)}}c.instance=null;class y{constructor(a,b,e){this._inputGeometries=a;this._angleTolerance=void 0!==b.angleTolerance?b.angleTolerance:120;this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let a=this._inputGeometries.next();for(;a;){if("esriGeometryPolygon"===a.geometryType)this._isClosed=!0;else if("esriGeometryPolyline"=== |
|
a.geometryType)this._isClosed=!1;else if("esriGeometryEnvelope"===a.geometryType){if(this._maxCosAngle)return a;this._isClosed=!0}else{a=this._inputGeometries.next();continue}for(;a.nextPath();)this._processPath(a);a.reset();return a}return null}_processPath(a){if(a.nextPoint()){const b=a.x,e=a.y;let n=b,p=e,q=a.pathSize,r=0,t=0,f=0,w=0,x=0,u=0;this._isClosed&&++q;for(let d=1;a.nextPoint()||d<q;++d){let l,m;this._isClosed&&d===q-1?(l=b,m=e):(l=a.x,m=a.y);const g=l-n,h=m-p,k=Math.sqrt(g*g+h*h);1<d&& |
|
0<k&&0<f&&(r*g+t*h)/k/f<=this._maxCosAngle&&a.setControlPointAt(d-1);1===d&&(w=g,x=h,u=k);0<k&&(n=l,p=m,r=g,t=h,f=k)}this._isClosed&&0<f&&0<u&&(r*w+t*x)/u/f<=this._maxCosAngle&&a.setControlPointAt(0)}}}v.EffectAddControlPoints=c;Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}); |