<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div><br><div><div>On May 13, 2010, at 9:26 PM, luc scholtes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Excellent! <br><br>This is exactly what I needed even if it is not really direct though... Does someone know if there is a way to "automatize" this procedure, as with a custom glyph? I tried to make a Custom Glyph but without any success (probably missed all the steps necessary for such a combination). Or maybe I could include the rotation of 90 degrees around Y-axis during the recording of my data... <br>
<br>Cheers<br><br> Luc<br><br><div class="gmail_quote">2010/5/13 Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;">Hey Luc,<div><br></div><div>Ah, I see. I'd actually never looked at which way the 2D glyphs are oriented. Interesting.</div><div><br></div><div>So with a slightly more complicated pipeline you can do it. From Sources create a 2D Glyph source. Apply a Transform filter to that, which only has a rotation of 90 degrees around the Y-axis. Then from your data, apply the Glyph With Custom Source filter, and when it pops up the dialog for choosing each, choose your data for Input and the Transform filter for Source.</div>
<div><br></div><div>Seems like there should be an easier way of doing this, but it works. (see screen shot)</div><div><br></div><div>Talk to you later,</div><div>-Eric</div><div><br></div><div><span><alt_circles.png></span></div>
<div><br><div><div><div></div><div class="h5"><div>On May 12, 2010, at 6:59 PM, luc scholtes wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="h5">Thank you Eric, but I was probably not as clear as I thought. I have already seen that a 2D glyphs can be oriented given a defined vector, but, actually, I was wondering if we can make the 2D plane perpendicular/normal to this vector, as in the attached picture.<br>
<br>Hope it is clearer now<br><br>Regards<br><br> Luc<br><br><div class="gmail_quote">2010/5/12 Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu" target="_blank">emonson@cs.duke.edu</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hey Luc,<br>
<br>
If I understand you correctly, you want 2D glyphs on your points, but you want them oriented according to the normal vectors you've read from your file?<br>
<br>
If you apply the Glyph filter to your data set, and then choose 2D Glyph from the Glyph Type combo-box, then you can set the type of 2d glyphs to Circle. If you want them to be oriented by the normals you've calculated, then just make sure the Orient check-box is checked, and your normals are chosen in the Vectors combo-box. I'll attach an example screen shot of the output so you can see if this is what you're looking for. (Note, I've also checked Filled to fill in the circles, but this isn't necessary.)<br>
<br>
If I'm misunderstanding your question, feel free to rephrase it and we'll try again. :)<br>
<br>
-Eric<br>
<br>
------------------------------------------------------<br>
<font color="#888888">Eric E Monson<br>
Duke Visualization Technology Group<br>
<br>
</font><br><br>
On May 12, 2010, at 2:25 AM, luc scholtes wrote:<br>
<br>
> Hi all,<br>
><br>
> I am new to Paraview and I could not find any clear information on how 2D glyphs are oriented. Is there a way to control their normals to the the 2D plane?<br>
><br>
> Here is the code I use to generate a cloud of points from a text file to which I would like to assign different filters (it can be 3D or 2D, but circles oriented by their normals would be perfect...)<br>
><br>
> /// here is the part to recover the data<br>
> std::ifstream file ("cracks.txt",std::ios::in);<br>
> if(file){<br>
> while ( !file.eof() ){<br>
> std::string line;<br>
> Real p0,p1,p2,s,o0,o1,o2;<br>
> while ( std::getline(file, line) ){<br>
> file >> p0 >> p1 >> p2 >> s >> o0 >> o1 >> o2;<br>
> vtkIdType pid[1];<br>
> pid[0] = crackPos->InsertNextPoint(p0, p1, p2);<br>
> crackCells->InsertNextCell(1,pid);<br>
> crackSize->InsertNextValue(s);<br>
> float n[3] = { o0,o1,o2 };<br>
> crackOri->InsertNextTupleValue(n);<br>
> }<br>
> }<br>
> file.close();<br>
> }<br>
><br>
> /// here is the code to create the VTK file<br>
> vtkSmartPointer<vtkUnstructuredGrid> crackUg = vtkSmartPointer<vtkUnstructuredGrid>::New();<br>
> crackUg->SetPoints(crackPos);<br>
> crackUg->SetCells(VTK_VERTEX, crackCells);<br>
> crackUg->GetPointData()->AddArray(crackSize);<br>
> crackUg->GetPointData()->AddArray(crackOri);<br>
><br>
> vtkSmartPointer<vtkXMLUnstructuredGridWriter> writer = vtkSmartPointer<vtkXMLUnstructuredGridWriter>::New();<br>
> string fn=fileName+"cracks."+lexical_cast<string>scene->currentIteration)+".vtu";<br>
> writer->SetFileName(fn.c_str());<br>
> writer->SetInput(crackUg);<br>
> writer->Write();<br>
><br>
> Do you have any advice?<br>
><br>
> Tahnks a lot in advance<br>
><br>
> Luc<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br>
<br></blockquote></div><br>
</div></div><span><CircleOrientation></span></blockquote></div><br></div></div></blockquote></div><br>
</blockquote></div><br></div></body></html>