sq() / sprt() / pow()

sq() sq() \ Language (API) \ Processing 2+squares a number (multiplies a number by itself) the result is always a positive number return float noStroke(); float a = sq(1); float b = sq(-5); float c = sq(9); rect(0,25,a,10); rect(0,45,b,10)…

「dust eyes, dust architecture」 dNA

double Negatives Architecture doubleNegatives Architecture Ltd. | architectural design Do the limits of the architecture's language mean the limits of the architecture?00 introduction 01 notation 02 spatial notation 03 retaining dimensions…

ghPython error : no module named perlin

nature of coderhino+gh ghpython componentNOC Python Grasshopper: 06 2d Perlin Noise - YouTube import rhinoscriptsyntax as rs import perlin sn = perlin.SimplexNoise() pList = [] for i in range(x): for j in range(y): perVal = sn.noise2(i*sca…

Ex_01_04_PVector_mult

vectorA.mult(value) void setup(){ size(600,600); } void draw(){ background(255); PVector mouse = new PVector(mouseX,mouseY); PVector center = new PVector(width/2,height/2); mouse.sub(center); mouse.mult(0.5); translate(width/2,height/2); s…

Ex_01_03_PVector_sub

vectorA.sub(vectorB) void setup(){ size(600,600); } void draw(){ background(255); PVector mouse = new PVector(mouseX,mouseY); PVector center = new PVector(width/2,height/2); mouse.sub(center); translate(width/2,height/2); line(0,0,mouse.x,…

Ex_01_02_Ball

Ball PVector PVector location; PVector velocity; void setup(){ size(600,600); background(255); location = new PVector(100,100); velocity = new PVector(2.1,3.9); } void draw(){ location.add(velocity); if ((location.x < 0)||(width < location…

Ex_01_01_Ball

not use PVector float x = 100; float y = 100; float xSpeed = 2.1; float ySpeed = 3.9; void setup(){ size(600,600); background(255); } void draw(){ x = x + xSpeed; y = y + ySpeed; if ((x<0)||(width

Ex_00_06_PerlinNoise_2D

perlin noise 2D // perlin noise size(600,600); loadPixels(); float xoff = 0.0; for (int x=0; x

Ex_00_05_RandomWalker_PerlinNoise

random walker perlin noiseperlin noise is noise() class Walker{ float x,y; float tx,ty; Walker(){ tx = 0; ty = 10000; } void step(){ x = map(noise(tx), 0,1, 0,width); y = map(noise(ty), 0,1, 0,height); tx += 0.01; ty += 0.01; noStroke(); f…

noise()

noise noise() \ Language (API) \ Processing 2+returns the perlin noise value at specified coodinates Perlin noise is a type of gradient noise float noiseScale = 0.02; void draw(){ background(0); for (int x=0; x

Ex_00_04_Gaussian

gaussian distribution import java.util.Random; Random generator; void setup(){ size(649,360); background(255); generator = new Random(); } void draw(){ float num = (float) generator.nextGaussian(); // next Gaussian return ""double"" float …

Ex_00_03_RandomWalker_Lopsidedly

random walker lopsided class Walker { int x; int y; int w = 1; Walker(){ x = width/4; y = height/2; } void display() { stroke(0); point(x, y); } void step() { float choice = random(1); // 0.0 to 3.9 // int() if (choice < 0.4) { x = x+w; } …

Ex_00_02_Random_XXX

XXX int[] randomCounts; void setup(){ size(640,240); randomCounts = new int[20]; } void draw(){ background(255); int index = int(random(randomCounts.length)); randomCounts[index] = randomCounts[index]+5; stroke(0); fill(175); int w = width…

Str_length()

str.length() String::length() \ Language (API) \ Processing 2+returns the total number of characters included in the String as an intger number String str1 = "Hoge"; String str2 = "HogeHoge"; int s1 = str1.length(); int s2 = str2.length();…

Ex_00_01_RandomWalker_OOP_Basic

random walker OOP basic class Walker { int x; int y; int w = 1; Walker(){ x = width/2; y = height/2; } void display() { stroke(0); point(x, y); } void step() { int choice = int(random(4)); // 0.0 to 3.9 // int() if (choice == 0) { x = x+w;…

map()

map() map() \ Language (API) \ Processing 2+x = map(value, d1,d2, d3,d4);value in the domain [d1 to d2] remap x in the domain [d3 to d4]d1,d2,d3,d4 and ReturnNum is """float""" float value = 50; float m = map(value, 0, 100, -20, -10); prin…

random()

random() random() \ Language (API) \ Processing 2+set upper limit [ 0 to X ] random(float:X);set domain [ Xmini to Ymax ] random(float:Xmini , float;Ymax);upper limit [ 0 to 10 ] for(int i=0; i<10; i++){ float r = random(10); println(r); }…

stroke()

stroke() stroke() \ Language (API) \ Processing 2+baced colorMode(); int rs = 400; // rect Size size(800,800); strokeWeight(20); noFill(); // default rectMode is CORNER // rect(start_X,start_Y,width,height); colorMode(RGB,255); stroke(0); …

rectMode()

rectMode() rectMode() \ Language (API) \ Processing 2+CORNER, CORNERS, RADIUS or CENTERCORNER mode is defalut rect(start_X,start_Y,width,height); size(800,800); for (int i=200; i<800; i=i+200){ line(i,0,i,height); line(0,i,width,i); } noSt…

ellipseMode()

ellipseMode() ellipseMode() \ Language (API) \ Processing 2+CENTER, RADIUS, CORNER or CORNERSCENTER Mode is default ellipse(center_X,center_Y,diameter_X,diameter_Y); size(800,800); noFill(); strokeWeight(10); smooth(); colorMode(RGB,255); …

fill()

fill() fill() \ Language (API) \ Processing 2+based colorMode(); int rs = 400; //rectSize size(800,800); noStroke(); /* colorMode(RGB or HSB,max) colorMode() is RGB,default max: remap range */ colorMode(RGB,255); /* colorMode(RGB); fill(Re…

colorMode()

colorMode() colorMode() \ Language (API) \ Processing 2+set color mode RGB or HSBRGB mode red,green,blue size(240,240); background(0); noStroke(); colorMode(RGB,100); /* colorMode(RGB,max); Red - Green - Blue max float: range for all color…

3D scaning with iPhone6

autodesk remake testAutodesk ReMake

009_for_loop_3D_RGB_Box

create RGB Box with 3D array import processing.opengl.*; import igeo.*; size(960,720,IG.GL); int m = 20; // max double mi = 1.0/m; for (int i=0; i

008_for_loop_2D

create 2D list import processing.opengl.*; import igeo.*; size(960,720,IG.GL); for(int i=0; i < 10; i++){ for(int j=0; j < 10; j++){ new IPoint(i*10,j*10,0).clr(i*0.1,j*0.1,0); new IPoint(i*10,j*10,40).hsb(i*0.1,1,j*0.1); } }

007_for_loop

crate spiral (sin,cos)color mode clr(r,g,b,alpha) hsb(h,s,b,alpha) import processing.opengl.*; import igeo.*; int r = 30; // radius size(960,720,IG.GL); for (int i=0; i<100; i++){ new IPoint(sin(i*0.5)*r,cos(i*0.5)*r,i*5).clr(i*0.01,0,1-i*…

006_for_loop

use loop OpenGL error 1281 at top endDraw(): invalid value import processing.opengl.*; import igeo.*; size(960,720,IG.GL); for(int i=0; i<10; i++){ new IPoint(i, 0, 0).clr(0.1*i,1-0.1*i,0); }

005_ISurface

create NURBS surface import processing.opengl.*; import igeo.*; size(960,720,IG.GL); // 4 points in u direction, 3 points in v direction double[][][] controlPoints = {{{-30,-30, 10},{-30, 0,-20},{-30, 30, 0}}, {{ 0,-30,-10},{ 0, 20,-50},{ …

004_ISurface

create surface import processing.opengl.*; import igeo.*; /* create surface from 3 or 4 corner points */ size(960,720,IG.GL); new ISurface(0,0,0,40,40,40,80,0,0,40,-40,40).clr(1.0,0.8); // white // 3 corner points (triangle) new ISurface(-…

003_ICurve

create NURBS curves import processing.opengl.*; import igeo.*; size(960,720,IG.GL); // controlPoints as CP // make list and ceate curve // new ICurve(point list,degree) double[][] CP1 = {{0,0,0}, {20,20,20}, {-20,20,0}}; new ICurve(CP1, 2)…

002_ICurve

create line import processing.opengl.*; import igeo.*; size(960,720,IG.GL); new IPoint(0,0,0).clr(255,255,255); new ICurve(0,0,0, 30,30,30); //black new ICurve(0,-10,0, 30,10,20).clr(1.0,0,0); // red new ICurve(0,-20,0, 30,-10,10).clr(0,1.…

ABC of Incremental Housing

プリツカー賞のアレハンドロ・アラヴェナのプロジェクト 自身が設計した集合住宅の図面をオープンソース化し、 お金が少ないところでも快適な生活環境を整えることができるように手助けする。 アラヴェナの事務所、ElementalのABC of Incremental Housingの…

001_IPoint

create point objects import processing.opengl.*; import igeo.*; size( 960, 720, IG.GL ); new IPoint(0,0,0).clr(1.0,0,0); // red new IPoint(20,0,0).clr(0,1.0,0); // grren new IPoint(20,20,0).clr(0,0,1.0); // blue new IPoint(0,20,0);