<html>
<head>
<meta content="text/html; charset=ISO-8859-2"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Agata,<br>
you need three points to uniquely define a plane in 3D space, two
points are not enough (there is infinitely many planes that pass
through the line defined by 2 points).<br>
To create a plane, set the origin and the normal vector. If you have
3 points that lie in the plane, p1, p2, p3, create 2 vectors, e.g.
p12, p23 and do a cross-product to create normal:<tt><br>
</tt><tt> double n[3]; // plane normal</tt><tt><br>
</tt><tt> vtkMath::Cross(p12, p23, n);</tt><tt><br>
</tt><tt> plane->SetOrigin(p1);</tt><tt><br>
</tt><tt> plane->SetNormal(n);</tt><tt><br>
</tt><br>
If you just need it for the cutter, you don't have to worry about
orientation of the plane.<br>
Best,<br>
Miro<br>
<br>
<br>
<div class="moz-cite-prefix">On 03/25/2014 01:44 PM, Agata Krasoñ
wrote:<br>
</div>
<blockquote
cite="mid:CAKKYitNC9MvNQLSSes5gTvnQicWTyPe3cS_XLoi611HwOSc=vw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-2">
<div dir="ltr">Hello,
<div><br>
</div>
<div><br>
</div>
<div>I have a question concering vtkPlane. I set two points and
I want to create a plane and use it in vtkCutter. Finally I
want to clip a mesh in this place.</div>
<div>Is there any possibility to to set two points and create
vtkPlane ?</div>
<div><br>
</div>
<div><b><font color="#ff0000"> double p1[3] = {26.4345,
12.3461, 15.3201};</font></b><br>
</div>
<div>
<div><b><font color="#ff0000"> double p2[3] = {22.496,
15.3133, 15.9631};</font></b></div>
</div>
<div><b><font color="#ff0000"><br>
</font></b></div>
<div>
<div><b><font color="#ff0000">
vtkSmartPointer<vtkPlane> plane =
vtkSmartPointer<vtkPlane>::New();</font></b></div>
<div><b><font color="#ff0000"> // plane->SetOrigin(0,0,0);</font></b></div>
<div><br>
</div>
<div> vtkSmartPointer<vtkCutter> cutter =
vtkSmartPointer<vtkCutter>::New();</div>
<div> cutter->SetCutFunction(plane);</div>
<div>
cutter->SetInputConnection(reader->GetOutputPort());</div>
<div> cutter->Update();</div>
<div><br>
</div>
<div>I would appreciate for any help please :)</div>
</div>
<div><br>
</div>
<div>Best,</div>
<div>Agata</div>
</div>
</blockquote>
<br>
</body>
</html>