From 1db029e3630baa92869c9a0aac61d8bda0f5e0f1 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Tue, 5 Dec 2023 16:18:40 -0500 Subject: [PATCH] BUG: Fix incorrect calculation in CylinderOps Signed-off-by: Michael Jackson --- Source/SIMPLib/Geometry/ShapeOps/CylinderAOps.cpp | 5 ++--- Source/SIMPLib/Geometry/ShapeOps/CylinderBOps.cpp | 5 ++--- Source/SIMPLib/Geometry/ShapeOps/CylinderCOps.cpp | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Source/SIMPLib/Geometry/ShapeOps/CylinderAOps.cpp b/Source/SIMPLib/Geometry/ShapeOps/CylinderAOps.cpp index 7c16375a4..1a9bb8c83 100644 --- a/Source/SIMPLib/Geometry/ShapeOps/CylinderAOps.cpp +++ b/Source/SIMPLib/Geometry/ShapeOps/CylinderAOps.cpp @@ -59,9 +59,8 @@ float CylinderAOps::radcur1(QMap args) float covera = args[C_OverA]; // the equation for volume for an A cylinder is pi*b*c*h where b and c are semi axis lengths, but - // h is a full axis length - meaning h = 2a. However, since our aspect ratios relate semi axis lengths, the 2.0 - // factor can be ingored in this part - radcur1 = static_cast((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera))); + // h is a full axis length - meaning h = 2a. + radcur1 = static_cast((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera))); radcur1 = powf(radcur1, 0.333333333333f); return radcur1; } diff --git a/Source/SIMPLib/Geometry/ShapeOps/CylinderBOps.cpp b/Source/SIMPLib/Geometry/ShapeOps/CylinderBOps.cpp index eeadd56be..cc34b819b 100644 --- a/Source/SIMPLib/Geometry/ShapeOps/CylinderBOps.cpp +++ b/Source/SIMPLib/Geometry/ShapeOps/CylinderBOps.cpp @@ -59,9 +59,8 @@ float CylinderBOps::radcur1(QMap args) float covera = args[C_OverA]; // the equation for volume for a B cylinder is pi*a*c*h where a and c are semi axis lengths, but - // h is a full axis length - meaning h = 2b. However, since our aspect ratios relate semi axis lengths, the 2.0 - // factor can be ingored in this part - radcur1 = static_cast((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera))); + // h is a full axis length - meaning h = 2b. + radcur1 = static_cast((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera))); radcur1 = powf(radcur1, 0.333333333333f); return radcur1; } diff --git a/Source/SIMPLib/Geometry/ShapeOps/CylinderCOps.cpp b/Source/SIMPLib/Geometry/ShapeOps/CylinderCOps.cpp index 1361af231..d656d9b54 100644 --- a/Source/SIMPLib/Geometry/ShapeOps/CylinderCOps.cpp +++ b/Source/SIMPLib/Geometry/ShapeOps/CylinderCOps.cpp @@ -59,9 +59,8 @@ float CylinderCOps::radcur1(QMap args) float covera = args[C_OverA]; // the equation for volume for a C cylinder is pi*a*b*h where a and b are semi axis lengths, but - // h is a full axis length - meaning h = 2c. However, since our aspect ratios relate semi axis lengths, the 2.0 - // factor can be ingored in this part - radcur1 = static_cast((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera))); + // h is a full axis length - meaning h = 2c. + radcur1 = static_cast((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera))); radcur1 = powf(radcur1, 0.333333333333f); return radcur1; }