anvil-reduce 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. anvil_reduce-0.1.1/LICENSE +21 -0
  2. anvil_reduce-0.1.1/PKG-INFO +89 -0
  3. anvil_reduce-0.1.1/README.md +59 -0
  4. anvil_reduce-0.1.1/anvil-reduce-core/Cargo.toml +20 -0
  5. anvil_reduce-0.1.1/anvil-reduce-core/benches/decimation.rs +13 -0
  6. anvil_reduce-0.1.1/anvil-reduce-core/src/attribute_transfer.rs +552 -0
  7. anvil_reduce-0.1.1/anvil-reduce-core/src/error.rs +20 -0
  8. anvil_reduce-0.1.1/anvil-reduce-core/src/geometry.rs +642 -0
  9. anvil_reduce-0.1.1/anvil-reduce-core/src/half_edge.rs +791 -0
  10. anvil_reduce-0.1.1/anvil-reduce-core/src/lib.rs +20 -0
  11. anvil_reduce-0.1.1/anvil-reduce-core/src/marching_cubes.rs +258 -0
  12. anvil_reduce-0.1.1/anvil-reduce-core/src/mc_tables.rs +318 -0
  13. anvil_reduce-0.1.1/anvil-reduce-core/src/progress.rs +136 -0
  14. anvil_reduce-0.1.1/anvil-reduce-core/src/proxy.rs +176 -0
  15. anvil_reduce-0.1.1/anvil-reduce-core/src/remesh.rs +1210 -0
  16. anvil_reduce-0.1.1/anvil-reduce-core/src/sdf.rs +563 -0
  17. anvil_reduce-0.1.1/anvil-reduce-core/src/shrink_fit.rs +179 -0
  18. anvil_reduce-0.1.1/anvil-reduce-core/src/smooth.rs +283 -0
  19. anvil_reduce-0.1.1/anvil-reduce-core/src/sparse.rs +297 -0
  20. anvil_reduce-0.1.1/anvil-reduce-core/src/types.rs +32 -0
  21. anvil_reduce-0.1.1/anvil-reduce-core/src/voxelize.rs +501 -0
  22. anvil_reduce-0.1.1/anvil-reduce-io/Cargo.toml +13 -0
  23. anvil_reduce-0.1.1/anvil-reduce-io/src/gltf_io.rs +251 -0
  24. anvil_reduce-0.1.1/anvil-reduce-io/src/lib.rs +202 -0
  25. anvil_reduce-0.1.1/anvil-reduce-io/src/obj.rs +262 -0
  26. anvil_reduce-0.1.1/anvil-reduce-io/src/usd.rs +312 -0
  27. anvil_reduce-0.1.1/anvil-reduce-py/Cargo.lock +802 -0
  28. anvil_reduce-0.1.1/anvil-reduce-py/Cargo.toml +15 -0
  29. anvil_reduce-0.1.1/anvil-reduce-py/LICENSE +21 -0
  30. anvil_reduce-0.1.1/anvil-reduce-py/README.md +59 -0
  31. anvil_reduce-0.1.1/anvil-reduce-py/src/lib.rs +474 -0
  32. anvil_reduce-0.1.1/pyproject.toml +57 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Alejandro Cabrera
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,89 @@
1
+ Metadata-Version: 2.4
2
+ Name: anvil-reduce
3
+ Version: 0.1.1
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.9
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Rust
13
+ Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
14
+ Classifier: Topic :: Software Development :: Libraries
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Requires-Dist: numpy>=1.21
19
+ License-File: LICENSE
20
+ Summary: Volume-based mesh proxy generator. Voxelize, marching-cubes, smooth, remesh. Fast, watertight, hands-off.
21
+ Keywords: mesh,geometry,decimation,proxy,lod,vfx,dcc,voxel,marching-cubes
22
+ Author-email: Alejandro Cabrera <voidreamer@gmail.com>
23
+ License-Expression: MIT
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
26
+ Project-URL: Homepage, https://github.com/voidreamer/anvil-reduce
27
+ Project-URL: Issues, https://github.com/voidreamer/anvil-reduce/issues
28
+ Project-URL: Repository, https://github.com/voidreamer/anvil-reduce
29
+
30
+ # anvil-reduce
31
+
32
+ Volume-based mesh proxy generator: voxelize, marching cubes, smooth, remesh.
33
+ Fast, watertight, hands-off. Native Rust core, Python bindings via PyO3.
34
+
35
+ ## Install
36
+
37
+ ```bash
38
+ pip install anvil-reduce
39
+ ```
40
+
41
+ Inside DCCs:
42
+
43
+ ```bash
44
+ mayapy -m pip install anvil-reduce # Maya
45
+ hython -m pip install anvil-reduce # Houdini
46
+ # Blender: install into the addon's bundled Python or vendor the wheel
47
+ ```
48
+
49
+ ## Quick start
50
+
51
+ One-shot file pipeline (the path most pipeline TDs want):
52
+
53
+ ```python
54
+ from anvil_reduce import proxy_from_path
55
+
56
+ result = proxy_from_path(
57
+ "hero.obj",
58
+ "hero_proxy.obj",
59
+ quality="balanced", # "fast" | "balanced" | "high"
60
+ transfer_normals=True,
61
+ )
62
+ print(f"{result['input_faces']} -> {result['output_faces']} in "
63
+ f"{result['wall_seconds']:.2f}s")
64
+ ```
65
+
66
+ NumPy-driven workflow:
67
+
68
+ ```python
69
+ import numpy as np
70
+ from anvil_reduce import Mesh, generate_proxy
71
+
72
+ mesh = Mesh.from_numpy(positions, indices) # (N,3) f64, (M,3) u32
73
+ proxy = generate_proxy(mesh, quality="balanced", target_faces=20_000)
74
+ positions, indices = proxy.positions(), proxy.indices()
75
+ ```
76
+
77
+ ## Quality presets
78
+
79
+ | Preset | voxel_res | smooth | remesh | sdf |
80
+ |-----------|-----------|--------|--------|------|
81
+ | fast | 64 | 10 | 0 | off |
82
+ | balanced | 128 | 10 | 3 | off |
83
+ | high | 256 | 15 | 5 | on |
84
+
85
+ Override individual knobs by passing them explicitly. `target_faces` auto-picks
86
+ `voxel_res`. `dilation` controls hull tightness (0 = tight, 1-3 = looser).
87
+
88
+ See <https://github.com/voidreamer/anvil-reduce> for the full project.
89
+
@@ -0,0 +1,59 @@
1
+ # anvil-reduce
2
+
3
+ Volume-based mesh proxy generator: voxelize, marching cubes, smooth, remesh.
4
+ Fast, watertight, hands-off. Native Rust core, Python bindings via PyO3.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ pip install anvil-reduce
10
+ ```
11
+
12
+ Inside DCCs:
13
+
14
+ ```bash
15
+ mayapy -m pip install anvil-reduce # Maya
16
+ hython -m pip install anvil-reduce # Houdini
17
+ # Blender: install into the addon's bundled Python or vendor the wheel
18
+ ```
19
+
20
+ ## Quick start
21
+
22
+ One-shot file pipeline (the path most pipeline TDs want):
23
+
24
+ ```python
25
+ from anvil_reduce import proxy_from_path
26
+
27
+ result = proxy_from_path(
28
+ "hero.obj",
29
+ "hero_proxy.obj",
30
+ quality="balanced", # "fast" | "balanced" | "high"
31
+ transfer_normals=True,
32
+ )
33
+ print(f"{result['input_faces']} -> {result['output_faces']} in "
34
+ f"{result['wall_seconds']:.2f}s")
35
+ ```
36
+
37
+ NumPy-driven workflow:
38
+
39
+ ```python
40
+ import numpy as np
41
+ from anvil_reduce import Mesh, generate_proxy
42
+
43
+ mesh = Mesh.from_numpy(positions, indices) # (N,3) f64, (M,3) u32
44
+ proxy = generate_proxy(mesh, quality="balanced", target_faces=20_000)
45
+ positions, indices = proxy.positions(), proxy.indices()
46
+ ```
47
+
48
+ ## Quality presets
49
+
50
+ | Preset | voxel_res | smooth | remesh | sdf |
51
+ |-----------|-----------|--------|--------|------|
52
+ | fast | 64 | 10 | 0 | off |
53
+ | balanced | 128 | 10 | 3 | off |
54
+ | high | 256 | 15 | 5 | on |
55
+
56
+ Override individual knobs by passing them explicitly. `target_faces` auto-picks
57
+ `voxel_res`. `dilation` controls hull tightness (0 = tight, 1-3 = looser).
58
+
59
+ See <https://github.com/voidreamer/anvil-reduce> for the full project.
@@ -0,0 +1,20 @@
1
+ [package]
2
+ name = "anvil-reduce-core"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+
6
+ [dependencies]
7
+ nalgebra = "0.33"
8
+ rayon = "1.10"
9
+ bitflags = "2.6"
10
+ thiserror = "2.0"
11
+ rustc-hash = "2.0"
12
+
13
+ [dev-dependencies]
14
+ criterion = "0.5"
15
+ proptest = "1.5"
16
+ approx = "0.5"
17
+
18
+ [[bench]]
19
+ name = "decimation"
20
+ harness = false
@@ -0,0 +1,13 @@
1
+ use criterion::{criterion_group, criterion_main, Criterion};
2
+
3
+ fn bench_placeholder(c: &mut Criterion) {
4
+ c.bench_function("placeholder", |b| {
5
+ b.iter(|| {
6
+ // TODO: add real benchmarks
7
+ std::hint::black_box(42)
8
+ });
9
+ });
10
+ }
11
+
12
+ criterion_group!(benches, bench_placeholder);
13
+ criterion_main!(benches);