import McGiWorldDrawType from"../McGiWorldDrawType";import MxDbEntity from"../MxDbEntity";import{addRegisterMxDbEntity}from"../../tools/registerMxDbEntity";function createCurvePath(e=!1){const t=new THREE.CurvePath;return t.autoClose=e,t}function createQuadraticBezierCurve3(e){let t=0,r=[];for(let i=0;i=s&&(r++,c.set(new THREE.Color(t[r]||t[--r]))),i.push(l.x,l.y,l.z||0),o.lerpHSL(c,a),n.push(o.r,o.g,o.b)}return[i,n]}function getColorGradientData(e,t){let r=[],i=[];for(let n=0,s=e.length;n1){const e=i?[...this.colors,this.colors[0]]:this.colors;[u,l]=this.curve?getCurveColorGradientData(r,e):getColorGradientData(r,e),c.setAttribute("position",new THREE.Float32BufferAttribute(u,3)),c.setAttribute("color",new THREE.Float32BufferAttribute(l,3)),v=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,linecap:p,linejoin:d})}else c.setFromPoints(r),v=new THREE.LineBasicMaterial({color:this.color,linecap:p,linejoin:d});const E=i?new THREE.LineLoop(c,v):new THREE.Line(c,v);if(e.drawEntity(E),(t===McGiWorldDrawType.kSelectDraw||t===McGiWorldDrawType.kDynDragDraw)&&this.curve){let t=this.getPoints();const r=e.getLineWidth();e.setLineWidth(1),e.drawLines(t),e.setLineWidth(r)}}getGripPoints(){return this.getPoints()}getPoints(){return this.closed?[...this.points,this.points[0]]:this.points}moveGripPointsAt(e,t){return this.move(e,t),!0}move(e,t){return this.points[e].add(t),this}dwgIn(e){return this.dwgInHelp(e,propertyDbKeys),this.curve=e.curve,!0}dwgOut(e){return this.dwgOutHelp(e,propertyDbKeys),e.curve=this.curve,e}}addRegisterMxDbEntity(MxDbGradientLine);export default MxDbGradientLine;