[vtkusers] A question about surface cutting
Amy Squillacote
ahs at cfdrc.com
Wed May 7 09:55:03 EDT 2008
Hi Andrea,
Did you try calling ExtractInsideOff() on your instance of
vtkExtractGeometry? The ExtractInside flag is supposed to determine
whether to extract the cells inside the implicit function (the default)
or outside (what I think you want).
- Amy
Andrea Bottino wrote:
> Hi everybody,
> I'd like to make a hole in a 3D surface. I have the contour of the
> part of the surface that must be removed (defined as a set of points).
> I was trying to use vtkExtractGeometry with vtkImplicitSelectionLoop
> to perform the cut, but what I get as result, is just the part of the
> object INSIDE the contour 8while I'd like to obtain the surface with
> the hole). I've checked the documentation and the examples but I
> couldn't find a way to tell that I want to keep the outside of the
> contour. The only way to obtain the desired result was to use
> vtkClipPolyData, which however is much slower than vtkExtractGeometry.
> Anybody knows how to solve the problem?
>
> This is an excerpt of the code I'm using
>
> // this extracts from the surface the internal part of the loop, I'd
> like to get the external part...
>
> vtkImplicitSelectionLoop* loop = vtkImplicitSelectionLoop::New();
> loop->SetLoop( contourPts );
> loop->SetAutomaticNormalGeneration(1);
>
> vtkExtractGeometry* extract = vtkExtractGeometry::New();
> extract->SetInputConnection( face->getModelSurface() );
> extract->SetImplicitFunction( loop );
>
> vtkConnectivityFilter* connect = vtkConnectivityFilter::New();
> connect->SetInputConnection(extract->GetOutputPort());
> connect->SetExtractionModeToClosestPointRegion();
> connect->SetClosestPoint( contourPts->GetPoint(0) );
>
> // to make a hole in the surface
>
> vtkClipPolyData* clipper = vtkClipPolyData::New();
> clipper->SetInputConnection(face->getModelSurface());
> clipper->SetClipFunction(loop);
> clipper->GenerateClipScalarsOn();
> clipper->GenerateClippedOutputOn();
> clipper->SetValue(0.5);
>
>
> best regards,
>
--
Amy Squillacote Phone: (256) 726-4839
Computer Scientist Fax: (256) 726-4806
CFD Research Corporation Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL 35805
More information about the vtkusers
mailing list