3D Reconstruction and Program Debug

I used a Python script to reconstruct the surface of a 3D object and generate a mesh, but I encountered some errors. How can I debug it? What are some quick and convenient tutorials and shortcut keys you can recommend?

e.g.

Warning : Curve 11 has a zero length
Segmentation fault
*** readUGrid ***
nb_points = 65
nb_cells = 185
rm: cannot remove ‘meshfilename’: No such file or directory
Total_num_points = 51
ERROR: In /sundials-3.2.1/build/vtk-v8.1.1/Common/DataModel/vtkPointLocator.cxx, line 867
vtkPointLocator (0x3846ef0): No points to subdivide

ERROR: In /sundials-3.2.1/build/vtk-v8.1.1/Common/DataModel/vtkPointLocator.cxx, line 867
vtkPointLocator (0x3849760): No points to subdivide

Total_num_points = 51
Number of points = 65
Number of tetra = 185
Iterating over subset, found 419 entities out of 419.
Traceback (most recent call last):
File “createBiVmesh_main.py”, line 30, in
fenics_mesh_ref, fenics_facet_ref, fenics_edge_ref = vtk_py.extractFeNiCsBiVFacet(ugrid)
File “/home/henryxiabing/heArtLVAD/CTImage/vtk_py/extractFeNiCsBiVFacet.py”, line 155, in extractFeNiCsBiVFacet
x0 = bc_pts[locator].GetPoints().GetPoint(ptid)
ValueError: expects 0 <= id && id < GetNumberOfPoints()

Without the actual code there is nothing we can really do to help you.
This also seems to be related to code written in:

and should probably be taken up with the library developer (mojumder@msu.edu) @mojumder.