@@ -29,27 +29,27 @@ plateRevolve = startSketchOn(YZ)
29
29
|> close()
30
30
|> revolve(axis = Y, angle = 65, symmetric = true)
31
31
32
+ // Define a function to create and extrude holes
33
+ fn holeFn(@center) {
34
+ return startSketchOn(XZ)
35
+ |> circle(center = center, diameter = boltSize)
36
+ |> extrude(length = -100)
37
+ }
38
+
32
39
// Create a hole sketch with the size and location of each bolt hole
33
- holeSketch = startSketchOn(XZ)
34
- hole01 = circle(holeSketch, center = [0, 12.25], radius = boltSize / 2)
35
- |> extrude(length = -100)
36
- hole02 = circle(holeSketch, center = [0, 29.5], radius = boltSize / 2)
37
- |> extrude(length = -100)
38
- hole03 = circle(holeSketch, center = [0, 46.25], radius = boltSize / 2)
39
- |> extrude(length = -100)
40
- hole04 = circle(holeSketch, center = [0, 77], radius = boltSize / 2)
41
- |> extrude(length = -100)
42
- hole05 = circle(holeSketch, center = [0, 100], radius = boltSize / 2)
43
- |> extrude(length = -100)
44
- hole06 = circle(holeSketch, center = [0, 130], radius = boltSize / 2)
45
- |> extrude(length = -100)
46
- hole07 = circle(holeSketch, center = [-20, 130], radius = boltSize / 2)
47
- |> extrude(length = -100)
48
- hole08 = circle(holeSketch, center = [20, 130], radius = boltSize / 2)
49
- |> extrude(length = -100)
40
+ holeCenters = [
41
+ [0, 12.25],
42
+ [0, 29.5],
43
+ [0, 46.25],
44
+ [0, 77],
45
+ [0, 100],
46
+ [0, 130],
47
+ [-20, 130],
48
+ [20, 130]
49
+ ]
50
+
51
+ // Use map to apply the hole creation function to the list of center coordinates
52
+ holes = map(holeCenters, f = holeFn)
50
53
51
- // Cut each guiding clearance hole from the bone plate
52
- solid001 = subtract([plateRevolve], tools = union([hole01, hole02]))
53
- solid002 = subtract([solid001], tools = union([hole03, hole04]))
54
- solid003 = subtract([solid002], tools = union([hole05, hole06]))
55
- solid004 = subtract([solid003], tools = union([hole07, hole08]))
54
+ // Cut each guiding clearance hole from the bone plate using a single subtract operation
55
+ solid = subtract([plateRevolve], tools = holes)
0 commit comments