Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
x = (radii * numpy.cos(angles)).flatten()
y = (radii * numpy.sin(angles)).flatten()
# Create the Triangulation; no triangles so Delaunay triangulation created.
triang = tri.Triangulation(x, y)
# print(triang)
# exit(1)
# import dmsh
# geo = dmsh.Circle([0.0, 0.0], 1.0)
# X, cells = dmsh.generate(geo, 0.1)
z = x + 1j * y
# z /= numpy.abs(z)
cplot.tripcolor(triang, z, alpha=0)
plt.gca().set_aspect("equal", "datalim")
plt.axis("off")
plt.savefig("logo.png", transparent=True)
return
angles[:, 1::2] += numpy.pi / n_angles
x = (radii * numpy.cos(angles)).flatten()
y = (radii * numpy.sin(angles)).flatten()
z = 2 * (x + 1j * y)
# Create the Triangulation; no triangles so Delaunay triangulation created.
triang = tri.Triangulation(x, y)
# Mask off unwanted triangles.
triang.set_mask(
numpy.hypot(x[triang.triangles].mean(axis=1), y[triang.triangles].mean(axis=1))
< min_radius
)
cplot.tripcolor(triang, z)
plt.gca().set_aspect("equal", "datalim")
plt.show()
return