Chyba zakończyłem uchwycik
This commit is contained in:
parent
ecd9c429f7
commit
68366651d8
Binary file not shown.
50
uchwyt.py
50
uchwyt.py
|
|
@ -1,5 +1,5 @@
|
|||
from build123d import *
|
||||
from ocp_vscode import *
|
||||
# from ocp_vscode import *
|
||||
|
||||
|
||||
dlugosc = 44
|
||||
|
|
@ -20,37 +20,33 @@ with BuildPart() as uchwyt:
|
|||
|
||||
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:
|
||||
with BuildPart() as uchwyt_polaczone:
|
||||
add(uchwyt)
|
||||
with Locations((0,-15,0)):
|
||||
add(powiekszony, mode=Mode.SUBTRACT)
|
||||
tylnias = polaczone.faces().sort_by(Axis.Z)[-1]
|
||||
RigidJoint("tylna_sciana", joint_location=Location(tylnias.center()))
|
||||
with Locations((0,-7,0)):
|
||||
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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue