Stap 3: Sinus Tests
Hier is de verwerking code die ik gebruikt:
//sine test with processing import processing.pdf.*; int scaleNum = 72;//scale factor of vectors (default 72 dpi) float theta;//angle variable float thetaIter = 88200;//how many values of theta per cycle float radius;//variable to calculate radius of grooves float diameter = 11.8;//diameter of record in inches float innerHole = 0.286;//diameter of center hole in inches float innerRad = 2.2;//radius of innermost groovein inches float outerRad = 5.75;//radius of outermost groove in inches //storage for a given point in the groove float radCalc; float xVal; float yVal; float dpi = 1200;//dpi of cutter float minDist = 4.0;//min pixel spacing between points in vector path (to prevent cutter from freaking out) 0.25919998 float xValLast = 0.0; float yValLast = 0.0; //parameters to test float amplitude[] = {4,6,8};//in pixels int frequency[] = {2000,1000,500,250};//cycles per rotation void setup(){ size(12*scaleNum,12*scaleNum); beginRecord(PDF,"test1.pdf");//save as PDF background(255);//white background noFill();//don't fill loops strokeWeight(0.001);//hairline width //draw sine waves float incrNum = TWO_PI/thetaIter;//calculcate inrementation amount radius = outerRad*scaleNum;//calculate outermost radius (at 5.75") //scale pixel distances for (byte i=0;i<3;i++){ amplitude[i] = amplitude[i]/dpi*scaleNum; } minDist = minDist/dpi*scaleNum; stroke(255,0,0);//red for(byte frequencyi=0;frequencyi<4;frequencyi++){//four sine frequencies for(byte amplitudei=0;amplitudei<3;amplitudei++){//three groove lateral amplitudes for(byte copies=0;copies<1;copies++){//two copies beginShape(); int numpoints = 0; for(theta=0;theta<TWO_PI;theta+=incrNum){//for theta between 0 and 2pi //calculate new point radCalc = radius+amplitude[amplitudei]*sin(frequency[frequencyi]*theta); xVal = width/2+radCalc*cos(theta); yVal = height/2+radCalc*sin(theta); if((((xValLast-xVal)*(xValLast-xVal)+(yValLast-yVal)*(yValLast-yVal))>(minDist*minDist))||(theta==0)){ vertex(xVal,yVal); //store last coordinates in vector path xValLast = xVal; yValLast = yVal; numpoints++; } } endShape(CLOSE); println(numpoints); radius -= 2*amplitude[amplitudei]+0.02*scaleNum;//separate each copy } radius -= 0.02*scaleNum; } radius -= 0.01*scaleNum; } //draw cut lines (100 units = 1") stroke(0);//draw in black ellipse(width/2,height/2,innerHole*scaleNum,innerHole*scaleNum);//0.286" center hole ellipse(width/2,height/2,diameter*scaleNum,diameter*scaleNum);//12" diameter outer edge endRecord(); exit(); //tell me when it's over println("Finished."); }
en hier is een video van de resultaten:
(de sinusgolf 139hz wellicht te laag om te horen met laptop luidsprekers)
Ik was echt blij met deze eerste testen. Dit is wat lawaai op de achtergrond, maar het is zeer consequent en de signaal / ruisverhouding is vrij goed. Amplitudes van 4 en 6 geluiden goed over de frequenties getest hier, als de frequentie hoger wordt, hoor je een goede hoeveelheid vervorming op de Golf amplitude 8.
Verschillende lasers en merken voor laser cutter zal anders reageren, maar deze record werd gesneden op 5000 freq met 100 snelheid (hoewel de snijkop bewoog zich heel langzaam als gevolg van de dichtheid van de punten op mijn Vectorpad) en 12 macht (genoeg etch het oppervlak maar niet helemaal doorgesneden).