mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-15 15:20:37 -08:00
Increasing error tolerance to work on all platforms
This commit is contained in:
parent
bcd8d37616
commit
1e479193ce
9 changed files with 9 additions and 9 deletions
|
|
@ -31,7 +31,7 @@ with bd.BuildPart() as bp:
|
|||
bd.Rectangle(1, 2, rotation=45)
|
||||
bd.Extrude(amount=0.1)
|
||||
|
||||
assert abs(bp.part.volume - (3**3 + 6 * (1 * 2 * 0.1)) < 1e-5)
|
||||
assert abs(bp.part.volume - (3**3 + 6 * (1 * 2 * 0.1)) < 1e-3)
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(bp.part.wrapped, name="box on faces")
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ with BuildPart(Plane.XZ) as rail:
|
|||
SlotOverall(slot_length, slot_width, rotation=90)
|
||||
Extrude(amount=-height, mode=Mode.SUBTRACT)
|
||||
|
||||
assert abs(rail.part.volume - 42462.863388694714) < 1e-5
|
||||
assert abs(rail.part.volume - 42462.863388694714) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(rail.part.wrapped, name="rail")
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ with BuildPart() as handle:
|
|||
# Create the handle by sweeping along the path
|
||||
Sweep(multisection=True)
|
||||
|
||||
assert abs(handle.part.volume - 94.77361455046953) < 1e-5
|
||||
assert abs(handle.part.volume - 94.77361455046953) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(handle_path.wrapped, name="handle_path")
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ with BuildPart() as heat_exchanger:
|
|||
Mirror(about=Plane.XY)
|
||||
|
||||
fillet_volume = 2 * (half_volume_after_fillet - half_volume_before_fillet)
|
||||
assert fillet_volume == 469.88331045553787
|
||||
assert abs(fillet_volume - 469.88331045553787) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(heat_exchanger.part.wrapped)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ with BuildPart() as pipes:
|
|||
Extrude(amount=10)
|
||||
Fillet(*pipes.edges(Select.LAST), radius=0.2)
|
||||
|
||||
assert abs(pipes.part.volume - 1015.939005681509) < 1e-5
|
||||
assert abs(pipes.part.volume - 1015.939005681509) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(pipes.part.wrapped, name="intersecting pipes")
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ with BuildPart() as key_cap:
|
|||
Rectangle(1.17 * MM, 4.1 * MM, mode=Mode.SUBTRACT)
|
||||
Extrude(amount=3.5 * MM, mode=Mode.ADD)
|
||||
|
||||
assert abs(key_cap.part.volume - 644.8900473617498) < 1e-5
|
||||
assert abs(key_cap.part.volume - 644.8900473617498) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(key_cap.part.wrapped, name="key cap", options={"alpha": 0.7})
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ with BuildPart() as lego:
|
|||
},
|
||||
)
|
||||
|
||||
assert abs(lego.part.volume - 3212.187337781355) < 1e-5
|
||||
assert abs(lego.part.volume - 3212.187337781355) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(lego.part.wrapped, name="lego")
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ with BuildPart() as art:
|
|||
top_bottom = art.faces().filter_by(GeomType.PLANE)
|
||||
Offset(openings=top_bottom, amount=0.5)
|
||||
|
||||
assert abs(art.part.volume - 1306.3405290344635) < 1e-5
|
||||
assert abs(art.part.volume - 1306.3405290344635) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(art.part.wrapped, name="art")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ with BuildPart() as obj:
|
|||
with BuildPart(*obj.faces().filter_by(Axis.Z), mode=Mode.SUBTRACT):
|
||||
Sphere(1.8)
|
||||
|
||||
assert abs(obj.part.volume - 15.083039190168236) < 1e-5
|
||||
assert abs(obj.part.volume - 15.083039190168236) < 1e-3
|
||||
|
||||
if "show_object" in locals():
|
||||
show_object(obj.part)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue