diff --git a/post_cap.py b/post_cap.py index 8faaa8e..650a944 100644 --- a/post_cap.py +++ b/post_cap.py @@ -25,36 +25,21 @@ with BuildPart() as p: with Locations((punkt1.Z, 0)): Ellipse(4 / 2, 10 / 2) sweep(path=ucho) +# with BuildPart() as bo: with BuildSketch(Plane.XZ) as s1: - # Trapezoid(18, 6, 80, 88, align=Align.MIN) Trapezoid(42, 37, 86, align=(Align.CENTER, Align.MIN)) split(bisect_by=Plane.YZ) - t3 = revolve(axis=Axis.Z) - t4 = t3.faces().sort_by(Axis.Z)[-1].edge() - t5 = fillet(t4, 1) + t3 = revolve(axis=Axis.Z, mode=Mode.PRIVATE) + krawedz = t3.faces().sort_by(Axis.Z)[-1].edge() + # t5 = fillet(t4, 1.5) + t3 = t3.fillet(radius=1.5, edge_list=[krawedz]) + add(t3, mode=Mode.SUBTRACT) -debug(t3) -debug(t4) +show_object(p) -# export_step(p.part, "/home/pali112/Build123d/debug.step") - -# with BuildPart() as testowo: -# with BuildSketch(Plane.XZ) as s1: -# # Trapezoid(18, 6, 80, 88, align=Align.MIN) -# Trapezoid(42, 37, 86, align=(Align.CENTER, Align.MIN)) -# split(bisect_by=Plane.YZ) -# t3 = revolve(axis=Axis.Z) -# t4 = testowo.faces().sort_by(Axis.Z)[-1].edge() -# t5 = fillet(t4, 3 / 2) - -# export_step(testowo.part, "/home/pali112/Build123d/debug.step") - -# show_object(testowo) - -# debug(punkt1, name="punkt1") -# debug(t3, name="t3") -# debug(s3.sketch, name="s3") -# debug(s2.sketch, name="s2") -# debug(l1.line, name="ucho") -# show_object(p) -# debug(s.sketch, name="kubek") +got_mass = p.part.volume * densc +want_mass = 43.09 +tolerance = 1 +delta = abs(got_mass - want_mass) +print(f"Mass: {got_mass:0.2f} g") +assert delta < tolerance, f'{got_mass=}, {want_mass=}, {delta=}, {tolerance=}'