CascadeStudio_3D_Manual
367 строк · 14.8 Кб
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": 50,45"isClosable": true,46"reorderEnabled": true,47"title": "",48"activeItemIndex": 0,49"content": [50{51"type": "component",52"componentName": "codeEditor",53"title": "three-arm-arm.json",54"componentState": {55"code": [56"// Three armed lever",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"// testing function to check if sketching commands work correctly",171"// let q0 = [0,0]",172"// let q1= [50,0]",173"// let q1a = SagArc(q0,q1,5,false)",174"// let q2= [50,50]",175"// let q2a = SagArc(q1,q2,5,false)",176"// let q3= [0,50]",177"// let q3a= SagArc(q2,q3,5,false)",178"// let q4= [0,0]",179"// let q4a= SagArc(q3,q4,5,false)",180"",181"// let qsketch=new Sketch(q0)",182"// .ArcTo(q1a,q1)",183"// .ArcTo(q2a,q2)",184"// .ArcTo(q3a,q3)",185"// .ArcTo(q4a,q4)",186"// .End().Face()",187"",188"// Box(10,10,10,false) // can be used to determine position of the axes. ",189"",190"// parameters that define the design intent",191"let d = 45; // distance center to radius of arm",192"let r0 = 10; // radius top of arm",193"let adeg = 13; // widening angle of arm",194"let arad = adeg * Math.PI/180; ",195"let d1 = d + Math.sin(arad)*r0",196"let r1 = 13; // inner radius of center cylinder",197"let t1 = 5 ; // wall thickness of center cylinder ",198"let h1 = 37; // height of inner cylinder",199"let h2 = 10; // height at end of the arm",200"let gamma = 25; // angle deg from tip of arm to cylinder",201"let r2 = 25; // radius of fillets between arms",202"let t3 = 7 ; // wallthickness arms",203"let r3 = 10; // cylinder at end of arms",204"let r4 = 1.5 // rounding of cutout",205"let ra = 2.5 // radius of hole at end of arm",206"let rcb = 5 // radius of counterbore ",207"let hcb = 7 // height of counterbore",208"",209"// generate center cylinder",210"let centerCyl0 = Translate([0,0,h1/2],Cylinder((r1+t1),h1,true))",211"let armCyl = Translate([0,d,h1/2], Cylinder(r3,h1,true))",212"",213"// points for sketch of the arm",214"let p0 = [0,0];",215"let p1 = Dy(p0, d);",216"let p2 = Polar(p1,r0,adeg);",217"let p3 = MirrorY(p2,0);",218"let p4 = RadiusArc(p2,p3,r0,false);",219"let p5 = PolarY(p2,-d1,adeg-90)",220"let p6 = MirrorY(p5,0)",221"",222"// generate sketch of one arm ",223"let armSketch = new Sketch(p0)",224".LineTo(p5)",225".LineTo(p2)",226".ArcTo(p4,p3)",227".LineTo(p6)",228".LineTo(p0)",229".End().Face()",230"let arm1 = Extrude(armSketch,[0,0,h1]);",231"let armCutout = Offset(arm1,-t3,0.01,true);",232"let armCutout1 = Difference(armCutout,[centerCyl0,armCyl]);",233"let armCutout2 = Translate([0,0,h1/2],armCutout1,true);",234"let armCutout3 = Translate([0,0,-h1/2],armCutout1,true);",235"armCutout = Union([armCutout1,armCutout2,armCutout3]);",236"armCutout = Offset(armCutout,-r4);",237"armCutout = Offset(armCutout,r4);",238"arm1 = Difference(arm1,[armCutout]);",239"",240"// copy three rotated arms",241"let arm2 = Rotate([0,0,1],120,arm1,true)",242"let arm3 = Rotate([0,0,1],240,arm1,true)",243"",244"let arms = Union([arm1,arm2,arm3])",245"arms = FilletEdges(arms, r2, [34,39,61])",246"",247"// create sketch of cutting object to taper arms",248"let pc0 = [d+r0+5,h2]",249"let pc1 = [d+r0,h2];",250"let pc2 = PolarX(pc1, -(r0+d)+(r1+t1),(180-gamma));",251"let pc3 = Dx(pc2,-t1-r1/2)",252"let pc4 = Dy(pc3,h1);",253"let pc5 = Dx(pc4,d+r0+10);",254"let pc6 = pc0;",255"",256"let cutterSketch = new Sketch(pc0)",257".LineTo(pc0)",258".LineTo(pc1)",259".LineTo(pc2)",260".LineTo(pc3)",261".LineTo(pc4)",262".LineTo(pc5)",263".LineTo(pc6)",264".End().Face(true);",265"let cutterFace = Rotate([1,0,0],90,cutterSketch);",266"let cutterShape= Revolve(cutterFace,false,false);",267"let cutterShape1 = RemoveInternalEdges(cutterShape);",268"let shapedArms = Difference(arms,[cutterShape1]);",269"shapedArms = FilletEdges(shapedArms,1.5,[51])",270"",271"let centerCyl1 = Translate([0,0,h1/2],Cylinder((r1+t1-2),h1,true))",272"let centerHole = Translate([0,0,h1/2],Cylinder((r1),h1+20,true))",273"let armHole = Translate([0,d,h1/2],Cylinder((ra),h1+20,true))",274"let countHole = Translate([0,d,hcb],Cylinder((rcb),h1+20,false))",275"let armHoleCb1 = Union([countHole,armHole])",276"let armHoleCb2 = Rotate([0,0,1],120,armHoleCb1,true)",277"let armHoleCb3 = Rotate([0,0,1],240,armHoleCb1,true)",278"",279"",280"",281"let armsTot = Union([shapedArms,centerCyl1])",282"let armsTot1 = Difference(armsTot,[centerHole]);",283"let armsTot2 = Difference(armsTot1,[armHoleCb1,armHoleCb2,armHoleCb3]);",284"",285"",286"",287"",288"",289"",290"",291""292]293},294"width": 50,295"isClosable": false,296"reorderEnabled": true297}298]299},300{301"type": "column",302"isClosable": true,303"reorderEnabled": true,304"title": "",305"width": 50,306"content": [307{308"type": "stack",309"height": 80,310"isClosable": true,311"reorderEnabled": true,312"title": "",313"activeItemIndex": 0,314"content": [315{316"type": "component",317"componentName": "cascadeView",318"title": "CAD View",319"componentState": {320"componentName": "cascadeView",321"MeshRes": 0.1,322"MeshResRange": [3230.01,3242325],326"Cache?": false,327"Radius": 30,328"RadiusRange": [32920,33040331]332},333"isClosable": false,334"reorderEnabled": true335}336]337},338{339"type": "stack",340"height": 20,341"isClosable": true,342"reorderEnabled": true,343"title": "",344"activeItemIndex": 0,345"content": [346{347"type": "component",348"componentName": "console",349"title": "Console",350"componentState": {},351"height": 20,352"isClosable": false,353"reorderEnabled": true354}355]356}357]358}359]360}361],362"isClosable": true,363"reorderEnabled": true,364"title": "",365"openPopouts": [],366"maximisedItemId": null367}
368