Flashback to January 2011!
IEEE-754 sighting

teaching machines

Benzene

Over Thanksgiving I added per-vertex coloring to Madeup. No longer are we bound to a single color for the entire model!

To celebrate, I fused together a benzene ring.

Benzene. C6H6. Known by the state of California to cause cancer.

Benzene. C6H6. Known by the state of California to cause cancer.

radius = 5
nsides = 30
bondRadius = 0.4
carbonRadius = 1.5
hydrogenRadius = 1
outerScale = 1.85

to polarto radius degrees
  x = radius * cos degrees
  y = radius * sin degrees
  moveto x, y, 0
end

for i to 360 by 60
  .rgb = {1, 0, 0}
  .radius = carbonRadius
  polarto radius, i
  
  .rgb = {1, 1, 1}
  .radius = hydrogenRadius
  polarto outerScale * radius, i
end
spheres

.rgb = 3 of 0.7
.radius = bondRadius
for i through 360 by 60
  polarto radius, i
end
dowel

for i through 360 by 60
  .radius = bondRadius
  polarto radius, i
  polarto outerScale * radius, i
  dowel
end

 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Past Posts

Categories