Cannot extrude in API
Hi,
Probably, It could be a simple error, but as a beginner in the API, I do not know why I cannot extrude on it. I am using python, I have already generated the points and two splines. However, I got stuck extruding the surface. I tried to follow the error, but they code only return 0 or 1 in ierr
. The code is the following:
model = gmsh.model
factory = model.occ
# We have to initialize this instance always
gmsh.initialize()
gmsh.option.setNumber("General.Terminal", 1)
model.add("spline")
#Creation of the first spline
point = 1
surf = []
for num, df in enumerate([top_data, bottom_data]):
for index, row in df.iterrows():
point += 1
x,y = row.values
factory.addPoint(x, y, 0.0, 0.1, point)
surf.append(factory.addBSpline(range(point-index, point+1), num+300))
#Creation of the second spline
# for index, row in top_data.iterrows():
# name = 200
# x,y = row.values
# factory.addPoint(x, y, 0.0, 0.1, index+201)
# factory.addBSpline(range(200, index+201), 2)
factory.extrude([surf[0]], 0, 0, 50, [], [])
factory.synchronize()
gmsh.fltk.run()
gmsh.finalize()
I hope you can help me. Regards