From: tedd <tedd@...>

Date: Fri, 21 May 1999 11:37:10 -0400

Date: Fri, 21 May 1999 11:37:10 -0400

Robert: >Then I have the below C structure to deal with. I am unsure what is going >on below with the pointers and such. If anyone could convert these to the >appropriate records and arrays such that it covers all that is shown below, >I would appreciate it. I get confused somewhere around the pxyz array >thing, because I don't see it being set up as the structs are. I am trying >to port a Delaunay Triangulation FN to FutureBasic. Assuming I can get it >working I will post note of it to the list at that time. I think it should >be straightforward enough to do once I get the appropriate data structures >set up. > >'Begin C stuff: > . >typedef struct { > double x,y,z; >} XYZ; >typedef struct TRIANGLE { > long p1,p2,p3; >} TRIANGLE; >typedef struct EDGE { > long p1,p2; >} EDGE; The translation is--- DIM RECORD xyz DIM x# DIM y# DIM z# END RECORD .sizeXYZ DIM myXYZ.sizeXYZ DIM RECORD triangle DIM x& DIM y& DIM z& END RECORD .sizeTRIANGLE DIM myTRIANGLE.sizeTRIANGLE DIM RECORD edge DIM p1& DIM p2& END RECORD .sizeEDGE DIM myEDGE.sizeEDGE --- >'Takes as input NV vertices in array pxyz >'Returned is a list of ntri triangular faces in the array v > >void triangulate(nv,pxyz,v,ntri) >long nv; >XYZ *pxyz; >TRIANGLE *v; >long *ntri; The above simply define a function similar to: LOCAL FN triangulate(nv,pxyz,v,ntri) DIM nv& The other three variables are pointers, like: DIM ntri DIM ptrNTRI ptrNTRI = VARPTR(ntri) 'where ptrNTRI is the same as *ntri above. The other two things, namely -- XYZ *pxyz; TRIANGLE *v; -- are DIMing pointers. For example, *pxyz is a pointer to a structure of XYZ -- similar to doing a VARPTR(myXYZ) -- using the above FB structures. Hope this helps. -- My C is a bit rusty. tedd ___________________________________________________________________ <mailto:tedd@...> http://sperling.com/