Fixed platters and panels not working in the GUI, a regression.
set_config() now puts $cwd in target.scad. use_stl() and use_dxf() included again instead of used.
This commit is contained in:
parent
60350eb228
commit
ca153c971d
|
@ -69,7 +69,11 @@ def set_config(target, usage = None):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
fname = source_dir + "/target.scad"
|
fname = source_dir + "/target.scad"
|
||||||
text = ['include <config_%s.scad>\n' % target, '$target = "%s";\n' % target];
|
text = ['include <config_%s.scad>\n' % target,
|
||||||
|
'$target = "%s";\n' % target,
|
||||||
|
'$cwd="%s";\n' % os.getcwd().replace('\\', '/')
|
||||||
|
]
|
||||||
|
|
||||||
lines = [""]
|
lines = [""]
|
||||||
try:
|
try:
|
||||||
with open(fname,"rt") as f:
|
with open(fname,"rt") as f:
|
||||||
|
|
|
@ -146,17 +146,11 @@ module dxf(name) { //! Name a dxf that will appear on the B
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module use_stl(name) { //! Import an STL to make a build platter
|
module use_stl(name) //! Import an STL to make a build platter
|
||||||
stl(name);
|
assert(false); // Here for documentation only, real version in core.scad
|
||||||
path = is_undef($target) ? "/stls/" : str("/", $target, "/stls/");
|
|
||||||
import(str($cwd, path, name, ".stl"));
|
|
||||||
}
|
|
||||||
|
|
||||||
module use_dxf(name) { //! Import a DXF to make a build panel
|
module use_dxf(name) //! Import a DXF to make a build panel
|
||||||
dxf(name);
|
assert(false); // Here for documentation only, real version in core.scad
|
||||||
path = is_undef($target) ? "/dxfs/" : str("/", $target, "/dxfs/");
|
|
||||||
import(str($cwd, path, name, ".dxf"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function value_string(value) = is_string(value) ? str("\"", value, "\"") : str(value); //! Convert `value` to a string or quote it if it is already a string
|
function value_string(value) = is_string(value) ? str("\"", value, "\"") : str(value); //! Convert `value` to a string or quote it if it is already a string
|
||||||
|
|
||||||
|
|
|
@ -25,3 +25,15 @@ include <../../global_defs.scad>
|
||||||
// Global functions and modules
|
// Global functions and modules
|
||||||
//
|
//
|
||||||
use <global.scad>
|
use <global.scad>
|
||||||
|
|
||||||
|
module use_stl(name) { //! Import an STL to make a build platter
|
||||||
|
stl(name);
|
||||||
|
path = is_undef($target) ? "../stls/" : str($cwd, "/", $target, "/stls/");
|
||||||
|
import(str(path, name, ".stl"));
|
||||||
|
}
|
||||||
|
|
||||||
|
module use_dxf(name) { //! Import a DXF to make a build panel
|
||||||
|
dxf(name);
|
||||||
|
path = is_undef($target) ? "../dxfs/" : str($cwd, "/", $target, "/dxfs/");
|
||||||
|
import(str(path, name, ".dxf"));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue