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

Home » Public Forums » archive » 2D and 3D filled objects.
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: 2D and 3D filled objects. [message #33467 is a reply to message #33373] Fri, 27 December 2002 09:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
New2IDL (biomedthesis2002@yahoo.com) writes:

> I already tried to generate the sphere the same way but the problem is
> it has various densities. I want a sphere with one density and that
> density is White.
>
> I've written my own code for 3D thinning. I'm not sure if the
> algorithm is right. I know what to expect when i thin a binary sphere.
> That's the reason for this question. To cross check that in 2D, i need
> a binary circle that is completely filled with each pixel value as
> 255.

Well, then, how about this:

sphere = FltArr(20, 20, 20)
FOR x=0,19 DO FOR y=0,19 DO FOR z=0,19 DO $
sphere(x, y, z) = SQRT((x-9.5)^2 + (y-9.5)^2 + (z-9.5)^2)
indices = Where(sphere GT 0)
sphere(indices) = 255

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: 2D and 3D filled objects.
Next Topic: Can't get an cell select event

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

Current Time: Fri Oct 17 21:14:06 PDT 2025

Total time taken to generate the page: 2.07916 seconds