juhakivekas / explision

A tool for making physical models of 3D files using lasrcutting.
5 stars 0 forks source link

Working as intented? #2

Open mankeli opened 5 years ago

mankeli commented 5 years ago

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 :grin: 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 commented 5 years ago

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 https://github.com/juhakivekas/explision/blob/11dd27ce5a6926a567f84f980373583e41c72a81/Shaper.py#L222

mankeli commented 5 years ago

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