| |
|
|
| cat("=== Debugging Border Issues ===\n") |
|
|
| |
| source("R/rectangular_puzzle.R") |
|
|
| |
| puzzle_2x2 <- generate_jigsaw_svg( |
| seed = 1234, |
| xn = 2, yn = 2, |
| width = 200, height = 200, |
| tabsize = 20, jitter = 4 |
| ) |
|
|
| cat("Original puzzle paths:\n") |
| cat("Horizontal:", substr(puzzle_2x2$horizontal, 1, 200), "...\n") |
| cat("Vertical:", substr(puzzle_2x2$vertical, 1, 200), "...\n") |
| cat("Border:", substr(puzzle_2x2$border, 1, 200), "...\n") |
|
|
| |
| |
|
|
| border_path <- puzzle_2x2$border |
| cat("\nFull border path:\n") |
| cat(border_path, "\n") |
|
|
| |
| |
|
|
| cat("\nAnalyzing border path components:\n") |
| cat("- Starts at (2,0) not (0,0)\n") |
| cat("- Top edge: (2,0) to (198,0)\n") |
| cat("- Top-right corner: arc from (198,0) to (200,2)\n") |
| cat("- Right edge: (200,2) to (200,198)\n") |
| cat("- Bottom-right corner: arc from (200,198) to (198,200)\n") |
| cat("- Bottom edge: (198,200) to (2,200)\n") |
| cat("- Bottom-left corner: arc from (2,200) to (0,198)\n") |
| cat("- Left edge: (0,198) to (0,2)\n") |
| cat("- Top-left corner: arc from (0,2) to (2,0)\n") |
|
|
| |
| |
|
|
| cat("\n=== Piece [1,0] Analysis ===\n") |
| cat("Expected coordinates: (100,0) to (200,100)\n") |
| cat("But with corner radius, the actual borders are:\n") |
| cat("- TOP: (100,0) to (198,0), then arc to (200,2)\n") |
| cat("- RIGHT: (200,2) to (200,100)\n") |
|
|
| |
| cat("\n=== Piece [1,1] Analysis ===\n") |
| cat("Expected coordinates: (100,100) to (200,200)\n") |
| cat("But with corner radius, the actual borders are:\n") |
| cat("- RIGHT: (200,100) to (200,198), then arc to (198,200)\n") |
| cat("- BOTTOM: (198,200) to (100,200)\n") |
|
|
| cat("\n=== Issue Identified ===\n") |
| cat("The straight border edges need to account for corner radius!\n") |
| cat("Current pieces use simple L commands, but should include the corner arcs.\n") |
|
|
| |
|
|
| |
| cat("\nPiece [1,0] should have:\n") |
| cat("- TOP: L 198 0 A 2 2 0 0 1 200 2\n") |
| cat("- RIGHT: L 200 100\n") |
|
|
| |
| cat("\nPiece [1,1] should have:\n") |
| cat("- RIGHT: L 200 198 A 2 2 0 0 1 198 200\n") |
| cat("- BOTTOM: L 100 200\n") |
|
|
| cat("\n=== Next Step ===\n") |
| cat("Fix the border segments to include proper corner radius handling\n") |