Closed encorechow closed 6 years ago
I cannot run your code:
AttributeError: module 'pymesh' has no attribute 'load_mesh'
This is with pymesh 1.0.2.
@nschloe you can follow the instruction on https://pymesh.readthedocs.io/en/latest/ to install pymesh. Thank you for the quick reply
I did install it of course. Your code still doesn't work. Perhaps you're using an outdated version?
On Thu, Sep 20, 2018, 11:20 AM Zheng Zhou notifications@github.com wrote:
@nschloe https://github.com/nschloe you can follow the instruction on https://pymesh.readthedocs.io/en/latest/ to install pymesh. Thank you for the quick reply
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nschloe/optimesh/issues/27#issuecomment-423108256, or mute the thread https://github.com/notifications/unsubscribe-auth/AALFfPJuD2RXfreCmqHbQZtF2ARCQtQ8ks5uc13agaJpZM4WxraF .
@nschloe I guess you installed pymesh by pip install pymesh
right? It actually not what I was using, the website I provided above is the one that I used. They are difference.
But this is not the problem. I just use pymesh to load obj as numpy array. I think you can use any other apis to load obj file as numpy array. The point is the smooth function didn't work when I pass the vertices and faces from my obj file. I am not sure if it is the problem of my mesh or the code. I will be very appreciated if you can help me figure it out. Thanks!
if you use pip install pymesh
, I think you should be able to load obj by following code:
from pymesh import obj
m = obj.Obj("sample.obj")
I guess you installed pymesh by pip install pymesh right?
Correct.
This
from pymesh import obj
m = obj.Obj("sample.obj")
gives
Traceback (most recent call last):
File "/home/nschloe/.local/lib/python3.6/site-packages/pymesh/obj.py", line 52, in __read
elif line.lstrip().startswith("vn"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "a.py", line 8, in <module>
mesh = obj.Obj("stitching.obj")
File "/home/nschloe/.local/lib/python3.6/site-packages/pymesh/obj.py", line 30, in __init__
data = Obj.__load(fh)
File "/home/nschloe/.local/lib/python3.6/site-packages/pymesh/obj.py", line 39, in __load
return numpy.fromiter(Obj.__read(fh), dtype=Obj.obj_dtype)
File "/home/nschloe/.local/lib/python3.6/site-packages/pymesh/obj.py", line 73, in __read
raise RuntimeError("Failed to load OBJ file.")
RuntimeError: Failed to load OBJ file.
Feel free to reopen once you have a reproducible example.
Hi, I was using optimesh odt to do the smoothness and got a bug during call the function
optimesh.odt.fixed_point_uniform
:I checked the mesh and find there is definitely no duplicate faces. here is the mesh I used for input
stitching.zip
Does anyone have idea how this happened? btw, I used pymesh to load .obj file as numpy array. Thanks!