discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Converting a hollow STL file to solid ??

HL
Hans L
Mon, Jan 18, 2021 12:14 AM

Well, for the simple case of hollow spheres and cubes (and any other
convex object), you can use hull() to fill in the empty space.

But generally, no I don't think it's possible given our current builtin
functionality.

On Sun, Jan 17, 2021 at 4:18 PM Jordan Brown openscad@jordan.maileater.net
wrote:

On 1/17/2021 12:41 PM, fred via Discuss wrote:

I must be misunderstanding the objective. I pictured the original model as
one with two (or more) independent, separated surfaces, with the outer
surface "encapsulating" the inner surface. To the best of my
(mis)understanding, one can create an STL file with this characteristic,
but I believe it would be considered non-manifold. I may be wrong; I'm
often wrong.

I don't know whether it has a name but no, I don't think it's
non-manifold.  I don't understand the math in the abstract, but I believe
the definition is that of a 2-manifold is that each edge is attached to
exactly two faces.  It may also be required to be non-self-intersecting, or
maybe that's a separate requirement.

As best I can tell, it would be a shape with two "boundary components".
Ref https://en.wikipedia.org/wiki/Boundary_(topology) .

BTW, the Wikipedia articles on this stuff are remarkably poor at
explaining it if you don't already understand most of it.  I'm not a dummy,
and generally I'm lost after the second paragraph.  To be fair, they're
reference material, not tutorial material, but ... still.

In some ways the first few paragraphs of the geographically-oriented
article on Enclaves and exclaves are a simpler way of looking at it.  (They
might be a better way, too, because they map straightforwardly to
multi-material construction.)  Ref
https://en.wikipedia.org/wiki/Enclave_and_exclave .

Based on this, I also believed the objective was to remove the inner
surface from the original STL file, leaving only the outer shell.

Yes, that's my understanding too.

Again, based on my limited comprehension (another word for understanding),
an STL file is not solid and cannot be made solid, as it is a collection of
(properly) joined surfaces of zero thickness. In a manner of speaking, a
properly constructed STL file is defining a solid, as long as there isn't
anything else "inside" it.

An STL file is just a list of triangles.  For a well-formed STL file, you
can look at the triangles and how they connect to one another, and (based
on some assumptions) you can decide from that which volumes are part of the
shape and which volumes are not part of the shape.  For simple shapes
that's the same as "inside" and "outside", but more complex shapes like
hollow shapes can have volumes that are in some sense "inside" but are not
part of the shape.

In 2D, with lines instead of triangles, we can have

and the conventional interpretation is that the green section is part of
the shape, and everything else (including the white section in the middle)
is not part of the shape.

There are other interpretations of those lines.  You could say that the
shape is the center rectangle, and the entire universe outside the outer
rectangle, and not the green section.  (But that's not very useful in
most cases.)

You could say that shape is the green area plus the center white area.
(But that would leave the inner rectangle meaningless.)

In the iterative build of the previous message, I see my error. The
"empty" volume of the original becomes non-empty during the difference
process and is also integrated in the next difference action.

Right.

There certainly could be an operation that was "remove any shape that is
completely enclosed by another shape", or something like that, but we don't
have it.

In a different way of phrasing the objective, would one accept that the
goal is to remove the "stuff" inside the outer shell?

I believe that's correct.


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

