| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| The message below is being cross-posted from LogoForum. Mike, Just a short note here...BUSY week...to thank you for your thoughtful suggestion. Looks like it will work fine and I'll give it a try this weekend. George ![]() -----Original Message----- > From: Mike Sandy <mjsandy@btinternet.com> > Sent: Jan 25, 2006 3:52 AM > To: LogoForum@yahoogroups.com > Subject: Re: [LogoForum] The FILL Command > > Oops; the output from my previous program was the number > of recursive calls. > Here is the corrected program: > > to aa :n :size > ; :n - number of sides of polygon > ; :size - side length of polygon > ; > cs > bitload "boundary.bmp > pu ht setpc 0 > local[theta phi p_radius r.total] > make "r.total 0 > make "theta 360/:n > make "phi (90-:theta/2) > make "p_radius :size/(2*cos hi)> rt 180- hi fd _radius lt 180- hi> tile 1 > (show "|Number of polygons used = | :r.total "FINISHED) > end > > to poly :dir > local "p > pd > (repeat :n > [fd :size lt :dir*:theta]) > pu > setfc ifelse :dir<0[2][4] > make "p list pos heading > lt :dir* hi fd _radius fill> make "r.total :r.total+1 > setpos first seth last ![]() > end > > to probe? :dir > local [p c] > make "p list pos heading > lt :dir* hi fd _radius> make "c pixel=7 ;(and pixel=7 :radius>distance [0 0]) > setpos first seth last ![]() > op :c > end > > to tile :dir > ifelse probe? :dir [poly :dir][stop] > (repeat :n > [tile -1*:dir > fd :size lt :dir*:theta > ]) > > end > > By modifying the above the number of pixels enclosed > within a boundary can be found, but the relationship > between this number and the enclosed area is not simple! > > > to aa > cs > bitload "boundary.bmp > pu ht setpc 0 > localmake "r.total 0 > tile 1 > (show "|Number of pixels present = | :r.total "FINISHED) > end > > to tile :dir > ifelse pixel=7 [setpixel 4 make "r.total :r.total+1][stop] > (repeat 4 > [tile -1*:dir > fd 1 lt :dir*90 > ]) > > end > > For both programs a thick boundary line is advisible. > Mike > > ---- Original Message ----- > From: "gvandemark1" <gvandemark@earthlink.net> > To: <LogoForum@yahoogroups.com> > Sent: Tuesday, January 24, 2006 4:54 AM > Subject: [LogoForum] The FILL Command > > >> I am trying to develop a method for determining the "area" of an >> irregular shape. When the FILL command is called to fill in an >> enclosed space, does it return a value representing the number of >> pixels that were filled? >> >> If not, is there any way to compute, at least approximately, the >> number of pixels within a fill area? >> >> Thanks in advance for your help. >> >> >> >> >> >> >> LogoForum messages are archived at: >> http://groups.yahoo.com/group/LogoForum >> |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.