Skip to content

Commit

Permalink
extruding a solid seems to be working!
Browse files Browse the repository at this point in the history
  • Loading branch information
MattFerraro committed May 12, 2024
1 parent 10341bf commit a4f15c0
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 34 deletions.
31 changes: 9 additions & 22 deletions packages/cadmium/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fn stacked_cubes() {
plane_id: top_plane_id.clone(),
plane: Plane::top(),
});
let top_plane_real = el.realize_plane(&top_plane_id);

// Create the sketch
let sketch_id = el.append(Operation::CreateSketch {
Expand All @@ -56,7 +57,7 @@ fn stacked_cubes() {
});
el.append(Operation::SetSketchPlane {
sketch_id: sketch_id.clone(),
plane_id: top_plane_id.clone(),
plane_id: top_plane_real.clone(),
});

// make a square
Expand All @@ -80,19 +81,7 @@ fn stacked_cubes() {
start: (100.0, 0.0),
end: (0.0, 0.0),
});
// // Add a handle to pull the extrusion from
// let handle_id = el.append(Operation::AddSketchHandle {
// sketch_id: sketch_id.clone(),
// position: (20.0, 20.0),
// });

// el.append(Operation::FinalizeSketch {
// sketch_id: sketch_id.clone(),
// workbench_id: workbench_id.clone(),
// });``

//
let face_id = el.find_faces(&workbench_id, &sketch_id);
let realized_sketch = el.realize_sketch(&sketch_id);

// extrude the square
let extrusion_id = el.append(Operation::CreateExtrusion {
Expand All @@ -107,22 +96,20 @@ fn stacked_cubes() {
extrusion_id: extrusion_id.clone(),
depth: 100.0,
});

el.append(Operation::SetExtrusionSketch {
extrusion_id: extrusion_id.clone(),
sketch_id: sketch_id.clone(),
sketch_id: realized_sketch.clone(),
});
el.append(Operation::SetExtrusionFaces {
extrusion_id: extrusion_id.clone(),
faces: vec![face_id.clone()],
faces: vec![0],
});

// el.append(Operation::SetExtrusionHandles {
// extrusion_id: extrusion_id.clone(),
// handles: vec![handle_id.clone()],
// });
el.realize_extrusion(&extrusion_id);

// el.git_log();
println!("project: {:?}", el.project);
el.git_log();
// println!("project: {:?}", el.project);

// el.to_project();
}
Loading

0 comments on commit a4f15c0

Please sign in to comment.