Skip to content

Commit

Permalink
[}+-><-+{]
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaudry committed Jul 26, 2024
1 parent 42d8190 commit 372dcd0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 49 deletions.
38 changes: 20 additions & 18 deletions p5-experiments/plottable/etemontreal001.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
function savesvg() {
save("etemontreal005.svg");
save("etemontreal001.svg");
}

function savepng() {
save("etemontreal005.png");
save("etemontreal001.png");
}

var font
var fSize = 12
var alea = []
var mainhu = 30
var rarehu = 180
function preload() {
font = loadFont("../fonts/1CAMBam_Stick_9.ttf");
sourcecode = loadStrings('etemontreal001-core.js');
}

function draw() {
background(0, 0, 100)
/* cartepostale(globalmargin, globalmargin)
cartepostale(globalmargin + wpostcard, globalmargin)
cartepostale(globalmargin, globalmargin + hpostcard)
cartepostale(globalmargin + wpostcard, globalmargin + hpostcard)
*/
codeetadresse(globalmargin, globalmargin, destinataires[0])
codeetadresse(globalmargin + wpostcard, globalmargin, destinataires[1])
strokeWeight(1.4)
cartepostale(globalmargin, globalmargin)
/* cartepostale(globalmargin + wpostcard, globalmargin)
cartepostale(globalmargin, globalmargin + hpostcard)
cartepostale(globalmargin + wpostcard, globalmargin + hpostcard)
*/
// codeetadresse(globalmargin, globalmargin, destinataires[0])
/* codeetadresse(globalmargin + wpostcard, globalmargin, destinataires[1])
codeetadresse(globalmargin, globalmargin + hpostcard, destinataires[2])
codeetadresse(globalmargin + wpostcard, globalmargin + hpostcard, destinataires[3])
noLoop()
*/ noLoop()
}

