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

Working as intented? #2

Open
mankeli opened this issue Jun 13, 2019 · 2 comments
Open

Working as intented? #2

mankeli opened this issue Jun 13, 2019 · 2 comments

Comments

@mankeli
Copy link

mankeli commented Jun 13, 2019

Hi,
First off, I had to make some modifications to get it to run:

index dd16569..04c6a49 100644
--- a/explision.py
+++ b/explision.py
@@ -14,8 +14,8 @@ from Shaper import Shaper
 def parse_mesh( inputfile ):
        '''this uses OpenMesh to do the complex 3D measurements and operations of explision'''
        #read the mesh form the input file
-       mesh = TriMesh()
-       if not read_mesh( mesh, inputfile ):
+       mesh = read_trimesh( inputfile )
+       if not mesh:
                raise ValueError( "Could not read mesh from " + inputfile )
        #create shapes out of mesh faces
        shapes = []
@@ -53,5 +53,5 @@ if __name__ == "__main__":
        shaper = Shaper(config)
        inputfile = sys.argv[2] 
        shapes = parse_mesh( inputfile )
-       open('shapes.svg',     'w').write(shaper.render_shapes(shapes))
-       open('connectors.svg', 'w').write(shaper.render_connectors(shapes))
+       open('shapes.svg',     'wb').write(shaper.render_shapes(shapes))
+       open('connectors.svg', 'wb').write(shaper.render_connectors(shapes))
diff --git a/openmesh.so b/openmesh.so
deleted file mode 100644
index 21cc0d2..0000000
Binary files a/openmesh.so and /dev/null differ

The included openmesh.so binary 😁 complained about ImportError: libOpenMeshTools.so.6.3: cannot open shared object file: No such file or directory, with these modifications openmesh installed from pip3 should do.

Also btw, there' "python2" interpreter specified in explisition.py, but readme tells to run program with python3? :)

Anyway, example.ply then generates plausible output, but triangles in shapes.svg seem to overlap with each other, like
image - is this how it should work?

Can you tell me about your configuration?

@juhakivekas
Copy link
Owner

juhakivekas commented Jun 14, 2019

Hey yeah it's intended to be run on Python3, even though I might have had to downgrade it for the openmesh bindings to work. I think there wasn't a pip package back when i wrote this so if it works properly with the one from pip then go with that. There may have been an OS problem with this though. If you have a version working with pip and Python3 (on Linux), then please add edits, remove the binary and make a PR, I'll gladly get rid of stuff 👍

What comes to the triangle placement, no, that's not what it's supposed to look like 😢 There was once a nice way of putting triangles in rows, but I always ended up moving them around so much that finally i just put them mext to eachother like this. maybe putting them side-by-side in one lon grow would be a better option with minimal effort. I'd make a fancy packer if I wanted to write a masters thesis 😃

Edit: oh look theres a comment about the placement

y = i * 50 #TODO make smarter or configurable

@mankeli
Copy link
Author

mankeli commented Jun 15, 2019

yeah, packing those triangles well would be quite a feat in itself :-)

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