Is there a function to scale a mesh along y-axis
only (left) after its creation?
I tried the open3d.geometry.Geometry3D.scale
function, but it scales along the 3-axis
(right).
import open3d as o3d
cylinder = o3d.geometry.create_mesh_cylinder(radius=1, height=3)
cylinder_scaled.scale(2) # I got the cylinder on the left.
Thanks in advance!
Convert mesh vertices to numpy array first. Convert back after scaling.
cylinder.vertices = o3d.utility.Vector3dVector(
np.asarray(cylinder.vertices) * np.array([1., 1., 2.]) )