@@ -114,7 +114,7 @@ def cone(
114114def sphere (
115115 radius = 0.5 ,
116116 center = (0.0 , 0.0 , 0.0 ),
117- direction = (0 .0 , 0.0 , 1 .0 ),
117+ direction = (1 .0 , 0.0 , 0 .0 ),
118118 theta_resolution = 30 ,
119119 phi_resolution = 30 ,
120120 start_theta = 0.0 ,
@@ -124,7 +124,7 @@ def sphere(
124124 color = "#555" ,
125125 opacity = 0.5 ,
126126) -> go .Mesh3d :
127- anchor_x , anchor_y , anchor_z = center
127+ anchor_x , anchor_y , anchor_z = ( 0. , 0. , 0. )
128128 phi = np .linspace (start_phi , 2 * np .radians (end_phi ), phi_resolution + 1 )
129129 theta = np .linspace (start_theta , np .radians (end_theta ), theta_resolution + 1 )
130130
@@ -134,9 +134,9 @@ def sphere(
134134 z_array = np .ravel (anchor_z + np .cos (phi ) * radius_zy )
135135 y_array = np .ravel (anchor_y + np .sin (phi ) * radius_zy )
136136 x_array = np .ravel (anchor_x + radius * np .cos (theta ))
137-
138137 x_array , y_array , z_array = apply_transformations (x_array , y_array , z_array , center , direction )
139-
138+ # print(center, direction)
139+ # print(y_array)
140140 return go .Mesh3d (
141141 x = x_array , y = y_array , z = z_array , alphahull = 0 , color = color , opacity = opacity
142142 )
@@ -326,6 +326,7 @@ def transform_points(
326326 collection (which is originally oriented toward (1, 0, 0)).
327327 """
328328 transform_matrix = reorient (direction = new_direction )
329+ # print(transform_matrix)
329330 oriented_point_matrix = transform_matrix @ point_matrix
330331 oriented_point_matrix_3 = oriented_point_matrix [0 :3 ]
331332 if not np .allclose (new_center , [0.0 , 0.0 , 0.0 ]):
0 commit comments