Vtkoutlinesource creates a box with a dashed line shape. The setbounds () method can be used to set the length, height, and width of the boundary box. You can use the setcorners () method to set the arc shape of the corner.
Example:
#-*-Coding: UTF-8-*-# outputs # Name: outlineactorfactory package # purpose: Create a line through two points # Author: ankier # created: 08-12-2012 # copyright: (c) ankier 2012 # licence: <your licence> # revoke from actorfactory import actorfactory from VTK import * ##@ a in a straight line of brief Ctor factoryclass outlineactorfactory (actorfactory): def _ init _ (Self): actorfactory. _ init _ (Self) self. _ outlinesource = vtkoutlinesource () def _ del _ (Self): del self. _ outlinesource # @ brief updates the poly data def _ updatedata (Self): Self. _ outlinesource. setbounds (-20, 20,-32.5, 32.5,-50, 50) # self. _ outlinesource. setboxtypetooriented () # Set the starting point of the box to the origin. Rotate the box around the origin. # Self. _ outlinesource. generatefaceson () # Set the production surface # self. _ outlinesource. setcorners ([2, 6, 7, 8, 9, 10, 15, 20, 2, 6, 7, 8, 9, 10, 15, 20, 2, 6, 7, 8, 9, 10, 15, 20]) ### @ brief override the base class method # See actorfactory. _ makeactors def _ makeactors (Self): Self. _ updatedata () polydatamapper = vtkpolydatamapper () polydatamapper. setinputconnection (self. _ outlinesource. getoutputport () actor = self. _ newactor () actor. setmapper (polydatamapper) actor. getproperty (). setcolor (1, 0, 0.3) del polydatamapper return [Actor]
Running result:
Use the generatefaceson () method to enable the production Surface
Effect:
Use setboxtypetooriented () and setcorners () to set radians.