Well, for the simple case of hollow spheres and cubes (and any other *convex* object), you can use hull() to fill in the empty space. But generally, no I don't think it's possible given our current builtin functionality. On Sun, Jan 17, 2021 at 4:18 PM Jordan Brown <openscad@jordan.maileater.net> wrote: > On 1/17/2021 12:41 PM, fred via Discuss wrote: > > I must be misunderstanding the objective. I pictured the original model as > one with two (or more) independent, separated surfaces, with the outer > surface "encapsulating" the inner surface. To the best of my > (mis)understanding, one can create an STL file with this characteristic, > but I believe it would be considered non-manifold. I may be wrong; I'm > often wrong. > > > I don't know whether it has a name but no, I don't think it's > non-manifold. I don't understand the math in the abstract, but I believe > the definition is that of a 2-manifold is that each edge is attached to > exactly two faces. It may also be required to be non-self-intersecting, or > maybe that's a separate requirement. > > As best I can tell, it would be a shape with two "boundary components". > Ref https://en.wikipedia.org/wiki/Boundary_(topology) . > > BTW, the Wikipedia articles on this stuff are remarkably poor at > explaining it if you don't already understand most of it. I'm not a dummy, > and generally I'm lost after the second paragraph. To be fair, they're > reference material, not tutorial material, but ... still. > > In some ways the first few paragraphs of the geographically-oriented > article on Enclaves and exclaves are a simpler way of looking at it. (They > might be a *better* way, too, because they map straightforwardly to > multi-material construction.) Ref > https://en.wikipedia.org/wiki/Enclave_and_exclave . > > Based on this, I also believed the objective was to remove the inner > surface from the original STL file, leaving only the outer shell. > > > Yes, that's my understanding too. > > Again, based on my limited comprehension (another word for understanding), > an STL file is not solid and cannot be made solid, as it is a collection of > (properly) joined surfaces of zero thickness. In a manner of speaking, a > properly constructed STL file is defining a solid, as long as there isn't > anything else "inside" it. > > > An STL file is just a list of triangles. For a well-formed STL file, you > can look at the triangles and how they connect to one another, and (based > on some assumptions) you can decide from that which volumes are part of the > shape and which volumes are not part of the shape. For simple shapes > that's the same as "inside" and "outside", but more complex shapes like > hollow shapes can have volumes that are in some sense "inside" but are not > part of the shape. > > In 2D, with lines instead of triangles, we can have > > > > and the conventional interpretation is that the green section is part of > the shape, and everything else (including the white section in the middle) > is not part of the shape. > > There are other interpretations of those lines. You could say that the > shape is the center rectangle, and the entire universe outside the outer > rectangle, and *not* the green section. (But that's not very useful in > most cases.) > > You could say that shape is the green area plus the center white area. > (But that would leave the inner rectangle meaningless.) > > In the iterative build of the previous message, I see my error. The > "empty" volume of the original becomes non-empty during the difference > process and is also integrated in the next difference action. > > > Right. > > There certainly could be an operation that was "remove any shape that is > completely enclosed by another shape", or something like that, but we don't > have it. > > In a different way of phrasing the objective, would one accept that the > goal is to remove the "stuff" inside the outer shell? > > > I believe that's correct. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
D
Dave
Mon, Jan 18, 2021 1:40 AM

An interesting discussion, I've learnt quite a lot from it :-)

Thanks all,
Dave

On 18/01/2021 00:14, Hans L wrote:

Well, for the simple case of hollow spheres and cubes (and any other convex object), you can use hull() to fill in the empty space.

But generally, no I don't think it's possible given our current builtin functionality.

On Sun, Jan 17, 2021 at 4:18 PM Jordan Brown <openscad@jordan.maileater.net> wrote:

On 1/17/2021 12:41 PM, fred via Discuss wrote:

I must be misunderstanding the objective. I pictured the original model as one with two (or more) independent, separated surfaces, with the outer surface "encapsulating" the inner surface. To the best of my (mis)understanding, one can create an STL file with this characteristic, but I believe it would be considered non-manifold. I may be wrong; I'm often wrong.

I don't know whether it has a name but no, I don't think it's non-manifold. I don't understand the math in the abstract, but I believe the definition is that of a 2-manifold is that each edge is attached to exactly two faces. It may also be required to be non-self-intersecting, or maybe that's a separate requirement.

As best I can tell, it would be a shape with two "boundary components". Ref https://en.wikipedia.org/wiki/Boundary_(topology) .

BTW, the Wikipedia articles on this stuff are remarkably poor at explaining it if you don't already understand most of it. I'm not a dummy, and generally I'm lost after the second paragraph. To be fair, they're reference material, not tutorial material, but ... still.

In some ways the first few paragraphs of the geographically-oriented article on Enclaves and exclaves are a simpler way of looking at it. (They might be a better way, too, because they map straightforwardly to multi-material construction.) Ref https://en.wikipedia.org/wiki/Enclave_and_exclave .

Based on this, I also believed the objective was to remove the inner surface from the original STL file, leaving only the outer shell.

Yes, that's my understanding too.

Again, based on my limited comprehension (another word for understanding), an STL file is not solid and cannot be made solid, as it is a collection of (properly) joined surfaces of zero thickness. In a manner of speaking, a properly constructed STL file is defining a solid, as long as there isn't anything else "inside" it.

An STL file is just a list of triangles. For a well-formed STL file, you can look at the triangles and how they connect to one another, and (based on some assumptions) you can decide from that which volumes are part of the shape and which volumes are not part of the shape. For simple shapes that's the same as "inside" and "outside", but more complex shapes like hollow shapes can have volumes that are in some sense "inside" but are not part of the shape.

In 2D, with lines instead of triangles, we can have

and the conventional interpretation is that the green section is part of the shape, and everything else (including the white section in the middle) is not part of the shape.

