1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-20 06:11:41 +02:00

Renders of dxfs now use the sheet colour.

This commit is contained in:
Chris Palmer
2020-04-07 22:07:28 +01:00
parent 9da8634769
commit 52011fd6f7
4 changed files with 15 additions and 9 deletions

View File

@@ -107,7 +107,7 @@ module stl_colour(colour = pp1_colour, alpha = 1) { //! Colour an stl where it i
children();
}
module stl(name) { //! Name an stl that will appear on the BOM, there needs to a module named ```<name>_stl``` to make it
module stl(name) { //! Name an stl that will appear on the BOM, there needs to a module named ```<name>_stl``` to make it
if(bom_mode()) {
colour = is_undef($stl_colour) ? pp1_colour : $stl_colour;
echo(str("~", name, ".stl(colour='", colour, "')"));
@@ -115,8 +115,12 @@ module stl(name) { //! Name an stl that will appear on the BOM, there needs to a
}
module dxf(name) { //! Name a dxf that will appear on the BOM, there needs to a module named ```<name>_dxf``` to make it
if(bom_mode())
echo(str("~", name, ".dxf"));
if(bom_mode()) {
if(is_undef($dxf_colour))
echo(str("~", name, ".dxf"));
else
echo(str("~", name, ".dxf(colour='", $dxf_colour, "')"));
}
}
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