Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take &mut Objects in Shape::compute_brep #1389

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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