1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-58f7f590"],{"02c4":function(t,n,e){"use strict";e.r(n);var i=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",[e("process",{ref:"process"}),t._v(" "),e("li",[t._v("point1"),e("span",[t._v("y")]),e("el-input-number",{staticStyle:{width:"200px"},model:{value:t.point1.y,callback:function(n){t.$set(t.point1,"y",n)},expression:"point1.y"}}),t._v(" "),e("span",[t._v("z")]),e("el-input-number",{staticStyle:{width:"200px"},model:{value:t.point1.z,callback:function(n){t.$set(t.point1,"z",n)},expression:"point1.z"}}),t._v(" "),e("el-button",{on:{click:function(n){return t.getPoint(t.point1.y,t.point1.z)}}},[t._v("addPoint")])],1),t._v(" "),e("li",[t._v("point2"),e("span",[t._v("y")]),e("el-input-number",{staticStyle:{width:"200px"},model:{value:t.point2.y,callback:function(n){t.$set(t.point2,"y",n)},expression:"point2.y"}}),t._v(" "),e("span",[t._v("z")]),e("el-input-number",{staticStyle:{width:"200px"},model:{value:t.point2.z,callback:function(n){t.$set(t.point2,"z",n)},expression:"point2.z"}}),t._v(" "),e("el-button",{on:{click:function(n){return t.getPoint(t.point2.y,t.point2.z)}}},[t._v("addPoint")])],1),t._v(" "),e("li",[t._v("point3"),e("span",[t._v("y")]),e("el-input-number",{staticStyle:{width:"200px"},model:{value:t.point3.y,callback:function(n){t.$set(t.point3,"y",n)},expression:"point3.y"}}),t._v(" "),e("span",[t._v("z")]),e("el-input-number",{staticStyle:{width:"200px"},model:{value:t.point3.z,callback:function(n){t.$set(t.point3,"z",n)},expression:"point3.z"}}),t._v(" "),e("el-button",{on:{click:function(n){return t.getPoint(t.point3.y,t.point3.z)}}},[t._v("addPoint")])],1),t._v(" "),e("li",[e("span",[t._v("DY")]),e("el-input-number",{staticStyle:{width:"200px"},model:{value:t.dy,callback:function(n){t.dy=n},expression:"dy"}}),t._v(" "),e("span",[t._v("DZ")]),e("el-input-number",{staticStyle:{wiodth:"200px"},model:{value:t.dz,callback:function(n){t.dz=n},expression:"dz"}}),t._v(" "),e("el-button",{on:{click:function(n){return t.offset(t.point1)}}},[t._v("offset")]),t._v(" "),e("el-button",{on:{click:function(n){return t.interpolate(t.point1,t.point2,.2)}}},[t._v("interpolate")]),t._v(" "),e("el-button",{on:{click:t.project}},[t._v("project")]),t._v(" "),e("el-button",{on:{click:t.extract}},[t._v("extract")]),t._v(" "),e("el-button",{on:{click:t.intersect}},[t._v("intersect")])],1),t._v(" "),e("li",[e("el-button",{on:{click:t.getLine}},[t._v("addline")]),t._v(" "),e("el-button",{on:{click:t.normal}},[t._v("normal")])],1),t._v(" "),e("li",[e("el-button",{on:{click:t.bspline}},[t._v("bspline")]),t._v(" "),e("el-button",{on:{click:t.bezier}},[t._v("bezier")]),t._v(" "),e("el-button",{on:{click:t.curlOffset}},[t._v("curlOffset")])],1),t._v(" "),e("li",[e("el-button",{on:{click:t.circleArcByThreePnts}},[t._v("circleArcByThreePnts")]),t._v(" "),e("el-button",{on:{click:t.circleArcByCenterAndTwoPnts}},[t._v("circleArcByCenterAndTwoPnts")]),t._v(" "),e("el-button",{on:{click:t.circleByThreePnts}},[t._v("circleByThreePnts")]),t._v(" "),e("el-button",{on:{click:t.circleByCenterAndTwoPnts}},[t._v("circleByCenterAndTwoPnts")]),t._v(" "),e("el-button",{on:{click:function(n){return t.circleByCenterAndRaduis(20)}}},[t._v("circleByCenterAndRaduis")]),t._v(" "),e("el-button",{on:{click:t.ellipseArcByCenterAndTwoPnts}},[t._v("ellipseArcByCenterAndTwoPnts")]),t._v(" "),e("el-button",{on:{click:t.ellipseByCenterAndTwoPnts}},[t._v("ellipseByCenterAndTwoPnts")])],1),t._v(" "),e("li")],1)},s=[],o=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",[e("div",{directives:[{name:"show",rawName:"v-show",value:t.container_show,expression:"container_show"}],ref:"container_vabs",staticClass:"vabsload"})])},r=[],c=(e("673e"),e("55dd"),e("ac6a"),e("5a89")),a=e("4721"),h=e("defc"),l=(e("7dac"),e("b775"),e("b9d8")),p=e("5c96"),u={data:function(){return{container_show:!0,scene:null,renderer:null,camera:null,controls:null,camerahight:5,mufactor:.2,meshs:[],percentage:0,movetage:0,nowIndex:0,moveflag:!1,clock:null,baseColors:[],camerahight_ele:10,meshList:[],meshShow:null,gui:new l["a"],canWidth:500,canHeight:500}},destroyed:function(){this.gui.destroy(),this.worker=null},mounted:function(){this.initScene()},created:function(){},methods:{loadingOpen:function(){p["Loading"].service({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"})},loadingClose:function(){var t=p["Loading"].service({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});t.close()},clear:function(){var t=this;this.meshs.forEach((function(n){t.scene.remove(n)})),this.meshs=[]},guiHide:function(t){"show"===t?this.gui.show():this.gui.hide()},init:function(){this.clock=new c["j"],this.scene=new c["P"];var t=new h["a"](200,20,2894892,8947848),n=new c["c"](20);this.scene.add(n),this.scene.add(t),this.renderer=new c["W"]({antialias:!0,alpha:!0}),this.camera=new c["H"](20,1,.2,2e3),this.camera.up.x=0,this.camera.up.y=0,this.camera.up.z=1,this.controls=new a["a"](this.camera,this.renderer.domElement)},initScene:function(){this.init(),this.renderer.setSize(this.canWidth,this.canHeight),this.$refs.container_vabs.appendChild(this.renderer.domElement),this.show();var t=this,n=function n(){requestAnimationFrame(n),t.renderer.render(t.scene,t.camera)};n()},show:function(){var t=(new c["e"]).setFromObject(this.scene),n=t.size().y,e=n/(2*Math.tan(this.camera.fov*Math.PI/360)),i=this.scene.position;this.camera.position.set(1.5*e,i.y,i.z),this.camera.lookAt(i),this.camera.updateMatrix()},point2:function(t){this.point(t.x,t.y,t.z)},point:function(t,n,e){var i=new c["u"],s=new c["U"](t,n,e);i.vertices.push(s);var o=new c["L"]({color:16777215,vertexColors:!0,size:5}),r=new c["K"](i,o);this.scene.add(r)},project:function(t){var n=[];t.forEach((function(t){n.push(new c["U"](0,t.y,t.z))}));var e=new c["i"](n,!1),i=e.getPoints(50),s=(new c["h"]).setFromPoints(i),o=new c["y"]({color:16711680}),r=new c["w"](s,o);this.scene.add(r);var a={x:0,y:15,z:1};this.point(a.x,a.y,a.z);for(var h=[],l=0;l<=1;l+=1e-4){var p=e.getTangent(l),u=e.getPoint(l),v=this.vec(a,u),f=Math.abs(this.angleTwoV(p,v));(Math.PI/2+.001>f&&f>Math.PI/2-1e-4||Math.PI/2*3+.001>f&&f>Math.PI/2*3-.001)&&h.push({pnt:u,len:this.xdLeng(u,a)})}h.sort((function(t,n){return t.len-n.len})),this.point2(h[0].pnt)},intersect:function(){var t=new c["M"](new c["U"](0,0,0),new c["U"](0,10,10),new c["U"](0,20,30)),n=t.getPoints(50),e=(new c["h"]).setFromPoints(n),i=new c["y"]({color:16711680}),s=new c["w"](e,i);this.scene.add(s);var o=new c["M"](new c["U"](0,2,0),new c["U"](0,10,30),new c["U"](0,20,5)),r=o.getPoints(50),a=(new c["h"]).setFromPoints(r),h=new c["y"]({color:16711680}),l=new c["w"](a,h);this.scene.add(l);for(var p=0;p<=1;p+=1e-4)for(var u=t.getPoint(p),v=0;v<=1;v+=1e-4){var f=o.getPoint(v);Math.abs(u.y-f.y)<.001&&Math.abs(u.z-f.z)<.001&&this.point(u.x,u.y,u.z)}},line:function(t){var n=new c["u"];t.forEach((function(t){n.vertices.push(new c["U"](0,t.y,t.z))}));var e=new c["y"]({color:255}),i=new c["w"](n,e);this.scene.add(i)},normal:function(t){var n=new c["M"](new c["U"](0,t[0].y,t[0].z),new c["U"](0,t[1].y,t[1].z),new c["U"](0,t[2].y,t[2].z)),e=n.getPoints(50),i=(new c["h"]).setFromPoints(e),s=new c["y"]({color:16711680}),o=new c["w"](i,s);this.scene.add(o);var r={x:0,y:6,z:5};this.point(r.x,r.y,r.z);for(var a=0;a<=1;a+=1e-4){var h=n.getTangent(a),l=n.getPoint(a),p=this.vec(r,l),u=Math.abs(this.angleTwoV(h,p));if(Math.abs(u-Math.PI/2)<.001){this.point(l.x,l.y,l.z);var v=[];v.push(r),v.push(l),this.line(v);break}}},bspline:function(t){var n=[];t.forEach((function(t){n.push(new c["U"](0,t.y,t.z))}));var e=new c["i"](n,!1),i=e.getPoints(50),s=(new c["h"]).setFromPoints(i),o=new c["y"]({color:16711680}),r=new c["w"](s,o);this.scene.add(r)},bezier:function(t){var n=new c["M"](new c["U"](0,t[0].y,t[0].z),new c["U"](0,t[1].y,t[1].z),new c["U"](0,t[2].y,t[2].z)),e=n.getPoints(50),i=(new c["h"]).setFromPoints(e),s=new c["y"]({color:16711680}),o=new c["w"](i,s);this.scene.add(o)},curlOffset:function(t,n){var e=new c["M"](new c["U"](0,t[0].y,t[0].z),new c["U"](0,t[1].y,t[1].z),new c["U"](0,t[2].y,t[2].z)),i=e.getPoints(50),s=(new c["h"]).setFromPoints(i),o=new c["y"]({color:65535}),r=new c["w"](s,o);this.scene.add(r);var a=[];if(n>1)for(var h=0;h<=1;h+=.01){var l=e.getTangent(h),p={x:0,y:-1*l.z,z:l.y},u=e.getPoint(h);u.z=u.z+(n-1)*Math.sin(Math.atan2(p.z,p.y)),u.y=u.y+(n-1)*Math.sin(Math.atan2(p.y,p.z)),a.push(u)}else for(var v=0;v<=1;v+=.01){var f=e.getTangent(v),y={x:0,y:f.z,z:-1*f.y};u=e.getPoint(v);u.z=u.z+n*Math.sin(Math.atan2(y.z,y.y)),u.y=u.y+n*Math.sin(Math.atan2(y.y,y.z)),a.push(u)}var w=(new c["h"]).setFromPoints(a),d=new c["y"]({color:0}),m=new c["w"](w,d);this.scene.add(m)},extract:function(t,n){var e=new c["M"](new c["U"](0,t[0].y,t[0].z),new c["U"](0,t[1].y,t[1].z),new c["U"](0,t[2].y,t[2].z)),i=e.getPoints(50),s=e.getPoint(n);this.point(s.x,s.y,s.z);var o=(new c["h"]).setFromPoints(i),r=new c["y"]({color:16711680}),a=new c["w"](o,r);this.scene.add(a)},circleArcByThreePnts:function(t,n,e,i){var s=new c["p"](t.y,t.z,n,n,e,i,!1,0),o=s.getPoints(50);o.forEach((function(t){t.z=t.y,t.y=t.x,t.x=0}));var r=(new c["h"]).setFromPoints(o),a=new c["y"]({color:16711680}),h=new c["w"](r,a);this.scene.add(h)},ellipse:function(t,n,e,i,s,o){console.log(t,n,e,i,s,o);var r=new c["p"](t.y,t.z,n,e,i,s,!1,o),a=r.getPoints(50);a.forEach((function(t){t.z=t.y,t.y=t.x,t.x=0}));var h=(new c["h"]).setFromPoints(a),l=new c["y"]({color:16711680}),p=new c["w"](h,l);this.scene.add(p)},ellipse2:function(t,n,e,i,s,o){console.log(t,n,e,i,s,o);var r=new c["p"](t.y,t.z,n,e,i,s,!1,o),a=r.getPoints(50);a.forEach((function(t){t.z=t.y,t.y=t.x,t.x=0}));var h=(new c["h"]).setFromPoints(a),l=new c["y"]({color:65280}),p=new c["w"](h,l);this.scene.add(p)},vec:function(t,n){var e=new c["U"];return e.copy(n).sub(t).normalize(),e},angleTwoV:function(t,n){var e=Math.atan2(n.z,n.y)-Math.atan2(t.z,t.y);return e},xdLeng:function(t,n){var e=Math.abs(n.y-t.y),i=Math.abs(n.z-t.z),s=Math.sqrt(Math.pow(e,2)+Math.pow(i,2));return s},positive:function(t){"x"==t&&this.camera.position.set(this.camerahight_ele*this.camerahight,0,0),"y"==t&&this.camera.position.set(0,this.camerahight_ele*this.camerahight,0),"z"==t&&this.camera.position.set(0,0,this.camerahight_ele*this.camerahight),this.camera.lookAt(this.scene.position),this.camera.updateMatrix()},negative:function(t){"x"==t&&this.camera.position.set(-1*this.camerahight_ele*this.camerahight,0,0),"y"==t&&this.camera.position.set(0,-1*this.camerahight_ele*this.camerahight,0),"z"==t&&this.camera.position.set(0,0,-1*this.camerahight_ele*this.camerahight),this.camera.lookAt(this.scene.position),this.camera.updateMatrix()},large:function(){var t=this;this.meshs.forEach((function(n){var e=n.scale.x*(1+t.mufactor),i=n.scale.y*(1+t.mufactor),s=n.scale.z*(1+t.mufactor);n.scale.set(e,i,s)}))},small:function(){var t=this;this.meshs.forEach((function(n){var e=n.scale.x*(1-t.mufactor),i=n.scale.y*(1-t.mufactor),s=n.scale.z*(1-t.mufactor);n.scale.set(e,i,s)}))},canwh:function(t,n){this.renderer.setSize(t,n)}}},v=u,f=e("2877"),y=Object(f["a"])(v,o,r,!1,null,null,null),w=y.exports,d={data:function(){return{point1:{y:10,z:0},point2:{y:20,z:0},point3:{y:15,z:10},dy:.5,dz:.5}},mounted:function(){},components:{process:w},methods:{getPoint:function(t,n){this.$refs.process.point(0,t,n)},getLine:function(){var t=[];t.push(this.point1),t.push(this.point2),t.push(this.point3),this.$refs.process.line(t)},offset:function(t){this.$refs.process.point(0,t.y+this.dy,t.z+this.dz)},interpolate:function(t,n,e){this.$refs.process.point(0,(t.y+n.y)*e,(t.z+n.z)*e)},project:function(){var t=[];t.push(this.point1),t.push(this.point2),t.push(this.point3),this.$refs.process.project(t)},normal:function(){var t=[];t.push(this.point1),t.push(this.point2),t.push(this.point3),this.$refs.process.normal(t)},intersect:function(){this.$refs.process.intersect()},bspline:function(){var t=[];t.push(this.point1),t.push(this.point2),t.push(this.point3),this.$refs.process.bspline(t)},bezier:function(){var t=[];t.push(this.point1),t.push(this.point2),t.push(this.point3),this.$refs.process.bezier(t)},curlOffset:function(){var t=[];t.push(this.point1),t.push(this.point2),t.push(this.point3),this.$refs.process.curlOffset(t,1.5)},extract:function(){var t=[];t.push(this.point1),t.push(this.point2),t.push(this.point3),this.$refs.process.extract(t,.8)},circleArcByThreePnts:function(){var t=this.locate(this.point1.y,this.point1.z,this.point2.y,this.point2.z,this.point3.y,this.point3.z);this.$refs.process.point(0,t.y,t.z);var n=this.xdLeng(t,this.point1),e=this.angle(t,this.point1),i=this.angle(t,this.point3);this.$refs.process.circleArcByThreePnts(t,n,i,e)},circleArcByCenterAndTwoPnts:function(){var t=this.xdLeng(this.point1,this.point2),n=this.angle(this.point1,this.point2),e=this.angle(this.point1,this.point3);this.$refs.process.circleArcByThreePnts(this.point1,t,e,n)},circleByThreePnts:function(){var t=this.locate(this.point1.y,this.point1.z,this.point2.y,this.point2.z,this.point3.y,this.point3.z);this.$refs.process.point(0,t.y,t.z);var n=this.xdLeng(t,this.point1);this.$refs.process.circleArcByThreePnts(t,n,0,2*Math.PI)},circleByCenterAndTwoPnts:function(){var t=this.xdLeng(this.point1,this.point2);this.$refs.process.circleArcByThreePnts(this.point1,t,0,2*Math.PI)},circleByCenterAndRaduis:function(t){this.$refs.process.circleArcByThreePnts(this.point1,t,0,2*Math.PI)},ellipseArcByCenterAndTwoPnts:function(){var t=this.xdLeng(this.point2,this.point1),n=this.xdLeng(this.point3,this.point1),e=this.angle(this.point1,this.point2),i=this.angle(this.point1,this.point3),s=e;console.log(e,i,s),this.$refs.process.ellipse(this.point1,t,n,i-s,e-s,s)},ellipseByCenterAndTwoPnts:function(){var t=this.xdLeng(this.point1,this.point2),n=this.xdLeng(this.point1,this.point3),e=this.angle(this.point1,this.point2),i=this.angle(this.point1,this.point3),s=e;console.log(e,i,s),this.$refs.process.ellipse2(this.point1,t,n,0,2*Math.PI,s)},locate:function(t,n,e,i,s,o){var r;r=(i-n)/(e-t);var c,a,h,l=(t+e)/2,p=(n+i)/2;return 0!=r?(c=p- -1/r*l,a=(Math.pow(t,2)+Math.pow(n,2)-Math.pow(s,2)-Math.pow(o,2)-2*c*n+2*c*o)/(2*(t-s-1/r*(n-o))),h=-1/r*a+c):(a=c=l,h=(Math.pow(t,2)+Math.pow(n,2)-Math.pow(s,2)-Math.pow(o,2)+2*a*(s-t))/(2*(n-o))),console.log("定位点X坐标: "+a),console.log("定位点Y坐标: "+h),{y:a,z:h}},xdLeng:function(t,n){var e=Math.abs(n.y-t.y),i=Math.abs(n.z-t.z),s=Math.sqrt(Math.pow(e,2)+Math.pow(i,2));return s},angle:function(t,n){var e=n.z-t.z,i=n.y-t.y;return Math.atan2(e,i)}}},m=d,g=Object(f["a"])(m,i,s,!1,null,null,null);n["default"]=g.exports},"7dac":function(t,n,e){"use strict";e.d(n,"a",(function(){return i}));e("c5f6"),e("28a5"),e("a481");var i=function(t){while(t.indexOf(" ")>0)t=t.replace(" "," ");return t}},defc:function(t,n,e){"use strict";e.d(n,"a",(function(){return a}));var i=e("4f7c"),s=e("a775"),o=e("9ca7"),r=e("cdfc"),c=e("72e8");function a(t,n,e,a){t=t||10,n=n||10,e=new c["a"](void 0!==e?e:4473924),a=new c["a"](void 0!==a?a:8947848);for(var h=n/2,l=t/n,p=t/2,u=[],v=[],f=0,y=0,w=-p;f<=n;f++,w+=l){u.push(0,-p,w,0,p,w),u.push(0,w,-p,0,w,p);var d=f===h?e:a;d.toArray(v,y),y+=3,d.toArray(v,y),y+=3,d.toArray(v,y),y+=3,d.toArray(v,y),y+=3}var m=new r["a"];m.setAttribute("position",new o["b"](u,3)),m.setAttribute("color",new o["b"](v,3));var g=new s["a"]({vertexColors:!0,toneMapped:!1});i["a"].call(this,m,g),this.type="GridHelper"}a.prototype=Object.assign(Object.create(i["a"].prototype),{constructor:a,copy:function(t){return i["a"].prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}})}}]);
|