You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromgeomdlimportNURBS# Create a NURBS surface instancesurf=NURBS.Surface()
# Set degreessurf.degree_u=3surf.degree_v=2# Set control points (weights vector will be 1 by default)# Use curve.ctrlptsw is if you are using homogeneous points as Pwcontrol_points= [[0, 0, 0], [0, 4, 0], [0, 8, -3],
[2, 0, 6], [2, 4, 0], [2, 8, 0],
[4, 0, 0], [4, 4, 0], [4, 8, 3],
[6, 0, 0], [6, 4, -3], [6, 8, 0]]
surf.set_ctrlpts(control_points, 4, 3)
# Set knot vectorssurf.knotvector_u= [0, 0, 0, 0, 1, 1, 1, 1]
surf.knotvector_v= [0, 0, 0, 1, 1, 1]
# Set evaluation delta (control the number of surface points)surf.delta=0.05# Get surface points (the surface will be automatically evaluated)surface_points=surf.evalpts
The error message:
ZeroDivisionErrorTraceback (mostrecentcalllast)
..\AppData\Local\Temp/ipykernel_21148/3509177292.pyin<module>2425# Get surface points (the surface will be automatically evaluated)--->26surface_points=surf.evalpts~\miniconda3\lib\site-packages\geomdl\abstract.pyinevalpts(self)
263 """
264 if self._eval_points is None or len(self._eval_points) == 0:
--> 265 self.evaluate()
266 return self._eval_points
267
~\miniconda3\lib\site-packages\geomdl\BSpline.py in evaluate(self, **kwargs)
614
615 # Evaluate and cache
--> 616 self._eval_points = self._evaluator.evaluate(self.data,
617 start=(start_u, start_v),
618 stop=(stop_u, stop_v))
~\miniconda3\lib\site-packages\geomdl\evaluators.py in evaluate(self, datadict, **kwargs)
395 eval_points = []
396 for pt in cptw:
--> 397 cpt = [float(c / pt[-1]) for c in pt[0:(dimension - 1)]]
398 eval_points.append(cpt)
399
~\miniconda3\lib\site-packages\geomdl\evaluators.pyin<listcomp>(.0)
395eval_points= []
396forptincptw:
-->397cpt= [float(c/pt[-1]) forcinpt[0:(dimension-1)]]
398eval_points.append(cpt)
399ZeroDivisionError: floatdivisionbyzero
Expected Behavior
I had tried to reduce surf.delta to 0.01, 0.005, also got ZeroDivisionError
Configuration:
OS: [Win11]
Python distribution: [Anaconda]
Python version: python 3.9.5
geomdl install source: Anaconda
geomdl version/branch: 5.3.1
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: