| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  | --- | 
					
						
							|  |  |  | source: kcl-lib/src/simulation_tests.rs | 
					
						
							|  |  |  | description: Result of unparsing fillet-and-shell.kcl | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | rpizWidth = 30 | 
					
						
							|  |  |  | rpizLength = 65 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | caseThickness = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | border = 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | screwHeight = 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | caseWidth = rpizWidth + border * 2 | 
					
						
							|  |  |  | caseLength = rpizLength + border * 2 | 
					
						
							|  |  |  | caseHeight = 8 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | widthBetweenScrews = 23 | 
					
						
							|  |  |  | lengthBetweenScrews = 29 * 2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | miniHdmiDistance = 12.4 | 
					
						
							|  |  |  | microUsb1Distance = 41.4 | 
					
						
							|  |  |  | microUsb2Distance = 54 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | miniHdmiWidth = 11.2 | 
					
						
							|  |  |  | microUsbWidth = 7.4 | 
					
						
							|  |  |  | connectorPadding = 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | miniHdmiHole = startSketchOn(XY) | 
					
						
							| 
									
										
										
										
											2025-04-25 16:01:35 -05:00
										 |  |  |   |> startProfile(at = [ | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  |        0, | 
					
						
							|  |  |  |        border + miniHdmiDistance - (miniHdmiWidth / 2) | 
					
						
							| 
									
										
										
										
											2025-04-25 16:01:35 -05:00
										 |  |  |      ]) | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  |   |> line(endAbsolute = [ | 
					
						
							|  |  |  |        0, | 
					
						
							|  |  |  |        border + miniHdmiDistance + miniHdmiWidth / 2 | 
					
						
							|  |  |  |      ]) | 
					
						
							|  |  |  |   |> line(endAbsolute = [ | 
					
						
							|  |  |  |        1, | 
					
						
							|  |  |  |        border + miniHdmiDistance + miniHdmiWidth / 2 | 
					
						
							|  |  |  |      ]) | 
					
						
							|  |  |  |   |> line(endAbsolute = [ | 
					
						
							|  |  |  |        1, | 
					
						
							|  |  |  |        border + miniHdmiDistance - (miniHdmiWidth / 2) | 
					
						
							|  |  |  |      ]) | 
					
						
							|  |  |  |   |> close(%) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-21 22:39:12 +13:00
										 |  |  | case = startSketchOn(XY) | 
					
						
							| 
									
										
										
										
											2025-04-25 16:01:35 -05:00
										 |  |  |   |> startProfile(at = [0, 0]) | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  |   |> line(endAbsolute = [caseWidth, 0], tag = $edge1) | 
					
						
							|  |  |  |   |> line(endAbsolute = [caseWidth, caseLength], tag = $edge2) | 
					
						
							|  |  |  |   |> line(endAbsolute = [0, caseLength], tag = $edge3) | 
					
						
							|  |  |  |   |> close(tag = $edge4) | 
					
						
							|  |  |  |   |> extrude(length = caseHeight) | 
					
						
							|  |  |  |   |> fillet( | 
					
						
							|  |  |  |        radius = 1, | 
					
						
							|  |  |  |        tags = [ | 
					
						
							|  |  |  |          getNextAdjacentEdge(edge1), | 
					
						
							|  |  |  |          getNextAdjacentEdge(edge2), | 
					
						
							|  |  |  |          getNextAdjacentEdge(edge3), | 
					
						
							|  |  |  |          getNextAdjacentEdge(edge4) | 
					
						
							|  |  |  |        ], | 
					
						
							|  |  |  |      ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fn m25Screw(x, y, height) { | 
					
						
							| 
									
										
										
										
											2025-03-21 22:39:12 +13:00
										 |  |  |   screw = startSketchOn(XY) | 
					
						
							| 
									
										
										
										
											2025-04-25 16:01:35 -05:00
										 |  |  |     |> startProfile(at = [0, 0]) | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  |     |> circle(center = [x, y], radius = 2.5) | 
					
						
							| 
									
										
										
										
											2025-04-26 15:31:51 -05:00
										 |  |  |     |> subtract2d(tool = circle(center = [x, y], radius = 1.25)) | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  |     |> extrude(length = height) | 
					
						
							|  |  |  |   return screw | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-05-01 11:36:51 -05:00
										 |  |  | m25Screw(x = border + rpizWidth / 2 - (widthBetweenScrews / 2), y = 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), height = screwHeight) | 
					
						
							|  |  |  | m25Screw(x = border + rpizWidth / 2 - (widthBetweenScrews / 2), y = 0 + border + rpizLength / 2 + lengthBetweenScrews / 2, height = screwHeight) | 
					
						
							|  |  |  | m25Screw(x = border + rpizWidth / 2 + widthBetweenScrews / 2, y = 0 + border + rpizLength / 2 + lengthBetweenScrews / 2, height = screwHeight) | 
					
						
							|  |  |  | m25Screw(x = border + rpizWidth / 2 + widthBetweenScrews / 2, y = 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), height = screwHeight) | 
					
						
							| 
									
										
										
										
											2025-03-20 11:06:27 +13:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-14 20:37:45 +12:00
										 |  |  | shell(case, faces = [END], thickness = caseThickness) |