diff --git a/__pycache__/uchwyt.cpython-312.pyc b/__pycache__/uchwyt.cpython-312.pyc index b08fbae..ff2939c 100644 Binary files a/__pycache__/uchwyt.cpython-312.pyc and b/__pycache__/uchwyt.cpython-312.pyc differ diff --git a/uchwyt.py b/uchwyt.py index e932b5e..342bbd1 100644 --- a/uchwyt.py +++ b/uchwyt.py @@ -10,27 +10,47 @@ zaokraglenie = 8 with BuildPart() as termometr: with BuildSketch() as s1: RectangleRounded(dlugosc, szerokosc, 8) - extrude(amount=wysokosc, both=True) + extrude(amount=wysokosc / 2, both=True) with BuildPart() as uchwyt: with BuildSketch() as s1: RectangleRounded(dlugosc + 20, szerokosc - 10 , zaokraglenie) - extrude(amount=wysokosc + 5, both=True) + extrude(amount=wysokosc / 2 + 5, both=True) powiekszony = scale(termometr.part, by=1.05) + +with BuildPart() as sciana: + with BuildSketch() as s1: + RectangleRounded(dlugosc + 20, 50 , zaokraglenie) + extrude(amount=1, both=True) + + +base_face = sciana.faces().sort_by(Axis.Z)[0] + + + +sciana.joints["mount"] = RigidJoint( + label="mount", + to_part=sciana, + joint_location=Location(base_face.center()) # Centrum znalezionej ściany +) + + + + with BuildPart() as polaczone: add(uchwyt) with Locations((0,-15,0)): add(powiekszony, mode=Mode.SUBTRACT) - with Locations((0,-7,0)): - Box(40,34.4,70, mode=Mode.SUBTRACT) - with Locations((0,-10,0)): - add(termometr) + tylnias = polaczone.faces().sort_by(Axis.Z)[-1] + RigidJoint("tylna_sciana", joint_location=Location(tylnias.center())) -show(polaczone) +sciana.joints["mount"].connect_to(polaczone.part.joints["tylna_sciana"]) + +show(polaczone,sciana, render_joints=True )