Hello, do the coordinates of the points added to the grid have to be in a certain order? My point coordinates are sorted by row, which gives the following result. Is there any way to improve it?Thank you.
mod = Sketchup.active_model # Open model
ent = mod.entities # All entities in model
sel = mod.selection # Current selection
mesh = Geom::PolygonMesh.new
array=[[0.0, 0.0, 0.0], [39.37007874015748, 0.0, 0.0], [78.74015748031496, 0.0, 0.0], [118.11023622047244, 0.0, 0.0], [157.48031496062993, 0.0, 0.0], [196.8503937007874, 0.0, 0.0], [236.2204724409449, 0.0, 0.0], [275.59055118110234, 0.0, 0.0], [314.96062992125985, 0.0, 0.0], [354.33070866141736, 0.0, 0.0], [0.0, 39.37007874015748, 0.0], [39.37007874015748, 39.37007874015748, 0.0], [78.74015748031496, 39.37007874015748, 0.0], [118.11023622047244, 39.37007874015748, 0.0], [157.48031496062993, 39.37007874015748, 0.0], [196.8503937007874, 39.37007874015748, 0.0], [236.2204724409449, 39.37007874015748, 0.0], [275.59055118110234, 39.37007874015748, 0.0], [314.96062992125985, 39.37007874015748, 0.0], [354.33070866141736, 39.37007874015748, 0.0], [118.11023622047244, 78.74015748031496, 0.0], [157.48031496062993, 78.74015748031496, 0.0], [196.8503937007874, 78.74015748031496, 0.0], [236.2204724409449, 78.74015748031496, 0.0], [275.59055118110234, 78.74015748031496, 0.0], [314.96062992125985, 78.74015748031496, 0.0]]
polygon_index = mesh.add_polygon(array)
Sketchup.active_model.entities.add_faces_from_mesh(mesh)