discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

Result of a boolean subtracting a solid from a closed mesh is itself not closed

GN
Greg Nuyens
Wed, Jan 5, 2022 12:08 AM

Hello,

I am modeling flaws in the production of glass vials.  One of the techniques I’m trying subtracts “flaws” from the original .stl with difference().

This first (exaggerated) example works (to demonstrate what I’m after):

module test () {
// remove a sphere from the vial
difference() {
import(pFilename);
#sphere(r=25);
}
}

However, with a differently produced .stl (which loads and renders fine on its own in OpenSCAD), the following error is reported:

Pardon me if this is a dumb question, but shouldn't a solid removed from a closed mesh, itself be closed?

(I’d like to include the .stl that fails, but am not clear how to do that with the mailing list.)

Thanks for any insight,
Greg

Hello, I am modeling flaws in the production of glass vials. One of the techniques I’m trying subtracts “flaws” from the original .stl with difference(). This first (exaggerated) example works (to demonstrate what I’m after): module test () { // remove a sphere from the vial difference() { import(pFilename); #sphere(r=25); } } However, with a differently produced .stl (which loads and renders fine on its own in OpenSCAD), the following error is reported: Pardon me if this is a dumb question, but shouldn't a solid removed from a closed mesh, itself be closed? (I’d like to include the .stl that fails, but am not clear how to do that with the mailing list.) Thanks for any insight, Greg
AC
A. Craig West
Wed, Jan 5, 2022 12:22 AM

This is likely the result of some edge case where there are coincident or
near coincident faces being subtracted from each other. At least that is my
guess

On Tue, 4 Jan 2022, 19:09 Greg Nuyens, greg@nuyens.com wrote:

Hello,

I am modeling flaws in the production of glass vials.  One of the
techniques I’m trying subtracts “flaws” from the original .stl with
difference().

This first (exaggerated) example works (to demonstrate what I’m after):

module test () {
// remove a sphere from the vial
difference() {
import(pFilename);
#sphere(r=25);
}
}

However, with a differently produced .stl (which loads and renders fine on
its own in OpenSCAD), the following error is reported:

Pardon me if this is a dumb question, but shouldn't a solid removed from a
closed mesh, itself be closed?

(I’d like to include the .stl that fails, but am not clear how to do that
with the mailing list.)

Thanks for any insight,
Greg


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

This is likely the result of some edge case where there are coincident or near coincident faces being subtracted from each other. At least that is my guess On Tue, 4 Jan 2022, 19:09 Greg Nuyens, <greg@nuyens.com> wrote: > Hello, > > I am modeling flaws in the production of glass vials. One of the > techniques I’m trying subtracts “flaws” from the original .stl with > difference(). > > This first (exaggerated) example works (to demonstrate what I’m after): > > module test () { > // remove a sphere from the vial > difference() { > import(pFilename); > #sphere(r=25); > } > } > > > However, with a differently produced .stl (which loads and renders fine on > its own in OpenSCAD), the following error is reported: > > > Pardon me if this is a dumb question, but shouldn't a solid removed from a > closed mesh, itself be closed? > > (I’d like to include the .stl that fails, but am not clear how to do that > with the mailing list.) > > Thanks for any insight, > Greg > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
NH
nop head
Wed, Jan 5, 2022 12:23 AM

Pardon me if this is a dumb question, but shouldn't a solid removed from a
closed mesh, itself be closed?

Not necessarily, but if they overlap by a finite amount and don't share
edges or faces it should be. The most likely cause is the original STL is
not a valid solid. OpenSCAD won't tell you until you try to do a boolean
operation on it.

On Wed, 5 Jan 2022 at 00:09, Greg Nuyens greg@nuyens.com wrote:

Hello,

I am modeling flaws in the production of glass vials.  One of the
techniques I’m trying subtracts “flaws” from the original .stl with
difference().

This first (exaggerated) example works (to demonstrate what I’m after):

module test () {
// remove a sphere from the vial
difference() {
import(pFilename);
#sphere(r=25);
}
}

However, with a differently produced .stl (which loads and renders fine on
its own in OpenSCAD), the following error is reported:

Pardon me if this is a dumb question, but shouldn't a solid removed from a
closed mesh, itself be closed?

(I’d like to include the .stl that fails, but am not clear how to do that
with the mailing list.)

Thanks for any insight,
Greg


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

> > Pardon me if this is a dumb question, but shouldn't a solid removed from a > closed mesh, itself be closed? Not necessarily, but if they overlap by a finite amount and don't share edges or faces it should be. The most likely cause is the original STL is not a valid solid. OpenSCAD won't tell you until you try to do a boolean operation on it. On Wed, 5 Jan 2022 at 00:09, Greg Nuyens <greg@nuyens.com> wrote: > Hello, > > I am modeling flaws in the production of glass vials. One of the > techniques I’m trying subtracts “flaws” from the original .stl with > difference(). > > This first (exaggerated) example works (to demonstrate what I’m after): > > module test () { > // remove a sphere from the vial > difference() { > import(pFilename); > #sphere(r=25); > } > } > > > However, with a differently produced .stl (which loads and renders fine on > its own in OpenSCAD), the following error is reported: > > > Pardon me if this is a dumb question, but shouldn't a solid removed from a > closed mesh, itself be closed? > > (I’d like to include the .stl that fails, but am not clear how to do that > with the mailing list.) > > Thanks for any insight, > Greg > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
M
MichaelAtOz
Wed, Jan 5, 2022 5:39 AM

(I’d like to include the .stl that fails, but am not clear how to do that with the mailing list.)

Just as an attachment like any other file.

However if it is large, > 1MB, zip it or stick it online (dropbox, drive etc) and include a link.

Note you should only include ones with appropriate copyright if they are not yours.

Sharing .stl files is usually good, as there are tools people can use to check them for you.


From: Greg Nuyens [mailto:greg@nuyens.com]
Sent: Wed, 5 Jan 2022 11:09
To: discuss@lists.openscad.org
Subject: [OpenSCAD] Result of a boolean subtracting a solid from a closed mesh is itself not closed

Hello,

(I’d like to include the .stl that fails, but am not clear how to do that with the mailing list.)

Thanks for any insight,

Greg

--
This email has been checked for viruses by AVG.
https://www.avg.com

> (I’d like to include the .stl that fails, but am not clear how to do that with the mailing list.) Just as an attachment like any other file. However if it is large, > 1MB, zip it or stick it online (dropbox, drive etc) and include a link. Note you should only include ones with appropriate copyright if they are not yours. Sharing .stl files is usually good, as there are tools people can use to check them for you. _____ From: Greg Nuyens [mailto:greg@nuyens.com] Sent: Wed, 5 Jan 2022 11:09 To: discuss@lists.openscad.org Subject: [OpenSCAD] Result of a boolean subtracting a solid from a closed mesh is itself not closed Hello, (I’d like to include the .stl that fails, but am not clear how to do that with the mailing list.) Thanks for any insight, Greg -- This email has been checked for viruses by AVG. https://www.avg.com
NH
nop head
Wed, Jan 5, 2022 7:20 AM

Perhaps projection() will do it.

On Wed, 5 Jan 2022 at 05:40, MichaelAtOz oz.at.michael@gmail.com wrote:

(I’d like to include the .stl that fails, but am not clear how to do

that with the mailing list.)

Just as an attachment like any other file.

However if it is large, > 1MB, zip it or stick it online (dropbox, drive
etc) and include a link.

Note you should only include ones with appropriate copyright if they are
not yours.

Sharing .stl files is usually good, as there are tools people can use to
check them for you.


From: Greg Nuyens [mailto:greg@nuyens.com]
Sent: Wed, 5 Jan 2022 11:09
To: discuss@lists.openscad.org
Subject: [OpenSCAD] Result of a boolean subtracting a solid from a
closed mesh is itself not closed

Hello,

(I’d like to include the .stl that fails, but am not clear how to do that
with the mailing list.)

Thanks for any insight,

Greg

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_-6538828107357746666_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Perhaps projection() will do it. On Wed, 5 Jan 2022 at 05:40, MichaelAtOz <oz.at.michael@gmail.com> wrote: > > (I’d like to include the .stl that fails, but am not clear how to do > that with the mailing list.) > > > > Just as an attachment like any other file. > > However if it is large, > 1MB, zip it or stick it online (dropbox, drive > etc) and include a link. > > Note you should only include ones with appropriate copyright if they are > not yours. > > > > Sharing .stl files is usually good, as there are tools people can use to > check them for you. > > > ------------------------------ > > *From:* Greg Nuyens [mailto:greg@nuyens.com] > *Sent:* Wed, 5 Jan 2022 11:09 > *To:* discuss@lists.openscad.org > *Subject:* [OpenSCAD] Result of a boolean subtracting a solid from a > closed mesh is itself not closed > > > > Hello, > > > > > > (I’d like to include the .stl that fails, but am not clear how to do that > with the mailing list.) > > > > Thanks for any insight, > > Greg > > > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. > www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > <#m_-6538828107357746666_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >