Skip to content

Fixing the triangulation of the Parametric Surfaces.

@lorensen noticed that the front face of orientable surfaces was being displayed as a back face. This arose as a "hack" when these functions were first implemented because the cross-product used to create the normals was right-handed, thus the triangulation orientation was clockwise. Additionally there were weird triangulations in the ParametricSuperEllipsoid and ParametricSuperToroid.

The following fixes have been applied:

  1. The orientation of the normals is fixed in the case of anti-clockwise ordering by calculating cross(Dv,Du) instead of cross(Du,Dv). When this is done the normals point in the expected direction and the front face is rendered correctly. See: vtkParametricFunctionSource.cxx.
  2. All the surfaces now implement anti-clockwise ordering with respect to the triangulation.
  3. The ParametricSuperEllipsoid and ParametricSuperToroid have been reworked, now the surface is constructed as four pieces that are abutted together, this removes the triangulations resulting in weird appearances.
  4. In order to implement the anti-clockwise ordering in the triangulation the x, y points have had to be swapped in a few cases.
  5. TestParametricFunctions.png has had to be replaced. The images for ParametricTorus, ParametricSuperEllipsoid and ParametricSuperToroid changed as a result of the above changes.

Merge request reports