Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on apple example #5

Open
alecjacobson opened this issue Feb 23, 2020 · 8 comments
Open

Error on apple example #5

alecjacobson opened this issue Feb 23, 2020 · 8 comments

Comments

@alecjacobson
Copy link

I tried to run:

python ../ConvexHull_Simplification/SILD_convexhull_simplification.py apple

but I got this output

original vertices number: 85
Traceback (most recent call last):
  File "../ConvexHull_Simplification/SILD_convexhull_simplification.py", line 344, in <module>
    mesh=remove_one_edge_by_finding_smallest_adding_volume_with_test_conditions(mesh,option=2)
  File "../ConvexHull_Simplification/SILD_convexhull_simplification.py", line 151, in remove_one_edge_by_finding_smallest_adding_volume_with_test_conditions
    mesh.get_halfedges()
  File "/Users/ajx/Dropbox/Decompose-Single-Image-Into-Layers/ConvexHull_Simplification/trimesh.py", line 442, in get_halfedges
    if self.__halfedges is None: self.update_halfedges()
  File "/Users/ajx/Dropbox/Decompose-Single-Image-Into-Layers/ConvexHull_Simplification/trimesh.py", line 333, in update_halfedges
    he0index = len( self.__halfedges )
AttributeError: 'TriMesh' object has no attribute '_TriMesh__halfedges'
@yig
Copy link
Collaborator

yig commented Feb 24, 2020

What platform are you running on? What if you cd ../ConvexHull_Simplification and then

python SILD_convexhull_simplification.py ../examples/apple

@alecjacobson
Copy link
Author

alecjacobson commented Feb 24, 2020 via email

@yig
Copy link
Collaborator

yig commented Feb 26, 2020

This is a very mysterious error. The same error arose for someone else on Ubuntu: #3 .

I was able to reproduce it with conda python (but not brew python). All the instance variables of the TriMesh object are being replaced with the instance variables of a different class (HalfEdge). I spent some time trying to debug it, but didn't succeed. It's as if something is trashing memory.

@alecjacobson
Copy link
Author

alecjacobson commented Feb 26, 2020 via email

@yig
Copy link
Collaborator

yig commented Feb 26, 2020

Success. It looks like the GLPK solver was trashing memory. In SILD_convexhull_simplification.py, change line 204 from:

res = cvxopt.solvers.lp( cvxopt.matrix(c), cvxopt.matrix(A), cvxopt.matrix(b) ), solver='glpk' )

to

res = cvxopt.solvers.lp( cvxopt.matrix(c), cvxopt.matrix(A), cvxopt.matrix(b) ) )

@yig yig mentioned this issue Feb 26, 2020
@yig
Copy link
Collaborator

yig commented Feb 26, 2020

I updated it to work on Python 2 or 3

@yig
Copy link
Collaborator

yig commented Feb 26, 2020

The line number for disabling the GLPK solver has moved to 205.

@alecjacobson
Copy link
Author

alecjacobson commented Feb 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants