Cut Object out of cube doesn't work

classic Classic list List threaded Threaded
8 messages Options
epe
Reply | Threaded
Open this post in threaded view
|

Cut Object out of cube doesn't work

epe
This post was updated on .
Hey,

I'm trying to cut an imported stl model out of a cube but it always throws
an error (WARNING: Object may not be a valid 2-manifold and may need
repair!).

I already tried to fix it with Netfabb. But in that case it throws a
different error (ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR:
assertion violation! Expr: e->incident_sface() != SFace_const_handle() File:
/opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_S2/SM_const_decorator.h
Line: 326).

I tried my code with an example model and it worked without any problems. So
there must be a problem with my imported model. Maybe somebody has an idea
what i could try to get this work.
When I just import my model, render it and export it as .stl there is no error.

My code:
model_filename = "mri_vessel_extract_fixed.stl";
model_rotate = [0,0,0];
model_translate = [0,0,0];
model_scale = 1;

difference(){
    translate([103.5,-133,16.9]){
    cube(size=[30,11.5,10]);
    }
    scale(model_scale)
        translate(v = model_translate)
            rotate(model_rotate)
                import(model_filename);
}

I uploaded the two models in my dropbox so you can try it yourself. Maybe I
just did anything else wrong.
https://www.dropbox.com/sh/dhjhagjhd9s19g7/AABqT30nO4eJC-qfjAQiSi8oa?dl=0
<https://www.dropbox.com/sh/dhjhagjhd9s19g7/AABqT30nO4eJC-qfjAQiSi8oa?dl=0

Thank you in advance



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Cut Object out of cube doesn't work

MichaelAtOz
Administrator
epe wrote
> I'm trying to cut an imported stl model out of a cube but it always throws
> an error (WARNING: Object may not be a valid 2-manifold and may need
> repair!).

Meshlab shows it has a problem (the ...fixed.stl)
<http://forum.openscad.org/file/t359/td22541.jpg>
The top bit is not manifold.
The lower red circle shows what looks like a infinitely thin face, that's
likely a problem, there are similar ones in the middle area at the base of
the T too.

Fixing that is sometimes not easy. I'll have a look a bit later...



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Cut Object out of cube doesn't work

MichaelAtOz
Administrator
In reply to this post by epe
Close up of that area in Netfabb
<http://forum.openscad.org/file/t359/td22541_B.jpg>



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Cut Object out of cube doesn't work

MichaelAtOz
Administrator
<http://forum.openscad.org/file/t359/td22541_C.jpg>
There you go, hollowed out cube.
Here's the file, if you're happy with the pointy end bits cut off...
mri_vessel_extract_fixed_Md.stl
<http://forum.openscad.org/file/t359/mri_vessel_extract_fixed_Md.stl>  



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Cut Object out of cube doesn't work

MichaelAtOz
Administrator
In reply to this post by MichaelAtOz
BTW what vessel?



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
epe
Reply | Threaded
Open this post in threaded view
|

Re: Cut Object out of cube doesn't work

epe
This post was updated on .
Thanks a lot. It works perfectly.
Can you tell me what you exactly did so I can understand it better and do it
myself in the future?
I was able to fille the model, but I can't get rid of the little thin faces.

MichaelAtOz wrote
> BTW what vessel?

The model is a small part of a brain vessel extracted from a MRI.




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Cut Object out of cube doesn't work

codifies
In reply to this post by MichaelAtOz
jeeze and all this time I just thought STL's would never work for this
because they are just a soup of triangles and not a "mathematical" volume

I shall have to find some "tidy" STL's to play with!!!


On 24/11/17 03:24, MichaelAtOz wrote:

> <http://forum.openscad.org/file/t359/td22541_C.jpg>
> There you go, hollowed out cube.
> Here's the file, if you're happy with the pointy end bits cut off...
> mri_vessel_extract_fixed_Md.stl
> <http://forum.openscad.org/file/t359/mri_vessel_extract_fixed_Md.stl>
>
>
>
> -----
> Admin - PM me if you need anything, or if I've done something stupid...
>
> Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Cut Object out of cube doesn't work

MichaelAtOz
Administrator
In reply to this post by epe
epe wrote
> Can you tell me what you exactly did so I can understand it better and do
> it
> myself in the future?
> I was able to fille the model, but I can't get rid of the little thin
> faces.

Firstly some experience of what looks wrong helps.

But start with Meshlab, Render/Show Non Manif Edges & Show Non Manif
Vertices.
If any are non-zero, Filters/Selection/Select non Manifold (Edges &/or
Vertices).
Also try Filter/Select/Select Self Interseting Faces.
Then go looking for the coloured bits.
Then, this is where it is an art, start looking at the vertices/edges around
there.
Set Render/Show Non Faux Edges.
Rotate/Translate/Zoom examine the area.
You may see a hole, or something doesn't render right.
In this case it was a face that jutted out seemingly without volume.
(You could try the following in Meshlab, but I switch to Netfabb)
In Netfabb Click the repair icon (Red Cross).
Rotate/Translate/Zoom examine the area. Wrong things are easier to spot than
in Meshlab.
Then start selecting vertices and deleting them trying to make a neat hole,
you will see
edges/vertices that also look wrong, delete them. Work on one area at a
time.
If it's on a protruding bit, look at the opposite side, probably trim that
too.
Zoom in real close, things like this are wrong, blow them away too...
<http://forum.openscad.org/file/t359/Problem_site_in_Netfabb.jpg>
Then Right-click the hole, try Close Trivial Holes. Try Close All Holes.
If that doesn't work reshape the hole a bit. Try again.
Click the Update button, make sure there are zero holes.
Rotate/Translate/Zoom examine the area. Make sure it looks 'right'

Then Click Apply Repair.
Click Part/Export Part, export the STL.

Test it.

Note that there have been many STLs which I couldn't fix.





-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!