mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-04 03:09:45 +00:00
Enlarge default image generation sizes.
This commit is contained in:
parent
6c98bf1afc
commit
c148317afb
1 changed files with 14 additions and 11 deletions
|
@ -145,14 +145,12 @@ class ImageProcessing(object):
|
||||||
with open(scriptfile, "w") as f:
|
with open(scriptfile, "w") as f:
|
||||||
f.write(script)
|
f.write(script)
|
||||||
|
|
||||||
if "Med" in extype:
|
if "Big" in extype:
|
||||||
imgsizes = ["800,600", "400x300"]
|
imgsize = [640, 480]
|
||||||
elif "Big" in extype:
|
elif "Med" in extype or "distribute" in script or "show_anchors" in script:
|
||||||
imgsizes = ["1280,960", "640x480"]
|
imgsize = [480, 360]
|
||||||
elif "distribute" in script or "show_anchors" in script:
|
|
||||||
imgsizes = ["800,600", "400x300"]
|
|
||||||
else: # Small
|
else: # Small
|
||||||
imgsizes = ["480,360", "240x180"]
|
imgsize = [320, 240]
|
||||||
|
|
||||||
tmpimgs = []
|
tmpimgs = []
|
||||||
if "Spin" in extype:
|
if "Spin" in extype:
|
||||||
|
@ -167,7 +165,7 @@ class ImageProcessing(object):
|
||||||
scadcmd = [
|
scadcmd = [
|
||||||
OPENSCAD,
|
OPENSCAD,
|
||||||
"-o", tmpimgfile,
|
"-o", tmpimgfile,
|
||||||
"--imgsize={}".format(imgsizes[0]),
|
"--imgsize={},{}".format(imgsize[0]*2, imgsize[1]*2),
|
||||||
"--hardwarnings",
|
"--hardwarnings",
|
||||||
"--projection=o",
|
"--projection=o",
|
||||||
"--autocenter",
|
"--autocenter",
|
||||||
|
@ -199,7 +197,7 @@ class ImageProcessing(object):
|
||||||
scadcmd = [
|
scadcmd = [
|
||||||
OPENSCAD,
|
OPENSCAD,
|
||||||
"-o", tmpimgfile,
|
"-o", tmpimgfile,
|
||||||
"--imgsize={}".format(imgsizes[0]),
|
"--imgsize={},{}".format(imgsize[0]*2, imgsize[1]*2),
|
||||||
"--hardwarnings",
|
"--hardwarnings",
|
||||||
"--projection=o",
|
"--projection=o",
|
||||||
"--autocenter",
|
"--autocenter",
|
||||||
|
@ -240,7 +238,12 @@ class ImageProcessing(object):
|
||||||
os.unlink(scriptfile)
|
os.unlink(scriptfile)
|
||||||
|
|
||||||
if len(tmpimgs) == 1:
|
if len(tmpimgs) == 1:
|
||||||
cnvcmd = [CONVERT, tmpimgfile, "-resize", imgsizes[1], newimgfile]
|
cnvcmd = [
|
||||||
|
CONVERT,
|
||||||
|
tmpimgfile,
|
||||||
|
"-resize", "{}x{}".format(imgsize[0], imgsize[1]),
|
||||||
|
newimgfile
|
||||||
|
]
|
||||||
res = subprocess.call(cnvcmd)
|
res = subprocess.call(cnvcmd)
|
||||||
if res != 0:
|
if res != 0:
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
@ -251,7 +254,7 @@ class ImageProcessing(object):
|
||||||
"-delay", "25",
|
"-delay", "25",
|
||||||
"-loop", "0",
|
"-loop", "0",
|
||||||
"-coalesce",
|
"-coalesce",
|
||||||
"-scale", imgsizes[1],
|
"-scale", "{}x{}".format(imgsize[0], imgsize[1]),
|
||||||
"-fuzz", "2%",
|
"-fuzz", "2%",
|
||||||
"+dither",
|
"+dither",
|
||||||
"-layers", "Optimize",
|
"-layers", "Optimize",
|
||||||
|
|
Loading…
Reference in a new issue