Articulated goals -
My plan is to cut out the negative space and have the lamp hold together by string, might make strips that hand down and move in the wind
the light will be on the top, everything will hang down
Cylinder of clear material will surround the lamp for refraction
or maybe they could still be in the frame like normal, but still tied together by string, picture to come(shown in sketch)
May add a light dimmer that dims depending on the darkness of the room
Your "algorithm" for achieving these goals: a step-by-step process that you plan to follow that produces the expected output.
Generate using my generation system from homework one that 1, look aestheically pleasing, and 2, will not look weird if i were to wrap them around in a cylinder shped (only if i do plan to wrap them around)
This is just the voronai diagram. The black is solid wood/material. The red is the string, but I am also thinking of making the red string the trianglulation. The holes that the string goes through will also be much smaller.
UPDATE:
Made code that generates the diagrams in a spiral, and I'll layer them over each other. In both programs below, drag your mouse across the black screen
Code is the same as the code for the Circut Playground Lab, but BluefruitGA.ino is changed to the following
#include <Adafruit_NeoPixel.h>
#include <Adafruit_CircuitPlayground.h>
#include "GeneticAlgo.h"
#define PIN PIN_NEOPIXEL
#define NUMPIXELS 10
#define MUTATIONRATE 3
//change brightness
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
GeneticAlgo population[NUMPIXELS];
int target[3] = {255, 50, 0};
// int DELAYVAL = 500;
uint8_t red, green, blue;
int brightness = 4;
void setup() {
// setting up neopixels
pixels.begin();
CircuitPlayground.begin();
// setting up initial population
randomSeed(1000);
for (int i = 0; i < NUMPIXELS; i++) {
population[i].randomValue(random(10000));
}
// for testing purposes
Serial.begin(9600);
pixels.setBrightness(brightness);
//senses a color
CircuitPlayground.senseColor(red, green, blue);
target[0] = red;
target[1] = green;
target[2] = blue;
}
void loop() {
//pressing this button reads a color then turns the target into that color
if (CircuitPlayground.rightButton())
{
// CircuitPlayground.senseColor(red, green, blue);
// target[0] = red;
// target[1] = green;
// target[2] = blue;
Serial.print((int)red);
Serial.print(", ");
Serial.print((int)green);
Serial.print(", ");
Serial.println((int)blue);
}
// calculate fitness
float totalFit = 0.0;
for (int i = 0; i < NUMPIXELS; i++) {
population[i].calculateFitness(target);
totalFit += population[i].getFitness();
}
// cycling through again to normalize things
for (int i = 0; i < NUMPIXELS; i++) {
population[i].setFitness(population[i].getFitness()/totalFit);
// Serial.println("RGB for PIXEL");
// Serial.print(population[i].getRed());
// Serial.print(", ");
// Serial.print(population[i].getGreen());
// Serial.print(", ");
// Serial.println(population[i].getBlue());
//states how far away from target
Serial.println("distance");
Serial.print(red - population[i].getRed());
Serial.print(", ");
Serial.print(green - population[i].getGreen());
Serial.print(", ");
Serial.println(blue - population[i].getBlue());
}
// reproducing (and selecting in one step)
// temp array
GeneticAlgo children[NUMPIXELS];
for (int i = 0; i < NUMPIXELS; i++) {
GeneticAlgo parentA = weightedSelection();
GeneticAlgo parentB = weightedSelection();
GeneticAlgo child = parentA.crossover(parentB);
child.mutate(MUTATIONRATE);
children[i] = child;
}
// cycling through to update population
for (int i = 0; i < NUMPIXELS; i++) {
population[i] = children[i];
// updating colors
pixels.setPixelColor(i, red, population[i].getGreen(), blue));
//pixels.setPixelColor(i, pixels.Color(population[i].getRed(), population[i].getGreen(), population[i].getBlue()));
}
// for testing purposes
pixels.setPixelColor(0, pixels.Color(target[0], target[1], target[2]));
pixels.show(); // make them do their thing
delay(200); // wait 0.300 seconds
}
GeneticAlgo weightedSelection() {
int index = 0;
int start = random(1000);
while (start >= 0 && index < NUMPIXELS) {
start = start - (population[index].getFitness()*1000);
index++;
}
index--;
// Serial.println("index");
// Serial.println(index);
return population[index];
}