Skip to content

Commit

Permalink
Merge pull request #1389 from hannobraun/objects
Browse files Browse the repository at this point in the history
Take `&mut Objects` in `Shape::compute_brep`
  • Loading branch information
hannobraun authored Nov 24, 2022
2 parents 0b679e8 + 864afa7 commit 96e38a8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/fj-operations/src/difference_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl Shape for fj::Difference2d {

fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
debug_info: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError> {
// This method assumes that `b` is fully contained within `a`:
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-operations/src/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl Shape for fj::Group {

fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
debug_info: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError> {
let mut faces = FaceSet::new();
Expand Down
6 changes: 3 additions & 3 deletions crates/fj-operations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait Shape {
/// Compute the boundary representation of the shape
fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
debug_info: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError>;

Expand All @@ -60,7 +60,7 @@ impl Shape for fj::Shape {

fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
debug_info: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError> {
match self {
Expand Down Expand Up @@ -96,7 +96,7 @@ impl Shape for fj::Shape2d {

fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
debug_info: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError> {
match self {
Expand Down
4 changes: 2 additions & 2 deletions crates/fj-operations/src/shape_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ impl ShapeProcessor {
Some(user_defined_tolerance) => user_defined_tolerance,
};

let objects = Objects::new();
let mut objects = Objects::new();
let mut debug_info = DebugInfo::new();
let shape = shape.compute_brep(&objects, &mut debug_info)?;
let shape = shape.compute_brep(&mut objects, &mut debug_info)?;
let mesh = (&shape, tolerance).triangulate();

Ok(ProcessedShape {
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-operations/src/sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl Shape for fj::Sketch {

fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
_: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError> {
let surface = objects.surfaces.xy_plane();
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-operations/src/sweep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl Shape for fj::Sweep {

fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
debug_info: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError> {
let sketch = self.shape().compute_brep(objects, debug_info)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-operations/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl Shape for fj::Transform {

fn compute_brep(
&self,
objects: &Objects,
objects: &mut Objects,
debug_info: &mut DebugInfo,
) -> Result<Self::Brep, ValidationError> {
let faces = self
Expand Down

0 comments on commit 96e38a8

Please sign in to comment.