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

Home » Public Forums » archive » Re: Mapping on Objekts...
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: Mapping on Objekts... [message #8513 is a reply to message #8512] Thu, 20 March 1997 00:00 Go to previous messageGo to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
Hey Folks,

If you liked the cylinder, here's one that's even more fun (is it possible?!?).

Herr Moebius' Strip:


Put in a file and .run it. Same conditions as with cylinder apply.

Enjoy,

JD

;; BEGIN MOEBIUS STRIP CODE

scale3,xrange=[0,1],yrange=[0,1],zrange=[0,1],AZ=80,AX=50
N=125
phi=findgen(N)/(N-1)*2*!PI
;; define angle of strip section rotation
thet=phi/2
;; set up base radius of strip
Ro=.5
;; define half width of strip
d=.3
;; define the radius at the top and bottom (as defined at phi=0)
Rtop=Ro-d*sin(thet) ;radius at top
Rbottom=Ro+d*sin(thet) ;radius at bottom
zc=d*cos(thet) ;height
;; convert polar to rectangular (top and bottom)
cv=cv_coord(FROM_POLAR=[rotate(phi,1),rotate(Rtop,1)],/TO_RE CT)
xctop=cv(0,*) & yctop=cv(1,*)
cv=cv_coord(FROM_POLAR=[rotate(phi,1),rotate(Rbottom,1)],/TO _RECT)
xcbot=cv(0,*) & ycbot=cv(1,*)

;; get some example data
file=filepath('people.dat',subdir='examples/data')
openr,un,/get_lun,file
d=bytarr(192,192)
readu,un,d
free_lun,un
s=size(d)

set_plot,'Z'
erase
;; render Moebius in strips
for i=0,N-2 do begin
x=[xcbot(i),xctop(i),xctop(i+1),xcbot(i+1)]+.5
y=[ycbot(i),yctop(i),yctop(i+1),ycbot(i+1)]+.5
z=[-zc(i),zc(i),zc(i+1),-zc(i+1)]+.5
left=round(float(i)/N*(s(1)-1)) & right=round(float(i+1)/N*(s(1)-1))
top=s(2)-1 & bot=0
polyfill,x,y,z,/T3D,PATTERN=d(left:right,bot:top),/IMAGE_INT ERP, $
IMAGE_COORD=[[0,0],[0,top],[right-left,top],[right-left,0]]
endfor
im=tvrd()
set_plot,'X'
tv,im
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Dual Installation of IDL 4 and IDL 5
Next Topic: Digital Alpha, Windows NT and IDL

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

Current Time: Sun Oct 12 16:50:01 PDT 2025

Total time taken to generate the page: 2.11714 seconds