Visualizing 1D geometry with 'k3d'
When attempting to visualize a 1D geometry using the 'k3d' backend in 'vedo' a TraitError occurs. Below is a code example that reproduces the error:
from splinepy.helpme.create import line
from vedo import settings
settings.default_backend = 'k3d'
curve = line(([0.0, 0.0], [1.0, 1.0]))
curve.show()
Error Message: TraitError: The 'width' trait of a Line instance expected a float or a dict, not the float32 np.float32(0.11313708).
If you don't mind switching numpy version, a quick fix is to use numpy 1.
pip install --force-reinstall numpy==1.26
You could also just uninstall and install.
Afterwards, you can check the version using splinepy -v.
I think this has something to do with NEP 50. So, an alternative quick fix is to set the promotion state to legacy:
np._set_promotion_state("legacy")
...
spline.show()
...
np._set_promotion_state("weak") # set back to default
Ideally, as suggested in numpy migration guide, we should explicitly cast it to float. The nearest dependency that we can work on is vedo. I can also create a PR for it