Clarify Enclosure Labels And Validate Clearance

This commit is contained in:
2026-09-28 12:13:46 +02:00
parent c5bf3e32f5
commit 26ed569fcb
8 changed files with 90704 additions and 18349 deletions
+23
View File
@@ -235,6 +235,28 @@ def variant_check():
print('PASS parameter CGAL mesh', part, defines)
def label_check():
"""Actual glyph solids must stay on roof, 1 mm clear of all roof openings."""
with tempfile.TemporaryDirectory(prefix="case-labels-") as temp:
wrapper = Path(temp)/"labels.scad"
wrapper.write_text(
f'include <{ROOT / "enclosure.scad"}>\n'
'cube(1);\n'
'translate([0,0,80]) linear_extrude(1) difference() {\n'
' projection() labels();\n'
' offset(delta=-1) projection(cut=true)\n'
' translate([0,0,-top_z+eps/2]) lid_body();\n'
'}\n')
path = Path(temp)/"clearance.stl"
result = subprocess.run(
["openscad", "-o", str(path), "-D", 'part="check"', str(wrapper)],
env={**os.environ, "QT_QPA_PLATFORM": "offscreen"},
capture_output=True, text=True, timeout=180)
assert result.returncode == 0 and "ERROR:" not in result.stderr, result.stderr
near([mesh_check(path, 1)["volume_mm3"]], [1])
print("PASS actual label glyphs within roof, >=1 mm from edges, display, buttons and screw-head openings")
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--source", action="store_true", help="also check saved KiCad/STEP registration")
@@ -246,6 +268,7 @@ def main():
if args.installation:
installation_check()
geometry_check()
label_check()
if args.source:
source_check()
reports = [mesh_check(ROOT / name, n) for name, n in [