Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_balls_difference():
radius = 1.0
displacement = 0.5
s0 = pygalmesh.Ball([displacement, 0, 0], radius)
s1 = pygalmesh.Ball([-displacement, 0, 0], radius)
u = pygalmesh.Difference(s0, s1)
a = numpy.sqrt(radius ** 2 - displacement ** 2)
edge_size = 0.15
n = int(2 * numpy.pi * a / edge_size)
circ = [
[0.0, a * numpy.cos(i * 2 * numpy.pi / n), a * numpy.sin(i * 2 * numpy.pi / n)]
for i in range(n)
]
circ.append(circ[0])
mesh = pygalmesh.generate_mesh(
u,
feature_edges=[circ],
cell_size=0.15,
edge_size=edge_size,
facet_angle=25,