VTK vtkoutlinesource: Create a boundary box or a poly data with a radian Angle

Source: Internet
Author: User
Tags dashed line

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.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.