1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-24 16:13:07 +02:00

Workarounds for bugs in the OpenSCAD snapshots.

This commit is contained in:
Chris Palmer
2021-09-12 18:02:43 +01:00
parent 588a1edf62
commit f0c25d37b0
20 changed files with 8632 additions and 8628 deletions

View File

@@ -94,11 +94,13 @@ def render(target, type):
cam = "--camera=0,0,0,70,0,315,500" if type == 'stl' else "--camera=0,0,0,0,0,0,500"
render = "--preview" if type == 'stl' or colour != pp1 else "--render"
tmp_name = tmp_dir + '/' + part[:-4] + '.png'
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall");
dummy_deps_name = tmp_dir + '/tmp.deps' # work around for OpenSCAD issue #3879
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall", "-d", dummy_deps_name)
do_cmd(("magick "+ tmp_name + " -trim -resize 280x280 -background %s -gravity Center -extent 280x280 -bordercolor %s -border 10 %s"
% (background, background, tmp_name)).split())
update_image(tmp_name, png_name)
os.remove(png_maker_name)
os.remove(dummy_deps_name)
#
# Remove tmp dir
#