-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualization (VisMPL) is showing an empty figure #165
Labels
bug
There is a problem with the coding or algorithms
Comments
I was able to fix it, temporarily at least, by replacing line 431 in ax = Axes3D(fig) to ax = fig.add_subplot( 111, projection='3d' ) |
Thank you! Same problem and this also solve my issue :) |
Same and solved. Also, for anyone having the error that |
ax=Axes3D(fig);fig.add_axes(ax) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I want to create NURBS/Bezier Surfaces with geomdl. I installed the package via conda and started by trying to run the example given here : https://nurbs-python.readthedocs.io/en/5.x/visualization.html
This is the given code:
`from geomdl import BSpline
from geomdl.visualization import VisMPL
ctrlpts = [
[[-25.0, -25.0, -10.0], [-25.0, -15.0, -5.0], [-25.0, -5.0, 0.0], [-25.0, 5.0, 0.0], [-25.0, 15.0, -5.0], [-25.0, 25.0, -10.0]],
[[-15.0, -25.0, -8.0], [-15.0, -15.0, -4.0], [-15.0, -5.0, -4.0], [-15.0, 5.0, -4.0], [-15.0, 15.0, -4.0], [-15.0, 25.0, -8.0]],
[[-5.0, -25.0, -5.0], [-5.0, -15.0, -3.0], [-5.0, -5.0, -8.0], [-5.0, 5.0, -8.0], [-5.0, 15.0, -3.0], [-5.0, 25.0, -5.0]],
[[5.0, -25.0, -3.0], [5.0, -15.0, -2.0], [5.0, -5.0, -8.0], [5.0, 5.0, -8.0], [5.0, 15.0, -2.0], [5.0, 25.0, -3.0]],
[[15.0, -25.0, -8.0], [15.0, -15.0, -4.0], [15.0, -5.0, -4.0], [15.0, 5.0, -4.0], [15.0, 15.0, -4.0], [15.0, 25.0, -8.0]],
[[25.0, -25.0, -10.0], [25.0, -15.0, -5.0], [25.0, -5.0, 2.0], [25.0, 5.0, 2.0], [25.0, 15.0, -5.0], [25.0, 25.0, -10.0]]
]
surf = BSpline.Surface()
surf.degree_u = 3
surf.degree_v = 3
surf.ctrlpts2d = ctrlpts
surf.knotvector_u = [0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 3.0, 3.0, 3.0]
surf.knotvector_v = [0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 3.0, 3.0, 3.0]
surf.delta = 0.025
surf.evaluate()
from matplotlib import cm
surf.vis = VisMPL.VisSurface()
surf.render(colormap=cm.cool)`
The code runs with without an error.
Expected Behavior
![image](https://user-images.githubusercontent.com/130771879/232077471-38388e7d-5995-4f1d-8444-5cfbfaf5999e.png)
![image](https://user-images.githubusercontent.com/130771879/232077656-3a890ab6-06d5-4182-b469-3a0461e4a985.png)
It should look like this:
But it just looks like this:
The example in 2D work without a problem but as soon as i try to plot a Curve or Surface in 3D it shows an empty figure.
Configuration:
It would be really appreciate your help.
The text was updated successfully, but these errors were encountered: