[机器小伟]在[工程师阿伟]的陪同下进入了筑基后期的修炼,
这次要修炼的目标是[投影与视图 小结与复习题]。
正剧开始:
星历2016年04月06日 11:42:52, 银河系厄尔斯星球*江南行省。
[工程师阿伟]正在和[机器小伟]一起研究[投影与视图 小结与复习题]。
<span style="font-size:18px;">//立方体的三视图 if (1) { var r = 20; config.setSector(1,1,1,1); config.graphPaper2D(0, 0, r); config.axis3D(0, 0, 0, 190); var array = [ [0,0,0],[0,1,0],[0,2,0], [0,0,1],[0,1,1], [0,0,2] ]; for (var i = 0; i < array.length; i++) { array[i][2] = 2-array[i][2]; } array = shape.xyzSort(array); shape.threeView(array); }</span>
<span style="font-size:18px;">//画出三视图 //题4 if (1) { var r = 20; var array = []; var tmp = [], tmp2 = []; //圆柱 tmp = shape.nEdge(0, 0, 1, 36); var len = tmp.length; for (var i = 0; i < len; i++) { array.push([tmp[i][0], 1,tmp[i][1]]); array.push([tmp[i][0], -1,tmp[i][1]]); } //三棱柱 tmp = shape.nEdge(0, 0, 1, 3); len = tmp.length; //对于点数过于稀少的,进行插值处理 var x1 = x2 = y1 = y2 = 0; var dx = dy = 0; for (var i = 0; i < len; i++) { if (i == len-1) { x1 = tmp[i][0]; x2 = tmp[0][0]; y1 = tmp[i][1]; y2 = tmp[0][1]; } else { x1 = tmp[i][0]; x2 = tmp[i+1][0]; y1 = tmp[i][1]; y2 = tmp[i+1][1]; } dx = (x2-x1)/10; dy = (y2-y1)/10; for (var j = 0; j < 10; j++) { tmp.push([x1 + j*dx, y1 + j*dy]); } } len = tmp.length; for (var i = 0; i < len; i++) { array.push([tmp[i][0], 1,tmp[i][1]]); array.push([tmp[i][0], 2,tmp[i][1]]); } //document.write(array); var points = array.length; //document.write(points); config.setSector(2,2,1,1); config.axis2D(0, 0, 90); var leftView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.pointLeft(tmp[0], tmp[1], tmp[2]); leftView.push([tmp2[0], tmp2[1]]); } leftView = shape.xyzSort(leftView); shape.pointDraw(leftView, 'red', r); plot.fillText('左视图', -100, -50, 100); config.setSector(2,2,1,2); config.axis2D(0, 0, 90); var frontView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.pointFront(tmp[0], tmp[1], tmp[2]); frontView.push([tmp2[0], tmp2[1]]); } frontView = shape.xyzSort(frontView); shape.pointDraw(frontView, 'red', r); plot.fillText('主视图', -100, -50, 100); config.setSector(2,2, 2, 1); config.axis2D(0, 0, 90); var topView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.pointTop(tmp[0], tmp[1], tmp[2]); topView.push([tmp2[0], tmp2[1]]); } topView = shape.xyzSort(topView); shape.pointDraw(topView, 'red', r); plot.fillText('俯视图', -100, -50, 100); config.setSector(2,2,2,2); config.axis3D(0, 0, 0, 90); var _3DView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.point3D(tmp[0], tmp[1], tmp[2]); _3DView.push([tmp2[0], tmp2[1]]); } _3DView = shape.xyzSort(_3DView); shape.pointDraw(_3DView, 'blue', r); plot.fillText('三维图', -100, -50, 100); }</span>
<span style="font-size:18px;">//画出三视图 //题5 if (0) { var r = 20; var array = []; var tmp = [], tmp2 = []; //六棱柱 tmp = shape.nEdge(0, 0, 1, 6); len = tmp.length; //对于点数过于稀少的,进行插值处理 var x1 = x2 = y1 = y2 = 0; var dx = dy = 0; for (var i = 0; i < len; i++) { if (i == len-1) { x1 = tmp[i][0]; x2 = tmp[0][0]; y1 = tmp[i][1]; y2 = tmp[0][1]; } else { x1 = tmp[i][0]; x2 = tmp[i+1][0]; y1 = tmp[i][1]; y2 = tmp[i+1][1]; } dx = (x2-x1)/10; dy = (y2-y1)/10; for (var j = 0; j < 10; j++) { tmp.push([x1 + j*dx, y1 + j*dy]); } } len = tmp.length; for (var i = 0; i < len; i++) { array.push([tmp[i][0], 0,tmp[i][1]]); array.push([tmp[i][0], 2,tmp[i][1]]); } //document.write(array); var points = array.length; //document.write(points); config.setSector(2,2,1,1); config.axis2D(0, 0, 90); var leftView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.pointLeft(tmp[0], tmp[1], tmp[2]); leftView.push([tmp2[0], tmp2[1]]); } leftView = shape.xyzSort(leftView); shape.pointDraw(leftView, 'red', r); plot.fillText('左视图', -100, -50, 100); config.setSector(2,2,1,2); config.axis2D(0, 0, 90); var frontView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.pointFront(tmp[0], tmp[1], tmp[2]); frontView.push([tmp2[0], tmp2[1]]); } frontView = shape.xyzSort(frontView); shape.pointDraw(frontView, 'red', r); plot.fillText('主视图', -100, -50, 100); config.setSector(2,2, 2, 1); config.axis2D(0, 0, 90); var topView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.pointTop(tmp[0], tmp[1], tmp[2]); topView.push([tmp2[0], tmp2[1]]); } topView = shape.xyzSort(topView); shape.pointDraw(topView, 'red', r); plot.fillText('俯视图', -100, -50, 100); config.setSector(2,2,2,2); config.axis3D(0, 0, 0, 90); var _3DView = []; for (var i = 0; i < points; i++) { tmp = array[i]; tmp2 = shape.point3D(tmp[0], tmp[1], tmp[2]); _3DView.push([tmp2[0], tmp2[1]]); } _3DView = shape.xyzSort(_3DView); shape.pointDraw(_3DView, 'blue', r); plot.fillText('三维图', -100, -50, 100); }</span>
<span style="font-size:18px;"> if (1) { var mathText = new MathText(); var s = [ 'V_[1] = pi*4^[2]/4*2+pi*8^[2]/4*8', ' = 427.312', ' ', 'V_[2] = pi*2^[2]/2*2+6*4*2', ' = 60.568' ]; var x =40, y=40; var r1 = 40; var len = s.length; for (var i = 0; i < len; i++) { if (s[i] == '') { if (x < 100) { x += 300; y-=r1*3; } else { x = 20; y += r1; } } else { mathText.print(s[i], x, y); y+=r1; } } }</span>
到这里为止, 筑基期的功法,小伟就全部修炼完毕了,从此将进入结丹期,
同时也进入高阶修士的行列。
在此里,阿伟也要怀念一下初中时的数学老师汪戬春老师,其实用怀念这个词可能不恰当,
毕竟当年他也估摸也就三十出头的年纪,现在也不过知天命之年,肯定健在。整个小学,阿伟
记忆中好像数学老师都是女的,反而语文老师有好几个男的,直到初中这种现象才有所改变。
当年初见面时,这位班主任加数学老师,一副雄纠纠气昂昂的威猛霸气,左手拎一本代数,右手
拿一本几何,把全班同学吓得见到他就哆嗦,真是出尽了风头,而且一连三年,都是如此。
于是,阿伟那花季的青春岁月,除了和书本打交道外,真的是什么都没有留下了。
不过诸位不要搞错,阿伟也算得上那个年代的学霸,所以所有老师对阿伟还是关怀备至的。
唉,只是人生苦短啊,好多当年没有享受到的乐趣,即使现在想去享受,也时过境迁,没有那个
兴致了。
也不知多少人能看到这里,权当留个纪念吧。毕竟对于绝大多数人来说,这都是三年的青葱岁月,
有多少的梦幻,但总是很难成真。
本节到此结束,欲知后事如何,请看下回分解。