Physical 3-D from LOLA GDR IMG or JP2 |
Physical 3-D from LOLA GDR IMG or JP2 |
![]()
Post
#1
|
|
Junior Member ![]() ![]() Group: Members Posts: 23 Joined: 6-November 09 Member No.: 5017 ![]() |
Admittedly I'm way behind the curve in both understanding and computing horsepower when it comes to the LOLA IMG and JP2 files. I've been able to work with some of the lower resolution files to make pretty pictures, but making the jump to physical 3-D boggles me. While waiting to hear back from some folks I worked with before on turning MOLA data into rapid prototype models, I was curious about whether any posters here can say how to take an LDEM/GDR type file and make it into STL. Can it be done? Would a different LOLA file be better? Thanks.
Rick |
|
|
![]() |
![]()
Post
#2
|
|
Junior Member ![]() ![]() Group: Members Posts: 23 Joined: 6-November 09 Member No.: 5017 ![]() |
Erwan - Thank you; yes, I believe I could use the code. I've got the ear of the STL folks who helped produce the 22" Valles Marineris model for me in 2006 from the MOLA data, and they know Matlab.
|
|
|
![]()
Post
#3
|
|
Junior Member ![]() ![]() Group: Members Posts: 22 Joined: 20-June 09 Member No.: 4830 ![]() |
Rick,
see the code below. The files produced are very large, but I guess that the way it is with the STL format. For such well-defined uniform grids, it seems quite overkill though. A 2400x2400 grid converts to 11,520,000 facets and ~550MB. Erwan CODE %%
clear IMGfile='ldem_875S_20m.img'; STLfile='ldem_875S_20m.stl'; %% read IMG file fidbin=fopen(IMGfile,'rb'); tmpbin=single(fread(fidbin,inf,'int16','ieee-le')/2000.0); fclose(fidbin); %% construct x/y vectors dxy=0.02; xymax=75.84; xps=single((-xymax+dxy/2):dxy:(xymax-dxy/2)); yps=single((xymax-dxy/2):-dxy:(-xymax+dxy/2)); %% construct x/y arrays [xps_,yps_]=meshgrid(xps,yps); %% zp=reshape(tmpbin,length(yps),length(xps))'; clear tmpbin %% select subset to plot/convert kx=3792+(-1200:1200); ky=3792+(-1200:1200); %% plot to check correct orientation clf; hold on; box on; set(gca,'FontSize',13); pcolor(xps_(ky,kx),yps_(ky,kx),zp(ky,kx)); shading flat; axis equal; axis image; xlabel('Stereographic X [km] '); ylabel('Stereographic Y [km] '); %% write STL file surf2stl(STLfile,xps_(ky,kx),yps_(ky,kx),zp(ky,kx),'binary'); |
|
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 24th June 2024 - 10:03 AM |
RULES AND GUIDELINES Please read the Forum Rules and Guidelines before posting. IMAGE COPYRIGHT |
OPINIONS AND MODERATION Opinions expressed on UnmannedSpaceflight.com are those of the individual posters and do not necessarily reflect the opinions of UnmannedSpaceflight.com or The Planetary Society. The all-volunteer UnmannedSpaceflight.com moderation team is wholly independent of The Planetary Society. The Planetary Society has no influence over decisions made by the UnmannedSpaceflight.com moderators. |
SUPPORT THE FORUM Unmannedspaceflight.com is funded by the Planetary Society. Please consider supporting our work and many other projects by donating to the Society or becoming a member. |
![]() |