julienr / meshcut Goto Github PK
View Code? Open in Web Editor NEWPython 3D mesh planar cross-section
License: MIT License
Python 3D mesh planar cross-section
License: MIT License
Is it possible for meshcut
to return the both halves as closed manifolds? Or would I have to adapt the code? If so, could you point me in the right direction of where to start?
Thanks in advance!
I'm using your library for a program I'm making. It works very well except that when I run the cross_section code, the returned arrays seem to build up points of a line. When I connect all these points some appear to because I'm not sure where to connect the start and in points of each array.
Here I have a teapot.stl and here is the result I got out by "connecting the dots" if you will.
So I have no idea where to connect the start and end points. Is there something I'm missing?
examples/ply.py
seems to only work with ASCII PLY files, not with binary PLY.
When i want to slice PLY i use examples.ply
, but for STL there's quite large number of dependencies. This means that meshcut will drag these dependecies to any project which will use it. Maybe we can write some minimalistic STL processor to do the same job.
We've run into this issue: vlachoudis/bCNC#1223
When slicing following mesh: fairy-of-the-forest20180624-11119-wpj9bg.zip
File "/usr/local/lib/python2.7/dist-packages/bCNC/plugins/slicemesh.py", line 96, in execute
verts, faces = self.loadMesh(file)
File "/usr/local/lib/python2.7/dist-packages/bCNC/plugins/slicemesh.py", line 149, in loadMesh
verts, faces = self.load_stl(file)
File "/usr/local/lib/python2.7/dist-packages/bCNC/plugins/slicemesh.py", line 289, in load_stl
verts, faces = self.merge_close_vertices(verts, faces)
File "/usr/local/lib/python2.7/dist-packages/bCNC/plugins/slicemesh.py", line 244, in merge_close_vertices
D = spdist.cdist(verts, verts)
File "/usr/local/lib/python2.7/dist-packages/scipy/spatial/distance.py", line 2710, in cdist
dm = np.empty((mA, mB), dtype=np.double)
MemoryError
Hi there,
I try to slice a vertical tube along the xy plane. the result is two circular polygones which are not connected. the outer one is considered as complete object and covers the inner one.
I tried to visualize my results with matplotlib:
this is the test object I created using openSCAD.
If polygones had normals, I could look them up to see what's inside and outside..
To my understanding, if a triangle is connected to the plane, it's normal must be projected onto the plane and should be normalized after..
I currently play around with your code to set the loaded stl.mesh's normals into your mesh object but since I'm completely new to numpy I have hard times recalculating the normals. I currently just ignore z because that's the normal to my plane
Here's the code I used to create that image..
I just pip installed meshcut
and tried to import the module.
Traceback (most recent call last):
File "/home/tom/portaal/env/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-99-cb3daef93112>", line 1, in <module>
import meshcut
File "/home/tom/portaal/env/lib/python3.6/site-packages/meshcut.py", line 228
print 'Degenerate case (probably non-closed mesh)'
^
SyntaxError: invalid syntax
Due to missing parentheses in print statement. Are there many more issues you could think of why meshcut will not run with Python3? Else I try to create a PR.
Hi! I want to use this to get list of lines representing intersection polygons at given STL/PLY layer height. So i can generate custom g-code based on that. How can i do it? I can't get mayavi working, but i don't even need that. I just need polylines.
Thanks in advance...
Hi!
Thanks for a great library.
In examples/1_stl_sphere_cut.py
, with the settings
example_fname = os.path.join('data', 'temp.stl')
plane_orig = (387.224, 232.544, 6.287)
plane_norm = (0, 1, 0)
I have attached the temp.stl
file, see below.
I get two lines from the slicing but I expect a single continuous line. One piece of the line is missing.
I had a look at the triangle where the missing line is and I can see nothing wrong with it. See this screenshot:
It seems I might have the same or similar problem as in this issue:
#7
This would simplify the github workflow file and make it possible to use tox when testing locally.
See for example the numpy-stl github workflow file.
I have ASCII PLY with holes:
But the holes are not present in slices:
The code i use is here: https://github.com/Harvie/bCNC/blob/master/plugins/slicemesh.py
The mesh is here:
chaos-cam.ply.zip
Any ideas what causes this?
Follow-up from vlachoudis/bCNC#901
In examples/1_stl_sphere_cut.py
, with the settings
plane_orig = (0, 0.75, 0)
plane_norm = (0, 1, 0)
this gives :
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.