Skip to content

Divide by Zero when using curve = fitting.approximate_curve(tuple_list, 3) #181

@KeithSloan

Description

@KeithSloan

Have code that is executing

curve = fitting.approximate_curve(tuple_list, 3)

File "/Users/keithsloan/Library/Application Support/FreeCAD/Mod/toSketch/./freecad/toSketch/toSharedFunc.py", line 387, in fit_bspline_to_geom_geomdl
curve = fitting.approximate_curve(tuple_list, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/FreeCAD 1.0.0.app/Contents/Resources/lib/python3.11/site-packages/geomdl/fitting.py", line 198, in approximate_curve
x = linalg.backward_substitution(matrix_u, y)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/FreeCAD 1.0.0.app/Contents/Resources/lib/python3.11/site-packages/geomdl/linalg.py", line 619, in backward_substitution
matrix_x[i] /= float(matrix_u[i][i])

float division by zero

  • OS: MacOS 14.4
  • Architecture: x86_64
    Version: 1.0.0.39109 (Git) Conda
  • Python version: 3.11.10
  • geomdl install source: pip
  • geomdl version 5.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThere is a problem with the code or documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions