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

LOGO-L> Icosahedron



Inspired by the football/soccerball, I've just done an icosahedron.
Unfortunately, while the wireframe looks ok, the solid doesn't really work 
from any viewpoint.  I'm not sure if this is the rendering engine or the 
model itself at fault.

Tom Lynn

to aaa
	; Draws an icosahedron.
	;
	; Two basic movement primitives are defined.
	; ne (next edge) moves to the next edge clockwise on the current face.
	; nr (next-right) moves to the next face to the right.
	; repeat 5 [nr] returns to the original position.
	;
	; The turtle draws five bars of four triangles around the icosahedron.

	ico 200
end

to fourtri
	make "col :col + 1
	setpc :col
	tri tri ne tri tri
	repeat 2 [nr nr ne]
	nr
end

to ico :size
	; Define some constants
	localmake "phi (1 + sqrt 5) / 2
	localmake "beta arcsin (:phi / sqrt 3)
	localmake "alpha 180-2*:beta ; 180-angle between unconnected vertices of two hinged faces

	cs
	perspective
	ask -1 [setposxyz [100 -500 600]]


	localmake "col 0
	repeat 5 [fourtri]
	polyview
end

to ne
	pu fd :size rt 120
end

to nr
	pu rt 60 fd :size lt 120 rr :alpha
end

to tri
	pd polystart repeat 3 [fd :size rt 120] polyend nr
end



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