discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Removing all surfaces in the X-Y Plane

H
hsafti
Thu, Jan 9, 2020 11:37 PM

Hi Alex and all,

Thanks again for your helpful tips. Python saves the day once more. Using
the numpy-stl library, one can do this short code:

import numpy
from stl import mesh

mesh3D = mesh.Mesh.from_file('mesh3D.stl')

indecies=[]
for i in range(len(mesh3D.normals)):
if mesh3D.normals[i][2] ==0:
indecies.append(i)

verticeCount = len(indecies)
data = numpy.zeros(verticeCount, dtype=mesh.Mesh.dtype)

mesh2D = mesh.Mesh(data, remove_empty_areas=False)

for k in range(verticeCount):
mesh2D.v0[k] = mesh3D.v0[indecies[k]]
mesh2D.v1[k] = mesh3D.v1[indecies[k]]
mesh2D.v2[k] = mesh3D.v2[indecies[k]]

mesh2D.save('mesh2D.stl')

Thanks again and until next time ;-)

http://forum.openscad.org/file/t2716/result.png

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

Hi Alex and all, Thanks again for your helpful tips. Python saves the day once more. Using the numpy-stl library, one can do this short code: import numpy from stl import mesh mesh3D = mesh.Mesh.from_file('mesh3D.stl') indecies=[] for i in range(len(mesh3D.normals)): if mesh3D.normals[i][2] ==0: indecies.append(i) verticeCount = len(indecies) data = numpy.zeros(verticeCount, dtype=mesh.Mesh.dtype) mesh2D = mesh.Mesh(data, remove_empty_areas=False) for k in range(verticeCount): mesh2D.v0[k] = mesh3D.v0[indecies[k]] mesh2D.v1[k] = mesh3D.v1[indecies[k]] mesh2D.v2[k] = mesh3D.v2[indecies[k]] mesh2D.save('mesh2D.stl') Thanks again and until next time ;-) <http://forum.openscad.org/file/t2716/result.png> -- Sent from: http://forum.openscad.org/
HJ
Hugo Jackson
Wed, Jan 15, 2020 10:05 PM

Far more times than I care to admit, I’ve mistakenly click on the render button right after a render is finished. I do that just out of unsupervised muscle memory or something… I don’t know… but I suspect I’m not the only one who does this. Often this is no big deal, but when the render itself took 15 or more minutes to complete its frustrating to have to sit through the whole process again. I MEANT to save too STL… but oh no… have to wait for it to render again and hope I don’t make the same mistake again.

We already have a somewhat related warning… when you click to save an STL file OpenSCAD will warn you if you’ve made any changes to the source file to alert you to the possibility that you may not be saving the file that you think you are.

So while I’m sitting here waiting for that 2nd unnecessary render to finish I thought I’d pop this off to the list as I’m thinking that with a preferences adjustable value, openSCAD could come up with a dialog that read something like “Are you sure you want to render? The last render of this object took 48 minutes”.

Is this doable? Worthwhile? Easy or hard?

Far more times than I care to admit, I’ve mistakenly click on the render button right after a render is finished. I do that just out of unsupervised muscle memory or something… I don’t know… but I suspect I’m not the only one who does this. Often this is no big deal, but when the render itself took 15 or more minutes to complete its frustrating to have to sit through the whole process again. I MEANT to save too STL… but oh no… have to wait for it to render again and hope I don’t make the same mistake again. We already have a somewhat related warning… when you click to save an STL file OpenSCAD will warn you if you’ve made any changes to the source file to alert you to the possibility that you may not be saving the file that you think you are. So while I’m sitting here waiting for that 2nd unnecessary render to finish I thought I’d pop this off to the list as I’m thinking that with a preferences adjustable value, openSCAD could come up with a dialog that read something like “Are you sure you want to render? The last render of this object took 48 minutes”. Is this doable? Worthwhile? Easy or hard?
DM
Doug Moen
Wed, Jan 15, 2020 11:41 PM

I'd like to be able to cancel a render.

On Wed, Jan 15, 2020, at 5:05 PM, Hugo Jackson wrote:

Far more times than I care to admit, I’ve mistakenly click on the
render button right after a render is finished. I do that just out of
unsupervised muscle memory or something… I don’t know… but I suspect
I’m not the only one who does this. Often this is no big deal, but when
the render itself took 15 or more minutes to complete its frustrating
to have to sit through the whole process again. I MEANT to save too
STL… but oh no… have to wait for it to render again and hope I don’t
make the same mistake again.

