mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-27 09:10:02 -05:00
Views.py and plateup.py now define $cwd and $target.
This commit is contained in:
parent
cb30f0c63d
commit
079168142b
@ -72,7 +72,9 @@ def plateup(target, part_type, usage = None):
|
|||||||
changed = check_deps(part_file, dname)
|
changed = check_deps(part_file, dname)
|
||||||
if changed:
|
if changed:
|
||||||
print(changed)
|
print(changed)
|
||||||
openscad.run("-D$bom=1", "-d", dname, "-o", part_file, src_file)
|
target_def = ['-D$target="%s"' % target] if target else []
|
||||||
|
cwd_def = ['-D$cwd="%s"' % os.getcwd().replace('\\', '/')]
|
||||||
|
openscad.run_list(["-D$bom=1"] + target_def + cwd_def + ["-d", dname, "-o", part_file, src_file])
|
||||||
if part_type == 'stl':
|
if part_type == 'stl':
|
||||||
c14n_stl.canonicalise(part_file)
|
c14n_stl.canonicalise(part_file)
|
||||||
log_name = 'openscad.log'
|
log_name = 'openscad.log'
|
||||||
|
@ -215,7 +215,9 @@ def views(target, do_assemblies = None):
|
|||||||
f.write("use <%s/%s>\n" % (dir, filename))
|
f.write("use <%s/%s>\n" % (dir, filename))
|
||||||
f.write("%s();\n" % module);
|
f.write("%s();\n" % module);
|
||||||
t = time.time()
|
t = time.time()
|
||||||
openscad.run_list(options.list() + ["-D$pose=1", "-D$explode=%d" % explode, colour_scheme, "--projection=p", "--imgsize=4096,4096", "--autocenter", "--viewall", "-d", dname, "-o", tmp_name, png_maker_name]);
|
target_def = ['-D$target="%s"' % target] if target else []
|
||||||
|
cwd_def = ['-D$cwd="%s"' % os.getcwd().replace('\\', '/')]
|
||||||
|
openscad.run_list(options.list() + target_def + cwd_def + ["-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", background, "-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)
|
||||||
|
Loading…
Reference in New Issue
Block a user