FreeMat
vtkSuperquadric

Section: Visualization Toolkit Filtering Classes

Usage

vtkSuperquadric computes the implicit function and function gradient for a superquadric. vtkSuperquadric is a concrete implementation of vtkImplicitFunction. The superquadric is centered at Center and axes of rotation is along the y-axis. (Use the superclass' vtkImplicitFunction transformation matrix if necessary to reposition.) Roundness parameters (PhiRoundness and ThetaRoundness) control the shape of the superquadric. The Toroidal boolean controls whether a toroidal superquadric is produced. If so, the Thickness parameter controls the thickness of the toroid: 0 is the thinnest allowable toroid, and 1 has a minimum sized hole. The Scale parameters allow the superquadric to be scaled in x, y, and z (normal vectors are correctly generated in any case). The Size parameter controls size of the superquadric.

This code is based on "Rigid physically based superquadrics", A. H. Barr, in "Graphics Gems III", David Kirk, ed., Academic Press, 1992.

To create an instance of class vtkSuperquadric, simply invoke its constructor as follows

  obj = vtkSuperquadric

Methods

The class vtkSuperquadric has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, obj is an instance of the vtkSuperquadric class.

  • string = obj.GetClassName ()
  • int = obj.IsA (string name)
  • vtkSuperquadric = obj.NewInstance ()
  • vtkSuperquadric = obj.SafeDownCast (vtkObject o)
  • double = obj.EvaluateFunction (double x[3])
  • double = obj.EvaluateFunction (double x, double y, double z)
  • obj.EvaluateGradient (double x[3], double g[3])
  • obj.SetCenter (double , double , double ) - Set the center of the superquadric. Default is 0,0,0.
  • obj.SetCenter (double a[3]) - Set the center of the superquadric. Default is 0,0,0.
  • double = obj. GetCenter () - Set the center of the superquadric. Default is 0,0,0.
  • obj.SetScale (double , double , double ) - Set the scale factors of the superquadric. Default is 1,1,1.
  • obj.SetScale (double a[3]) - Set the scale factors of the superquadric. Default is 1,1,1.
  • double = obj. GetScale () - Set the scale factors of the superquadric. Default is 1,1,1.
  • double = obj.GetThickness () - Set/Get Superquadric ring thickness (toroids only). Changing thickness maintains the outside diameter of the toroid.
  • obj.SetThickness (double ) - Set/Get Superquadric ring thickness (toroids only). Changing thickness maintains the outside diameter of the toroid.
  • double = obj.GetThicknessMinValue () - Set/Get Superquadric ring thickness (toroids only). Changing thickness maintains the outside diameter of the toroid.
  • double = obj.GetThicknessMaxValue () - Set/Get Superquadric ring thickness (toroids only). Changing thickness maintains the outside diameter of the toroid.
  • double = obj.GetPhiRoundness () - Set/Get Superquadric north/south roundness. Values range from 0 (rectangular) to 1 (circular) to higher orders.
  • obj.SetPhiRoundness (double e) - Set/Get Superquadric north/south roundness. Values range from 0 (rectangular) to 1 (circular) to higher orders.
  • double = obj.GetThetaRoundness () - Set/Get Superquadric east/west roundness. Values range from 0 (rectangular) to 1 (circular) to higher orders.
  • obj.SetThetaRoundness (double e) - Set/Get Superquadric east/west roundness. Values range from 0 (rectangular) to 1 (circular) to higher orders.
  • obj.SetSize (double ) - Set/Get Superquadric isotropic size.
  • double = obj.GetSize () - Set/Get Superquadric isotropic size.
  • obj.ToroidalOn () - Set/Get whether or not the superquadric is toroidal (1) or ellipsoidal (0).
  • obj.ToroidalOff () - Set/Get whether or not the superquadric is toroidal (1) or ellipsoidal (0).
  • int = obj.GetToroidal () - Set/Get whether or not the superquadric is toroidal (1) or ellipsoidal (0).
  • obj.SetToroidal (int ) - Set/Get whether or not the superquadric is toroidal (1) or ellipsoidal (0).