-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1058 from hannobraun/approx
Validate approximations before using them for triangulation
- Loading branch information
Showing
8 changed files
with
138 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! Shell approximation | ||
use std::collections::BTreeSet; | ||
|
||
use crate::objects::Shell; | ||
|
||
use super::{face::FaceApprox, Approx, Tolerance}; | ||
|
||
impl Approx for &Shell { | ||
type Approximation = BTreeSet<FaceApprox>; | ||
|
||
fn approx(self, tolerance: Tolerance) -> Self::Approximation { | ||
self.faces().approx(tolerance) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! Sketch approximation | ||
use std::collections::BTreeSet; | ||
|
||
use crate::objects::Sketch; | ||
|
||
use super::{face::FaceApprox, Approx, Tolerance}; | ||
|
||
impl Approx for &Sketch { | ||
type Approximation = BTreeSet<FaceApprox>; | ||
|
||
fn approx(self, tolerance: Tolerance) -> Self::Approximation { | ||
self.faces().approx(tolerance) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//! Solid approximation | ||
use std::collections::BTreeSet; | ||
|
||
use crate::objects::Solid; | ||
|
||
use super::{face::FaceApprox, Approx, Tolerance}; | ||
|
||
impl Approx for &Solid { | ||
type Approximation = BTreeSet<FaceApprox>; | ||
|
||
fn approx(self, tolerance: Tolerance) -> Self::Approximation { | ||
self.shells() | ||
.flat_map(|shell| shell.approx(tolerance)) | ||
.collect() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.