CascadeStudio_3D_Manual
342 строки · 13.9 Кб
1{
2"settings": {3"hasHeaders": true,4"constrainDragToContainer": true,5"reorderEnabled": true,6"selectionEnabled": false,7"popoutWholeStack": false,8"blockedPopoutsThrowError": true,9"closePopoutsOnUnload": true,10"showPopoutIcon": false,11"showMaximiseIcon": false,12"showCloseIcon": false,13"responsiveMode": "onload",14"tabOverlapAllowance": 0,15"reorderOnTabMenuClick": true,16"tabControlOffset": 1017},18"dimensions": {19"borderWidth": 5,20"borderGrabWidth": 15,21"minItemHeight": 10,22"minItemWidth": 10,23"headerHeight": 20,24"dragProxyWidth": 300,25"dragProxyHeight": 20026},27"labels": {28"close": "close",29"maximise": "maximise",30"minimise": "minimise",31"popout": "open in new window",32"popin": "pop in",33"tabDropdown": "additional tabs"34},35"content": [36{37"type": "row",38"isClosable": true,39"reorderEnabled": true,40"title": "",41"content": [42{43"type": "stack",44"width": 31.428571428571427,45"isClosable": true,46"reorderEnabled": true,47"title": "",48"activeItemIndex": 0,49"content": [50{51"type": "component",52"componentName": "codeEditor",53"title": "* three-arm-library.json",54"componentState": {55"code": [56"",57"",58"function Dxy(currentPoint,dx,dy)",59"{ ",60" let newPoint = []; ",61" newPoint[0] = currentPoint[0] + dx;",62" newPoint[1] = currentPoint[1] + dy; ",63" return newPoint",64"}",65"",66"function Dx(currentPoint,dx)",67"{ ",68" let newPoint = []; ",69" newPoint[0] = currentPoint[0] + dx;",70" newPoint[1] = currentPoint[1] ; ",71" return newPoint",72"}",73"",74"function Dy(currentPoint,dy)",75"{ ",76" let newPoint = []; ",77" newPoint[0] = currentPoint[0];",78" newPoint[1] = currentPoint[1] + dy; ",79" return newPoint",80"}",81"",82"function Polar(currentPoint,distance,angleDegToX)",83"{ ",84" let newPoint = []; ",85" let angleRad = angleDegToX * Math.PI/180;",86" newPoint[0] = currentPoint[0] + (distance * Math.cos(angleRad));",87" newPoint[1] = currentPoint[1] + (distance * Math.sin(angleRad)); ",88" return newPoint",89"}",90"",91"function PolarX(currentPoint,xdistance,angleDegToX)",92"{ ",93" let newPoint = []; ",94" let angleRad = angleDegToX * Math.PI/180;",95" newPoint[0] = currentPoint[0] + xdistance;",96" newPoint[1] = currentPoint[1] + xdistance * Math.tan(angleRad); ",97" return newPoint",98"}",99"",100"function PolarY(currentPoint,ydistance,angleDegToX)",101"{ ",102" let newPoint = []; ",103" let angleRad = angleDegToX * Math.PI/180;",104" newPoint[0] = currentPoint[0] + ydistance/Math.tan(angleRad);",105" newPoint[1] = currentPoint[1] + ydistance; ",106" return newPoint",107"}",108"",109"function RadiusArc(currentPoint,endPoint,radius, clockwise)",110"{",111" let midPoint = [];",112" let dx = endPoint[0] - currentPoint[0];",113" let dy = endPoint[1] - currentPoint[1];",114" let dist = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));",115" let alpha = Math.asin(dy/dist);",116" let beta = Math.asin((dist/2)/radius);",117" let sag = radius - (Math.cos(beta) * radius)",118" if (dx<0){clockwise = !clockwise}",119" if (clockwise == true)",120" {",121" midPoint[0] = currentPoint[0] + dx/2 - Math.sin(alpha)*sag;",122" midPoint[1] = currentPoint[1] + dy/2 + Math.cos(alpha)*sag; ",123" }",124" else",125" {",126" midPoint[0] = currentPoint[0] + dx/2 + Math.sin(alpha)*sag;",127" midPoint[1] = currentPoint[1] + dy/2 - Math.cos(alpha)*sag;",128" }",129" return midPoint",130"}",131"",132"",133"function SagArc(currentPoint,endPoint,sag,clockwise)",134"{",135" let midPoint = [];",136" let dx = endPoint[0] - currentPoint[0];",137" let dy = endPoint[1] - currentPoint[1];",138" let dist = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));",139" let alpha = Math.asin(dy/dist);",140" if (dx<0){clockwise = !clockwise}",141" if (clockwise == true)",142" {",143" midPoint[0] = currentPoint[0] + dx/2 - Math.sin(alpha)*sag;",144" midPoint[1] = currentPoint[1] + dy/2 + Math.cos(alpha)*sag; ",145" }",146" else",147" {",148" midPoint[0] = currentPoint[0] + dx/2 + Math.sin(alpha)*sag;",149" midPoint[1] = currentPoint[1] + dy/2 - Math.cos(alpha)*sag;",150" }",151" return midPoint",152"}",153"",154"function MirrorX(currentPoint, yvalue)",155" {",156" let mirrorPoint = []; ",157" mirrorPoint[0] = currentPoint[0];",158" mirrorPoint[1] = yvalue - (currentPoint[1]-yvalue);",159" return mirrorPoint",160" }",161"",162"function MirrorY(currentPoint, xvalue)",163" {",164" let mirrorPoint = []; ",165" mirrorPoint[0] = xvalue - (currentPoint[0]-xvalue);",166" mirrorPoint[1] = currentPoint[1];",167" return mirrorPoint",168" }",169"",170"// parameters that define the design intent",171"let d = 45; // distance center to radius of arm",172"let r0 = 10; // radius top of arm",173"let adeg = 13; // widening angle of arm",174"let arad = adeg * Math.PI/180; ",175"let d1 = d + Math.sin(arad)*r0",176"let r1 = 13; // inner radius of center cylinder",177"let t1 = 5 ; // wall thickness of center cylinder ",178"let h1 = 37; // height of inner cylinder",179"let h2 = 10; // height at end of the arm",180"let gamma = 25; // angle deg from tip of arm to cylinder",181"let r2 = 25; // radius of fillets between arms",182"let t3 = 7 ; // wallthickness arms",183"let r3 = 10; // cylinder at end of arms",184"let r4 = 1.5 // rounding of cutout",185"let ra = 2.5 // radius of hole at end of arm",186"let rcb = 5 // radius of counterbore ",187"let hcb = 7 // height of counterbore",188"",189"",190"// generate center cylinder",191"let centerCyl0 = Translate([0,0,h1/2],Cylinder((r1+t1),h1,true))",192"let armCyl = Translate([0,d,h1/2], Cylinder(r3,h1,true))",193"",194"// points for sketch of the arm",195"let p0 = [0,0];",196"let p1 = Dy(p0, d);",197"let p2 = Polar(p1,r0,adeg);",198"let p3 = MirrorY(p2,0);",199"let p4 = RadiusArc(p2,p3,r0,false);",200"let p5 = PolarY(p2,-d1,adeg-90)",201"let p6 = MirrorY(p5,0)",202"",203"// generate sketch of one arm ",204"let armSketch = new Sketch(p0)",205".LineTo(p5)",206".LineTo(p2)",207".ArcTo(p4,p3)",208".LineTo(p6)",209".LineTo(p0)",210".End().Face()",211"let arm1 = Extrude(armSketch,[0,0,h1]);",212"let armCutout = Offset(arm1,-t3,0.01,true);",213"let armCutout1 = Difference(armCutout,[centerCyl0,armCyl]);",214"let armCutout2 = Translate([0,0,h1/2],armCutout1,true);",215"let armCutout3 = Translate([0,0,-h1/2],armCutout1,true);",216"armCutout = Union([armCutout1,armCutout2,armCutout3]);",217"armCutout = Offset(armCutout,-r4);",218"armCutout = Offset(armCutout,r4);",219"arm1 = Difference(arm1,[armCutout], false);",220"",221"// copy three rotated arms",222"let arm2 = Rotate([0,0,1],120,arm1,true)",223"let arm3 = Rotate([0,0,1],240,arm1,true)",224"",225"let arms = Union([arm1,arm2,arm3])",226"arms = FilletEdges(arms, r2, [34,39,61])",227"",228"// create sketch of cutting object to taper arms",229"let pc0 = [d+r0+5,h2]",230"let pc1 = [d+r0,h2];",231"let pc2 = PolarX(pc1, -(r0+d)+(r1+t1),(180-gamma));",232"let pc3 = Dx(pc2,-t1-r1/2)",233"let pc4 = Dy(pc3,h1);",234"let pc5 = Dx(pc4,d+r0+10);",235"let pc6 = pc0;",236"",237"let cutterSketch = new Sketch(pc0)",238".LineTo(pc0)",239".LineTo(pc1)",240".LineTo(pc2)",241".LineTo(pc3)",242".LineTo(pc4)",243".LineTo(pc5)",244".LineTo(pc6)",245".End().Face(true);",246"let cutterFace = Rotate([1,0,0],90,cutterSketch);",247"let cutterShape= Revolve(cutterFace);",248"let shapedArms = Difference(arms,[cutterShape], false);",249"shapedArms = FilletEdges(shapedArms,1.5,[51])",250"",251"let centerCyl1 = Translate([0,0,h1/2],Cylinder((r1+t1),h1,true))",252"let centerHole = Translate([0,0,h1/2],Cylinder((r1),h1+20,true))",253"let armHole = Translate([0,d,h1/2],Cylinder((ra),h1+20,true))",254"let countHole = Translate([0,d,hcb],Cylinder((rcb),h1+20,false))",255"let armHoleCb1 = Union([countHole,armHole])",256"let armHoleCb2 = Rotate([0,0,1],120,armHoleCb1,true)",257"let armHoleCb3 = Rotate([0,0,1],240,armHoleCb1,true)",258"",259"",260"",261"let armsTot = Union([shapedArms,centerCyl1]);",262"let armsTot1 = Difference(armsTot,[centerHole]);",263"let armsTot2 = Difference(armsTot1,[armHoleCb1,armHoleCb2,armHoleCb3]);",264"",265"let armsTot3 = Rotate([1,0,0],-90,Translate([100,0,0],armsTot2,true))",266""267]268},269"width": 50,270"isClosable": false,271"reorderEnabled": true272}273]274},275{276"type": "column",277"isClosable": true,278"reorderEnabled": true,279"title": "",280"width": 68.57142857142857,281"content": [282{283"type": "stack",284"height": 80,285"isClosable": true,286"reorderEnabled": true,287"title": "",288"activeItemIndex": 0,289"content": [290{291"type": "component",292"componentName": "cascadeView",293"title": "CAD View",294"componentState": {295"componentName": "cascadeView",296"MeshRes": 0.1,297"MeshResRange": [2980.01,2992300],301"Cache?": true,302"Radius": 30,303"RadiusRange": [30420,30540306]307},308"isClosable": false,309"reorderEnabled": true310}311]312},313{314"type": "stack",315"height": 20,316"isClosable": true,317"reorderEnabled": true,318"title": "",319"activeItemIndex": 0,320"content": [321{322"type": "component",323"componentName": "console",324"title": "Console",325"componentState": {},326"height": 20,327"isClosable": false,328"reorderEnabled": true329}330]331}332]333}334]335}336],337"isClosable": true,338"reorderEnabled": true,339"title": "",340"openPopouts": [],341"maximisedItemId": null342}