VolumeManager with "ValueError: Please set the number of control points on the u-, v- and w-directions"

31 views
Skip to first unread message

JJ

unread,
Nov 8, 2022, 2:55:26 PM11/8/22
to NURBS-Python
Hi,
I'm trying to use a  volume. I follow Doc on https://nurbs-python.readthedocs.io/en/latest/module_cpmanager.html
but I got "ValueError: Please set the number of control points on the u-, v- and w-directions". How can I set the number of control points on directions?
Here is the code:

from geomdl import BSpline
from geomdl import control_points
# Number of control points in all parametric dimensions
size_u = 5
size_v = 3
size_w = 2

# Create control points manager
points = control_points.VolumeManager(size_u, size_v, size_w)
pt = [10, 15, 12]
# Set control points
for u in range(size_u):
for v in range(size_v):
for w in range(size_w):
# 'pt' is the control point, e.g. [10, 15, 12]
points.set_ctrlpt(pt, u, v, w)

# Create spline geometry
volume = BSpline.Volume()

# Set control points
volume.ctrlpts = points.ctrlpts

Screenshot from 2022-11-08 12-50-07.png
Thanks!

Onur Bingol

unread,
Nov 19, 2022, 4:29:50 PM11/19/22
to nurbs-python
You need to set u,v,w sizes and the knot vectors on the "BSpline.Volume" object. VolumeManager is only for control points, and I agree the naming is a bit off and the example seems to assume just a bit more from the users.

Thanks for bringing this issue to my attention. I'll add this doc fix to the todo list.




---- On Tue, 08 Nov 2022 11:55:26 -0800 JJ <colab.o...@gmail.com> wrote ---

--
You received this message because you are subscribed to the Google Groups "NURBS-Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nurbs-python...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nurbs-python/82abe90e-f241-4dcc-8785-c75cc166773dn%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages