Fix my STL export issue (I needed to truncate old files)

This commit is contained in:
Chris Hodapp 2020-02-15 09:41:47 -05:00
parent 40abb2426b
commit 2a86209010
2 changed files with 5 additions and 4 deletions

View File

@ -2,8 +2,6 @@
## Highest priority:
- Fix my fucked STL export at max_iters=4. Blender & Wings refuse to
load.
- Fix `OpenMesh.connect()`.
- Continue converting `curve_horn_*`.
@ -19,3 +17,6 @@
## If I'm bored:
- Fix links in tri_mesh docs that use relative paths & do a PR?
- Look in https://www.nalgebra.org/quick_reference/# for "pour
obtain". Can I fix this somehow? Looks like a French-ism that made
its way in.

View File

@ -49,7 +49,7 @@ impl OpenMesh {
}
fn write_stl_file(&self, fname: &str) -> io::Result<()> {
let mut file = OpenOptions::new().write(true).create(true).open(fname)?;
let mut file = OpenOptions::new().write(true).create(true).truncate(true).open(fname)?;
self.write_stl(&mut file)
}
@ -602,7 +602,7 @@ fn main() {
let r = Rule::Recurse(cube_thing_rule);
let max_iters = 5;
let max_iters = 4;
println!("Running rules...");
let (cubemesh, nodes) = rule_to_mesh(&r, max_iters);
println!("Merged {} nodes", nodes);