Giter Site home page Giter Site logo

Bad slicing for some planes about meshcut HOT 14 CLOSED

julienr avatar julienr commented on August 15, 2024 2
Bad slicing for some planes

from meshcut.

Comments (14)

julienr avatar julienr commented on August 15, 2024 1

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.

Harvie avatar Harvie commented on August 15, 2024 1

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:

image

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.

Harvie avatar Harvie commented on August 15, 2024

I've just tried latest meshcut.py from your git and there are still some artifacts :-/

image

from meshcut.

Harvie avatar Harvie commented on August 15, 2024

Any ideas what might cause this? It almost looks like one of the coordinates is ignored...

image

the line goes flat instead of being at angle.

from meshcut.

julienr avatar julienr commented on August 15, 2024

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.

Harvie avatar Harvie commented on August 15, 2024

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.

Harvie avatar Harvie commented on August 15, 2024

@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.

Harvie avatar Harvie commented on August 15, 2024

I've tried increasing close_epsilon and dist_tol magic numbers and it does not seem to help.

from meshcut.

julienr avatar julienr commented on August 15, 2024

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)

screen shot 2018-10-24 at 21 57 38

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.

Harvie avatar Harvie commented on August 15, 2024

Update: i had problem in bCNC. I had typo in code which automaticaly closes the contour. Now i fixed it:

image

I am quite happy with how it turned out.

from meshcut.

Harvie avatar Harvie commented on August 15, 2024

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.

unre4l avatar unre4l commented on August 15, 2024

any news regarding this issue? 🤔

from meshcut.

julienr avatar julienr commented on August 15, 2024

@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.

julienr avatar julienr commented on August 15, 2024

Duplicate of #20, closed by #21

from meshcut.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.