From add9c4f0ef8cd870facff07e6734010aca454d94 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 11 Apr 2022 16:18:15 +0200 Subject: [PATCH] Add implementation note --- fj-kernel/src/algorithms/triangulation/polygon.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fj-kernel/src/algorithms/triangulation/polygon.rs b/fj-kernel/src/algorithms/triangulation/polygon.rs index f19c822c4..9ee6baaf2 100644 --- a/fj-kernel/src/algorithms/triangulation/polygon.rs +++ b/fj-kernel/src/algorithms/triangulation/polygon.rs @@ -12,6 +12,21 @@ pub struct Polygon { } impl Polygon { + /// Construct an instance of `Polygon` + /// + /// # Implementation note + /// + /// This method takes a `Surface`, but `Polygon` only uses that for + /// generating debug info. It might be better, if `Polygon` had a field + /// where it stored debug info specific to its algorithm. Then code using + /// `Polygon` could access that `Polygon`-specific debug info and translate + /// that into `DebugInfo`, as necessary. + /// + /// This would have the advantage of removing this dependency on `Surface`. + /// It would also make the test code a bit cleaner, as it wouldn't have to + /// bother with the `DebugInfo` anymore. Also, the `Polygon`-specific debug + /// info could potentially be more useful in test code, as a debugging tool + /// there. pub fn new(surface: Surface) -> Self { Self { surface,