[x3d-public] Extrusions, take 3

Don Brutzman brutzman at nps.edu
Tue Jan 26 19:09:32 PST 2016

On 1/26/2016 7:15 AM, Alekseyev, Vsevolod (NIH/NIAID) [E] wrote:
> Hi X3D community,
> I've tried and failed twice to explain the problems with the definition of the Extrusion node. So here's a tl;dr version:

I doubt that you have failed, but we have failed to keep up with you while trying unsuccessfully to illustrate the problems.

> Dear authors of the X3D standard, please take a careful look at the standard and answer me:

13.3.5 Extrusion

The final orientation of each cross-section is computed by first orienting it relative to the spine segments on either side of point at which the cross-section is placed. This is known as the spine-aligned cross-section plane (SCP), and is designed to provide a smooth transition from one spine segment to the next (see Figure 13.5). The SCP is then rotated by the corresponding orientation value. This rotation is performed relative to the SCP. For example, to impart twist in the cross-section, a rotation about the Y-axis (0 1 0) would be used. Other orientations are valid and rotate the cross-section out of the SCP.

Figure 13.5 — Spine-aligned cross-section plane at a spine point.

The SCP is computed by first computing its Y-axis and Z-axis, then taking the cross product of these to determine the X-axis. These three axes are then used to determine the rotation value needed to rotate the Y=0 plane to the SCP. This results in a plane that is the approximate tangent of the spine at each point, as shown in Figure 13.5.
===================================================================== Special cases

If the number of scale or orientation values is greater than the number of spine points, the excess values are ignored. If they contain one value, it is applied at all spine points. The results are undefined if the number of scale or orientation values is greater than one but less than the number of spine points. The scale values shall be positive.

If the three points used in computing the Z-axis are collinear, the cross-product is zero so the value from the previous point is used instead.

If the Z-axis of the first point is undefined (because the spine is not closed and the first two spine segments are collinear) then the Z-axis for the first spine point with a defined Z-axis is used.

If the entire spine is collinear, the SCP is computed by finding the rotation of a vector along the positive Y-axis (v1) to the vector formed by the spine points (v2). The Y=0 plane is then rotated by this value.

If two points are coincident, they both have the same SCP. If each point has a different orientation value, then the surface is constructed by connecting edges of the cross-sections as normal. This is useful in creating revolved surfaces.

Note:  combining coincident and non-coincident spine segments, as well as other combinations, can lead to interpenetrating surfaces which the extrusion algorithm makes no attempt to avoid.

> 1) When the spine goes (0,0,0)-(0,-1,0), what is the CSP?
> Note: all answers but one will render one of the reference models in the Savage archive invalid.

I'm not seeing where the specification defines the spine-aligned cross-section plane (SCP) when only 2 unique points are provided.

We ought to.  This is a specification deficiency.

Clearly a SCP is well defined for 2 spine points, the normal plane is unambiguous.

Further checking of the prose will also be needed to ensure that the 2-point spine case is fully defined in a correct manner.

Not seeing mathematically degenerate cases defined, such as a spine of one point or more than one coincident points.

> 2) When the spine goes (0,0,0)-(0,1,0)-(0,0,0), what is the CSP?

First a flaw in the specification prose above:

	"If two points are coincident, they both have the same SCP."

is better expressed by something like

	"If two sequential points in a spine array are coincident, they both have the same SCP."

If we think the case you give can be generalized into a special-case definition, we should provide one.  Otherwise it should be covered in the degenerate definition.

> 3) When the spine goes (0,0,0)-(1,1,0)-(1,1,0)-(1,1,0)-(2,0,0), what is the CSP for the three middle points?

Hopefully the wording above covers this case of coincident points, at least for SCP (other animation issues may vary).  What do you think?

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