I am trying to get isosurface's x-y coordinates from 3D plot. Here is my attempt;
import matplotlib.pyplot as plt
from numpy import pi, cos, sin, linspace, meshgrid
x = linspace(0,50,1000)
y = linspace(0,50,1000)
n = 5
L = 50
t = 0
def gyroid(x, y, n, L, t):
tanım1 = (sin(2*pi*n*x/L) * cos(2*pi*n*y/L) sin(2*pi*n*y/L) cos(2*pi*n*x/L))
return tanım1*tanım1 - t**2
XX, YY = meshgrid(x, y)
z = gyroid(XX, YY, n, L, t)
thickness = 0.1
contour = plt.contour(XX, YY, z,levels=[thickness])
# Attempt to get x-y coordinates
dat0= contour.allsegs[0][0]
plt.plot(dat0[:,0],dat0[:,1])