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

Home » Public Forums » archive » Creating mesh from XYZ points
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Creating mesh from XYZ points [message #83663 is a reply to message #83523] Wed, 13 March 2013 22:58 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi Mairan,

TRIANGULATE will work well on a set of 2-D points, so we'll need another trick for your XYZ points.


Option 1: Two convex hulls

These look like two convex shapes that may or may not intersect (it looks like they do). Would it suffice to make two solid intersecting meshes? I'll assume you have (or can make) these arrays:

xyz1, a FltArr(3, nPts1) with XYZ values for mesh 1
xyz2, a FltArr(3, nPts2) with XYZ values for mesh 2


;; Random point sets that should make two intersecting lumps

xyz1 = RandomU(seed, 3, 100)
xyz2 = RandomU(seed, 3, 100)+0.7

QHull, xyz1, tri1
QHull, xyz2, tri2

;; Make connectivity arrays from list of triangles

conn1 = [Replicate(3, 1, (N_Elements(tri1)/3)), tri1]
conn2 = [Replicate(3, 1, (N_Elements(tri2)/3)), tri2]

oMesh1 = Obj_New('IDLgrPolygon', xyz1, Polygons=conn1, Style=2, Color=[255,0,0])
; You probably want to use Vert_Colors to add the colour information!
oMesh2 = Obj_New('IDLgrPolygon', xyz2, Polygons=conn2, Style=2, Color=[0,0,255])

XObjView, [oMesh1, oMesh2]


Option 2: Two meshes made by Mesh_Obj

If you are generating these points on a spherical grid or some other regular way, then you may be able to use Mesh_Obj to make each of the grids. If Option 1 didn't meet your needs, post more info on how the points are generated.

Speaking of Mesh_Obj, if anyone's looking for my code to make the animated GIF for my spinning-balloon-letters logo, I moved the link off of my home page to my website's "Other" page. See the logo at www.d-jackson.com (click for a big rendering) and the code is here:
http://www.d-jackson.com/images/djsclogo.pro


Cheers,
-Dick

Dick Jackson Software Consulting
Victoria, BC, Canada
www.d-jackson.com


On Wednesday, March 13, 2013 8:51:25 AM UTC-7, Mairan Teodoro wrote:
> Hi all!
>
> I would like some advise on how to create a mesh grid from a set of XYZ coordinates.
>
> Please, take a look at this figure to have an idea on what I'm talking about:
>
> https://dl.dropbox.com/u/6573328/sample.png
>
> The 3 plots show each of the points at their respective XYZ coordinate but I would like to show a "solid" structure with a surface and not a bunch of points.
>
> I tried using the TRIANGULATE/TRIGRID approach without achieving what I want. In fact, the figure in the following link is the result from this approach:
>
> https://dl.dropbox.com/u/6573328/sample2.png
>
> Thank you in advance for any help.
>
> Cheers,
>
> m.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: qualifying object classes on the fly
Next Topic: Re: qualifying object classes on the fly

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

Current Time: Sun Nov 30 05:28:44 PST 2025

Total time taken to generate the page: 0.09373 seconds