Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
recherche:residence_polygones:start [2025/11/08 19:42]
emoc [mesh 2 svg]
recherche:residence_polygones:start [2025/11/08 22:27] (Version actuelle)
emoc ç
Ligne 13: Ligne 13:
 Meshlab : https://​www.meshlab.net/​ Rien tiré de meshlab pour transformer un mesh (stl, obj) en svg \\ Meshlab : https://​www.meshlab.net/​ Rien tiré de meshlab pour transformer un mesh (stl, obj) en svg \\
  
-Essai concluant avec https://​www.svgai.org/​convert/​stl-to-svg,​ le fichier s'​ouvre bien avec inkscape, l'​épaisseur des traits est bien trop élevée mais ça s'​arrange facilement+Premier essai concluant avec https://​www.svgai.org/​convert/​stl-to-svg,​ le fichier s'​ouvre bien avec inkscape, l'​épaisseur des traits est bien trop élevée mais ça s'​arrange facilement. __Aucune face n'est cachée__ ​
  
-Conseil de Laurent : utiliser «ln» de Michael Fogleman : https://​github.com/​fogleman/​ln+**Conseil de Laurent : utiliser «ln» de Michael Fogleman** : https://​github.com/​fogleman/​ln
 C'est programmé en Go, jamais utilisé C'est programmé en Go, jamais utilisé
-  # installation du langage Go sur Debian 12  @ tenko+  ​# ************************************** ​    #​ installation du langage Go sur Debian 12  @ tenko
   sudo apt update   sudo apt update
   sudo apt install golang   sudo apt install golang
-  go version ​      ​# go version go1.19.8 linux/amd64+  go version ​                                  ​# go version go1.19.8 linux/amd64 
 +  go env GOPATH ​                               # ok : /​home/​emoc/​go 
 +  go install github.com/​fogleman/​ln/​ln@latest 
 +  mkdir -p ~/go/bin 
 +   
 +Aucun des tests d'​installation ne fonctionne correctement ... (ci-dessous) 
 +  git clone https://​github.com/​fogleman/​ln.git 
 +  cd ln 
 +  go mod init lnbuild 
 +  go mod tidy 
 +  go build -o ~/go/bin/ln ./ln 
 +  chmod +x ~/​go/​bin/​ln 
 +  ~/go/bin/ln --help ​                           # erreur 
 + 
 +alors plutôt j'​essaie de comprendre comment doit fonctionner go... 
 + 
 +**Test d'un helloworld** \\ 
 +Créer un fichier vide hello.go 
 +  nano hello.go 
 +Y écrire 
 +<code go> 
 +package main 
 + 
 +import "​fmt"​ 
 + 
 +func main() { 
 +    fmt.Println("​HelloWorld,​ Golang!"​) 
 +
 +</​code>​ 
 +Puis 
 +  go run hello.go 
 +   
 +**Transformation d'un .OBJ en .SVG** 
 +Ça marche! Le fichier svg est créé, en fonction du point de vue défini dans le script go, les faces qui doivent l'​être sont cachées. 
 +  git clone https://​github.com/​fogleman/​ln.git 
 +  cd ln 
 +  go mod init ln/ln 
 +  go mod tidy 
 +  go run teapot.go 
 + 
 +placer le fichier teapot.obj dans le dossier et créer le fichier teapot.go : 
 +<code go> 
 +package main 
 + 
 +import "​github.com/​fogleman/​ln/​ln"​ 
 + 
 +func main() { 
 + scene := ln.Scene{} 
 + mesh, err := ln.LoadOBJ("​teapot.obj"​) 
 + if err != nil { 
 + panic(err) 
 +
 + mesh.UnitCube() 
 + scene.Add(ln.NewTransformedShape(mesh,​ ln.Rotate(ln.Vector{0,​ 1, 0}, 0.5))) 
 + // scene.Add(mesh) 
 + eye := ln.Vector{-0.5,​ 0.5, 2} 
 + center := ln.Vector{} 
 + up := ln.Vector{0,​ 1, 0} 
 + width := 1024.0 
 + height := 1024.0 
 + paths := scene.Render(eye,​ center, up, width, height, 35, 0.1, 100, 0.01) 
 + paths.WriteToPNG("​teapot.png",​ width, height) 
 + paths.WriteToSVG("​teapot.svg",​ width, height) 
 +
 +</​code>​
  
 ==== Petite parenthèse VRML ==== ==== Petite parenthèse VRML ====
  • recherche/residence_polygones/start.1762627329.txt.gz
  • Dernière modification: 2025/11/08 19:42
  • par emoc