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
The corresponding 3d shading of sphere1 in the Figure of ExampleSphere looks inconsistent. This is because of confused ranges u_range and v_range in the initialization of sphere1.
Expected behavior
Shading of sphere1 should look smoothly, e.g. as for sphere2 in the Figure of ExampleSphere.
How to reproduce the issue
This is just a copy-pasted snippet of code from docs with my comments for u_range and v_range.
Code for reproducing the problem
frommanimimport*classExampleSphere(ThreeDScene):
defconstruct(self):
self.set_camera_orientation(phi=PI/6, theta=PI/6)
sphere1=Sphere(
center=(3, 0, 0),
radius=1,
resolution=(20, 20),
### u_range and v_range looks confused#u_range=[0.001, PI-0.001], # should be [0.001, TAU - 0.001], or better [0, TAU]v_range=[0, TAU] # should be [0, PI]
) # bad shadingsphere1.set_color(RED)
self.add(sphere1)
sphere2=Sphere(center=(-1, -3, 0), radius=2, resolution=(18, 18)) # expected shadingsphere2.set_color(GREEN)
self.add(sphere2)
sphere3=Sphere(center=(-1, 2, 0), radius=2, resolution=(16, 16)) # expected shadingsphere3.set_color(BLUE)
self.add(sphere3)
Additional comments
I spent plenty of time guessing what's wrong with that shading. Finally, I tried the default initialization sph = Sphere() which did not show the above behavior. Therefore, I believe this example is a misleading one, isn't it?
The text was updated successfully, but these errors were encountered:
Description of bug / unexpected behavior
The corresponding 3d shading of
sphere1
in the Figure of ExampleSphere looks inconsistent. This is because of confused rangesu_range
andv_range
in the initialization ofsphere1
.Expected behavior
Shading of
sphere1
should look smoothly, e.g. as forsphere2
in the Figure of ExampleSphere.How to reproduce the issue
This is just a copy-pasted snippet of code from docs with my comments for
u_range
andv_range
.Code for reproducing the problem
Additional comments
I spent plenty of time guessing what's wrong with that shading. Finally, I tried the default initialization
sph = Sphere()
which did not show the above behavior. Therefore, I believe this example is a misleading one, isn't it?The text was updated successfully, but these errors were encountered: