When I get the following line
"Top level object is a 3D object (manifold):"
Beneath it is a field "Genus:" along with fields for "Vertices:" and
"Facets:".
Most of my models generate a Genus: of a small positive integer but some
are zero and I just noticed one is -4 which makes me wonder what
it could be.
I don't know from OpenSCAD, but Wikipedia says:
In mathematics
https://en.wikipedia.org/wiki/Mathematics, genus (pl.: genera)
has a few different, but closely related, meanings. Intuitively, the
genus is the number of "holes" of a surface
https://en.wikipedia.org/wiki/Surface_(topology).^[1]
https://en.wikipedia.org/wiki/Genus_(mathematics)#cite_note-FOOTNOTEPopescu-Pampu2016xiiiIntroduction-1
A sphere https://en.wikipedia.org/wiki/Sphere has genus 0, while
a torus https://en.wikipedia.org/wiki/Torus has genus 1.
Some simple experiments yield results consistent with this definition.
It does not mention the possibility of a negative number. A Google
search hints at a negative genus reflecting disconnected surfaces, and
experiments are consistent with that, with three disconnected objects
yielding a genus of -2. (Though when I follow up on those Google hits,
that's not what they say. Still, the experiment is consistent with that
interpretation.)
And they appear to be added together, which doesn't make any intuitive
sense to me. One sphere plus two donuts equals zero.
Manifold documentation says:
https://manifoldcad.org/docs/html/classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1
The genus is a topological property of the manifold, representing the
number of "handles". A sphere is 0, torus 1, etc. It is only
meaningful for a single mesh, so it is best to call Decompose() first.
Decompose is:
https://manifoldcad.org/docs/html/classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106
This operation returns a vector of Manifolds that are topologically
disconnected. If everything is connected, the vector is length one,
containing a copy of the original. It is the inverse operation of
Compose().
And they appear to be added together, which doesn't make any intuitive
sense to me. One sphere plus two donuts equals zero.
Thanks! Your genus formula of adding holes and subtracting
additional topologically disconnected manifolds works for my models. I
probably could have come up with that through repeated tests but I'm glad I
did not try too hard as it was making my brain hurt enough that I feared I
would need a visit with doctor Gumby.
On Fri, Mar 28, 2025 at 11:00 PM Jordan Brown openscad@jordan.maileater.net
wrote:
I don't know from OpenSCAD, but Wikipedia says:
https://en.wikipedia.org/wiki/Genus_(mathematics)
In mathematics https://en.wikipedia.org/wiki/Mathematics, genus (pl.:
genera) has a few different, but closely related, meanings.
Intuitively, the genus is the number of "holes" of a surface
https://en.wikipedia.org/wiki/Surface_(topology).[1]
https://en.wikipedia.org/wiki/Genus_(mathematics)#cite_note-FOOTNOTEPopescu-Pampu2016xiiiIntroduction-1
A sphere https://en.wikipedia.org/wiki/Sphere has genus 0, while a
torus https://en.wikipedia.org/wiki/Torus has genus 1.
Some simple experiments yield results consistent with this definition.
It does not mention the possibility of a negative number. A Google search
hints at a negative genus reflecting disconnected surfaces, and experiments
are consistent with that, with three disconnected objects yielding a genus
of -2. (Though when I follow up on those Google hits, that's not what they
say. Still, the experiment is consistent with that interpretation.)
And they appear to be added together, which doesn't make any intuitive
sense to me. One sphere plus two donuts equals zero.
Manifold documentation says:
https://manifoldcad.org/docs/html/classmanifold_1_1_manifold.html#a4b1e9ca27fc618965d0bbbc9d29fb5c1
The genus is a topological property of the manifold, representing the
number of "handles". A sphere is 0, torus 1, etc. It is only meaningful for
a single mesh, so it is best to call Decompose() first.
Decompose is:
https://manifoldcad.org/docs/html/classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106
This operation returns a vector of Manifolds that are topologically
disconnected. If everything is connected, the vector is length one,
containing a copy of the original. It is the inverse operation of Compose().