We already have a somewhat related warning… when you click to save an
STL file OpenSCAD will warn you if you’ve made any changes to the
source file to alert you to the possibility that you may not be saving
the file that you think you are.

So while I’m sitting here waiting for that 2nd unnecessary render to
finish I thought I’d pop this off to the list as I’m thinking that with
a preferences adjustable value, openSCAD could come up with a dialog
that read something like “Are you sure you want to render? The last
render of this object took 48 minutes”.

Is this doable? Worthwhile? Easy or hard?


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I'd like to be able to cancel a render. On Wed, Jan 15, 2020, at 5:05 PM, Hugo Jackson wrote: > Far more times than I care to admit, I’ve mistakenly click on the > render button right after a render is finished. I do that just out of > unsupervised muscle memory or something… I don’t know… but I suspect > I’m not the only one who does this. Often this is no big deal, but when > the render itself took 15 or more minutes to complete its frustrating > to have to sit through the whole process again. I MEANT to save too > STL… but oh no… have to wait for it to render again and hope I don’t > make the same mistake again. > > We already have a somewhat related warning… when you click to save an > STL file OpenSCAD will warn you if you’ve made any changes to the > source file to alert you to the possibility that you may not be saving > the file that you think you are. > > So while I’m sitting here waiting for that 2nd unnecessary render to > finish I thought I’d pop this off to the list as I’m thinking that with > a preferences adjustable value, openSCAD could come up with a dialog > that read something like “Are you sure you want to render? The last > render of this object took 48 minutes”. > > Is this doable? Worthwhile? Easy or hard? > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
M
MichaelAtOz
Thu, Jan 16, 2020 12:05 AM

a. I moved this to a separate topic.

b.

doug.moen wrote

I'd like to be able to cancel a render.

You can click the close button to the right of the progress meter, but if it
has reached the final global union that is a single call to CGAL so won't
cancel until it returns.

Re re-render warning, due to cache, re-renders should be almost instant.
What are you doing that makes it time consuming?


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

  • click on my MichaelAtOz label, there is a link to email me.

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.

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

a. I moved this to a separate topic. b. doug.moen wrote > I'd like to be able to cancel a render. You can click the close button to the right of the progress meter, but if it has reached the final global union that is a single call to CGAL so won't cancel until it returns. Re re-render warning, due to cache, re-renders should be almost instant. What are you doing that makes it time consuming? ----- Admin - email* me if you need anything, or if I've done something stupid... * click on my MichaelAtOz label, there is a link to email me. 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. -- Sent from: http://forum.openscad.org/
HJ
Hugo Jackson
Thu, Jan 16, 2020 7:06 AM

On Jan 15, 2020, at 4:05 PM, MichaelAtOz oz.at.michael@gmail.com wrote:

Re re-render warning, due to cache, re-renders should be almost instant.
What are you doing that makes it time consuming?

I don’t know what I’m doing, but the particular design I’m working on employs a half a dozen toruses and those torus’s are hulled. I’ve replaced most of the primitive modules (like circle, cube etc.) with routines that create point lists that are then made into polygons and linear extruded. For most of my projects I don’t notice a performance hit for either preview or render but perhaps I’m missing something. I’m thinking that perhaps I’m doing something that doesn’t cache so when I render it has to start over?
I’d be happy to show my code, but I don’t know how useful it would be given that its highly modified from ‘pure’ openSCAD. Given that… any suggestions you might have for what to look for?

> On Jan 15, 2020, at 4:05 PM, MichaelAtOz <oz.at.michael@gmail.com> wrote: > > > Re re-render warning, due to cache, re-renders should be almost instant. > What are you doing that makes it time consuming? > I don’t know what I’m doing, but the particular design I’m working on employs a half a dozen toruses and those torus’s are hulled. I’ve replaced most of the primitive modules (like circle, cube etc.) with routines that create point lists that are then made into polygons and linear extruded. For most of my projects I don’t notice a performance hit for either preview or render but perhaps I’m missing something. I’m thinking that perhaps I’m doing something that doesn’t cache so when I render it has to start over? I’d be happy to show my code, but I don’t know how useful it would be given that its highly modified from ‘pure’ openSCAD. Given that… any suggestions you might have for what to look for?
M
MichaelAtOz
Thu, Jan 16, 2020 11:00 PM

What are your Edit/Preferences/Advance/CGAL cache sizes?
That will affect re-render performance if to small.
I have both at 2048MB.


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

  • click on my MichaelAtOz label, there is a link to email me.

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.

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

