orbingol / NURBS-Python

Object-oriented pure Python B-Spline and NURBS library
https://onurraufbingol.com/NURBS-Python/
MIT License
603 stars 153 forks source link

operations.split_curve #164

Open GabrielJMS opened 1 year ago

GabrielJMS commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

ctrlpts = [[1.15172946556, -0.793717672594, 0.933672039573], [1.1518952086, -0.793708770555, 0.933608435395], [1.15206095164, -0.793699868517, 0.933544831218], [1.15222669467, -0.793690966478, 0.93348122704], [1.15272633787, -0.793664130701, 0.933289488101], [1.1531929054699999, -0.7934084417080001, 0.9331344375280001], [1.1534493163300001, -0.7931431955970001, 0.933061562775], [1.15370516404, -0.7926548375820001, 0.9330119698329999], [1.1537477257400002, -0.7921211122790001, 0.9330501527689999], [1.15376183642, -0.791944163861, 0.9330628117349999], [1.1537759471, -0.7917672154430001, 0.9330754707], [1.1537900577800002, -0.791590267025, 0.933088129665]]

curve = BSpline.Curve() curve. Degree= 5 curve.ctrlpts = ctrlpts curve.knotvector = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.24999999999999975, 0.24999999999999975, 0.24999999999999975, 0.75, 0.75, 0.75, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] curves = operations.split_curve(curve, 0.2499999955077846)

  1. See error File "Python\Python310\site-packages\geomdl\operations.py", line 969, in split_curve curve1.set_ctrlpts(curve1_ctrlpts) File "Python\Python310\site-packages\geomdl\abstract.py", line 957, in set_ctrlpts raise GeomdlException("Number of control points should be at least degree + 1") geomdl.exceptions.GeomdlException: GEOMDL ERROR: Number of control points should be at least degree + 1

Expected Behavior A clear and concise description of what you expected to happen. Error whiling trying to split a BSpline curve using operations.split_curve. Configuration:

Screenshots (Optional) If applicable, add screenshots to help explain your problem. image

Additional Details (Optional) Add any other context about the problem here.