Skip to content

Commit

Permalink
Re-enable step tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Zervas <[email protected]>
  • Loading branch information
dzervas committed May 24, 2024
1 parent c6a59aa commit 9e30864
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
31 changes: 11 additions & 20 deletions packages/cadmium/src/extrusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ fn are_coplanar(p0: Plane, p1: Plane) -> bool {
#[cfg(test)]
mod tests {
use crate::project::Project;
use crate::project::tests::create_test_project;

#[allow(unused_imports)]
use super::*;
Expand Down Expand Up @@ -433,25 +434,15 @@ mod tests {
}
}

// #[test]
// fn step_export() {
// let mut p = Project::new("Test Project");
// p.add_defaults();
// p.add_
// let workbench = &p.workbenches[0 as usize];
// let realization = workbench.realize(1000);
// // let solids = realization.solids;
// let keys = Vec::from_iter(realization.solids.keys());
// let key = keys[0 as usize];
// let step_file = realization.solid_to_step(keys[0]);

// realization.save_solid_as_step_file(keys[0], "test.step");
// // now delete that file
// // std::fs::remove_file("test.step").unwrap();

// realization.save_solid_as_obj_file(keys[0], "test.obj", 0.001);
// // now delete that file
// // std::fs::remove_file("test.obj").unwrap();
// }
#[test]
fn step_export() {
let p = create_test_project();
let workbench = &p.workbenches[0 as usize];
let realization = workbench.realize(1000);
let keys = Vec::from_iter(realization.solids.keys());

realization.save_solid_as_step_file(keys[0], "target/test.step");
realization.save_solid_as_obj_file(keys[0], "target/test.obj", 0.001);
}

}
18 changes: 9 additions & 9 deletions packages/cadmium/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ pub struct RealPlane {
}

#[cfg(test)]
mod tests {
pub mod tests {
use truck_polymesh::obj;

use crate::extrusion::Direction;
Expand All @@ -255,14 +255,6 @@ mod tests {
s.add_segment(ur, ul);
s.add_segment(ul, ll);

p
}

#[test]
fn one_extrusion() {
let mut p = create_test_project();
let wb = p.workbenches.get_mut(0).unwrap();

let extrusion = Extrusion::new(
"Sketch-0".to_owned(),
vec![0],
Expand All @@ -273,6 +265,14 @@ mod tests {
);
wb.add_extrusion("Ext1", extrusion);

p
}

#[test]
fn one_extrusion() {
let mut p = create_test_project();
let wb = p.workbenches.get_mut(0).unwrap();

let realization = p.get_realization(0, 1000);
let solids = realization.solids;

Expand Down

0 comments on commit 9e30864

Please sign in to comment.