zaczalem z clamp_base

This commit is contained in:
Rafał Paluch 2026-01-02 22:52:25 +01:00
parent a38240068a
commit 80c323ee6f
4 changed files with 25 additions and 4 deletions

Binary file not shown.

View File

@ -1,4 +1,5 @@
from build123d import *
from ocp_vscode import *
densa = 7800 / 1e6 # carbon steel density g/mm^3
densb = 2700 / 1e6 # aluminum alloy
@ -22,13 +23,11 @@ with BuildPart() as p:
with Locations((42 / 2 + 6, 0)):
CounterBoreHole(24 / 2, 34 / 2, 4)
mirror(about=Plane.XZ)
# debug(test)
with BuildSketch() as s4:
RectangleRounded(115, 50, 6)
s = extrude(amount=80, mode=Mode.INTERSECT)
# fillet does not work right, mode intersect is safer
# debug(s)
with BuildSketch(Plane.YZ) as s4:
with BuildLine() as bl:
@ -38,9 +37,8 @@ with BuildPart() as p:
mirror(about=Plane.YZ)
make_face()
extrude(amount=115 / 2, both=True, mode=Mode.SUBTRACT)
debug(s4)
show_object(p)
show(p)
got_mass = p.part.volume*densa
want_mass = 797.15

23
clamp_base.py Normal file
View File

@ -0,0 +1,23 @@
from build123d import *
from ocp_vscode import *
set_defaults(helper_scale=1, transparent=False, reset_camera=Camera.KEEP)
with BuildPart() as p:
with BuildSketch(Plane.XZ) as s:
with BuildLine() as line1:
Polyline((0, 0), (95 / 2, 0), (95 / 2, 34), close=False)
offset(amount=16, side=Side.LEFT)
make_face()
mirror(about=Plane.YZ)
extrude(amount=34)
e1 = p.faces().sort_by(Axis.X)[0].edges().sort_by(Axis.Z)[0]
e2 = p.faces().sort_by(Axis.X)[-1].edges().sort_by(Axis.Z)[0]
eplus = e1 + e2
fillet(eplus, 18)
show_all()
# show(t1)
# show(p)