Skip to content

Commit 367979a

Browse files
committed
Remove Rust main application, favor Python main.
1 parent 49ef4fb commit 367979a

File tree

4 files changed

+38
-167
lines changed

4 files changed

+38
-167
lines changed

Cargo.lock

Lines changed: 0 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ extension-module = ["pyo3/extension-module"]
1414

1515
[dependencies]
1616
ahash = "0.8.12"
17-
approx = "0.5.1"
18-
clap = { version = "4.5.49", features = ["cargo"] }
1917
indicatif = "0.18.0"
2018
kiddo = { version = "5.2.2", features = ["simd"] }
2119
mimalloc = { version = "0.1.48", features = ["v3"] }
2220
nalgebra = { version = "0.34.1", features = ["rand"] }
2321
parry3d-f64 = { version = "0.25", features = ["parallel"] }
24-
pyo3 = { version = "0.26.0", features = ["abi3-py39", "extension-module"] }
22+
pyo3 = { version = "0.26.0", features = ["abi3-py39"] }
2523
rand = "0.9.2"
2624
rand_chacha = "0.9.0"
2725
rayon = "1.11.0"
@@ -32,6 +30,7 @@ tobj = "4.0.3"
3230
pyo3-build-config = "0.26.0"
3331

3432
[dev-dependencies]
33+
approx = "0.5.1"
3534
divan = "0.1.21"
3635

3736
[[bench]]

examples/main.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use std::{env, path::PathBuf};
2+
3+
use miniacd::{
4+
Config,
5+
io::{self, load_obj},
6+
mesh::Mesh,
7+
ops::{self},
8+
};
9+
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
10+
11+
fn main() {
12+
let args: Vec<String> = env::args().collect();
13+
let input_path = args.get(1).expect("no input path");
14+
let output_path = PathBuf::from(&args.get(2).expect("no output path"));
15+
let threshold: f64 = args
16+
.get(3)
17+
.unwrap_or(&"0.1".to_string())
18+
.parse()
19+
.expect("invalid threshold");
20+
21+
let config = Config {
22+
threshold,
23+
print: true,
24+
..Default::default()
25+
};
26+
let mesh = load_obj(input_path);
27+
let components = miniacd::run(mesh, &config);
28+
29+
// PARALLEL: compute the output convex hulls in parallel.
30+
let convex_meshes: Vec<Mesh> = components
31+
.par_iter()
32+
.map(|c| ops::convex_hull(&c.mesh))
33+
.collect();
34+
35+
io::write_meshes_to_obj(&output_path, &convex_meshes).unwrap();
36+
}

src/main.rs

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)