meshpro / optimesh

:spider_web: Mesh optimization, mesh smoothing.
578 stars 56 forks source link

assignment destination is read-only #51

Closed AlbertoMQ closed 4 years ago

AlbertoMQ commented 4 years ago

Why am I getting error? Using Optimesh 0.6.3

 File "/home/alberto/anaconda3/envs/tf_gpu_3/lib/python3.6/site-packages/meshplex/mesh_tri.py", line 1106, in flip_interior_edges
    self.cells["nodes"][adj_cells[0]] = verts[[0, 1, 2]].T
ValueError: assignment destination is read-only
mesh = pymesh.load_mesh(myfile)
xyz = np.asarray(mesh.vertices)
faces = np.asarray(mesh.faces)
mymesh, cells = optimesh.odt.fixed_point_uniform(xyz, faces, 1.0e-2, 100)
nschloe commented 4 years ago

Can't say without an MWE. https://stackoverflow.com/help/minimal-reproducible-example

You will need to complete your code so I can just copy and paste it to my machine to see the error.

AlbertoMQ commented 4 years ago

Sorry this is actually an issue with xyz = np.asarray(mesh.vertices) needs to be xyz = np.copy(np.asarray(mesh.vertices))