"""Auto-converted from Einsy-doors.scad — cadbuildr.foundation port.""" from cadbuildr.foundation import ( Part, Sketch, Point, Square, Rectangle, Circle, RegularPolygon, RectangleRounded, Extrusion, Lathe, Hole, Cylinder, Box, Sphere, Cone, show, ) class EinsyDoors(Part): def __init__(self): super().__init__() sketch = self._sketch = Sketch(self.xy()) # === body() === self._add_box(105.5/2, 87.5/2, 1.5/2, 105.5, 87.5, 1.5) self._add_box(105.5/2, 2/2, 16/2, 105.5, 2, 16) self._add_box(2/2, 87.5/2, 16/2, 2, 87.5, 16) # corner reinforcements self._add_box(98 + 7.5/2, 1 + 5/2, 16/2, 7.5, 5, 16) self._add_box(0.5 + 5/2, 0.5 + 6.5/2, 16/2, 5, 6.5, 16) self._add_box(1 + 10/2, 87.5/2, 6/2, 10, 87.5, 6) self._add_box(99.5 + 6/2, 87.5/2, 7/2, 6, 87.5, 7) self._add_box(10 + 6/2, 5/2, 6/2, 6, 5, 6) # screw thread body self._add_box(54 + 9.5/2, 2 + 6/2, 16/2, 9.5, 6, 16) # rounded side (cylinder along X at y=87.5, z=4.5) self._add_cyl(105.5/2, 87.5, 4.5, 4.5, 105.5) # upper hinge reinforcement self._add_box(0.5 + 26/2, 69 + 20/2, -9 + 10/2, 26, 20, 10) # door closing bumps self._add_cone(4, 3.5, 12.8, 1.8, 3.5, 3.2) self._add_cone(102, 3.5, 12.8, 1.8, 3.5, 3.2) # === cutouts() === # door closing screw self._add_cyl(58.5, 4, 1, 1.8, 17, cut=True) self._add_cone(58.5, 4, 14.5, 1.8, 2.2, 2.6) # approx self._add_box(58.5, 4 + 2.5, 4, 5.7, 3.8, 1, cut=True) self._add_box(58.5, 4 + 3, 4, 3.8, 3.8, 1, cut=True) # ventilation holes (10 slots) for i in range(10): self._add_box(40 + i*6 + 3.65/2, 10.5 + (19+50)/2, -1 + 1.2/2, 3.65, 19+50, 1.2, cut=True) self._add_box(40 + i*6 + 3.65/2, 10.5 + 19/2, -1 + 10/2, 3.65, 19, 10, cut=True) self._add_box(40 + i*6 + 3.65/2, 10.5+25 + 19/2, -1 + 10/2, 3.65, 19, 10, cut=True) self._add_box(40 + i*6 + 3.65/2, 10.5+50 + 19/2, -1 + 10/2, 3.65, 19, 10, cut=True) # large ventilation panel self._add_box(15 + 20/2, 10 + 55/2, 1 + 1.5/2, 20, 55, 1.5, cut=True) # rounded side cutoff self._add_cyl(26.5 + 73/2, 87.5, 4.5, 3.5, 73, cut=True) self._add_box(26.5 + 73/2, 80 + 19/2, 5 + 10/2, 73, 19, 10, cut=True) self._add_box(26.5 + 73/2, 82.5 + 5/2, 1 + 10/2, 73, 5, 10, cut=True) # upper hinge cuts self._add_box(0 + 30/2, 60 + 30/2, -10 + 10/2, 30, 30, 10, cut=True) self._add_box(-1 + 22.5/2, 87.5 + 10/2, 0 + 10/2, 22.5, 10, 10, cut=True) self._add_box(2 + 19.5/2, 80 + 10/2, 6 + 10/2, 19.5, 10, 10, cut=True) self._add_cyl(-5 + 26.5/2, 87.5, 4.5, 2.5, 26.5, cut=True) # hinge hole (full width) self._add_cyl(-5 + 120/2, 87.5, 4.5, 2.6, 120, cut=True) # door closing inner cone cuts self._add_cone(4, 3.5, 12.9, 1.2, 2.8, 3.2) # approx self._add_cone(102, 3.5, 12.9, 1.2, 2.8, 3.2) # M3 nut slot self._add_box(55.65 + 5.7/2, 0.5 + 10/2, 12 + 2.2/2, 5.7, 10, 2.2, cut=True) # side lightning slots self._add_box(2 + 7/2, 10 + 65/2, 3 + 5/2, 7, 65, 5, cut=True) self._add_box(101 + 3/2, 10 + 70/2, 3 + 5/2, 3, 70, 5, cut=True) # large corner cut self._add_box(0 + 30/2, -20 + 30/2, -3 + 20/2, 30, 30, 20, 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 = EinsyDoors() show(part)