comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: QHULL connectivity list - sorting possible?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: QHULL connectivity list - sorting possible? [message #77019] Tue, 26 July 2011 10:53
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Sorry for the text wrapping. Let's try that again, with a bonus: copy
and paste at the command prompt for the full demo:

vList = RandomU(seed, 3, 100) ; Random points
QHull, vList, tri ; tri becomes (3, nTri)
nTri = N_Elements(tri)/3
pList = [Replicate(3, [1, nTri]), tri] ; Prepend column of '3's
oMesh = Obj_New('IDLgrPolygon', vList, Polygons=pList)
XObjView, oMesh ; Show the lump of coal!

Cheers,
-Dick

Dick Jackson Software Consulting
Victoria, BC, Canada --- +1-250-220-6117
dick@d-jackson.com --- http://www.d-jackson.com


On Jul 26, 10:38 am, Dick Jackson <d...@d-jackson.com> wrote:
> Hi,
>
> This may be what you need. QHull returns nothing but triangle vertex
> indices, while IDL generally uses a more generic connectivity list.
> Starting with vList, a (3, nVertices) array of XYZ points...
>
>          QHull, vList, tri                         ; tri becomes (3,
> nTri)
>          nTri = N_Elements(tri)/3
>          pList = [Replicate(3, [1, nTri]), tri]    ; Attach column of
> '3' values
>          oMesh = Obj_New('IDLgrPolygon', vList, Polygons=pList)
>
> Cheers,
> -Dick
>
> Dick Jackson Software Consulting
> Victoria, BC, Canada --- +1-250-220-6117
> d...@d-jackson.com   ---http://www.d-jackson.com
>
> On Jul 26, 6:59 am, asp <ayl...@gmail.com> wrote:
>
>
>
>
>
>
>
>> Hi all,
>
>> I am trying to apply QHULL to a thresholded volume and then use the
>> result to create a mesh object. While I have been able to use MESH_OBJ
>> with the results from QHULL the resultant object is a mess. I am
>> thinking this may be due to the fact that the connectivity list in
>> QHULL is not ordered. This is unlike TRIANGULATE, which does provide
>> an ordered adjacency list. Does anyone have a suggestion for how to
>> order the connectivity list from QHULL, or does anyone have a
>> suggestion for another way I might go about doing this?
>
>> Thanks!
Re: QHULL connectivity list - sorting possible? [message #77020 is a reply to message #77019] Tue, 26 July 2011 10:46 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Let's try that again. Sorry for the text-wrapping, and here's a bonus.
Copy and paste into the command line for the full demo:

vList = RandomU(seed, 3, 100) ; Random points
QHull, vList, tri ; tri becomes (3,nTri)
nTri = N_Elements(tri)/3
pList = [Replicate(3, [1, nTri]), tri] ; Attach column of '3's
oMesh = Obj_New('IDLgrPolygon', vList, Polygons=pList)
XObjView, oMesh ; See the lump of coal!

Cheers,
-Dick

Dick Jackson Software Consulting
Victoria, BC, Canada --- +1-250-220-6117
dick@d-jackson.com --- http://www.d-jackson.com

On Jul 26, 10:38 am, Dick Jackson <d...@d-jackson.com> wrote:
> Hi,
>
> This may be what you need. QHull returns nothing but triangle vertex
> indices, while IDL generally uses a more generic connectivity list.
> Starting with vList, a (3, nVertices) array of XYZ points...
>
>          QHull, vList, tri                         ; tri becomes (3,
> nTri)
>          nTri = N_Elements(tri)/3
>          pList = [Replicate(3, [1, nTri]), tri]    ; Attach column of
> '3' values
>          oMesh = Obj_New('IDLgrPolygon', vList, Polygons=pList)
>
> Cheers,
> -Dick
>
> Dick Jackson Software Consulting
> Victoria, BC, Canada --- +1-250-220-6117
> d...@d-jackson.com   ---http://www.d-jackson.com
>
> On Jul 26, 6:59 am, asp <ayl...@gmail.com> wrote:
>
>
>
>
>
>
>
>> Hi all,
>
>> I am trying to apply QHULL to a thresholded volume and then use the
>> result to create a mesh object. While I have been able to use MESH_OBJ
>> with the results from QHULL the resultant object is a mess. I am
>> thinking this may be due to the fact that the connectivity list in
>> QHULL is not ordered. This is unlike TRIANGULATE, which does provide
>> an ordered adjacency list. Does anyone have a suggestion for how to
>> order the connectivity list from QHULL, or does anyone have a
>> suggestion for another way I might go about doing this?
>
>> Thanks!
Re: QHULL connectivity list - sorting possible? [message #77021 is a reply to message #77020] Tue, 26 July 2011 10:38 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi,

This may be what you need. QHull returns nothing but triangle vertex
indices, while IDL generally uses a more generic connectivity list.
Starting with vList, a (3, nVertices) array of XYZ points...

QHull, vList, tri ; tri becomes (3,
nTri)
nTri = N_Elements(tri)/3
pList = [Replicate(3, [1, nTri]), tri] ; Attach column of
'3' values
oMesh = Obj_New('IDLgrPolygon', vList, Polygons=pList)

Cheers,
-Dick

Dick Jackson Software Consulting
Victoria, BC, Canada --- +1-250-220-6117
dick@d-jackson.com --- http://www.d-jackson.com

On Jul 26, 6:59 am, asp <ayl...@gmail.com> wrote:
> Hi all,
>
> I am trying to apply QHULL to a thresholded volume and then use the
> result to create a mesh object. While I have been able to use MESH_OBJ
> with the results from QHULL the resultant object is a mess. I am
> thinking this may be due to the fact that the connectivity list in
> QHULL is not ordered. This is unlike TRIANGULATE, which does provide
> an ordered adjacency list. Does anyone have a suggestion for how to
> order the connectivity list from QHULL, or does anyone have a
> suggestion for another way I might go about doing this?
>
> Thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: QHULL connectivity list - sorting possible?
Next Topic: difference between PLOT/OPLOT and PLOTS

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:43:42 PDT 2025

Total time taken to generate the page: 0.00898 seconds