Dear all,
I am trying to construct a closed polygonal surface from some scattered
points in 3D space. The IDL routine SURFACE won't work in this case, since
it doesn't handle a closed surface. I am trying to TRIANGULATE the lon,
and lat in spherical coordinate as following,
-------------------------------------
; Create array to hold vertices
vertexlist = dblarr(3, 200)
; Create some random longitude points:
vertexlist[0, *] = RANDOMU(seed, 200) * 360. - 180.
; Create some random latitude points:
vertexlist[1, *] = RANDOMU(seed, 200) * 180. - 90.
; Set z to uniform value
vertexlist[2, *] = 300
Triangulate, vertexlist[0, *], vertexlist[1, *], $
tri,CONNECTIVITY=connect,/degrees
vertex = CV_COORD(From_Sphere=vertexlist, /To_Rect, /degrees)
oSurf = OBJ_NEW('IDLgrPolygon', vertex, polygon=connect, STYLE=2, $
SHADING=1, COLOR=[0,20,255])
oGroup = OBJ_NEW('IDLgrModel')
oGroup->Add, oSurf
XOBJVIEW,oGroup
---------------------------------------------
In the above example, the object is surposely a sphere, however the
resulting 'sphere' has a very rough surface, looks like a diamond instead.
I am suspecting it is because of the incorrect connectivity, but I don't
how to correct them.
Another related problem, if I try to interpolate the date using TRIGID as
following, my IDL gave me error message in TRIANGULATE when I tried to
store SPHERE to a named variable myS.
--------------------------------------------
--> Triangulate, vertexlist[0, *], vertexlist[1, *], $
tri,CONNECTIVITY=connect,/degrees,FVALUE=myF,SPHERE=myS
^^^^^^^^^^
GS = [180.0/50.0,180.0/50.0]
limits = [0.0,0.0,360.0,180.0]
gridedData = TRIGRID( myF, GS,limits,SPHERE=myS, XGrid=xvector, $
YGrid=yvector, /DEGREES,/QUINTIC )
-------------------------------------------
The error message says,
% Attempt to store into an expression: <DOUBLE Array[1, 200]>.
Appreciate any help,hints,tips....
Chunlei
|