There are other interpretations of those lines. You could say that the shape is the center rectangle, and the entire universe outside the outer rectangle, and not the green section. (But that's not very useful in most cases.)

You could say that shape is the green area plus the center white area. (But that would leave the inner rectangle meaningless.)

In the iterative build of the previous message, I see my error. The "empty" volume of the original becomes non-empty during the difference process and is also integrated in the next difference action.

Right.

There certainly could be an operation that was "remove any shape that is completely enclosed by another shape", or something like that, but we don't have it.

In a different way of phrasing the objective, would one accept that the goal is to remove the "stuff" inside the outer shell?

I believe that's correct.

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

<pre class="moz-quote-pre" wrap="">_______________________________________________
OpenSCAD mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Discuss@lists.openscad.org">Discuss@lists.openscad.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org">http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org</a>
JB
Jordan Brown
Mon, Jan 18, 2021 2:52 AM

On 1/17/2021 2:18 PM, Jordan Brown wrote:

I don't know whether [a hollow object] has a name but no, I don't
think it's non-manifold.

I waded through enough of the Wikipedia text to find that "Manifolds
need not be connected (all in "one piece"); an example is a pair of
separate circles."  Ref: https://en.wikipedia.org/wiki/Manifold#Other_curves

Critically, a 2-manifold (which is what we usually talk about here) is a
surface.  It isn't exactly a 3-dimensional object; it is only the
surface of that 3-dimensional object.

Note that the overall shape of the surface is not important.  What is
important is that you can take any immediate "neighborhood", flatten it
out, and it will look like a boring flat surface.

What we usually deal with are 2-manifolds without boundaries.  As an ant
walking along the surface, you can always keep walking; you will never
encounter "the end of the world".  Ref: 
https://en.wikipedia.org/wiki/Manifold#Manifold_with_boundary

Incomplete polyhedra, ones that don't have a fully-connected set of
faces, do have boundaries.  But they're arguably in the same class
as non-2-manifolds and self-intersecting surfaces, structures that
the language allows us to make but that are malformed for many purposes.

The objects themselves are 3-manifolds with boundaries.  Their
boundaries are... the 2-manifold surfaces that we're designing.  Unlike
the ant, a fly flying through the sphere can run into the side of the
sphere.

This ties back to the green rectangle from my previous message.  We're
defining the boundaries, but it's something of a matter of
interpretation what those boundaries mean to the solids that they
enclose.  A sphere is a boundary, but is the object the ball-shaped
thing inside, or is it the infinite-space thing outside less a
ball-shaped exclusion?

(Anybody who does understand the math is welcome to jump in and
explain this stuff better... please!)

On 1/17/2021 2:18 PM, Jordan Brown wrote: > I don't know whether [a hollow object] has a name but no, I don't > think it's non-manifold. I waded through enough of the Wikipedia text to find that "Manifolds need not be connected (all in "one piece"); an example is a pair of separate circles."  Ref: https://en.wikipedia.org/wiki/Manifold#Other_curves Critically, a 2-manifold (which is what we usually talk about here) is a *surface*.  It isn't exactly a 3-dimensional object; it is only the surface of that 3-dimensional object. Note that the overall shape of the surface is not important.  What is important is that you can take any immediate "neighborhood", flatten it out, and it will look like a boring flat surface. What we usually deal with are 2-manifolds without boundaries.  As an ant walking along the surface, you can always keep walking; you will never encounter "the end of the world".  Ref:  https://en.wikipedia.org/wiki/Manifold#Manifold_with_boundary Incomplete polyhedra, ones that don't have a fully-connected set of faces, do have boundaries.  But they're arguably in the same class as non-2-manifolds and self-intersecting surfaces, structures that the language allows us to make but that are malformed for many purposes. The objects themselves are 3-manifolds *with* boundaries.  Their boundaries are... the 2-manifold surfaces that we're designing.  Unlike the ant, a fly flying through the sphere *can* run into the side of the sphere. This ties back to the green rectangle from my previous message.  We're defining the boundaries, but it's something of a matter of interpretation what those boundaries mean to the solids that they enclose.  A sphere is a boundary, but is the object the ball-shaped thing inside, or is it the infinite-space thing outside less a ball-shaped exclusion? (Anybody who *does* understand the math is welcome to jump in and explain this stuff better... please!)
KS
Kenneth Sloan
Mon, Jan 18, 2021 3:38 AM

Well...strictly speaking, the stated intention of OpenSCAD is to define SOLIDS.  The boundaries are simply one representation of the solid.  Alas, the created boundaries are not always correct representations of the solids, and OpenSCAD really has no way of dealing with the boundaries, per se.

One difficulty is that the created boundaries are limited to a set of triangles.  There are good reasons for this choice, but it is important to realize that it is a choice.

Failure  to recognize the differences between {triangles} and 2-manifolds and 3D solids leads to many misunderstandings.

Alas, OpenSCAD practitioners (and the writers of the OpenSCAD manuals) often confuse these  three very different things.

--
Kenneth Sloan
KennethRSloan@gmail.com
Vision is the art of seeing what is invisible to others.

On Jan 17, 2021, at 20:52, Jordan Brown openscad@jordan.maileater.net wrote:

On 1/17/2021 2:18 PM, Jordan Brown wrote:

I don't know whether [a hollow object] has a name but no, I don't think it's non-manifold.

I waded through enough of the Wikipedia text to find that "Manifolds need not be connected (all in "one piece"); an example is a pair of separate circles."  Ref: https://en.wikipedia.org/wiki/Manifold#Other_curves https://en.wikipedia.org/wiki/Manifold#Other_curves

Critically, a 2-manifold (which is what we usually talk about here) is a surface.  It isn't exactly a 3-dimensional object; it is only the surface of that 3-dimensional object.

Note that the overall shape of the surface is not important.  What is important is that you can take any immediate "neighborhood", flatten it out, and it will look like a boring flat surface.

What we usually deal with are 2-manifolds without boundaries.  As an ant walking along the surface, you can always keep walking; you will never encounter "the end of the world".  Ref:  https://en.wikipedia.org/wiki/Manifold#Manifold_with_boundary https://en.wikipedia.org/wiki/Manifold#Manifold_with_boundary
Incomplete polyhedra, ones that don't have a fully-connected set of faces, do have boundaries.  But they're arguably in the same class as non-2-manifolds and self-intersecting surfaces, structures that the language allows us to make but that are malformed for many purposes.
The objects themselves are 3-manifolds with boundaries.  Their boundaries are... the 2-manifold surfaces that we're designing.  Unlike the ant, a fly flying through the sphere can run into the side of the sphere.

This ties back to the green rectangle from my previous message.  We're defining the boundaries, but it's something of a matter of interpretation what those boundaries mean to the solids that they enclose.  A sphere is a boundary, but is the object the ball-shaped thing inside, or is it the infinite-space thing outside less a ball-shaped exclusion?

(Anybody who does understand the math is welcome to jump in and explain this stuff better... please!)


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

Well...strictly speaking, the stated intention of OpenSCAD is to define SOLIDS. The boundaries are simply one representation of the solid. Alas, the created boundaries are not always correct representations of the solids, and OpenSCAD really has no way of dealing with the boundaries, per se. One difficulty is that the created boundaries are limited to a set of triangles. There are good reasons for this choice, but it is important to realize that it *is* a choice. Failure to recognize the differences between {triangles} and 2-manifolds and 3D solids leads to many misunderstandings. Alas, OpenSCAD practitioners (and the writers of the OpenSCAD manuals) often confuse these three very different things. -- Kenneth Sloan KennethRSloan@gmail.com Vision is the art of seeing what is invisible to others. > On Jan 17, 2021, at 20:52, Jordan Brown <openscad@jordan.maileater.net> wrote: > > On 1/17/2021 2:18 PM, Jordan Brown wrote: >> I don't know whether [a hollow object] has a name but no, I don't think it's non-manifold. > > I waded through enough of the Wikipedia text to find that "Manifolds need not be connected (all in "one piece"); an example is a pair of separate circles." Ref: https://en.wikipedia.org/wiki/Manifold#Other_curves <https://en.wikipedia.org/wiki/Manifold#Other_curves> > > Critically, a 2-manifold (which is what we usually talk about here) is a *surface*. It isn't exactly a 3-dimensional object; it is only the surface of that 3-dimensional object. > > Note that the overall shape of the surface is not important. What is important is that you can take any immediate "neighborhood", flatten it out, and it will look like a boring flat surface. > > What we usually deal with are 2-manifolds without boundaries. As an ant walking along the surface, you can always keep walking; you will never encounter "the end of the world". Ref: https://en.wikipedia.org/wiki/Manifold#Manifold_with_boundary <https://en.wikipedia.org/wiki/Manifold#Manifold_with_boundary> > Incomplete polyhedra, ones that don't have a fully-connected set of faces, do have boundaries. But they're arguably in the same class as non-2-manifolds and self-intersecting surfaces, structures that the language allows us to make but that are malformed for many purposes. > The objects themselves are 3-manifolds *with* boundaries. Their boundaries are... the 2-manifold surfaces that we're designing. Unlike the ant, a fly flying through the sphere *can* run into the side of the sphere. > > This ties back to the green rectangle from my previous message. We're defining the boundaries, but it's something of a matter of interpretation what those boundaries mean to the solids that they enclose. A sphere is a boundary, but is the object the ball-shaped thing inside, or is it the infinite-space thing outside less a ball-shaped exclusion? > > (Anybody who *does* understand the math is welcome to jump in and explain this stuff better... please!) > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org