From 289edd588a3dccda8ba1dabbc850d73c548e10b7 Mon Sep 17 00:00:00 2001 From: teade Date: Wed, 24 Apr 2024 11:44:48 +0100 Subject: [PATCH 1/2] Fix to additional cone surface when defining tori --- src/geouned/GEOUNED/Conversion/CellDefinition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geouned/GEOUNED/Conversion/CellDefinition.py b/src/geouned/GEOUNED/Conversion/CellDefinition.py index ca390815..7dcec3d0 100644 --- a/src/geouned/GEOUNED/Conversion/CellDefinition.py +++ b/src/geouned/GEOUNED/Conversion/CellDefinition.py @@ -598,7 +598,7 @@ def GenTorusAnnexVSurface(face,Vparams,forceCylinder=False): Apex = face.Surface.Center + za * axis semiAngle = abs(math.atan(d1/(z1-za))) - ConeAxis = axis if za < 0 else -axis + ConeAxis = axis if (face.Surface.Center.dot(axis) + z1 - Apex.dot(axis)) > 0.0 else -axis Vmid = (Vparams[0]+Vparams[1])*0.5 pMid = face.valueAt(0,Vmid) - face.Surface.Center From cdc637f2da40a43c6050a68254b95efea6b98b98 Mon Sep 17 00:00:00 2001 From: teade Date: Wed, 24 Apr 2024 20:08:09 +0100 Subject: [PATCH 2/2] Updated fix as per psauvan suggestion --- src/geouned/GEOUNED/Conversion/CellDefinition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geouned/GEOUNED/Conversion/CellDefinition.py b/src/geouned/GEOUNED/Conversion/CellDefinition.py index 7dcec3d0..9d2762c6 100644 --- a/src/geouned/GEOUNED/Conversion/CellDefinition.py +++ b/src/geouned/GEOUNED/Conversion/CellDefinition.py @@ -598,7 +598,7 @@ def GenTorusAnnexVSurface(face,Vparams,forceCylinder=False): Apex = face.Surface.Center + za * axis semiAngle = abs(math.atan(d1/(z1-za))) - ConeAxis = axis if (face.Surface.Center.dot(axis) + z1 - Apex.dot(axis)) > 0.0 else -axis + ConeAxis = axis if (z1 - za) > 0.0 else -axis Vmid = (Vparams[0]+Vparams[1])*0.5 pMid = face.valueAt(0,Vmid) - face.Surface.Center