[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LOGO-L> Curve Stitching with Logo



Charles T. Smith wrote:
Hello all,

<snip>

===============Curving Stitching Procedures Follow================

to cardioid
cg st init
setcircle 100 72
make "t 0
repeat 36 [make "t :t + 1 stitch :t :t * 2]
repeat 36 [make "t :t + 1 stitch :t (:t - 36) * 2]
end

to nephroid
cg st init
setcircle 100 72
make "t 0
setc 2 repeat 24 [make "t :t + 1 stitch :t :t * 3]
repeat 24 [make "t :t + 1 if (:t > 36) [setc 5] stitch :t (:t - 24) * 3]
repeat 24 [make "t :t + 1 stitch :t (:t - 48) * 3]
end

to placepoint
dot
output pos
end

to dot
pd fd 0 pu
end

to setplace
pu
make "pointlist se :pointlist butlast list placepoint []
end

to setline :length :n
pu
repeat :n [fd :length / :n make "pointlist se :pointlist butlast list
placepoint []]
end

to setcircle :radius :n
pu rt 360 / :n
repeat :n [ fd :radius make "pointlist se :pointlist butlast list
placepoint [] bk :radius rt 360 / :n]
end

to stitch :a :b
pu
setpos item :a :pointlist
seth towards item :b :pointlist
pd setpos item :b :pointlist pu
end

to init
clearnames
make "pointlist []
end

;The following 3 procedures are to provide compatibility between LogoWriter
and UCBLogo

to cg
cs
end

to clearnames
erns
end

to setc :color
setpencolor :color
end

Hi,

Here's a different approach to draw Cardioid and Nephroid. The following short codes are for MSWLogo and UCBLogo. The Cardioid and the Nephroid are the envelope of the relevant images:

to main           ; Cardioid
cs ht pu rt 90
setsc 0 setpc 6 draw 35
end

to draw :rad
repeat 32[fd :rad pd
   circle distance se 0 :rad
   pu bk :rad rt 360/32]
end

============================

to main           ; Nephroid
cs ht pu
setsc 0 setpc 4 draw 46
end

to draw :size
repeat 32[fd :size pd
   circle xcor
   pu bk :size rt 360/32]
end

Regards...

[[Yehuda]]
 

  _/    _/     _/ _/_/_/_/_/ _/_/_/_/
   _/   _/     _/_/    _/          _/
  _/_/_/     _/  _/   _/        _/
 _/   _/   _/_/_/_/  _/      _/
_/     _/_/      _/ _/     _/_/_/_/

http://www.geocities.com/CollegePark/lab/2276/
 



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home