# Conical Tank dimensions

Hi All,
In order to write a python script of the geometry of my conical Tank which should be customizable by users according to its volume, I should compute and find relation betwwen all geometry parameters according to the inputs which are figured in blanc in the image below.

My issue is that I can not find the hight of the exterior wall face figured in red which is based on the exterior angle that can not be find either due to the non parallel faces of the wall because Thk1 and Thk2 are not equals
Then any idea or orientation to use a special node in dynamo well welcomed

Thanks.

Hello, here is a possibility of construction edit: for angle and H (I think there must be a simpler way, but for now it’s not obvious)

Cordially
christian.stan

1 Like

@christian.stan

as usual, your solutions are usefull  I dont think there is a simpler way then this Thanks.

1 Like

Here is a solution with python , but beware of the possible division by zero blocking that I don’t know how to handle

Python script: watch out for the risk of crashing
``````import sys
import clr
from Autodesk.DesignScript.Geometry import *
import math

#--- INPUT DATA ---
pt_A,pt_B=IN,IN
thick_1,thick_2=IN,IN
offset_up,offset_down=IN,IN
#--- Right equation: z =mx+p ---
m=(pt_B.Z-pt_A.Z)/(pt_B.X-pt_A.X)
p=pt_A.Z-m*pt_A.X
alpha=math.atan(m)
#--- Right equation of the shifted curve ---
pt_C=Point.ByCoordinates(pt_A.X+thick_1*math.sin(alpha),pt_A.Y,pt_A.Z-thick_1*math.cos(alpha))
pt_D=Point.ByCoordinates(pt_B.X+thick_2*math.sin(alpha),pt_B.Y,pt_B.Z-thick_2*math.cos(alpha))
m_offset=(pt_D.Z-pt_C.Z)/(pt_D.X-pt_C.X)
p_offset=pt_C.Z-m_offset*pt_C.X
#---- Intersection points based on offset along X up and down---
Pt_up=Point.ByCoordinates(pt_B.X+offset_up,pt_B.Y,m_offset*(pt_B.X+offset_up)+p_offset)
Pt_down=Point.ByCoordinates(pt_A.X+offset_down,pt_A.Y,m_offset*(pt_A.X+offset_down)+p_offset)
#--- Results ---
angle=math.degrees(math.atan(m_offset))
H=Pt_up.Z-Pt_down.Z

OUT = my_dic={"angle-->":angle ,"H-->":H}
``````

Cordially
christian.stan

1 Like

@christian.stan

Good job my friend  where you find the value -0.24 for the input IN ?

You got a division by zero? in what case?

Thanks.

1 Like

on your initial figure `6.94-6.70 = 0.24`
edit: In the case where `pt_B.X = pt_A.X`
cordially
christian.stan

1 Like

@christian.stan

I tryed your script, it works well for an angle of 45 degrees…but by sweeping the angle alpha I discovered an error that needs to be corrected…so there are two choices:

1- change input IN to +0.24

or

-2 Replace the Z coordinate for Pt_down from:

``````m_offset*(pt_A.X+offset_down)+p_offset
``````

to

``````p_offset-m_offset*(pt_A.X+offset_down)
``````

Thanks.

1 Like

Hello,
I must have got the offset notations wrong at some point
Sorry
I note it
Thanks
Cordially
christian.stan

@christian.stan

No problem my freind

Have a good day Thanks

1 Like