implemented graphviz builderin dot.go to build dot files for graphviz
This commit is contained in:
10
main.go
10
main.go
@@ -4,6 +4,7 @@ import (
|
||||
"bspviz/internal/bsp"
|
||||
"bspviz/internal/geom"
|
||||
"bspviz/internal/mapfmt"
|
||||
"bspviz/internal/viz"
|
||||
"bspviz/internal/wad"
|
||||
"flag"
|
||||
"fmt"
|
||||
@@ -30,6 +31,7 @@ func main() {
|
||||
depth := flag.Int("maxdepth", 32, "max. Rekursionstiefe")
|
||||
cands := flag.Int("cands", 16, "Anzahl Kandidaten (Subsample)")
|
||||
seed := flag.Int64("seed", 0, "RNG-Seed (0 = default)")
|
||||
dotOut := flag.String("dot", "", "DOT-Export-Datei (optional)")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -190,6 +192,14 @@ func main() {
|
||||
st.Nodes, st.Leaves, st.MaxDepth, st.TotalSegs)
|
||||
fmt.Printf(" params: alpha=%.2f beta=%.2f eps=%.1e leafMax=%d maxDepth=%d cands=%d seed=%d\n",
|
||||
p.Alpha, p.Beta, p.Eps, p.LeafMax, p.MaxDepth, p.Cands, p.Seed)
|
||||
|
||||
if *dotOut != "" {
|
||||
if err := viz.EmitDOT(root, *dotOut); err != nil {
|
||||
log.Fatalf("write DOT: %v", err)
|
||||
}
|
||||
fmt.Printf("DOT export geschrieben: %s (mit 'dot -Tpng %s -o tree.png' rendern)\n",
|
||||
*dotOut, *dotOut)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user