Skip to content
Snippets Groups Projects
Commit fa0906f2 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

correct computation of sliced Pyramid6

parent 7ac7e6dc
No related branches found
No related tags found
1 merge request!1227correct computation of sliced Pyramid6 (#385)
Pipeline #84362 passed
...@@ -46,13 +46,11 @@ IFormFactor* doSlice(const IFormFactor* ff, double dz_bottom, double dz_top) ...@@ -46,13 +46,11 @@ IFormFactor* doSlice(const IFormFactor* ff, double dz_bottom, double dz_top)
double dradius = dz_bottom * Math::cot(f->alpha()); double dradius = dz_bottom * Math::cot(f->alpha());
return new Cone(f->radius() - dradius, f->height() - dz_bottom - dz_top, 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)) { 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, return new Pyramid6(f->baseEdge() - dbase_edge, f->height() - dz_bottom - dz_top,
f->alpha()); f->alpha());
} }
*/
if (const auto* f = dynamic_cast<const Bipyramid4*>(ff)) { if (const auto* f = dynamic_cast<const Bipyramid4*>(ff)) {
if (dz_bottom > f->base_height()) { if (dz_bottom > f->base_height()) {
double dbase_edge = 2 * (dz_bottom - f->base_height()) * Math::cot(f->alpha()); double dbase_edge = 2 * (dz_bottom - f->base_height()) * Math::cot(f->alpha());
......
...@@ -65,7 +65,7 @@ class SlicedSpheresTest(unittest.TestCase): ...@@ -65,7 +65,7 @@ class SlicedSpheresTest(unittest.TestCase):
self.runPlainFF(ba.Prism6(4., 9.)) self.runPlainFF(ba.Prism6(4., 9.))
self.runPlainFF(ba.Pyramid3(8., 10., 80*ba.deg)) self.runPlainFF(ba.Pyramid3(8., 10., 80*ba.deg))
self.runPlainFF(ba.Pyramid4(8., 9., 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__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment