Comments (14)
I would need to investigate this, I'm not sure what's wrong. I am currently quite busy, but I'll try to have a look when I have some time.
from meshcut.
Well. Maybe there's some problem in how i interpret the resulting contour, but it seems to me that sometimes there's one piece missing. Even in your screenshot:
We can close that slice path by returning back to the first coordinates, but not every slice should be closed as some models might not be manifold / solid and in such case the resulting slice should be open path. For example if you slice STL model of plane (eg. single triangle) you should get line (open path), but if you slice sphere, you should get circle (closed path). So i thin we should not always close the path, but rather figure out, why is the last line missing from slice.
from meshcut.
I've just tried latest meshcut.py from your git and there are still some artifacts :-/
from meshcut.
Any ideas what might cause this? It almost looks like one of the coordinates is ignored...
the line goes flat instead of being at angle.
from meshcut.
Trying to reproduce this: is this still with the hemisphere.stl
model ? The plane y=14.5
doesn't intersect the sphere, so I guess there is some scaling going on. I guess you are using another model. Could you share it ?
from meshcut.
I am using this model:
https://github.com/vlachoudis/bCNC/files/2358797/sphere.stl.zip
But i've got very similar problems with sphere.stl from your repository. see following:
vlachoudis/bCNC#901 (comment)
from meshcut.
@julienr note it is Y -14.5 not Y 14.5
update: it probably does not matter, because model is symmetric in this axis...
but there are such problems in lots of slices... 14.5 is just example.
from meshcut.
I've tried increasing close_epsilon
and dist_tol
magic numbers and it does not seem to help.
from meshcut.
I am not able to reproduce this on the 1_stl_sphere_cut.py
example of meshcut. Here is an example with the sphere.stl.zip
that you gave above and
plane_orig = (0, -14.5, 0)
plane_norm = (0, 1, 0)
I tried to play a bit with various parameters, but couldn't find some that would reproduce the bug. Are you sure this is not a display problem in bCNC ?
from meshcut.
Update: i had problem in bCNC. I had typo in code which automaticaly closes the contour. Now i fixed it:
I am quite happy with how it turned out.
from meshcut.
Only issue is the non-manifold case. It's not really critical, as most meshes are manifold, however it would make meshcut more consistent if fixed.
I think that meshcut should close the path itself if needed. Now i close it by returning to original coordinates, but this might not be desirable for non-watertight meshes. See the last line of this code:
first = contour[0]
block.append("g0 x%f y%f z%f"%(first[0],first[1],first[2]))
for segment in contour:
block.append("g1 x%f y%f z%f"%(segment[0],segment[1],segment[2]))
block.append("g1 x%f y%f z%f"%(first[0],first[1],first[2])) #HERE I CLOSE THE PATH
if i don't include the last line, i get bad slice for manifold mesh. if i include it, i get bad slice for non-manifold mesh.
from meshcut.
any news regarding this issue? 🤔
from meshcut.
@unre4l Are you running into this with a non-manifold mesh ? Do you have a repro mesh ?
I've been quite busy, but I think fixing this would involve keeping track of the starting triangle and the ending triangle and if those are the same triangle, then it means the mesh is manifold and we can close the path. If the two triangles are different, then the mesh is non-manifold and the path shouldn't be closed. If you want to work on it, PR welcome. Otherwise, I can have a look, but I don't promise anything :)
from meshcut.
Duplicate of #20, closed by #21
from meshcut.
Related Issues (15)
- cross section HOT 6
- Make meshcut compatible with Python 3 HOT 4
- Returning both halves of the mesh HOT 1
- numpy MemoryError
- cutting orthogonal to tubes ends up with two non connected polygons HOT 2
- ? HOT 1
- Wall thickness evaluation HOT 1
- How to get slice as polygon HOT 4
- Missing line segment after slicing non-manifold mesh HOT 2
- Use tox for multi-python tests
- Release 0.3.0 HOT 1
- Holes not sliced properly? HOT 1
- Decrease number of dependencies needed to parse STL files HOT 2
- Can't slice binary PLY files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshcut.