Changed the colour scheme
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 169 KiB |
Before Width: | Height: | Size: 284 KiB After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 290 KiB After Width: | Height: | Size: 291 KiB |
Before Width: | Height: | Size: 296 KiB After Width: | Height: | Size: 286 KiB |
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 230 KiB |
Before Width: | Height: | Size: 212 KiB After Width: | Height: | Size: 207 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 198 KiB |
BIN
libtest.png
Before Width: | Height: | Size: 685 KiB After Width: | Height: | Size: 657 KiB |
@ -24,7 +24,7 @@ from set_config import *
|
|||||||
from exports import bom_to_parts
|
from exports import bom_to_parts
|
||||||
import os
|
import os
|
||||||
import openscad
|
import openscad
|
||||||
from tests import do_cmd, update_image
|
from tests import do_cmd, update_image, colour_scheme, background
|
||||||
from deps import mtime
|
from deps import mtime
|
||||||
|
|
||||||
def render(target, type):
|
def render(target, type):
|
||||||
@ -60,8 +60,9 @@ 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"
|
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' else "--render"
|
render = "--preview" if type == 'stl' else "--render"
|
||||||
tmp_name = 'tmp.png'
|
tmp_name = 'tmp.png'
|
||||||
openscad.run("--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall", "-o", tmp_name, png_maker_name);
|
openscad.run(colour_scheme, "--projection=p", "--imgsize=4096,4096", cam, render, "--autocenter", "--viewall", "-o", tmp_name, png_maker_name);
|
||||||
do_cmd(("magick "+ tmp_name + " -trim -resize 280x280 -background #ffffe5 -gravity Center -extent 280x280 -bordercolor #ffffe5 -border 10 " + tmp_name).split())
|
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)
|
update_image(tmp_name, png_name)
|
||||||
os.remove(png_maker_name)
|
os.remove(png_maker_name)
|
||||||
|
|
||||||
|
@ -36,7 +36,10 @@ from colorama import Fore
|
|||||||
w = 4096
|
w = 4096
|
||||||
h = w
|
h = w
|
||||||
threshold = 20 # Image comparison allowed number of different pixels
|
threshold = 20 # Image comparison allowed number of different pixels
|
||||||
fuzz = 10 # Image comparison allowed percentage error in pixel value
|
fuzz = 5 # Image comparison allowed percentage error in pixel value
|
||||||
|
|
||||||
|
colour_scheme = "--colorscheme=Nature"
|
||||||
|
background = "#F8F8F8"
|
||||||
|
|
||||||
def do_cmd(cmd, output = sys.stdout):
|
def do_cmd(cmd, output = sys.stdout):
|
||||||
for arg in cmd:
|
for arg in cmd:
|
||||||
@ -98,8 +101,8 @@ def tests(tests):
|
|||||||
png_name = "libtest.png"
|
png_name = "libtest.png"
|
||||||
scad_name = "libtest.scad"
|
scad_name = "libtest.scad"
|
||||||
if not os.path.isfile(png_name):
|
if not os.path.isfile(png_name):
|
||||||
openscad.run("--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall", "-o", png_name, scad_name);
|
openscad.run(colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,50,0,340,500", "--autocenter", "--viewall", "-o", png_name, scad_name);
|
||||||
do_cmd(["magick", png_name, "-trim", "-resize", "1280", "-bordercolor", "#ffffe5", "-border", "10", png_name])
|
do_cmd(["magick", png_name, "-trim", "-resize", "1280", "-bordercolor", background, "-border", "10", png_name])
|
||||||
#
|
#
|
||||||
# List of individual part files
|
# List of individual part files
|
||||||
#
|
#
|
||||||
@ -188,9 +191,9 @@ def tests(tests):
|
|||||||
print(changed)
|
print(changed)
|
||||||
t = time.time()
|
t = time.time()
|
||||||
tmp_name = 'tmp.png'
|
tmp_name = 'tmp.png'
|
||||||
openscad.run("-D", "$bom=2", "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, scad_name);
|
openscad.run("-D", "$bom=2", colour_scheme, "--projection=p", "--imgsize=%d,%d" % (w, h), "--camera=0,0,0,70,0,315,500", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, scad_name);
|
||||||
times.add_time(scad_name, t)
|
times.add_time(scad_name, t)
|
||||||
do_cmd(["magick", tmp_name, "-trim", "-resize", "1000x600", "-bordercolor", "#ffffe5", "-border", "10", tmp_name])
|
do_cmd(["magick", tmp_name, "-trim", "-resize", "1000x600", "-bordercolor", background, "-border", "10", tmp_name])
|
||||||
update_image(tmp_name, png_name)
|
update_image(tmp_name, png_name)
|
||||||
BOM = bom.parse_bom()
|
BOM = bom.parse_bom()
|
||||||
with open(bom_name, 'wt') as outfile:
|
with open(bom_name, 'wt') as outfile:
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from set_config import *
|
from set_config import *
|
||||||
import openscad
|
import openscad
|
||||||
from tests import do_cmd, update_image
|
from tests import do_cmd, update_image, colour_scheme, background
|
||||||
import time
|
import time
|
||||||
import times
|
import times
|
||||||
from deps import *
|
from deps import *
|
||||||
@ -153,13 +153,13 @@ def views(target, do_assemblies = None):
|
|||||||
if changed:
|
if changed:
|
||||||
print(changed)
|
print(changed)
|
||||||
t = time.time()
|
t = time.time()
|
||||||
openscad.run("-D$pose=1", "-D$explode=%d" % explode, "--projection=p", "--imgsize=4096,4096", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, png_maker_name);
|
openscad.run("-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, png_maker_name);
|
||||||
times.add_time(png_name, t)
|
times.add_time(png_name, t)
|
||||||
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", "#ffffe5", "-border", "10", tmp_name])
|
do_cmd(["magick", tmp_name, "-trim", "-resize", "1004x1004", "-bordercolor", background, "-border", "10", tmp_name])
|
||||||
update_image(tmp_name, png_name)
|
update_image(tmp_name, png_name)
|
||||||
tn_name = png_name.replace('.png', '_tn.png')
|
tn_name = png_name.replace('.png', '_tn.png')
|
||||||
if mtime(png_name) > mtime(tn_name):
|
if mtime(png_name) > mtime(tn_name):
|
||||||
do_cmd(("magick "+ png_name + " -trim -resize 280x280 -background #ffffe5 -gravity Center -extent 280x280 -bordercolor #ffffe5 -border 10 " + tmp_name).split())
|
do_cmd(("magick "+ png_name + " -trim -resize 280x280 -background " + background + " -gravity Center -extent 280x280 -bordercolor " + background + " -border 10 " + tmp_name).split())
|
||||||
update_image(tmp_name, tn_name)
|
update_image(tmp_name, tn_name)
|
||||||
os.remove(png_maker_name)
|
os.remove(png_maker_name)
|
||||||
done_assemblies.append(module)
|
done_assemblies.append(module)
|
||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 21 KiB |