<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<STYLE>BODY {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana
}
PRE {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
BLOCKQUOTE {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
A {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
MENU {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DD {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
UL {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DT {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DIR {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
ADDRESS {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
H5 {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
H6 {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
HR {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
P {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
TD {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
TR {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
P.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
LI.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DIV.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
LI {
        MARGIN-TOP: 3pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 3pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
UL {
        MARGIN-TOP: 3pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 3pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
OL {
        MARGIN-TOP: 3pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 3pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
H1 {
        FONT-SIZE: 16pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-FAMILY: Verdana,Arial,sans-serif
}
H2 {
        FONT-SIZE: 14pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-STYLE: italic; FONT-FAMILY: Verdana,Arial,sans-serif
}
H3 {
        FONT-SIZE: 12pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-FAMILY: Verdana,Arial,sans-serif
}
H4 {
        FONT-SIZE: 11pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-FAMILY: Verdana,Arial,sans-serif
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.7600.16671"></HEAD>
<BODY style="FONT-FAMILY: Verdana; COLOR: #000000; FONT-SIZE: 10pt" id=ridBody 
background="">
<DIV dir=ltr align=left> </DIV>
<DIV><SPAN class=577190907-24112010>Hi</SPAN></DIV>
<DIV><SPAN class=577190907-24112010></SPAN> </DIV>
<DIV><SPAN class=577190907-24112010>I wrote an application where a user can 
paint 2d polygons in 3D space. Then the user can define a cutting plane and i 
display the resulting lines. </SPAN></DIV>
<DIV><SPAN class=577190907-24112010>The problem is that SOMETIMES the 
cutting does not work, so if anyone replys i will send him the Test1.vtk file 
which contains 4 Polygons whereby only three are cutted. (Yes the cutting plane 
defenetly cuts all polygons and there are 4 Polygons in the input file, see 
first visualization).</SPAN></DIV>
<DIV><SPAN class=577190907-24112010></SPAN> </DIV>
<DIV><SPAN class=577190907-24112010>here my code:</SPAN></DIV>
<DIV><SPAN class=577190907-24112010></SPAN> </DIV>
<DIV><SPAN class=577190907-24112010><FONT size=2>
<P>vtkSmartPointer<vtkPolyDataReader> oReader = 
vtkPolyDataReader::New();</P>
<P>oReader->SetFileName(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 
size=2>"C:\\Test1.vtk"</FONT></FONT><FONT size=2>);</P>
<P>oReader->Update();</P>
<P>vtkSmartPointer<vtkPolyData> oPolyData = oReader->GetOutput();</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//Display input 
data, not important</P></FONT></FONT><FONT size=2>
<P>{</P>
<P>vtkSmartPointer<vtkPolyDataMapper> oMapper = 
vtkPolyDataMapper::New();</P>
<P>oMapper->SetInputConnection(oReader->GetOutputPort());</P>
<P>vtkSmartPointer<vtkActor> oActor = vtkActor::New();</P>
<P>oActor->SetMapper( oMapper );</P>
<P>vtkSmartPointer<vtkRenderer> oRenderer = vtkRenderer::New();</P>
<P>vtkSmartPointer<vtkRenderWindow> oRenderWindow = 
vtkRenderWindow::New();</P>
<P>oRenderWindow->AddRenderer(oRenderer);</P>
<P>vtkSmartPointer<vtkRenderWindowInteractor> oIRen = 
vtkRenderWindowInteractor::New();</P>
<P>oIRen->SetRenderWindow(oRenderWindow);</P>
<P>oRenderer->AddActor(oActor);</P>
<P></P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Render and 
interact</P></FONT></FONT><FONT size=2>
<P>oRenderWindow->Render();</P>
<P>oIRen->Initialize();</P>
<P>oIRen->Start();</P>
<P>}</P>
<P>oPolyData->Print(std::cout); </FONT><FONT color=#008000 size=2><FONT 
color=#008000 size=2>//containing 4 polygons</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//Cut 2D 
polygons in 3D space with a plane</P></FONT></FONT><FONT size=2>
<P>vtkSmartPointer<vtkPlane> oPlane = vtkPlane::New();</P>
<P>vtkSmartPointer<vtkCutter> oCutter = vtkCutter::New();</P>
<P>oCutter->SetCutFunction(oPlane);</P>
<P>oCutter->GenerateValues(1,0,1); </FONT><FONT color=#008000 size=2><FONT 
color=#008000 size=2>//i am not sure why i do that</P></FONT></FONT><FONT 
size=2>
<P>oPlane->SetOrigin(8.5, -72, -1177.0);</P>
<P>oPlane->SetNormal(1,0,0);</P>
<P>oCutter->SetInput(oPolyData);</P>
<P>oCutter->Update();</P>
<P>vtkSmartPointer<vtkPolyData> oCuttedPolyData = 
oCutter->GetOutput();</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//Display 
cutting data, not important </P></FONT></FONT><FONT size=2>
<P>{</P>
<P>vtkSmartPointer<vtkPolyDataMapper> oMapper = 
vtkPolyDataMapper::New();</P>
<P>oMapper->SetInputConnection(oCutter->GetOutputPort());</P>
<P>vtkSmartPointer<vtkActor> oActor = vtkActor::New();</P>
<P>oActor->SetMapper( oMapper );</P>
<P>vtkSmartPointer<vtkRenderer> oRenderer = vtkRenderer::New();</P>
<P>vtkSmartPointer<vtkRenderWindow> oRenderWindow = 
vtkRenderWindow::New();</P>
<P>oRenderWindow->AddRenderer(oRenderer);</P>
<P>vtkSmartPointer<vtkRenderWindowInteractor> oIRen = 
vtkRenderWindowInteractor::New();</P>
<P>oIRen->SetRenderWindow(oRenderWindow);</P>
<P>oRenderer->AddActor(oActor);</P>
<P></P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Render and 
interact</P></FONT></FONT><FONT size=2>
<P>oRenderWindow->Render();</P>
<P>oIRen->Initialize();</P>
<P>oIRen->Start();</P>
<P>}</P></FONT></SPAN></DIV></BODY></HTML>