Open goldengrape opened 2 years ago
I have exactly the same problem! Has there been any progress on this?
The problem can be solved by using homogenous control points as follows. I'll copy-past here my example.
from geomdl import NURBS as nrb from geomdl import compatibility as compat
srf = nrb.Surface()
srf.degree_u = 3 srf.degree_v = 1
control_points = [[0, 0, 0], [0, 0, 1], [2, 0, 1], [2, 0, 0], [0, 1, 0], [0, 1, 1], [2, 1, 1], [2, 1, 0]] weights = [1, 1, 1, 1, 1, 1, 1, 1] control_points_w = compat.combine_ctrlpts_weights(control_points, weights) points_size_u = 4 points_size_v = 2 control_points_w = compat.flip_ctrlpts_u(control_points_w, points_size_u, points_size_v) srf.set_ctrlpts(control_points_w, points_size_u, points_size_v)
srf.knotvector_u = [0, 0, 0, 0, 1, 1, 1, 1] srf.knotvector_v = [0, 0, 1, 1]
srf.delta_u = 0.2 srf.delta_v = 0.2 points = srf.evalpts
Describe the bug run NURBS Surface example https://nurbs-python.readthedocs.io/en/5.x/module_nurbs.html#nurbs-surface
but failed.
To Reproduce Steps to reproduce the behavior:
The error message:
Expected Behavior I had tried to reduce surf.delta to 0.01, 0.005, also got ZeroDivisionError
Configuration: