Extrusion Edge Cases

From Web3D.org
Revision as of 13:05, 28 October 2015 by Sevaa (Talk | contribs)

Jump to: navigation, search

The Extrusion node specification has ambiguities [1]

This wiki page supports discussion on the x3d-public mailing list regarding Extrusion specification edge cases that make consistent modeling difficult.

Problem issues

The algorithm for generating the spine-aligned cross section plane (SCP) is ambiguous, hard to follow, sometimes ill-defined.

Coincident Spine Points

Conincident spine points are allowed under the spec.

1. The algorithm for generating Y for the SCP is ill defined if three spine points in a row are coincident. In the spirit of the spec, reusing the last value of Y makes sense, but the spec doesn't say so.

2. The algorithm for generating Y for the SCP at the first point of an open spine is ill defined if the first two spine points are coincident. Similarly, one may employ look-ahead to the first non-null spine segment, but the spec doesn't say so.

Conincident Spine Points with a Bend

Consider the following spine:

(0,0,0) - (0,1,0) - (0,1,0) - (0,1,1)

Collinear spines

If the spine is collinear (and thus allows for no SCP-Z calculation), the standard calls for generating the SCP in the following manner:

A. The direction of the spine is determined (as a vector) B. The rotation that takes the vector (0,1,0) to the said vector is calculated C. This rotation is applied to vectors (1,0,0) and (0,0,1), and those are the X and Z axes of the SCP.

There are some problems with that algorithm.

1. If the vector in step A happens to be (0,-1,0), the rotation in step B is not unique.

2. If the spine goes: (0,0,0) - (0,1,0) - (0,0,0), it's collinear, but the standard doesn't specify what constitutes the "spine direction". Common sense suggests the first nonzero length spine segment, but the standard doesn't say so.

Also, it's worth noting that the popular implementations out there don't follow those rules.

Possible solutions

Resolved issues