Skip to content

Commit dca6d01

Browse files
authored
Merge pull request #111 from qthree/fix_tests
Fix compilation of tests and examples after refactoring
2 parents 1b26d94 + 3c5862c commit dca6d01

File tree

5 files changed

+86
-81
lines changed

5 files changed

+86
-81
lines changed

examples/adjacency_demo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn main() {
6262

6363
for &vertex_idx in adjacency_map.keys().take(10) {
6464
let (valence, regularity) =
65-
csgrs::mesh::vertex::Vertex::analyze_connectivity_with_index(
65+
csgrs::vertex::Vertex::analyze_connectivity_with_index(
6666
vertex_idx,
6767
&adjacency_map,
6868
);
@@ -85,7 +85,7 @@ fn main() {
8585
println!("\n5. Laplacian smoothing using global connectivity:");
8686

8787
// Track a specific vertex to show position changes
88-
let test_vertex_pos = sphere.polygons[0].vertices[0].pos;
88+
let test_vertex_pos = sphere.polygons[0].vertices[0].position;
8989
println!(
9090
" Original test vertex position: ({:.3}, {:.3}, {:.3})",
9191
test_vertex_pos.x, test_vertex_pos.y, test_vertex_pos.z
@@ -95,8 +95,8 @@ fn main() {
9595
let smoothed_weak = sphere.laplacian_smooth(0.1, 1, false);
9696
let smoothed_strong = sphere.laplacian_smooth(0.3, 1, false);
9797

98-
let weak_pos = smoothed_weak.polygons[0].vertices[0].pos;
99-
let strong_pos = smoothed_strong.polygons[0].vertices[0].pos;
98+
let weak_pos = smoothed_weak.polygons[0].vertices[0].position;
99+
let strong_pos = smoothed_strong.polygons[0].vertices[0].position;
100100

101101
println!(
102102
" After weak smoothing (λ=0.1): ({:.3}, {:.3}, {:.3})",

examples/multi_format_export.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! OBJ (universal format), PLY (research/scanning), and AMF (3D printing format).
55
//! These formats can be opened in most 3D modeling software, CAD programs, and 3D viewers.
66
use csgrs::mesh::Mesh;
7-
use csgrs::traits::CSG;
7+
use csgrs::csg::CSG;
88

99
fn main() -> Result<(), Box<dyn std::error::Error>> {
1010
println!("Multi-Format Export Demo");

src/io/stl.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,6 @@ impl<S: Clone + Debug + Send + Sync> crate::bmesh::BMesh<S> {
114114
self::to_stl_binary(self, name)
115115
}
116116
}
117+
118+
// TODO: re-impl Mesh::from_stl
119+
// was used in crate::tests::test_csg_to_stl_and_from_stl_file

src/mesh/bsp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ impl<S: Clone + Send + Sync + Debug> Node<S> {
318318
#[cfg(test)]
319319
mod tests {
320320
use crate::mesh::bsp::Node;
321-
use crate::mesh::polygon::Polygon;
322-
use crate::mesh::vertex::Vertex;
321+
use crate::polygon::Polygon;
322+
use crate::vertex::Vertex;
323323
use nalgebra::{Point3, Vector3};
324324

325325
#[test]

0 commit comments

Comments
 (0)