[vtkusers] how to implement selection of cells along a line (like autocad's fence)

Bill Lorensen bill.lorensen at gmail.com
Sun Apr 7 12:56:07 EDT 2013


This example:
http://itk.org/Wiki/VTK/Examples/Cxx/DataStructures/ModifiedBSPTreeExtractCells

illustrates how to extract cells intersected by a line.



On Fri, Apr 5, 2013 at 6:00 PM, Alex Malyushytskyy <alexmalvtk at gmail.com>wrote:

> Have you tried vtkModifiedBSPTree? It has IntersectWithLine version which
> returns multiple cells.
> virtual int<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a61569f2965b7a369eb10b6d75d410d11>vtkModifiedBSPTree::IntersectWithLine
> ( const double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>
>   *p1*[3],
>
> const double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>
>   *p2*[3],
>
> const double<http://www.vtk.org/doc/nightly/html/vtkVectorOperators_8h.html#a45c855d65dd0e2b57b08024500ff9159>
>   *tol*,
>
> vtkPoints <http://www.vtk.org/doc/nightly/html/classvtkPoints.html> *  *
> points*,
>
> vtkIdList <http://www.vtk.org/doc/nightly/html/classvtkIdList.html> *  *
> cellIds*
> )
>
> Alex
>
>
> On Fri, Apr 5, 2013 at 2:12 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>
>> I'm sorry. I should have said I have low confidence that
>> vtkOBBTree::IntersectWithLine will work. If it does not, it is a bug.
>>
>> Bill
>>
>>
>> On Fri, Apr 5, 2013 at 4:39 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>>
>>> David,
>>>
>>> In theory the vtkOBBTree::IntersectWithLine should do the job, but since
>>> that method has 0 test coverage and my preliminary testing indicates it
>>> only returns the first intersection.
>>>
>>> More investigation is required.
>>>
>>> Bill
>>>
>>>
>>>
>>> On Fri, Apr 5, 2013 at 2:54 PM, David Gobbi <david.gobbi at gmail.com>wrote:
>>>
>>>> Hi Andreas,
>>>>
>>>> Look at vtkOBBTree.  It has a method called InstersectWithLine that
>>>> can return the Ids of all of the cells that are intersected by a line.
>>>>
>>>>  - David
>>>>
>>>> On Fri, Apr 5, 2013 at 12:07 PM, Andreas Buykx <A.Buykx at tnodiana.com>
>>>> wrote:
>>>> > Hi all,
>>>> >
>>>> >
>>>> >
>>>> > I’m looking for a way to extract cells from an unstructured grid by a
>>>> > polyline selection, similar to what vtkImplicitSelectionLoop does for
>>>> a
>>>> > closed polygon. Is this something that can be implemented efficiently
>>>> with
>>>> > algorithms from VTK or should I write a custom algorithm?
>>>> >
>>>> >
>>>> >
>>>> > Thanks,
>>>> >
>>>> > Andreas Buykx
>>>> >
>>>> > Senior Software Engineer
>>>> >
>>>> >
>>>> >
>>>> > TNO DIANA BV
>>>> >
>>>> > Software Developers and Analysis Consultants for Civil and
>>>> Geotechnical
>>>> > Engineering
>>>> >
>>>> >
>>>> >
>>>> > Delftechpark 19a, 2628 XJ, Delft, The Netherlands
>>>> >
>>>> > Tel: +31 88 34262 15 (Direct) │ Tel: +31 88 34262 00 (Switchboard) │
>>>> +31 88
>>>> > 34262 99 (Fax)
>>>> >
>>>> > http://tnodiana.com
>>>> >
>>>> >
>>>> >
>>>> > …be green keep it on screen
>>>> >
>>>> >
>>>> >
>>>> > ____________________________________________________________
>>>> > TNO DIANA BV is a limited liability company registered in the trade
>>>> register
>>>> > of the Chamber of Commerce as TNO DIANA BV with registered number
>>>> 27252655.
>>>> > ____________________________________________________________
>>>> > This e-mail and its contents are subject to the DISCLAIMER at
>>>> > http://tnodiana.com/content/Disclaimer
>>>> > ____________________________________________________________
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>>
>>>
>>>
>>> --
>>> Unpaid intern in BillsBasement at noware dot com
>>>
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130407/d9f193c1/attachment.htm>


More information about the vtkusers mailing list