[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
+177 -65
View File
@@ -2,91 +2,203 @@
id: wiki-2026-0508-processing
title: Processing
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AUTO-PROC-001]
aliases: [Processing language, p5.js, Generative Art Toolkit]
duplicate_of: none
source_trust_level: A
confidence_score: 0.92
tags: [auto-reinforced, processing, computation, data-transformation, throughput, Efficiency]
confidence_score: 0.9
verification_status: applied
tags: [creative-coding, generative-art, visualization, java, javascript]
raw_sources: []
last_reinforced: 2026-04-20
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: unspecified
framework: unspecified
language: Java/JavaScript
framework: Processing/p5.js
---
# [[Processing|Processing]]
# Processing
## 📌 한 줄 통찰 (The Karpathy Summary)
> "데이터의 연금술: 가공되지 않은 날것의 입력값(Raw data)에 논리와 수학적 연산을 가하여, 의사결정에 즉시 사용 가능한 가치 있는 정보로 탈바꿈시키는 모든 지적 가공 과정."
## 한 줄
> **"매 sketch 는 setup() + draw() 의 loop"**. 2001 Casey Reas + Ben Fry @ MIT Media Lab 에서 시작된 creative coding language. 매 visual artist + designer + educator 를 위한 minimal API. 매 2026 현재 p5.js (JavaScript port) 가 web-first default.
## 📖 구조화된 지식 (Synthesized Content)
처리(Processing)는 데이터를 체계적으로 변환하여 유용한 결과를 생성하는 일련의 작업입니다.
## 매 핵심
1. **3대 처리 방식**:
* **Batch Processing**: 데이터를 모아서 한꺼번에 처리 (대량 처리 효율성). ([[MapReduce|MapReduce]]와 연결)
* **Real-time Processing**: 데이터가 들어오는 즉시 처리 (지연 시간 최소화).
* **Stream Processing**: 끊임없이 흐르는 데이터를 실시간 분석.
2. **왜 중요한가?**:
* 지능은 결국 '방대한 입력'을 '압축된 출력'으로 바꾸는 처리 품질 정책에 의해 결정되기 때문임. (Efficiency와 연결)
### 매 모델
- **setup()**: 매 once 실행 — canvas size, initial state.
- **draw()**: 매 frame 실행 (default 60fps) — render loop.
- **mousePressed / keyPressed**: 매 event callback.
- **frameCount, millis()**: 매 time-based animation primitive.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌**: 과거에는 중앙 집중식(Mainframe) 정책이었으나, 현대 정책은 데이터가 발생하는 현장에서 즉시 처리하는 '에지 컴퓨팅([[Edge Computing|Edge Computing]]) 정책'과 수만 대의 서버로 나누는 '분산 처리 정책'이 주류가 됨(RL Update). ([[Parallel-Computing|Parallel-Computing]]와 연결)
- **정책 변화(RL Update)**: 단순히 계산하는 정책을 넘어, 데이터 속의 맥락을 파악하고 다음 행동을 결정하는 '추론형 처리 정책'이 현대 AI 프로세싱의 핵심 정책임.
### 매 변형
- **Processing (Java)**: 매 desktop, 매 OpenGL access, 매 .pde sketch.
- **p5.js**: 매 web-native JS port — Lauren McCarthy, 2014. 매 modern default.
- **Processing.py**: 매 Python mode (deprecated 2024, py5 successor).
- **py5**: 매 Processing 4 + Java17 backend, 매 Python frontend. 매 Jupyter integration.
## 🔗 지식 연결 (Graph)
- [[Efficiency|Efficiency]], [[MapReduce|MapReduce]], [[Parallel-Computing|Parallel-Computing]], Data-Mining, [[Technical-Architecture|Technical-Architecture]]
- **Modern Tech/Tools**: Apache Kafka, Spark, Flink, NVIDIA GPU processing.
---
### 매 응용
1. Generative art (Casey Reas 의 Process series).
2. Data visualization (Ben Fry, Visualizing Data 책).
3. Live coding / VJing (Hydra adjacency).
4. Interactive installations (museums, galleries).
5. Education — 매 first programming language for 비-CS major.
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
## 💻 패턴
**언제 이 지식을 쓰는가:**
- *(TODO)*
### Sketch 기본 구조 (p5.js)
```javascript
function setup() {
createCanvas(800, 600);
colorMode(HSB, 360, 100, 100, 1);
}
**언제 쓰면 안 되는가:**
- *(TODO)*
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
function draw() {
background(0, 0, 10, 0.05); // trail effect
const t = frameCount * 0.01;
for (let i = 0; i < 100; i++) {
const x = width/2 + cos(t + i*0.1) * (200 + i*2);
const y = height/2 + sin(t + i*0.1) * (200 + i*2);
fill(i * 3.6, 80, 100);
noStroke();
circle(x, y, 8);
}
}
```
## 🤔 의사결정 기준 (Decision Criteria)
### Perlin noise field (flow field)
```javascript
let particles = [];
**선택 A를 써야 할 때:**
- *(TODO)*
function setup() {
createCanvas(1000, 1000);
for (let i = 0; i < 2000; i++) {
particles.push({x: random(width), y: random(height)});
}
background(15);
}
**선택 B를 써야 할 때:**
- *(TODO)*
function draw() {
noStroke();
for (const p of particles) {
const a = noise(p.x * 0.003, p.y * 0.003, frameCount * 0.005) * TWO_PI * 4;
p.x += cos(a) * 1.5;
p.y += sin(a) * 1.5;
if (p.x < 0 || p.x > width) p.x = random(width);
if (p.y < 0 || p.y > height) p.y = random(height);
fill(255, 50);
circle(p.x, p.y, 1);
}
}
```
**기본값:**
> *(TODO)*
### Recursive tree (L-system feel)
```javascript
function setup() {
createCanvas(800, 800);
stroke(255);
noLoop();
}
## ❌ 안티패턴 (Anti-Patterns)
function draw() {
background(20);
translate(width/2, height);
branch(180);
}
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
function branch(len) {
line(0, 0, 0, -len);
translate(0, -len);
if (len > 4) {
push(); rotate(0.4); branch(len * 0.67); pop();
push(); rotate(-0.4); branch(len * 0.67); pop();
}
}
```
### Shader (WEBGL mode)
```javascript
let shader1;
function preload() {
shader1 = loadShader('vert.glsl', 'frag.glsl');
}
function setup() {
createCanvas(800, 800, WEBGL);
}
function draw() {
shader(shader1);
shader1.setUniform('u_time', millis() * 0.001);
shader1.setUniform('u_res', [width, height]);
rect(-width/2, -height/2, width, height);
}
```
### py5 Jupyter sketch
```python
import py5
def setup():
py5.size(800, 800)
py5.color_mode(py5.HSB, 360, 100, 100)
def draw():
py5.background(0, 0, 10)
for i in range(50):
h = (i * 7 + py5.frame_count) % 360
py5.fill(h, 80, 100)
py5.circle(400 + py5.cos(i) * 200, 400 + py5.sin(i) * 200, 20)
py5.run_sketch()
```
### AI-assisted generative (2026 pattern)
```javascript
// Claude Opus 4.7 generates sketch from prompt → eval as p5 sketch
// 매 modern workflow: prompt → code → live edit
const response = await fetch('/api/claude', {
method: 'POST',
body: JSON.stringify({prompt: 'circular spirograph with 7-fold symmetry'})
});
const code = await response.text();
new Function('p', code)(p5Instance);
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Web sketch / share link | **p5.js** (default 2026) |
| Desktop performance + OpenGL | Processing 4 (Java) |
| Python data viz integration | py5 |
| Live VJ / shader-heavy | Hydra or TouchDesigner |
| Production interactive install | openFrameworks (C++) |
**기본값**: p5.js — 매 web 즉시 share, 매 zero install.
## 🔗 Graph
- 부모: [[Creative-Coding]] · [[Generative-Art]]
- 변형: [[p5js]] · [[py5]] · [[openFrameworks]]
- 응용: [[Data-Visualization]] · [[Interactive-Art]]
- Adjacent: [[Hydra]] · [[TouchDesigner]] · [[Three.js]]
## 🤖 LLM 활용
**언제**: 매 sketch idea → code, 매 stuck on math (rotation, easing), 매 shader GLSL 의 starter.
**언제 X**: 매 final aesthetic decision — 매 LLM 의 generative output 의 generic. 매 artistic intent 의 human.
## ❌ 안티패턴
- **draw() 안 heavy work**: 매 60fps 의 깨짐. preload / setup 의 사용.
- **Global mutable state spaghetti**: 매 small sketch 에서 OK, 매 large 의 class structure.
- **NOLOOP forget**: 매 static image 의 noLoop() 의 사용 — 매 CPU 의 절약.
- **Pixel-by-pixel without `loadPixels()`**: 매 250x slow. 매 typed array 의 사용.
## 🧪 검증 / 중복
- Verified (processing.org docs, p5js.org reference).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Processing/p5.js creative coding 의 full content. |