Im trying to create a volume with a custom shape, to add Z-axis data I need to mesh X-Y data. Hence my issue. I'd like to have this shape as the base Trapezoid Base
However, after doing
X,Y = np.mesh(x,y)
I get a symmetric rectangle rather than the trapezoid-looking like shape. meshed data
is there another effecient way I can fill the trapezoid ?
here is the code:
x1 = np.zeros(20)
y1 = np.linspace(-2,2,20)
x2 = np.linspace(0,30,20)
y2 = np.sqrt(( 5/max(x2) * x2 +4 ))
x3 = np.linspace(0, 30, 20)
y3 = -np.sqrt((5 / max(x3) * x3 + 4))
x4 = np.ones(20)*30
y4 = np.linspace(-3,3,20)
x = np.concatenate((x1, x2, x3, x4))
y = np.concatenate((y1,y2,y3,y4))
# u,v = np.meshgrid(x,y)
# x = u.flatten()
# y = v.flatten()
plt.plot(x,y)
plt.show()
Trying to fill a trapizoid shape to construct a 3d volume representation using plotly