Vtksuperquadricsource: Create a polygon superquadratic surface centered on the origin. You can set the size. You can set the resolution of two (?) latitudes and the longitude (?) Direction ).The latitude round and longitude round parameters control the shape of the superquadratic surface. The Boolean value of the ring determines whether to generate a circular superquadratic surface. If yes, the thickness parameter controls the thickness of the ring: 0 is the thinnest ring, and 1 has the smallest size of the hole. The scale parameter allows scaling over a Quadratic Surface on X, Y, and Z (in any case, the normal vector is correctly generated. The size of the superquadratic surface controlled by the size parameter.
The principle is based on the "rigid physical-based superquadratic surface", Ah Bala, in the "graphic gem III", David Kirk, editor, Science Press, 1992.
Basic method:
Setcenter () sets the center point
The setthickness () thickness parameter controls the thickness of the ring: 0 is the thinnest ring, and 1 has the smallest size of the hole
Toroideon () Enable Ring
Setphiroundness () and setthetaroundness set the latitude and longitude Ring
Setscale () is set to the tensile coefficient of the superquadratic surface in the X, Y, and Z directions.
Example:
# -*-Coding: UTF-8 -*- # ------------------------------------------------------------------------------- # Name: module 2 # Purpose: ## Author: ankier ## Created: 12-12-2012 # Copyright: (c) ankier 2012 # Licence: <your licence> # ------------------------------------------------------------------------------- From Actorfactory Import Actorfactory From VTK Import * # # @ Detal produce superquadratic Surface Class Superquadricactorfactory (actorfactory ): Def _ Init __ (Self): actorfactory. _ Init __ (Self) self. _ Superquadricsource = Vtksuperquadricsource () Def _ Makeactors (Self): Self. _ Superquadricsource . Setcenter (0, 0, 0) self. _ Superquadricsource . Setthickness (0.8 ) Self. _ Superquadricsource . Setsize (20 ) Self. _ Superquadricsource . Toroideon () self. _ Superquadricsource . Setphiroundness (10 ) Self. _ Superquadricsource . Setthetaroundness (1 ) Self. _ Superquadricsource . Setscale (1, 0.5, 1 ) Polydatamapper = Vtkpolydatamapper () polydatamapper. setinput (self. _ Superquadricsource . Getoutput () actor =Self. _ newactor () actor. setmapper (polydatamapper) actor. getproperty (). setcolor (( 1.0, 0.7, 0.2 )) Return [Actor] Def _ Del __ (Self ): Del Self. _ Superquadricsource
Running effect: