1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-07-24 17:31:14 +02:00

The assembly module now has a big parameter to force large or small views.

This commit is contained in:
Chris Palmer
2020-04-04 12:06:14 +01:00
parent f5980b4703
commit bc4e18d788
4 changed files with 50 additions and 28 deletions

View File

@@ -52,22 +52,23 @@ def bom_to_assemblies(bom_dir, bounds_map):
# Decide if we need big or small assembly pictures
#
for bom in flat_bom:
big = False
for ass in bom["assemblies"]:
for b in flat_bom:
if b["name"] == ass:
if b["big"]:
if bom["big"] == None:
big = False
for ass in bom["assemblies"]:
for b in flat_bom:
if b["name"] == ass:
if b["big"]:
big = True
break
if not big:
for stl in bom["printed"]:
bounds = bounds_map[stl]
width = bounds[1][0] - bounds[0][0]
depth = bounds[1][1] - bounds[0][1]
if max(width, depth) > 80:
big = True
break
if not big:
for stl in bom["printed"]:
bounds = bounds_map[stl]
width = bounds[1][0] - bounds[0][0]
depth = bounds[1][1] - bounds[0][1]
if max(width, depth) > 80:
big = True
break
bom["big"] = big or bom["routed"]
break
bom["big"] = big or bom["routed"]
#
# Remove the main assembly if it is a shell
#