Re: [LogoForum] The FILL Command



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@xxxxxxxxxxxxxx>
Sent: Jan 25, 2006 3:52 AM
To: LogoForum@xxxxxxxxxxxxxxx
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 :phi)
 rt 180-:phi fd :p_radius lt 180-:phi
 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*:phi fd :p_radius fill
make "r.total :r.total+1
setpos first :p seth last :p
end

to probe? :dir
local [p c]
make "p list pos heading
lt :dir*:phi fd :p_radius
make "c  pixel=7 ;(and  pixel=7 :radius>distance [0 0])
setpos first :p seth last :p
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@xxxxxxxxxxxxx>
To: <LogoForum@xxxxxxxxxxxxxxx>
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


































































































.



Relevant Pages

  • Printing positive from 2000 but negative from XP
    ... I have a custom thermal printer for which I tried to make a custom driver ... The data that goes to the printer has to consist in a start block command ... actual pixels that have to be printed followed 2368 bytes of FF. ... *Feature: Resolution ...
    (microsoft.public.development.device.drivers)
  • Re: ImageMagick Newbie
    ... pixels, 4000/inch to 1200x1800 pixels, 300/inch, ... I got good results with my test image, ... else I should include in the command line? ... You don't really need the "-format JPEG" option, ...
    (rec.photo.digital.slr-systems)
  • Re: ImageMagick Newbie
    ... pixels, 4000/inch to 1200x1800 pixels, 300/inch, ... I got good results with my test image, ... else I should include in the command line? ... You don't really need the "-format JPEG" option, ...
    (rec.photo.digital.slr-systems)
  • Re: SED1335 Problem
    ... using the "command byte+stream of data bytes" method. ... a problem occurs where an additional 8 pixels can be written on ... I know this looks like a silly coding error, ... It happens far far less frequently if I write my bitmap rows with ...
    (comp.arch.embedded)
  • Re: default chunk size for wss in 2003 (sp1) command line variable
    ... Thanks so much Dan my man ... does nothing but gve a command line error - and I think the reason is the ... "Dan Orchard" wrote: ... > Seth at Sherwood wrote: ...
    (microsoft.public.sharepoint.windowsservices)