add leading zero to parts
This commit is contained in:
parent
e1f727101f
commit
9156a5a99b
2 changed files with 4 additions and 3 deletions
4
Makefile
4
Makefile
|
@ -61,8 +61,8 @@ clean:
|
||||||
rm *.dat
|
rm *.dat
|
||||||
cargo clean
|
cargo clean
|
||||||
|
|
||||||
vis: build/assembly.scad
|
vis: build/assembly-clear.scad
|
||||||
openscad build/assembly.scad
|
openscad build/assembly-clear.scad
|
||||||
|
|
||||||
build/testwing-clear.scad: build/testwing.scad
|
build/testwing-clear.scad: build/testwing.scad
|
||||||
sed 's/color("clear-red")/color([1.0,1.0,0.0,0.9])/g' $< > $@
|
sed 's/color("clear-red")/color([1.0,1.0,0.0,0.9])/g' $< > $@
|
||||||
|
|
|
@ -80,11 +80,12 @@ fn main() {
|
||||||
let mut file = ScadFile::new();
|
let mut file = ScadFile::new();
|
||||||
file.set_detail(50);
|
file.set_detail(50);
|
||||||
file.add_object(part);
|
file.add_object(part);
|
||||||
file.write_to_file(format!("build/part{idx}.scad"));
|
file.write_to_file(format!("build/part{idx:0>3}.scad"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// all parts in one file
|
// all parts in one file
|
||||||
let mut allparts = ScadFile::new();
|
let mut allparts = ScadFile::new();
|
||||||
|
parts.push(scad!(Square(vec2(STOCK_WIDTH, STOCK_HEIGHT))));
|
||||||
allparts.set_detail(50);
|
allparts.set_detail(50);
|
||||||
for (idx, part) in parts.into_iter().enumerate() {
|
for (idx, part) in parts.into_iter().enumerate() {
|
||||||
allparts.add_object(scad!(Translate2d(vec2(0.0, INF * idx as f32)); part));
|
allparts.add_object(scad!(Translate2d(vec2(0.0, INF * idx as f32)); part));
|
||||||
|
|
Loading…
Reference in a new issue