<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hello,<br><br>Ok, here a simple code<br><br><br>// this is the futur cuted polydata..<br> vtkCubeSource * rectangle = vtkCubeSource::New();<br> <br>simpleCube->SetCenter(0,0,0);<br>simpleCube->SetXLength(150);<br>simpleCube->SetYLength(40);<br>simpleCube->SetZLength(100);<br><br><br>vtkBox * boxFunc = vtkBox::New();<br><br> // a 20x20x20 box.<br>// I displayed a vtkCubeSource with the same bounds and it clearly intersect with the rectangle...<br><br> double testBounds[6];<br> testBounds[0] = -10.0;<br> testBounds[1] = 10.0;<br> testBounds[2] = -10.0;<br> testBounds[3] = 10.0;<br> testBounds[4] = -10;<br> testBounds[5] = 10.0;<br><br> boxFunc->SetBounds(testBounds);<br><br> vtkExtractPolyDataGeometry * clipper3 = vtkExtractPolyDataGeometry::New();<br><br> clipper3->SetInput(simpleCube);<br> clipper3->SetImplicitFunction(boxFunc);<br> clipper3->ExtractInsideOn();<br> clipper3->Update();<br><br><br>// Rendering stuff...<br> vtkPolyDataMapper *map2 = vtkPolyDataMapper::New();<br> map2->SetInput(clipper2->GetOutput());<br><br> vtkActor* act2 = vtkActor::New();<br> act2->SetMapper(map2);<br> act2->SetProperty( this->CubeProperty);<br> this->CurrentRenderer->AddActor(act2);<br><br><br>And renctangle is not displated.... if I se tExtractInsideOff rectangle is displayed<br>but not cuted...<br><br>Regards,<br>Adeline<br><br><br><hr id="stopSpelling">Subject: Re: [vtkusers] vtkClipPolyData with vtkBox doesn't work<br>From: emonson@cs.duke.edu<br>Date: Fri, 15 Jan 2010 10:10:00 -0500<br>CC: vtkusers@vtk.org<br>To: adeline_joli@hotmail.com<br><br>
<base>Hello Adeline,<div><br></div><div>(Please reply to the whole list so others can help if they have ideas, too.)</div><div><br></div><div>Okay, if setting the bounds manually doesn't work, maybe you can post a more complete code sample and someone will be able to play with it or spot the problem.</div><div><br></div><div>Good luck,</div><div>-Eric</div><div><br></div><div><br><div><div>On Jan 15, 2010, at 5:00 AM, Adeline Joliet wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="ecxhmmessage" style="font-size: 10pt; font-family: Verdana;">Hello Eric,<br><br>Thank's for the answer.<br><br>"So, are you seeing nothing when you render your scene?"<br>Actually no, nothing appends my Polydata is not "cuted" it's exactly the same size<br><br>Then I tried InsideOutOn() and now nothing is dislplayed.<br><br>I don't know where I can be wrong.. I will try again to set the bounds manually, but not sure that's the problem..<br><br>Regards,<br>Adeline<br><hr id="ecxstopSpelling">Subject: Re: [vtkusers] vtkClipPolyData with vtkBox doesn't work<br>From:<span class="ecxApple-converted-space"> </span><a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a><br>Date: Thu, 14 Jan 2010 14:28:52 -0500<br>CC:<span class="ecxApple-converted-space"> </span><a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:adeline_joli@hotmail.com">adeline_joli@hotmail.com</a><br><br>Hello Adeline,<div><br></div><div>So, are you seeing nothing when you render your scene? One thing to be careful of when using a box for your clip function is which direction the default normals of the box faces point -- this defines whether the clip leaves the inside intact or cuts out the inside of the box. Maybe this isn't the problem you're having, but you could try setting </div><div><br></div><div>clipper->InsideOutOn();</div><div><br></div><div>and see if anything shows up.</div><div><br></div><div>Otherwise, there are examples of clipping with the vtkBoxWidget and it's GetPlanes method in {vtksource}/Widgets/Testing/Cxx/BoxWidget.cxx and {vtksource}/Examples/GUI/Python/BoxWidget.py in case those could help you track down the problem or approach it in another way. </div><div><br></div><div>Talk to you later,</div><div>-Eric</div><div><br></div><div><div><span class="ecxecxApple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><br class="ecxecxwebkit-block-placeholder"></div></span></div><br><div><div>On Jan 14, 2010, at 12:29 PM, Adeline Joliet wrote:</div><br class="ecxecxApple-interchange-newline"><blockquote><span class="ecxecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="ecxecxhmmessage" style="font-size: 10pt; font-family: Verdana;">Hello,<br><br>I'm trying to cut un polydata using vtkClipPolyData with a vtkBox as implicit function.<br><br>my Polydata is simply a rectangle (x = 100, y = 50, z= 20). I'd like to cut this rectangle to obtain<br>only the part of the middle.. (so i'd like to cut to a right side AND a left side...)<br><br>here is the code<br><br> vtkBox * cuting = vtkBox::New();<br> double boundy[6];<br><br> //m_image is a vtkImageData that represent a cube (my rectangle polydata interect this cube, so the bounds should be correct...)<br> m_image->GetBounds(boundy);<br><br> cuting->SetBounds(boundy);<br> <br>vtkClipPolyData * clipper = vtkClipPolyData::New();<br>clipper->SetInput(newPolyData);<br>clipper->SetClipFunction(cuting);<br><br>// and then I display clipper->GetOutput...<br><br>the thing is that i tried with vtkPlane and it works... but the problem is that i need if a use<br>vtkPlane I can cut only One side....<br><br><br>any help would be appreciated,<br>Than's<br><br>Adeline<br><br><hr>Windows 7 : Trouvez le PC qui vous convient!<span class="ecxecxApple-converted-space"> </span><a href="http://clk.atdmt.com/FRM/go/181574577/direct/01/">Découvrez notre offre !</a>_______________________________________________<br>Powered by<span class="ecxecxApple-converted-space"> </span><a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at:<a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></span></blockquote></div><br></div><br><hr>Faites une bonne action avec Bing Solidaire !<span class="ecxApple-converted-space"> </span><a href="http://www.bingsolidaire.com">C'est ici !</a></div></span></blockquote></div><br></div>                                            <br /><hr />Vous cherchez l'intégrale des clips de Michael Jackson ? <a href='http://www.bing.com/videos/search?q=Michael+Jackson&FORM=MVDE6' target='_new'>Bing ! Trouvez !</a></body>
</html>