<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:EN-CA;}
span.co1
{mso-style-name:co1;}
span.sy0
{mso-style-name:sy0;}
span.me1
{mso-style-name:me1;}
span.br0
{mso-style-name:br0;}
span.nu0
{mso-style-name:nu0;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Good day.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I found this <a href="http://www.paraview.org/Wiki/VTK/Examples/Python/GeometricObjects/Display/Cell3DDemonstration">
example code</a>:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> # Create the points<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> points = vtk.vtkPoints()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> points.InsertNextPoint(0.0, 0.0, 0.0)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> points.InsertNextPoint(1.0, 0.0, 0.0)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> points.InsertNextPoint(1.0, 1.0, 0.0)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> points.InsertNextPoint(0.0, 1.0, 0.0)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> … … …</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA">which had me wonder if there is a way to assign data in a vectorized fashion instead of point by point?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA">Let’s say I can read in 3 1D arrays (vectors) with X, Y, Z data or one 2D array (matrix, dataframe) with the same data in columns, is there a way to assign that data to the points all at once instead
of iteratively?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> points = vtk.vtkPoints()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-CA"> points.InsertNextPoint(X, Y, Z) - just saying; this is obviously not correct!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-fareast-language:EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA">Obviously, any data could be combined and reshaped first to whatever format required ….<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA">Given that ParaView/VTK was designed to work with (very) large data sets I’d be surprised if there were no vectorized operations implemented.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-CA">Thanks, Chris </span>
<span style="mso-fareast-language:EN-CA"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>