From 5fad335620f7f60eec4d586c1a2fa9f517b49014 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 27 Mar 2024 11:33:13 +0100 Subject: [PATCH] Store the original face in `FaceApprox` This enables code dealing with `FaceApprox` to load data about the face from layers, which means `FaceApprox` can now be simplified by removing the color. --- crates/fj-core/src/algorithms/approx/face.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/fj-core/src/algorithms/approx/face.rs b/crates/fj-core/src/algorithms/approx/face.rs index 16cebb565..534cca3a8 100644 --- a/crates/fj-core/src/algorithms/approx/face.rs +++ b/crates/fj-core/src/algorithms/approx/face.rs @@ -104,6 +104,7 @@ impl Approx for Handle { let color = self.region().get_color(core); let coord_handedness = self.coord_handedness(&core.layers.geometry); FaceApprox { + face: self, exterior, interiors, color, @@ -115,6 +116,9 @@ impl Approx for Handle { /// An approximation of a [`Face`] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct FaceApprox { + /// The [`Face`], that this approximates + pub face: Handle, + /// Approximation of the exterior cycle pub exterior: CycleApprox,