What are your Edit/Preferences/Advance/CGAL cache sizes? That will affect re-render performance if to small. I have both at 2048MB. ----- Admin - email* me if you need anything, or if I've done something stupid... * click on my MichaelAtOz label, there is a link to email me. 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. -- Sent from: http://forum.openscad.org/
HJ
Hugo Jackson
Thu, Jan 16, 2020 11:38 PM

WOW!!!! So grateful for your advice. My cache size was just set to the default 100MB… reset it to 2048 and presto… 1st render took 25 minutes… rerender was immediate! What will I do with all my spare time now?

Seeing as this bottleneck just sort of crept up on me and I don’t think I had any reason to presume openSCAD could be improved to reduce rerender times I’m just wondering if there are any other preference settings that should be adjusted… is there some docs on the settings that you know of that I can look up? If polyset cache is undersized is it just going to result in some kind of slow down or will it precipitate some kind of warning. Is Enable for OpenGL 1.x best left enabled? Is 16000000 an appropriate rendering limit? And forcing goldfeather? I have no idea what that even means.

Regardless… thanks so much… I’m very grateful!

On Jan 16, 2020, at 3:00 PM, MichaelAtOz oz.at.michael@gmail.com wrote:

What are your Edit/Preferences/Advance/CGAL cache sizes?
That will affect re-render performance if to small.
I have both at 2048MB.


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

  • click on my MichaelAtOz label, there is a link to email me.

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.

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


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

WOW!!!! So grateful for your advice. My cache size was just set to the default 100MB… reset it to 2048 and presto… 1st render took 25 minutes… rerender was immediate! What will I do with all my spare time now? Seeing as this bottleneck just sort of crept up on me and I don’t think I had any reason to presume openSCAD could be improved to reduce rerender times I’m just wondering if there are any other preference settings that should be adjusted… is there some docs on the settings that you know of that I can look up? If polyset cache is undersized is it just going to result in some kind of slow down or will it precipitate some kind of warning. Is Enable for OpenGL 1.x best left enabled? Is 16000000 an appropriate rendering limit? And forcing goldfeather? I have no idea what that even means. Regardless… thanks so much… I’m very grateful! > On Jan 16, 2020, at 3:00 PM, MichaelAtOz <oz.at.michael@gmail.com> wrote: > > What are your Edit/Preferences/Advance/CGAL cache sizes? > That will affect re-render performance if to small. > I have both at 2048MB. > > > > ----- > Admin - email* me if you need anything, or if I've done something stupid... > > * click on my MichaelAtOz label, there is a link to email me. > > 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. > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
M
MichaelAtOz
Fri, Jan 17, 2020 12:19 AM

boxcarmib wrote

I’m just wondering if there are any other preference settings that should
be adjusted… is there some docs on the settings that you know of that I
can look up?

Hmmm...seems not.

If polyset cache is undersized is it just going to result in some kind of
slow down or will it precipitate some kind of warning.

AFAIK just slows down as it re-renders what is no longer in cache.

Is Enable for OpenGL 1.x best left enabled?

No, unless you have an old system.

Is 16000000 an appropriate rendering limit?

This affects preview, I think it will look bad if too low, but if too high,
preview movement can get clunky.
I have it at 1 billion.

And forcing goldfeather? I have no idea what that even means.

It is a different algorithm, only needed where there is a GPU compatibility
problem.
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Preview_doesn't_appear_to_work_at_all


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

  • click on my MichaelAtOz label, there is a link to email me.

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.

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

boxcarmib wrote > I’m just wondering if there are any other preference settings that should > be adjusted… is there some docs on the settings that you know of that I > can look up? Hmmm...seems not. > If polyset cache is undersized is it just going to result in some kind of > slow down or will it precipitate some kind of warning. AFAIK just slows down as it re-renders what is no longer in cache. > Is Enable for OpenGL 1.x best left enabled? No, unless you have an old system. > Is 16000000 an appropriate rendering limit? This affects preview, I think it will look bad if too low, but if too high, preview movement can get clunky. I have it at 1 billion. > And forcing goldfeather? I have no idea what that even means. It is a different algorithm, only needed where there is a GPU compatibility problem. https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Preview_doesn't_appear_to_work_at_all ----- Admin - email* me if you need anything, or if I've done something stupid... * click on my MichaelAtOz label, there is a link to email me. 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. -- Sent from: http://forum.openscad.org/