Output: AxisError: axis 1 is out of bounds for array of dimension 1 You can observe this in the following example. Doing so will lead to numpy.AxisError exception with the message “numpy.AxisError: axis 1 is out of bounds for array of dimension 1”. You cannot concatenate 1-D numpy arrays using the concatenate() function vertically using the axis=1 parameter. Hence, all the elements of the input arrays are converted to elements of the output array. Here, we have concatenated two numpy arrays horizontally. You can concatenate 1-D numpy arrays using the concatenate() function by passing a tuple containing the numpy arrays as an input argument as shown below. For axis=None, all the input arrays are flattened and the output is a 1-D numpy array.Ĭoncatenate 1-D arrays using the concatenate() function in Python.the columns of the input array become the columns of the output array. For axis=1, the arrays are concatenated horizontally i.e.the rows of different arrays become the rows of the output array. For axis=0, the rows of the different arrays are concatenated vertically i.e.The axis along which the input arrays are concatenated is decided using the axis parameter.After execution, it returns the concatenated array. Plot.Here, the concatenate() function takes a tuple of numpy arrays as its first input argument. Plot = mp.plot(verts, faces, return_plot=True) Using this context manager to supress it.ĭef _exit_(self, exc_type, exc_val, exc_tb):ĭef show(radius, thickness, noise_scale, noise_strength, seed, bump_angle, bump_width, bump_height): # Meshplot left an annoying print statement in their code. The code using meshplot is like following: # I have used jupyter notebook to run the code. If it would have been worked I could have seen the effects of the change of various parameters. I can visualize using meshplot library but interactive change is not working. I could have implemented different libraries to get the desired shapes using union but I need the desired shape only by distorting some vertices from the torus. The shapes should have the same number of vertices and faces. Important Note: I need torus shapes with bumps at different angles (one bump per torus). It seems like the x_bump is not adding any effect. I tried using different width and height of the bump but it is not showing up. Pcd = o3d.io.read_triangle_mesh('torus_bump_500/torus_bump_1.ply') Igl.write_triangle_mesh(f"torus_bump_500/torus_bump_.ply", verts, faces)įor visualizing I use the following code: pcd.compute_vertex_normals() X_warp = rearrange(x_warp, 'v h w d -> h w d v') X_dist = np.linalg.norm((x - gaussian_center), axis=0) X_warp = gradient_noise(x, noise_scale, noise_strength, seed) Verts, faces, normals, values = measure.marching_cubes(sdf, level=0) X = np.stack(np.meshgrid(coords, coords, coords)) Vector_noise = np.stack(np.gradient(scalar_noise))įor idx, bump_angle in tqdm(enumerate(np.linspace(-1, 1, 2))): Scalar_noise = center_crop(scalar_noise, shape=x.shape) Scalar_noise = zoom(scalar_noise, zoom=scale) Slices = tuple()ĭef gradient_noise(x, scale, strength, seed=None): # Crop an n-dimensional image with a centered cropping region Return np.linalg.norm(q, axis=0) - thickness Expected outcome and what I got is like the following figure.įrom sklearn.preprocessing import MinMaxScaler I can see the torus but not the bump when visualize using open3d. The code is supposed to create bump at different angle on torus 3d shape.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |