"""Auto-converted from Extruder-cable-clip.scad — cadbuildr.foundation port.""" from cadbuildr.foundation import ( Part, Sketch, Point, Square, Rectangle, Circle, RegularPolygon, RectangleRounded, Extrusion, Lathe, Hole, Cylinder, Box, Sphere, Cone, show, ) # Offset from translate([6,-28,-28]) applied at call site OX, OY, OZ = 6, -28, -28 class ExtruderCableClip(Part): def __init__(self): super().__init__() sketch = self._sketch = Sketch(self.xy()) # body shape — cylinders rotated 90 around Y (lying along X), approx as boxes # translate([-6,28,28]) rotate([0,90,0]) cylinder(h=6,r=13.5) self._add_box(-6 + 6/2 + OX, 28 + OY, 28 + OZ, 6, 27, 27) # translate([-10,28,28]) rotate([0,90,0]) cylinder(h=4,r1=8.5,r2=13.5) self._add_box(-10 + 4/2 + OX, 28 + OY, 28 + OZ, 4, 27, 27) # translate([0,16.6,28]) cube([2.9,22.8,7]) self._add_box(0 + 2.9/2 + OX, 16.6 + 22.8/2 + OY, 28 + 7/2 + OZ, 2.9, 22.8, 7) # bottom cut and shape self._add_box(-15 + 30/2 + OX, 7 + 40/2 + OY, 13 + 15/2 + OZ, 30, 40, 15, cut=True) self._add_cyl(-20 + OX, 28 + OY, 28 + OZ, 6, 40, cut=True) # screws (rotated 90 around Z -> along Y, approx as vertical cylinders) self._add_cyl(-2.7 + OX, 19.5 + OY, 25 + OZ, 1.6, 10, cut=True) self._add_cyl(-2.7 + OX, 36.5 + OY, 25 + OZ, 1.6, 10, cut=True) self._add_cyl(-2.7 + OX, 36.5 + OY, 32 + OZ, 3.1, 13, cut=True) self._add_cyl(-2.7 + OX, 19.5 + OY, 32 + OZ, 3.1, 13, cut=True) # screw head openings self._add_box(-2.7 + 10/2 + OX, 16.4 + 6.2/2 + OY, 35 + 15/2 + OZ, 10, 6.2, 15, cut=True) self._add_box(-2.7 + 10/2 + OX, 33.4 + 6.2/2 + OY, 35 + 15/2 + OZ, 10, 6.2, 15, cut=True) # cable grip inner cut self._add_cyl(-20 + OX, 28 + OY, 28 + OZ, 5.5, 40, cut=True) # nylon hole (angled — approximate as vertical cylinder) self._add_cyl(-3 + OX, 28 + OY, 28 + OZ, 1.8, 24, cut=True) def _pt(self, x, y): return Point(self._sketch, x, y) def _add_box(self, x, y, z, w, d, h, cut=False): self.add_operation(Box(self._pt(x, y), w, d, h, cut=cut)) def _add_cyl(self, x, y, z, radius, height, cut=False): self.add_operation(Cylinder(self._pt(x, y), radius, height, cut=cut)) def _add_cone(self, x, y, z, r1, r2, height): self.add_operation(Cone(self._pt(x, y), r1, r2, height)) def _add_sphere(self, x, y, z, radius, cut=False): self.add_operation(Sphere(self._pt(x, y), radius, cut=cut)) def _add_extrusion(self, shape, end, start=0, cut=False): self.add_operation(Extrusion(shape, end=end, start=start, cut=cut)) part = ExtruderCableClip() show(part)