figure_de_lichtenberg
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| figure_de_lichtenberg [2019/11/18 01:11] – Mushussu | figure_de_lichtenberg [2021/04/21 10:48] (Version actuelle) – [Figures de Lichtenberg] Mushussu | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Figures de Lichtenberg ====== | ====== Figures de Lichtenberg ====== | ||
| - | https:// | + | Définition sur [[https:// |
| En mode analogique : | En mode analogique : | ||
| - | https:// | + | [[https:// |
| Sinon d’autres renseignements : | Sinon d’autres renseignements : | ||
| - | http:// | + | [[http:// |
| + | |||
| + | [[https:// | ||
| ==== Illustration ==== | ==== Illustration ==== | ||
| - | {{: | + | {{media_07: |
| ==== Théorie ==== | ==== Théorie ==== | ||
| - | http:// | + | [[http:// |
| ===== Simulation ===== | ===== Simulation ===== | ||
| ==== Résultat ==== | ==== Résultat ==== | ||
| - | {{: | + | {{media_03: |
| ==== Processing ==== | ==== Processing ==== | ||
| <code java> | <code java> | ||
| Ligne 149: | Ligne 151: | ||
| ==== Processing 3D ==== | ==== Processing 3D ==== | ||
| - | <code java> | ||
| + | Voici le code avec exportation .png et .stl : | ||
| + | <code java> | ||
| + | import java.io.*; | ||
| import peasy.PeasyCam; | import peasy.PeasyCam; | ||
| PeasyCam cam; | PeasyCam cam; | ||
| + | File repertoire; | ||
| + | |||
| ArrayList< | ArrayList< | ||
| ArrayList< | ArrayList< | ||
| - | int nombreMarcheurs = 2000; | + | int nombreMarcheurs = 1000; |
| int limite = 800; | int limite = 800; | ||
| int rangMax = 0; | int rangMax = 0; | ||
| Ligne 173: | Ligne 179: | ||
| public void setup() { | public void setup() { | ||
| cam = new PeasyCam(this, | cam = new PeasyCam(this, | ||
| + | repertoire = new File(sketchPath()); | ||
| + | |||
| } | } | ||
| Ligne 203: | Ligne 211: | ||
| } | } | ||
| } | } | ||
| - | affichageArbre(); | + | affichageArbre(arbre); |
| if (marcheurs.size() == 0) { | if (marcheurs.size() == 0) { | ||
| println(rangMax); | println(rangMax); | ||
| Ligne 209: | Ligne 217: | ||
| } | } | ||
| - | void affichageArbre() { | + | void affichageArbre(ArrayList< |
| background(0); | background(0); | ||
| - | for (int j = 1; j < arbre.size(); j++) { | + | for (int j = 1; j < a.size(); j++) { |
| - | Marcheur ma1 = arbre.get(j); | + | Marcheur ma1 = a.get(j); |
| Marcheur ma2 = ma1.parent; | Marcheur ma2 = ma1.parent; | ||
| stroke(255); | stroke(255); | ||
| Ligne 224: | Ligne 232: | ||
| saveFrame(" | saveFrame(" | ||
| } | } | ||
| + | if (key == ' | ||
| + | exporterSTL(arbre); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | void exporterSTL(ArrayList< | ||
| + | String ligne = " | ||
| + | for (int j = 1; j < a.size(); j++) { | ||
| + | if (j != 1) { | ||
| + | ligne += ","; | ||
| + | } | ||
| + | Marcheur ma1 = a.get(j); | ||
| + | Marcheur ma2 = ma1.parent; | ||
| + | String p1 = " | ||
| + | String p2 = " | ||
| + | ligne += " | ||
| + | } | ||
| + | ligne += " | ||
| + | println(ligne); | ||
| + | String[] cmd = {"/ | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | "u = " + ligne, | ||
| + | " | ||
| + | | ||
| + | Process p; | ||
| + | try { | ||
| + | p = Runtime.getRuntime().exec(cmd, | ||
| + | p.waitFor(); | ||
| + | float error = p.exitValue(); | ||
| + | println(" | ||
| + | } | ||
| + | catch (InterruptedException e) { | ||
| + | e.printStackTrace(); | ||
| + | } | ||
| + | catch (IOException e) { | ||
| + | e.printStackTrace(); | ||
| + | } | ||
| } | } | ||
| Ligne 275: | Ligne 322: | ||
| float dz = b.z - a.z; | float dz = b.z - a.z; | ||
| return dx * dx + dy * dy + dz * dz; | return dx * dx + dy * dy + dz * dz; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Pour la partie OpenSACD de l' | ||
| + | <code c> | ||
| + | $fn = 15; | ||
| + | |||
| + | u = [[[[10, 10, 10], 30], [[30, 20, 40], 20]], [[[30, 20, 40], 20], [[60, 30, 45], 10]]]; | ||
| + | |||
| + | for (i = [0:len(u) - 1]) { | ||
| + | element(u[i]); | ||
| + | } | ||
| + | |||
| + | module element(e) { | ||
| + | a = e[0]; | ||
| + | b = e[1]; | ||
| + | hull() { | ||
| + | translate(a[0]) sphere(d = a[1]); | ||
| + | translate(b[0]) sphere(d = b[1]); | ||
| + | } | ||
| } | } | ||
| </ | </ | ||
| Ligne 280: | Ligne 347: | ||
| === Heightmap === | === Heightmap === | ||
| - | https:// | + | [[https:// |
| === Agrégation limitée par la diffusion (DLA) === | === Agrégation limitée par la diffusion (DLA) === | ||
| - | https:// | + | [[https:// |
| - | https:// | + | [[https:// |
| - | https:// | + | [[https:// |
| - | {{tag> | + | {{tag> processing sylvain}} |
figure_de_lichtenberg.1574039492.txt.gz · Dernière modification : de Mushussu
