[x3d-public] C:/x3d-code/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter13GeometryTrianglesQuadrilaterals/SummaryIndexedTriangleSets.x3d

Don Brutzman brutzman at nps.edu
Wed Sep 6 09:39:26 PDT 2017


OK great, thanks John.  Yes it looks like you have identified a problem in lower bounds for index field in IndexedTriangleFanSet and IndexedTriangleStripSet, which should be inclusive of value -1.

Analysis of impacts follows.  First: the approved X3D v3.3 specification confirms your point, excerpted:

11.4.6 IndexedTriangleFanSet
http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#IndexedTriangleFanSet

IndexedTriangleFanSet : X3DComposedGeometryNode {
   MFInt32 [in]     set_index       []   [0,∞) or -1
[...]
   MFInt32 []       index           []   [0,∞) or -1
}

11.4.8 IndexedTriangleStripSet
http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#IndexedTriangleStripSet

IndexedTriangleStripSet : X3DComposedGeometryNode {
   MFInt32 [in]     set_index       []   [0,∞) or −1
[...]
   MFInt32 []       index           []   [0,∞) or −1
}

Checking github:  the X3D v4 draft specification is the same.

Inspecting X3D XML Schema shows that the value bounds on index and set_index fields are incorrect, the minInclusive values are 0 instead of -1.

Fixing those values will fix the object model and subsequent products.

Roy: can you check the X3D JSON schema please?  I think you got bounds correct, but not sure why you have minItems of 1.

"@index": {
	"type": "array",
	"minItems": 1,
	"items": {
		"type": "integer",
		"minimum": -1
	}
},

X3D Tooltips are OK for these two nodes.

http://www.web3d.org/x3d/content/X3dTooltips.html#IndexedTriangleFanSet
"index 	[index accessType initializeOnly, type MFInt32 CDATA #IMPLIED] [-1,+∞)"

http://www.web3d.org/x3d/content/X3dTooltips.html#IndexedTriangleStripSet
"index 	[index accessType initializeOnly, type MFInt32 CDATA #IMPLIED] [-1,+∞)"

X3D Schematron: looks to be OK, accommodated already.

Note that 11.4.7 IndexedTriangleSet does not include -1, since the index field is always specifying triangles (rather than n-sided polygons needing a -1 termination-sentinel value).
- found error in X3D XML Schema for set_index, fixed
- Roy it looks like you need to fix that in X3D JSON Schema since bounds are OK but it appears to have a typo "Trangle"

"IndexedTriangleSet": {
	"$ref": "#/definitions/IndexedTrangleSet"
},

"IndexedTrangleSet": {
	"type": "object",
	"properties": {
[...]
		"@index": {
			"type": "array",
			"items": {
				"type": "integer",
				"minimum": 0
			}
		},

Following group review, I will publish an update to X3D Schema and object model.


On 9/5/2017 3:15 PM, John Carlson wrote:
>     Does anyone see a problem with the index in these two IndexedTriangle sets?
> 
>     <Shape>
> 
>          <IndexedTriangleStripSet index='9 10 11 12 13 -1 14 15 16 17 -1' solid='false'>
> 
>            <Coordinate USE='Points'/>
> 
>            <Color USE='Colors'/>
> 
>          </IndexedTriangleStripSet>
> 
>        </Shape>
> 
>        <Shape>
> 
>          <IndexedTriangleFanSet index='18 19 20 21 22 23 24 25 26 -1 27 28 29 30 31 32 -1' solid='false'>
> 
>            <Coordinate USE='Points'/>
> 
>            <Color USE='Colors'/>
> 
>          </IndexedTriangleFanSet>
> 
> The X3DUOM looks like:
> 
>              <field type="MFInt32"
> 
>                     accessType="initializeOnly"
> 
>                     name="index"
> 
>                     minInclusive="0"/>
> 
> For all index’es and I’m wondering which is right.  Should this be minItems? Or minInclusive=”-1”? Wondering.
> 
> The old JSON schema may have it right, and the generated one is messed up because of the X3DUOM.
> 
> Thanks,
> 
> John
all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list