[x3d-public] convex field only a hint? are quads rectangular?

Don Brutzman brutzman at nps.edu
Mon Nov 23 10:12:55 PST 2015


On 11/23/2015 8:34 AM, Andreas Plesch wrote:
> This is a request for clarification of the purpose of the convex field. The standard says that it is an indicator. It looks like the intention is to aid renderers by not requiring them to figure out if a polygon is convex. The original motivation for such a field may be that it is trivial to triangulate a convex polygon but relatively expensive to triangulate a concave polygon.
>
> Does this mean that the value of convex field is irrelevant for how a polygon is rendered from the standard's perspective ?
> Is it up to the x3d browser to decide what is rendered if there is mismatch between actual and indicated "convexity" ?
> Probably, the expectation is that the rendering of a concave polygon in the convex="true" case is undefined by the standard. Similarly, the rendering of a convex polygon with convex="false" may also be undefined. If this is the intention, should such language be added to the standard ?
>
> Given technological advances, it may be possible to deprecate the convex field altogether, and forfeit potential performance gains.
>
> Here is the current wording at
>
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#CommonGeometryFields :
>
> The /convex/ field indicates whether all polygons in the shape are convex (|TRUE|). A polygon is convex if it is planar, does not intersect itself, and all of the interior angles at its vertices are less than 180 degrees. Non planar and self intersecting polygons may produce undefined results even if the /convex/ field is |FALSE|.
>
> -Andreas

Worthy question regarding /convex/ Andreas, thanks.  Of additional note:

a. whether the polygons themselves are convex or concave is a mathematical fact, regardless of what the /convex/ field says.  thus it is a "hint" and does not take precedence.
b. for n-gons with n=4 or higher, roundoff errors in floating point numbers can make vertices in a planar polygon non-coplanar.
c. If the node is QuadSet or IndexedQuadSet then the renderer might reasonably presume planar quads are intended, which can help (spec comment submitted to tighten that wording further).
d. different algorithms can have better speed versus better fidelity depending on what they are given.
e. high-end graphics cards and use cases of today might make convex irrelevant, but smaller devices and software rendering might nevertheless care.

So it would seem that /convex/ is useful.  Wondering if /convex/ fields are still found in OpenGL/WebGL or other render languages?

Meanwhile, thanks to this review, looks like our definitions for QuadSet/IndexedQuadSet implicitly expect rectangular quads, given the examples shown and lack of /convex/ field.  However the spec does not explicitly say rectangular, or planar for that matter.  What is intended?  This came out of the CAD component, motivated by the export of CAD models that reportedly include quads frequently, so we should ask the cad group too (cc:ed).

http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/CADGeometry.html#IndexedQuadSet
http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/CADGeometry.html#QuadSet

If not rectangular, then the /convex/ field ought to be added for consistency.  Another spec comment submitted.

(Curiously, if these nodes are always rectangular, then wondering why we didn't call them RectangleSet in the first place.)

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