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

Standardised setting of imgsize in scripts.

This commit is contained in:
Martin Budden
2022-06-21 07:19:11 +01:00
parent 66f793b00b
commit 06443a558b
3 changed files with 7 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ from set_config import *
from exports import bom_to_parts
import os
import openscad
from tests import do_cmd, update_image, colour_scheme, background
from tests import do_cmd, update_image, colour_scheme, background, image_size
from deps import mtime
from colorama import init
import json
@@ -95,7 +95,7 @@ def render(target, type):
render = "--preview" if type == 'stl' or colour != pp1 else "--render"
tmp_name = tmp_dir + '/' + part[:-4] + '.png'
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)
openscad.run("-o", tmp_name, png_maker_name, colour_scheme, "--projection=p", image_size, 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)