File size: 1,324 Bytes
e232e39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env Rscript
# Debug border edge paths

source("R/logging.R")
source("R/config_utils.R")
source("R/hexagonal_topology.R")
source("R/hexagonal_neighbors.R")
source("R/hexagonal_bezier_generation.R")
source("R/hexagonal_edge_generation_fixed.R")

cat("=== Debug Border Edge Paths ===\n\n")

rings <- 3
seed <- 42
diameter <- 200
tabsize <- 27
jitter <- 5

cat("Testing trunc_only (warp=FALSE, trunc=TRUE):\n\n")

capture.output({
  edge_data <- generate_hex_edge_map(rings, seed, diameter, tabsize, jitter,
                                      do_warp = FALSE, do_trunc = TRUE)
}, type = "output")

cat("Checking all border edges for path content:\n")
for (key in names(edge_data$piece_edge_map)) {
  edge <- edge_data$piece_edge_map[[key]]
  if (edge$type == "border") {
    path_val <- edge$path
    path_desc <- if (is.null(path_val)) {
      "NULL"
    } else if (length(path_val) == 0) {
      "EMPTY (length 0)"
    } else {
      paste0("length ", nchar(path_val))
    }
    cat(sprintf("  Edge %s: path = %s\n", key, path_desc))

    # Show first 100 chars if path exists
    if (!is.null(path_val) && length(path_val) > 0 && nchar(path_val) > 0) {
      cat(sprintf("    First 100 chars: %s\n", substr(path_val, 1, 100)))
    }
  }
}

cat("\n=== Done ===\n")