Chyba zakończyłem uchwycik

This commit is contained in:
Rafał Paluch 2025-12-06 18:37:57 +01:00
parent ecd9c429f7
commit 68366651d8
2 changed files with 23 additions and 27 deletions

Binary file not shown.

View File

@ -1,5 +1,5 @@
from build123d import * from build123d import *
from ocp_vscode import * # from ocp_vscode import *
dlugosc = 44 dlugosc = 44
@ -20,37 +20,33 @@ with BuildPart() as uchwyt:
powiekszony = scale(termometr.part, by=1.05) powiekszony = scale(termometr.part, by=1.05)
with BuildPart() as uchwyt_polaczone:
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) add(uchwyt)
with Locations((0,-15,0)): with Locations((0,-15,0)):
add(powiekszony, mode=Mode.SUBTRACT) add(powiekszony, mode=Mode.SUBTRACT)
tylnias = polaczone.faces().sort_by(Axis.Z)[-1] with Locations((0,-7,0)):
RigidJoint("tylna_sciana", joint_location=Location(tylnias.center())) Box(40,34.4,70, mode=Mode.SUBTRACT)
with BuildPart() as sciana:
vertex_przesuniecia = uchwyt_polaczone.part.faces().sort_by(Axis.Z)[-1].edges().filter_by(Axis.X).sort_by(Axis.Y)[-1].vertex()
tylna = uchwyt.part.faces().sort_by(Axis.Z)[-1]
with BuildSketch(tylna) as s1:
with Locations((0,vertex_przesuniecia.Y,0)):
RectangleRounded(dlugosc + 20, 50 , zaokraglenie, align=(Align.CENTER, Align.MAX))
extrude(amount=2)
with BuildPart() as polaczone:
add(uchwyt_polaczone)
add(sciana)
# debug(vertex_przesuniecia)
show_object(polaczone)
sciana.joints["mount"].connect_to(polaczone.part.joints["tylna_sciana"])
show(polaczone,sciana, render_joints=True )
# show_o(polaczone,sciana, tylna)
# show_object(polaczone)
# debug(sciana)