function codeetadresse(x, y, adresse) {
Expand All @@ -40,12 +39,15 @@ function codeetadresse(x, y, adresse) {
}

var destinataires = [
{ noms: ["jacques baudry", "françoise burel"], adresse: "15 rue des vedaudais", ville: "35690 Acigné", pays: "FRANCE" },
{ noms: ["dept. informatique et",'recherche opérationelle'], adresse: "pavillon andré-aisenstadt", ville: "Montréal (Qc), H3C 3J7", pays: "CANADA" },
{ noms: ["jacques baudry", "françoise burel"], adresse: "15 rue des verdaudais", ville: "35690 Acigné", pays: "FRANCE" },
{ noms: ["martin monperrus"], adresse: "Virebergsvägen 15", ville: "16930 Solna", pays: "SUEDE" },
{ noms: ["marie-cécile mocellin","corentin lemonnier"], adresse: "13 rue glacière", ville: "75013 Paris", pays: "FRANCE" },
{ noms: ["marie-cécile mocellin", "corentin lemonnier"], adresse: "13 rue glacière", ville: "75013 Paris", pays: "FRANCE" },
{ noms: ["erik natanael gustafsson"], adresse: "orions bälte 38", ville: "136 76 Brandbergen", pays: "SUEDE" },
{ noms: ["gaspard d'assignies","elvira periac"], adresse: "43 boulevard de l'estuaire", ville: "44200 Nantes", pays: "FRANCE" },
]


function adresseadrtoite(adresse) {
var adresse, posx, posy

Expand All @@ -57,14 +59,14 @@ function adresseadrtoite(adresse) {
push()
translate(leftmargin, bottommargin);
rotate(radians(270))
for(i=0;i<adresse.noms.length;i++){
for (i = 0; i < adresse.noms.length; i++) {
text(adresse.noms[i], posx, posy)
posy+=1.5*fSize
posy += 1.5 * fSize
}
text(adresse.adresse, posx, posy)
posy+=1.5*fSize
posy += 1.5 * fSize
text(adresse.ville, posx, posy)
posy+=1.5*fSize
posy += 1.5 * fSize
text(adresse.pays, posx, posy)
pop()
}
Expand Down
4 changes: 2 additions & 2 deletions p5-experiments/plottable/plottableframePostcards.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

var echelle = 1
//overall frame on a letter size. (0,0) on the bottom left of a letter page, portrait position
var w = 1122 * echelle
var h = 1587 * echelle
var w = 816 * echelle
var h = 1056 * echelle
//postcard dimensions
var wpostcard = 454 * echelle
var hpostcard = 726 * echelle
Expand Down
62 changes: 33 additions & 29 deletions p5-experiments/plottable/summer005.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function drawpostcard(x, y) {
}
function onepiece() {
alea = []
punch3()
punch4()
}

function punch() {
Expand Down Expand Up @@ -100,7 +100,6 @@ function punch2() {

function punch3() {
var ox1, oy1, dx1, dy1, ox2, oy2, dx2, dy2, t1
if(random()<0.5){
for (t1 = 0; t1 < 1; t1 += 0.05) {
ox1 = leftmargin
oy1 = bottommargin
Expand All @@ -111,20 +110,7 @@ function punch3() {
dx2 = rightmargin
dy2 = (1 - (t1+0.05)) * bottommargin + ((t1+0.05) * topmargin)
section(ox1,oy1,dx1,dy1,dx2,dy2)
}}
else{ for (t1 = 0; t1 < 1; t1 += 0.05) {
ox1 = leftmargin
oy1 = bottommargin
dx1 = rightmargin
dy1 = (1 - t1) * bottommargin + (t1 * topmargin)
ox2 = leftmargin
oy2 = bottommargin
dx2 = rightmargin
dy2 = (1 - (t1+0.05)) * bottommargin + ((t1+0.05) * topmargin)
ocean(ox1,oy1,dx1,dy1,dx2,dy2)
}
}
if(random()<0.6){
for (t1 = 0; t1 < 1; t1 += 0.05) {
ox1 = leftmargin
oy1 = bottommargin
Expand All @@ -135,12 +121,6 @@ function punch3() {
dx2 = (1 - (t1+0.05)) * leftmargin + ((t1+0.05) * rightmargin)
dy2 = topmargin
section(ox1,oy1,dx1,dy1,dx2,dy2)
}}
else{
t1=random()
dx1 = (1 - t1) * leftmargin + (t1 * rightmargin)
dy1 = topmargin
quad(dx1-42,dy1,dx1+42,dy1,dx1+42,dy1+42,dx1-42,dy1+42)
}
ellipse(rightmargin,topmargin,7,7)
}
Expand Down Expand Up @@ -169,14 +149,38 @@ function section(x1, y1, x2, y2, x3, y3){
}
}

function ocean(x1, y1, x2, y2, x3, y3){
var ox1, oy1, dx1, dy1, ox2, oy2, dx2, dy2, cpx1,cpy1,cpx2,cpy2,t1, step
var ratio1=0.25
var ratio2=0.75
cpx1 = ((1 - ratio1) * x1 + (ratio1 * x2))+random(-42,84)
cpy1 = ((1 - ratio1) * y1 + (ratio1 * y2))-42
cpx2 = ((1 - ratio2) * x1 + (ratio2 * x2))+random(-42,84)
cpy2 = ((1 - ratio2) * y1 + (ratio2 * y2))+42
function punch4(){
ocean(leftmargin,bottommargin,rightmargin,bottommargin)
}

function ocean(x1, y1, x2, y2){
ellipse(x1,y1,7,7)
ellipse(x2,y2,7,7)
line(x1, y1, x2, y2)
var ox1, oy1, cpx1,cpy1,cpx2,cpy2,t1, step
var ratio1=0.5
var ratio2=0.5
step=0.2
beginShape()
ox1=x1
oy1=y1
vertex(x1,y1)
for (var t1 = step; t1 < 1; t1 += step) {
dx1 = (1 - t1) * x1 + (t1 * x2)
dy1 = (1 - t1) * y1 + (t1 * y2)
cpx1 = ((1 - ratio1) * ox1 + (ratio1 * dx1))//+random(-42,84)
cpy1 = ((1 - ratio1) * oy1 + (ratio1 * dy1))-42
cpx2 = ((1 - ratio2) * ox1 + (ratio2 * dx1))//+random(-42,84)
cpy2 = ((1 - ratio2) * oy1 + (ratio2 * dy1))+42
bezierVertex(cpx1,cpy1,cpx2,cpy2,dx1, dy1)
ox1 = dx1
oy1 = dy1
}
endShape()
cpx1 = ((1 - ratio1) * x1 + (ratio1 * x2))//+random(-42,84)
cpy1 = ((1 - ratio1) * y1 + (ratio1 * y2))-142
cpx2 = ((1 - ratio2) * x1 + (ratio2 * x2))//+random(-42,84)
cpy2 = ((1 - ratio2) * y1 + (ratio2 * y2))+142
bezier(x1,y1,cpx1,cpy1,cpx2,cpy2,x2,y2)
}

Expand Down

0 comments on commit 372dcd0

Please sign in to comment.