Python Visual TVTK Cubesource pipeline First Use

Source: Internet
Author: User

The Cubesource object is a box data source object. This time a box object is displayed based on the successful installation of the TVTK library. With the following code, we set up a box data source with a length-width height of 1.0,2.0,3.0 and display it through the pipeline.

 fromTvtk.apiImportTvtk#Import TVTK Librarys = tvtk. Cubesource (x_length=1.0,y_length=2.0,z_length=3.0)#Create a box data source and set the length -to-width heightm = tvtk. Polydatamapper (input_connection=s.output_port)#convert Cubesource data to graph dataA = TVTK. Actor (mapper=m)#create an action entity actorR = tvtk. Renderer (background= (0,0,0))#renderer background is (0,0,0)R.add_actor (a)#Create a renderer render to add the actor inW = tvtk. Renderwindow (size= (300,300))#create a drawing window size is 300*300W.add_renderer (R)#Add the created render to the windowi = TVTK. Renderwindowinteractor (RENDER_WINDOW=W)#Create an interactive tooli.initialize () I.start ( )" "displays a box that is converted from the raw data to an image on the screen, which is done together by the TVTK object tvtk.cubesource: Box data source TVTK. Polydatamapper: Graphical data Object TVTK. Actor:action entity Object tvtk.renderer: Renderer TVTK. Renderwindow: Draws the Window object TVTK. Renderwindowinteractor: Interactive tool window in TVTK, the process of coordinating the completion of work between objects called pipelines (Pipeline)" "
" " pipeline technology is also called pipelining Technology (Pipeline) Each object is only a relatively simple task, the entire pipeline for complex visualization in TVTK is divided into visual pipeline and graphical pipeline    visualization pipeline (visualization Pipeline): Process of processing raw data into graphical data graphics    pipeline (Pipeline): Graphics data visualization is divided into five modules:    data module, data pre-processing module, data mapping module, Draw the module and display module. The        first two parts are the two objects that the visualization pipeline relates to a            visual pipeline:                TVTK. Cubesource Data Objects and Tvtk.polydatamapper graphic objects        The following three parts are            four TVTK objects related to the graphics pipeline:                actor Entity object,                renderer render Scene Object                Renderwindow Graphics Window objects                for rendering Renderwindowinteractor user Interaction Object " "

The code above is also interesting to run (for someone I've contacted for a while).

It displays a box object that can control its rotation and size with the mouse

Here's how the Python shell works

The use of other Python pipeline objects may continue to be attempted later on

Python Visual TVTK Cubesource pipeline First Use

Related Article

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.