Closed jratike80 closed 2 years ago
Let me allow myself to mingle in this discussion. I've spent years developing code for 3D GIS validation (https://github.com/tudelft3d/val3dity).
Yes higher-dimensional primitives are composed of lower-dimensional primitives, this is how ISO19107 works. Like a polygon is formed a several rings (outer+inners) which are composed of lines.
Here I think that the word "hole" could be misinterpreted though, and perhaps it would be better to use "void" or "cavity".
For the docs of val3dity I wrote the description of a Solid, which is a polyhedron here: https://val3dity.readthedocs.io/en/latest/definitions/#solid
My point is that this definition does not allow MultiPolygons which have several outer rings The first shell is the exterior boundary, all other shells are holes
. A MultiPolygon with one outer ring is naturally OK but that can as well be modelled as Polygon.
The question is "Can a polyhedron be an array of MultiPolygons which have several outer rings"?
Can you draw what you mean by a MultiPolygon having several outer rings?
Because from ISO19107 a Polygon cannot have more than one outer ring, and actually it needs to have one and only one. A MultiPolygon is just a set of Polygons, each having one outer ring.
Like this
MULTIPOLYGON ((( 1560 3860, 2340 3720, 1320 2980, 1560 3860 )), (( -20 3880, 1120 3920, 740 2980, -20 3880 )))
or
MULTIPOLYGON ((( 1560 3860, 2340 3720, 1320 2980, 1560 3860 )), (( -20 3880, 1120 3920, 740 2980, -20 3880 ), ( 460 3660, 620 3500, 680 3680, 460 3660 )))
so it's (1) 2 polygons, each having 1 outer ring (2) 2 polygons, first one has outer+inner and second has outer.
And the definition above does allow this. A set of polygons define a shell, eg the 6 polygons forming a cube.
Maybe it is this what puzzles me Each multi-polygon array is a shell and must be closed
. Does it mean rather "Each element of a multipolygon array is a shell and must be closed"?
It means that the polygons in the multi-polygon put together form the shell.
Take a cube for example: each side can be defined by a polygon (5 vertices each). Putting the polygons of each side (6 in total) in a multi-polygon creates the shell of the cube.
All right, so it is the word "shell" that I understood wrong. I apologize, I have done only 2D and I think that I have seen shells probably only when I have had data with topology errors, so quite often. Example with PostGIS
select ST_IsValidReason(
ST_GeomFromText('POLYGON (( -260 -1740, -260 5440, 7560 5440, 7560 -1740, -260 -1740 ), ( 8540 940, 11300 940, 11300 4020, 8540 4020, 8540 940 ))' ));
"Hole lies outside shell[8540 940]"
I checked the Simple Feature standards and there "shell" is used only in one place
A Ball with some number of voids (holes) inside can thus be presented as one exterior boundary shell, and some number in interior boundary shells.
The word "shell" to mean the interior of a 2D polygon is used at least in error messages of JTS topology suite, GEOS library, PostGIS, and GDAL. It may be that I am not the only one who does not get directly that shell in this context means the skin of a 3D thing, but I understand that this issue is invalid. I will wait till next week for more comments before closing.
Would a bit different wording make sense?
A polyhedron is a solid with flat polygonal faces. In JSON-FG polyhedron is encoded as a non-empty array of shells. Each shell is an array of polygons which make up a closed boundary. The first shell is the exterior boundary, all other shells are holes.
I suppose that "multi-polygon array" is used intentionally in the original text to distinct it from "MultiPolygon" because the arrays of polygons in polyhedron are not valid Simple Feature 2D MultiPolygons where polygon primitives must not intersect at edges.
Thanks for bringing this up. I agree the current wording is confusing ("multi-polygon" vs "MultiPolygon").
The term "shell" comes from ISO 19107 (Spatial Schema):
A solid has a boundary consisting of surfaces in the same coordinate system as the solid. These surfaces can be organized into shells that are the 3D equivalent to the rings for a surface. A solid shall be connected (contiguous) in such a manner that for any two points on the solid, but not on its boundary, it is possible to create a curve from one to the other in such a manner that the curve is also completely contained in the interior of the solid. A solid shall have as its boundary a set of simple closed surfaces (shells). A solid is always below it shells (as defined by the upward normal of the surface). These shells shall not self-intersect nor be self-tangent. They may, for shells in the boundary of the same solid, be tangent to one another at a single point or along a non-closed, simple curve, bottom side to bottom side (that means that the upward normals of the two at points of contact are in opposite directions). As a set and within the limits of calculation error on the machine in question, the boundary of a solid is uniquely representable by shells (as a collection of surfaces that are both cycles (closed) and simple).
For a polyhedron, each shell is a closed and simple PolyhedralSurface, i.e. "a Surface composed of Polygons connected along their common boundary curves."
Here is another attempt:
A polyhedron is a non-empty array of closed, simple polyhedral surfaces (shells). The first shell is the exterior boundary, all other shells are voids. Each shell is an array of polygons which make up a closed boundary surface.
A polyhedral surface is a surface composed of polygons connected along their common boundary curves.
An explanatory figure would probably help, too.
Meeting 2022-02-07: @cportele will create a PR with a proposal for an improved text.
Meeting 2022-02-21: The updated text in #42 looks good.
The definition of polyhedron in the draft is
I do not know polyhedrons but the multipolygon part seems to define a polygon
The first shell is the exterior boundary, all other shells are holes
. Is polyhedron actually made of polygons?