From fa0906f2e8ad35cf33b81a897467de9f10e57e55 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Fri, 23 Dec 2022 14:41:21 +0100
Subject: [PATCH] correct computation of sliced Pyramid6

---
 Resample/Processed/Slicer.cpp       | 4 +---
 Tests/Py/Functional/auto_slicing.py | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Resample/Processed/Slicer.cpp b/Resample/Processed/Slicer.cpp
index 5802e9b1e0b..d5cf65a21e3 100644
--- a/Resample/Processed/Slicer.cpp
+++ b/Resample/Processed/Slicer.cpp
@@ -46,13 +46,11 @@ IFormFactor* doSlice(const IFormFactor* ff, double dz_bottom, double dz_top)
         double dradius = dz_bottom * Math::cot(f->alpha());
         return new Cone(f->radius() - dradius, f->height() - dz_bottom - dz_top, f->alpha());
     }
-    /* TODO repair
     if (const auto* f = dynamic_cast<const Pyramid6*>(ff)) {
-        double dbase_edge = dz_bottom * Math::cot(f->alpha());
+        double dbase_edge = 2 / sqrt(3) * dz_bottom * Math::cot(f->alpha());
         return new Pyramid6(f->baseEdge() - dbase_edge, f->height() - dz_bottom - dz_top,
                             f->alpha());
     }
-    */
     if (const auto* f = dynamic_cast<const Bipyramid4*>(ff)) {
         if (dz_bottom > f->base_height()) {
             double dbase_edge = 2 * (dz_bottom - f->base_height()) * Math::cot(f->alpha());
diff --git a/Tests/Py/Functional/auto_slicing.py b/Tests/Py/Functional/auto_slicing.py
index 6c09e631f1b..e1e5380be0d 100644
--- a/Tests/Py/Functional/auto_slicing.py
+++ b/Tests/Py/Functional/auto_slicing.py
@@ -65,7 +65,7 @@ class SlicedSpheresTest(unittest.TestCase):
         self.runPlainFF(ba.Prism6(4., 9.))
         self.runPlainFF(ba.Pyramid3(8., 10., 80*ba.deg))
         self.runPlainFF(ba.Pyramid4(8., 9., 80*ba.deg))
-        # self.runPlainFF(ba.Pyramid6(18., 8., 40*ba.deg)) TODO wrong, disabled
+        self.runPlainFF(ba.Pyramid6(18., 8., 40*ba.deg))
 
 
 if __name__ == '__main__':
-- 
GitLab