Seems like the attachments did not work, here is the code:
from ngsolve import *
from ngsolve.solve import Draw, Redraw
from netgen.csg import *
# Creating the coil geometry
# Format of endpoints: end_point = [xi1, yi1, zi1, xi2, yi2, zi2, r]
end_points = []
radius = 6
end_points.append([0, 0, 0, 198.179, 0, 0, radius])
end_points.append([198.179, 0, 0, 198.179 , 280, 0, radius])
end_points.append([198.179, 280, 0, -182.184, 280, 0, radius])
end_points.append([-182.184, 280, 0, -182.184, 20, 0, radius])
end_points.append([-182.184, 20, 0, 168.162, 20, 0, radius])
end_points.append([168.162, 20, 0, 168.162, 260, 0, radius])
end_points.append([168.162, 260, 0, -152.166, 260, 0, radius])
# Create tubes from end_points vecotr
tubes = []
for end_point in end_points:
tubes.append(Cylinder(Pnt(end_point[0],end_point[1],end_point[2]), Pnt(end_point[3],end_point[4],end_point[5]), end_point[6]))
# Join tubes to coil geometry
coil = tubes[0]
for i in range (1,len(tubes)):
coil = coil + tubes
# Create geometry
geo = CSGeometry()
geo.Add(coil)
# Draw Geometry
geo.Draw()
# Generate Mesh
mesh = geo.GenerateMesh()