The Canvas Grid

Every Canvas has a Grid or pattern of evenly-spaced overlapping guides to assist you in creating and aligning objects on the canvas.

Grid Properties

A canvas grid has properties whose values determine how it functions with the canvas. NOTE: in the current OmniJS scripting implementation, the values of grid properties are Read-Only, meaning can accessed by a script but are not alterable via a script.

grid-01

Here’s an example script that reads the grid settings and creates a graphic to fill the area of a single major grid space. The fill and stroke colors of the created shape will match those of the grid.

cnvs = document.windows[0].selection.canvas blockDimension = cnvs.grid.majorSpacing * cnvs.grid.spacing minColor = cnvs.grid.minorColor majColor = cnvs.grid.majorColor aRect = new Rect(0,0,blockDimension,blockDimension) aShape = cnvs.addShape('Rectangle',aRect) aShape.fillColor = minColor aShape.strokeColor = majColor
omnigraffle:///omnijs-run?script=cnvs%20%3D%20document%2Ewindows%5B0%5D%2Eselection%2Ecanvas%0AblockDimension%20%3D%20cnvs%2Egrid%2EmajorSpacing%20*%20cnvs%2Egrid%2Espacing%0AminColor%20%3D%20cnvs%2Egrid%2EminorColor%0AmajColor%20%3D%20cnvs%2Egrid%2EmajorColor%0AaRect%20%3D%20new%20Rect%280%2C0%2CblockDimension%2CblockDimension%29%0AaShape%20%3D%20cnvs%2EaddShape%28%27Rectangle%27%2CaRect%29%0AaShape%2EfillColor%20%3D%20minColor%0AaShape%2EstrokeColor%20%3D%20majColor
grid-02

The Toothpick Puzzle

Here’s an example script demonstrating setting up a canvas grid. It is a classic “Toothpick Puzzle” where the lines on the canvas represent virtual toothpicks. The puzzles are from the research paper Toothpick Geometry by Jung Kim and John Rader at the University of Hawai’i at Manoa.

Puzzle #1: remove one toothpick to leave only three squares:

toothpick-puzzle-1
function setupCanvasGrid(cnvs){ cnvs.canvasSizingMode = CanvasSizingMode.Infinite cnvs.grid.majorSpacing = 10 cnvs.grid.spacing = 10 cnvs.grid.majorColor = Color.blue cnvs.grid.minorColor = Color.white cnvs.grid.snaps = true cnvs.grid.visible = true cnvs.grid.drawsInFront = false } function deleteGraphicsFromCanvas(cnvs){ cnvs.graphics.forEach(function(graphic){ graphic.remove() }) } function setupToothpickPuzzle1(){ var cnvs = document.windows[0].selection.canvas; deleteGraphicsFromCanvas(cnvs); setupCanvasGrid(cnvs); var g1 = cnvs.newLine(); var g2 = cnvs.newLine(); var g3 = cnvs.newLine(); var g4 = cnvs.newLine(); var g5 = cnvs.newLine(); var g6 = cnvs.newLine(); var g7 = cnvs.newLine(); var g8 = cnvs.newLine(); var g9 = cnvs.newLine(); var g10 = cnvs.newLine(); var g11 = cnvs.newLine(); var g12 = cnvs.newLine(); var g13 = cnvs.newLine(); g1.strokeThickness = 10; g1.name = "Toothpick M"; g1.shadowColor = null; g1.strokeCap = LineCap.Butt; g1.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g1.points = [new Point(200.00, 410.00), new Point(200.00, 590.00)]; g2.strokeThickness = 10; g2.name = "Toothpick L"; g2.shadowColor = null; g2.strokeCap = LineCap.Butt; g2.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g2.points = [new Point(0.00, 410.00), new Point(0.00, 590.00)]; g3.strokeThickness = 10; g3.name = "Toothpick K"; g3.shadowColor = null; g3.strokeCap = LineCap.Butt; g3.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g3.points = [new Point(400.00, 210.00), new Point(400.00, 390.00)]; g4.strokeThickness = 10; g4.name = "Toothpick J"; g4.shadowColor = null; g4.strokeCap = LineCap.Butt; g4.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g4.points = [new Point(200.00, 210.00), new Point(200.00, 390.00)]; g5.strokeThickness = 10; g5.name = "Toothpick I"; g5.shadowColor = null; g5.strokeCap = LineCap.Butt; g5.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g5.points = [new Point(0.00, 210.00), new Point(0.00, 390.00)]; g6.strokeThickness = 10; g6.name = "Toothpick H"; g6.shadowColor = null; g6.strokeCap = LineCap.Butt; g6.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g6.points = [new Point(200.00, 10.00), new Point(200.00, 190.00)]; g7.strokeThickness = 10; g7.name = "Toothpick G"; g7.shadowColor = null; g7.strokeCap = LineCap.Butt; g7.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g7.points = [new Point(0.00, 10.00), new Point(0.00, 190.00)]; g8.strokeThickness = 10; g8.name = "Toothpick F"; g8.shadowColor = null; g8.strokeCap = LineCap.Butt; g8.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g8.points = [new Point(10.00, 600.00), new Point(190.00, 600.00)]; g9.strokeThickness = 10; g9.name = "Toothpick E"; g9.shadowColor = null; g9.strokeCap = LineCap.Butt; g9.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g9.points = [new Point(210.00, 400.00), new Point(390.00, 400.00)]; g10.strokeThickness = 10; g10.name = "Toothpick D"; g10.shadowColor = null; g10.strokeCap = LineCap.Butt; g10.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g10.points = [new Point(10.00, 400.00), new Point(190.00, 400.00)]; g11.strokeThickness = 10; g11.name = "Toothpick C"; g11.shadowColor = null; g11.strokeCap = LineCap.Butt; g11.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g11.points = [new Point(210.00, 200.00), new Point(390.00, 200.00)]; g12.strokeThickness = 10; g12.name = "Toothpick B"; g12.shadowColor = null; g12.strokeCap = LineCap.Butt; g12.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g12.points = [new Point(10.00, 200.00), new Point(190.00, 200.00)]; g13.strokeThickness = 10; g13.name = "Toothpick A"; g13.shadowColor = null; g13.strokeCap = LineCap.Butt; g13.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g13.points = [new Point(10.00, 0.00), new Point(190.00, 0.00)]; } setupToothpickPuzzle1()
omnigraffle://localhost/omnijs-run?script=function%20setupCanvasGrid%28cnvs%29%7B%0A%09cnvs%2EcanvasSizingMode%20%3D%20CanvasSizingMode%2EInfinite%0A%09cnvs%2Egrid%2EmajorSpacing%20%3D%2010%0A%09cnvs%2Egrid%2Espacing%20%3D%2010%0A%09cnvs%2Egrid%2EmajorColor%20%3D%20Color%2Eblue%0A%09cnvs%2Egrid%2EminorColor%20%3D%20Color%2Ewhite%0A%09cnvs%2Egrid%2Esnaps%20%3D%20true%0A%09cnvs%2Egrid%2Evisible%20%3D%20true%0A%09cnvs%2Egrid%2EdrawsInFront%20%3D%20false%0A%7D%0A%0Afunction%20deleteGraphicsFromCanvas%28cnvs%29%7B%0A%09cnvs%2Egraphics%2EforEach%28function%28graphic%29%7B%0A%09%09graphic%2Eremove%28%29%0A%09%7D%29%0A%7D%0A%0Afunction%20setupToothpickPuzzle1%28%29%7B%0A%09var%20cnvs%20%3D%20document%2Ewindows%5B0%5D%2Eselection%2Ecanvas%3B%0A%09deleteGraphicsFromCanvas%28cnvs%29%3B%0A%09setupCanvasGrid%28cnvs%29%3B%0A%09var%20g1%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g2%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g3%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g4%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g5%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g6%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g7%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g8%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g9%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g10%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g11%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g12%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g13%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09g1%2EstrokeThickness%20%3D%2010%3B%0A%09g1%2Ename%20%3D%20%22Toothpick%20M%22%3B%0A%09g1%2EshadowColor%20%3D%20null%3B%0A%09g1%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g1%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g1%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%20410%2E00%29%2C%20new%20Point%28200%2E00%2C%20590%2E00%29%5D%3B%0A%09g2%2EstrokeThickness%20%3D%2010%3B%0A%09g2%2Ename%20%3D%20%22Toothpick%20L%22%3B%0A%09g2%2EshadowColor%20%3D%20null%3B%0A%09g2%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g2%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g2%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%20410%2E00%29%2C%20new%20Point%280%2E00%2C%20590%2E00%29%5D%3B%0A%09g3%2EstrokeThickness%20%3D%2010%3B%0A%09g3%2Ename%20%3D%20%22Toothpick%20K%22%3B%0A%09g3%2EshadowColor%20%3D%20null%3B%0A%09g3%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g3%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g3%2Epoints%20%3D%20%5Bnew%20Point%28400%2E00%2C%20210%2E00%29%2C%20new%20Point%28400%2E00%2C%20390%2E00%29%5D%3B%0A%09g4%2EstrokeThickness%20%3D%2010%3B%0A%09g4%2Ename%20%3D%20%22Toothpick%20J%22%3B%0A%09g4%2EshadowColor%20%3D%20null%3B%0A%09g4%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g4%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g4%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%20210%2E00%29%2C%20new%20Point%28200%2E00%2C%20390%2E00%29%5D%3B%0A%09g5%2EstrokeThickness%20%3D%2010%3B%0A%09g5%2Ename%20%3D%20%22Toothpick%20I%22%3B%0A%09g5%2EshadowColor%20%3D%20null%3B%0A%09g5%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g5%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g5%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%20210%2E00%29%2C%20new%20Point%280%2E00%2C%20390%2E00%29%5D%3B%0A%09g6%2EstrokeThickness%20%3D%2010%3B%0A%09g6%2Ename%20%3D%20%22Toothpick%20H%22%3B%0A%09g6%2EshadowColor%20%3D%20null%3B%0A%09g6%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g6%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g6%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%2010%2E00%29%2C%20new%20Point%28200%2E00%2C%20190%2E00%29%5D%3B%0A%09g7%2EstrokeThickness%20%3D%2010%3B%0A%09g7%2Ename%20%3D%20%22Toothpick%20G%22%3B%0A%09g7%2EshadowColor%20%3D%20null%3B%0A%09g7%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g7%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g7%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%2010%2E00%29%2C%20new%20Point%280%2E00%2C%20190%2E00%29%5D%3B%0A%09g8%2EstrokeThickness%20%3D%2010%3B%0A%09g8%2Ename%20%3D%20%22Toothpick%20F%22%3B%0A%09g8%2EshadowColor%20%3D%20null%3B%0A%09g8%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g8%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g8%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20600%2E00%29%2C%20new%20Point%28190%2E00%2C%20600%2E00%29%5D%3B%0A%09g9%2EstrokeThickness%20%3D%2010%3B%0A%09g9%2Ename%20%3D%20%22Toothpick%20E%22%3B%0A%09g9%2EshadowColor%20%3D%20null%3B%0A%09g9%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g9%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g9%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%20400%2E00%29%2C%20new%20Point%28390%2E00%2C%20400%2E00%29%5D%3B%0A%09g10%2EstrokeThickness%20%3D%2010%3B%0A%09g10%2Ename%20%3D%20%22Toothpick%20D%22%3B%0A%09g10%2EshadowColor%20%3D%20null%3B%0A%09g10%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g10%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g10%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20400%2E00%29%2C%20new%20Point%28190%2E00%2C%20400%2E00%29%5D%3B%0A%09g11%2EstrokeThickness%20%3D%2010%3B%0A%09g11%2Ename%20%3D%20%22Toothpick%20C%22%3B%0A%09g11%2EshadowColor%20%3D%20null%3B%0A%09g11%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g11%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g11%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%20200%2E00%29%2C%20new%20Point%28390%2E00%2C%20200%2E00%29%5D%3B%0A%09g12%2EstrokeThickness%20%3D%2010%3B%0A%09g12%2Ename%20%3D%20%22Toothpick%20B%22%3B%0A%09g12%2EshadowColor%20%3D%20null%3B%0A%09g12%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g12%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g12%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20200%2E00%29%2C%20new%20Point%28190%2E00%2C%20200%2E00%29%5D%3B%0A%09g13%2EstrokeThickness%20%3D%2010%3B%0A%09g13%2Ename%20%3D%20%22Toothpick%20A%22%3B%0A%09g13%2EshadowColor%20%3D%20null%3B%0A%09g13%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g13%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g13%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%200%2E00%29%2C%20new%20Point%28190%2E00%2C%200%2E00%29%5D%3B%0A%7D%0A%0AsetupToothpickPuzzle1%28%29
function setupCanvasGrid(cnvs){ cnvs.canvasSizingMode = CanvasSizingMode.Infinite cnvs.grid.majorSpacing = 10 cnvs.grid.spacing = 10 cnvs.grid.majorColor = Color.blue cnvs.grid.minorColor = Color.white cnvs.grid.snaps = true cnvs.grid.visible = true cnvs.grid.drawsInFront = false } function deleteGraphicsFromCanvas(cnvs){ cnvs.graphics.forEach(function(graphic){ graphic.remove() }) } function solveToothpickPuzzle1(){ var cnvs = document.windows[0].selection.canvas; deleteGraphicsFromCanvas(cnvs); setupCanvasGrid(cnvs); var g1 = cnvs.newLine(); var g2 = cnvs.newLine(); var g3 = cnvs.newLine(); var g4 = cnvs.newLine(); var g5 = cnvs.newLine(); var g6 = cnvs.newLine(); var g7 = cnvs.newLine(); var g8 = cnvs.newLine(); var g9 = cnvs.newLine(); var g10 = cnvs.newLine(); var g11 = cnvs.newLine(); var g12 = cnvs.newLine(); g1.strokeThickness = 10; g1.name = "Toothpick M"; g1.shadowColor = null; g1.strokeCap = LineCap.Butt; g1.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g1.points = [new Point(200.00, 410.00), new Point(200.00, 590.00)]; g2.strokeThickness = 10; g2.name = "Toothpick L"; g2.shadowColor = null; g2.strokeCap = LineCap.Butt; g2.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g2.points = [new Point(0.00, 410.00), new Point(0.00, 590.00)]; g3.strokeThickness = 10; g3.name = "Toothpick K"; g3.shadowColor = null; g3.strokeCap = LineCap.Butt; g3.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g3.points = [new Point(400.00, 210.00), new Point(400.00, 390.00)]; g4.strokeThickness = 10; g4.name = "Toothpick J"; g4.shadowColor = null; g4.strokeCap = LineCap.Butt; g4.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g4.points = [new Point(200.00, 210.00), new Point(200.00, 390.00)]; g5.strokeThickness = 10; g5.name = "Toothpick H"; g5.shadowColor = null; g5.strokeCap = LineCap.Butt; g5.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g5.points = [new Point(200.00, 10.00), new Point(200.00, 190.00)]; g6.strokeThickness = 10; g6.name = "Toothpick G"; g6.shadowColor = null; g6.strokeCap = LineCap.Butt; g6.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g6.points = [new Point(0.00, 10.00), new Point(0.00, 190.00)]; g7.strokeThickness = 10; g7.name = "Toothpick F"; g7.shadowColor = null; g7.strokeCap = LineCap.Butt; g7.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g7.points = [new Point(10.00, 600.00), new Point(190.00, 600.00)]; g8.strokeThickness = 10; g8.name = "Toothpick E"; g8.shadowColor = null; g8.strokeCap = LineCap.Butt; g8.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g8.points = [new Point(210.00, 400.00), new Point(390.00, 400.00)]; g9.strokeThickness = 10; g9.name = "Toothpick D"; g9.shadowColor = null; g9.strokeCap = LineCap.Butt; g9.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g9.points = [new Point(10.00, 400.00), new Point(190.00, 400.00)]; g10.strokeThickness = 10; g10.name = "Toothpick C"; g10.shadowColor = null; g10.strokeCap = LineCap.Butt; g10.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g10.points = [new Point(210.00, 200.00), new Point(390.00, 200.00)]; g11.strokeThickness = 10; g11.name = "Toothpick B"; g11.shadowColor = null; g11.strokeCap = LineCap.Butt; g11.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g11.points = [new Point(10.00, 200.00), new Point(190.00, 200.00)]; g12.strokeThickness = 10; g12.name = "Toothpick A"; g12.shadowColor = null; g12.strokeCap = LineCap.Butt; g12.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g12.points = [new Point(10.00, 0.00), new Point(190.00, 0.00)]; } solveToothpickPuzzle1()
omnigraffle://localhost/omnijs-run?script=function%20setupCanvasGrid%28cnvs%29%7B%0A%09cnvs%2EcanvasSizingMode%20%3D%20CanvasSizingMode%2EInfinite%0A%09cnvs%2Egrid%2EmajorSpacing%20%3D%2010%0A%09cnvs%2Egrid%2Espacing%20%3D%2010%0A%09cnvs%2Egrid%2EmajorColor%20%3D%20Color%2Eblue%0A%09cnvs%2Egrid%2EminorColor%20%3D%20Color%2Ewhite%0A%09cnvs%2Egrid%2Esnaps%20%3D%20true%0A%09cnvs%2Egrid%2Evisible%20%3D%20true%0A%09cnvs%2Egrid%2EdrawsInFront%20%3D%20false%0A%7D%0A%0Afunction%20deleteGraphicsFromCanvas%28cnvs%29%7B%0A%09cnvs%2Egraphics%2EforEach%28function%28graphic%29%7B%0A%09%09graphic%2Eremove%28%29%0A%09%7D%29%0A%7D%0A%0Afunction%20solveToothpickPuzzle1%28%29%7B%0A%09var%20cnvs%20%3D%20document%2Ewindows%5B0%5D%2Eselection%2Ecanvas%3B%0A%09deleteGraphicsFromCanvas%28cnvs%29%3B%0A%09setupCanvasGrid%28cnvs%29%3B%0A%09var%20g1%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g2%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g3%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g4%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g5%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g6%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g7%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g8%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g9%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g10%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g11%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g12%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09g1%2EstrokeThickness%20%3D%2010%3B%0A%09g1%2Ename%20%3D%20%22Toothpick%20M%22%3B%0A%09g1%2EshadowColor%20%3D%20null%3B%0A%09g1%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g1%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g1%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%20410%2E00%29%2C%20new%20Point%28200%2E00%2C%20590%2E00%29%5D%3B%0A%09g2%2EstrokeThickness%20%3D%2010%3B%0A%09g2%2Ename%20%3D%20%22Toothpick%20L%22%3B%0A%09g2%2EshadowColor%20%3D%20null%3B%0A%09g2%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g2%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g2%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%20410%2E00%29%2C%20new%20Point%280%2E00%2C%20590%2E00%29%5D%3B%0A%09g3%2EstrokeThickness%20%3D%2010%3B%0A%09g3%2Ename%20%3D%20%22Toothpick%20K%22%3B%0A%09g3%2EshadowColor%20%3D%20null%3B%0A%09g3%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g3%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g3%2Epoints%20%3D%20%5Bnew%20Point%28400%2E00%2C%20210%2E00%29%2C%20new%20Point%28400%2E00%2C%20390%2E00%29%5D%3B%0A%09g4%2EstrokeThickness%20%3D%2010%3B%0A%09g4%2Ename%20%3D%20%22Toothpick%20J%22%3B%0A%09g4%2EshadowColor%20%3D%20null%3B%0A%09g4%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g4%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g4%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%20210%2E00%29%2C%20new%20Point%28200%2E00%2C%20390%2E00%29%5D%3B%0A%09g5%2EstrokeThickness%20%3D%2010%3B%0A%09g5%2Ename%20%3D%20%22Toothpick%20H%22%3B%0A%09g5%2EshadowColor%20%3D%20null%3B%0A%09g5%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g5%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g5%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%2010%2E00%29%2C%20new%20Point%28200%2E00%2C%20190%2E00%29%5D%3B%0A%09g6%2EstrokeThickness%20%3D%2010%3B%0A%09g6%2Ename%20%3D%20%22Toothpick%20G%22%3B%0A%09g6%2EshadowColor%20%3D%20null%3B%0A%09g6%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g6%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g6%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%2010%2E00%29%2C%20new%20Point%280%2E00%2C%20190%2E00%29%5D%3B%0A%09g7%2EstrokeThickness%20%3D%2010%3B%0A%09g7%2Ename%20%3D%20%22Toothpick%20F%22%3B%0A%09g7%2EshadowColor%20%3D%20null%3B%0A%09g7%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g7%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g7%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20600%2E00%29%2C%20new%20Point%28190%2E00%2C%20600%2E00%29%5D%3B%0A%09g8%2EstrokeThickness%20%3D%2010%3B%0A%09g8%2Ename%20%3D%20%22Toothpick%20E%22%3B%0A%09g8%2EshadowColor%20%3D%20null%3B%0A%09g8%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g8%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g8%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%20400%2E00%29%2C%20new%20Point%28390%2E00%2C%20400%2E00%29%5D%3B%0A%09g9%2EstrokeThickness%20%3D%2010%3B%0A%09g9%2Ename%20%3D%20%22Toothpick%20D%22%3B%0A%09g9%2EshadowColor%20%3D%20null%3B%0A%09g9%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g9%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g9%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20400%2E00%29%2C%20new%20Point%28190%2E00%2C%20400%2E00%29%5D%3B%0A%09g10%2EstrokeThickness%20%3D%2010%3B%0A%09g10%2Ename%20%3D%20%22Toothpick%20C%22%3B%0A%09g10%2EshadowColor%20%3D%20null%3B%0A%09g10%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g10%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g10%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%20200%2E00%29%2C%20new%20Point%28390%2E00%2C%20200%2E00%29%5D%3B%0A%09g11%2EstrokeThickness%20%3D%2010%3B%0A%09g11%2Ename%20%3D%20%22Toothpick%20B%22%3B%0A%09g11%2EshadowColor%20%3D%20null%3B%0A%09g11%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g11%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g11%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20200%2E00%29%2C%20new%20Point%28190%2E00%2C%20200%2E00%29%5D%3B%0A%09g12%2EstrokeThickness%20%3D%2010%3B%0A%09g12%2Ename%20%3D%20%22Toothpick%20A%22%3B%0A%09g12%2EshadowColor%20%3D%20null%3B%0A%09g12%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g12%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g12%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%200%2E00%29%2C%20new%20Point%28190%2E00%2C%200%2E00%29%5D%3B%0A%7D%0A%0AsolveToothpickPuzzle1%28%29
function setupCanvasGrid(cnvs){ cnvs.canvasSizingMode = CanvasSizingMode.Infinite cnvs.grid.majorSpacing = 10 cnvs.grid.spacing = 10 cnvs.grid.majorColor = Color.blue cnvs.grid.minorColor = Color.white cnvs.grid.snaps = true cnvs.grid.visible = true cnvs.grid.drawsInFront = false } function deleteGraphicsFromCanvas(cnvs){ cnvs.graphics.forEach(function(graphic){ graphic.remove() }) } function setupToothpickPuzzle2(){ var cnvs = document.windows[0].selection.canvas; deleteGraphicsFromCanvas(cnvs); setupCanvasGrid(cnvs); var g1 = cnvs.newLine(); var g2 = cnvs.newLine(); var g3 = cnvs.newLine(); var g4 = cnvs.newLine(); var g5 = cnvs.newLine(); var g6 = cnvs.newLine(); var g7 = cnvs.newLine(); var g8 = cnvs.newLine(); var g9 = cnvs.newLine(); var g10 = cnvs.newLine(); var g11 = cnvs.newLine(); var g12 = cnvs.newLine(); g1.strokeThickness = 10; g1.name = "Toothpick L"; g1.shadowColor = null; g1.strokeCap = LineCap.Butt; g1.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g1.points = [new Point(400.00, 210.00), new Point(400.00, 390.00)]; g2.strokeThickness = 10; g2.name = "Toothpick K"; g2.shadowColor = null; g2.strokeCap = LineCap.Butt; g2.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g2.points = [new Point(200.00, 210.00), new Point(200.00, 390.00)]; g3.strokeThickness = 10; g3.name = "Toothpick J"; g3.shadowColor = null; g3.strokeCap = LineCap.Butt; g3.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g3.points = [new Point(0.00, 210.00), new Point(0.00, 390.00)]; g4.strokeThickness = 10; g4.name = "Toothpick I"; g4.shadowColor = null; g4.strokeCap = LineCap.Butt; g4.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g4.points = [new Point(400.00, 10.00), new Point(400.00, 190.00)]; g5.strokeThickness = 10; g5.name = "Toothpick H"; g5.shadowColor = null; g5.strokeCap = LineCap.Butt; g5.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g5.points = [new Point(200.00, 10.00), new Point(200.00, 190.00)]; g6.strokeThickness = 10; g6.name = "Toothpick G"; g6.shadowColor = null; g6.strokeCap = LineCap.Butt; g6.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g6.points = [new Point(0.00, 10.00), new Point(0.00, 190.00)]; g7.strokeThickness = 10; g7.name = "Toothpick F"; g7.shadowColor = null; g7.strokeCap = LineCap.Butt; g7.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g7.points = [new Point(210.00, 400.00), new Point(390.00, 400.00)]; g8.strokeThickness = 10; g8.name = "Toothpick E"; g8.shadowColor = null; g8.strokeCap = LineCap.Butt; g8.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g8.points = [new Point(10.00, 400.00), new Point(190.00, 400.00)]; g9.strokeThickness = 10; g9.name = "Toothpick D"; g9.shadowColor = null; g9.strokeCap = LineCap.Butt; g9.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g9.points = [new Point(210.00, 200.00), new Point(390.00, 200.00)]; g10.strokeThickness = 10; g10.name = "Toothpick C"; g10.shadowColor = null; g10.strokeCap = LineCap.Butt; g10.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g10.points = [new Point(10.00, 200.00), new Point(190.00, 200.00)]; g11.strokeThickness = 10; g11.name = "Toothpick B"; g11.shadowColor = null; g11.strokeCap = LineCap.Butt; g11.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g11.points = [new Point(210.00, 0.00), new Point(390.00, 0.00)]; g12.strokeThickness = 10; g12.name = "Toothpick A"; g12.shadowColor = null; g12.strokeCap = LineCap.Butt; g12.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g12.points = [new Point(10.00, 0.00), new Point(190.00, 0.00)]; } setupToothpickPuzzle2()
omnigraffle://localhost/omnijs-run?script=function%20setupCanvasGrid%28cnvs%29%7B%0A%09cnvs%2EcanvasSizingMode%20%3D%20CanvasSizingMode%2EInfinite%0A%09cnvs%2Egrid%2EmajorSpacing%20%3D%2010%0A%09cnvs%2Egrid%2Espacing%20%3D%2010%0A%09cnvs%2Egrid%2EmajorColor%20%3D%20Color%2Eblue%0A%09cnvs%2Egrid%2EminorColor%20%3D%20Color%2Ewhite%0A%09cnvs%2Egrid%2Esnaps%20%3D%20true%0A%09cnvs%2Egrid%2Evisible%20%3D%20true%0A%09cnvs%2Egrid%2EdrawsInFront%20%3D%20false%0A%7D%0A%0Afunction%20deleteGraphicsFromCanvas%28cnvs%29%7B%0A%09cnvs%2Egraphics%2EforEach%28function%28graphic%29%7B%0A%09%09graphic%2Eremove%28%29%0A%09%7D%29%0A%7D%0A%0Afunction%20setupToothpickPuzzle2%28%29%7B%0A%09var%20cnvs%20%3D%20document%2Ewindows%5B0%5D%2Eselection%2Ecanvas%3B%0A%09deleteGraphicsFromCanvas%28cnvs%29%3B%0A%09setupCanvasGrid%28cnvs%29%3B%0A%09var%20g1%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g2%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g3%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g4%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g5%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g6%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g7%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g8%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g9%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g10%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g11%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g12%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09g1%2EstrokeThickness%20%3D%2010%3B%0A%09g1%2Ename%20%3D%20%22Toothpick%20L%22%3B%0A%09g1%2EshadowColor%20%3D%20null%3B%0A%09g1%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g1%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g1%2Epoints%20%3D%20%5Bnew%20Point%28400%2E00%2C%20210%2E00%29%2C%20new%20Point%28400%2E00%2C%20390%2E00%29%5D%3B%0A%09g2%2EstrokeThickness%20%3D%2010%3B%0A%09g2%2Ename%20%3D%20%22Toothpick%20K%22%3B%0A%09g2%2EshadowColor%20%3D%20null%3B%0A%09g2%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g2%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g2%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%20210%2E00%29%2C%20new%20Point%28200%2E00%2C%20390%2E00%29%5D%3B%0A%09g3%2EstrokeThickness%20%3D%2010%3B%0A%09g3%2Ename%20%3D%20%22Toothpick%20J%22%3B%0A%09g3%2EshadowColor%20%3D%20null%3B%0A%09g3%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g3%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g3%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%20210%2E00%29%2C%20new%20Point%280%2E00%2C%20390%2E00%29%5D%3B%0A%09g4%2EstrokeThickness%20%3D%2010%3B%0A%09g4%2Ename%20%3D%20%22Toothpick%20I%22%3B%0A%09g4%2EshadowColor%20%3D%20null%3B%0A%09g4%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g4%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g4%2Epoints%20%3D%20%5Bnew%20Point%28400%2E00%2C%2010%2E00%29%2C%20new%20Point%28400%2E00%2C%20190%2E00%29%5D%3B%0A%09g5%2EstrokeThickness%20%3D%2010%3B%0A%09g5%2Ename%20%3D%20%22Toothpick%20H%22%3B%0A%09g5%2EshadowColor%20%3D%20null%3B%0A%09g5%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g5%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g5%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%2010%2E00%29%2C%20new%20Point%28200%2E00%2C%20190%2E00%29%5D%3B%0A%09g6%2EstrokeThickness%20%3D%2010%3B%0A%09g6%2Ename%20%3D%20%22Toothpick%20G%22%3B%0A%09g6%2EshadowColor%20%3D%20null%3B%0A%09g6%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g6%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g6%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%2010%2E00%29%2C%20new%20Point%280%2E00%2C%20190%2E00%29%5D%3B%0A%09g7%2EstrokeThickness%20%3D%2010%3B%0A%09g7%2Ename%20%3D%20%22Toothpick%20F%22%3B%0A%09g7%2EshadowColor%20%3D%20null%3B%0A%09g7%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g7%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g7%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%20400%2E00%29%2C%20new%20Point%28390%2E00%2C%20400%2E00%29%5D%3B%0A%09g8%2EstrokeThickness%20%3D%2010%3B%0A%09g8%2Ename%20%3D%20%22Toothpick%20E%22%3B%0A%09g8%2EshadowColor%20%3D%20null%3B%0A%09g8%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g8%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g8%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20400%2E00%29%2C%20new%20Point%28190%2E00%2C%20400%2E00%29%5D%3B%0A%09g9%2EstrokeThickness%20%3D%2010%3B%0A%09g9%2Ename%20%3D%20%22Toothpick%20D%22%3B%0A%09g9%2EshadowColor%20%3D%20null%3B%0A%09g9%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g9%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g9%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%20200%2E00%29%2C%20new%20Point%28390%2E00%2C%20200%2E00%29%5D%3B%0A%09g10%2EstrokeThickness%20%3D%2010%3B%0A%09g10%2Ename%20%3D%20%22Toothpick%20C%22%3B%0A%09g10%2EshadowColor%20%3D%20null%3B%0A%09g10%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g10%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g10%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20200%2E00%29%2C%20new%20Point%28190%2E00%2C%20200%2E00%29%5D%3B%0A%09g11%2EstrokeThickness%20%3D%2010%3B%0A%09g11%2Ename%20%3D%20%22Toothpick%20B%22%3B%0A%09g11%2EshadowColor%20%3D%20null%3B%0A%09g11%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g11%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g11%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%200%2E00%29%2C%20new%20Point%28390%2E00%2C%200%2E00%29%5D%3B%0A%09g12%2EstrokeThickness%20%3D%2010%3B%0A%09g12%2Ename%20%3D%20%22Toothpick%20A%22%3B%0A%09g12%2EshadowColor%20%3D%20null%3B%0A%09g12%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g12%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g12%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%200%2E00%29%2C%20new%20Point%28190%2E00%2C%200%2E00%29%5D%3B%0A%7D%0A%0AsetupToothpickPuzzle2%28%29
function setupCanvasGrid(cnvs){ cnvs.canvasSizingMode = CanvasSizingMode.Infinite cnvs.grid.majorSpacing = 10 cnvs.grid.spacing = 10 cnvs.grid.majorColor = Color.blue cnvs.grid.minorColor = Color.white cnvs.grid.snaps = true cnvs.grid.visible = true cnvs.grid.drawsInFront = false } function deleteGraphicsFromCanvas(cnvs){ cnvs.graphics.forEach(function(graphic){ graphic.remove() }) } function solveToothpickPuzzle2(){ var cnvs = document.windows[0].selection.canvas; deleteGraphicsFromCanvas(cnvs); setupCanvasGrid(cnvs); var g1 = cnvs.newLine(); var g3 = cnvs.newLine(); var g4 = cnvs.newLine(); var g5 = cnvs.newLine(); var g6 = cnvs.newLine(); var g7 = cnvs.newLine(); var g8 = cnvs.newLine(); var g10 = cnvs.newLine(); var g11 = cnvs.newLine(); var g12 = cnvs.newLine(); g1.strokeThickness = 10; g1.name = "Toothpick L"; g1.shadowColor = null; g1.strokeCap = LineCap.Butt; g1.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g1.points = [new Point(400.00, 210.00), new Point(400.00, 390.00)]; g3.strokeThickness = 10; g3.name = "Toothpick J"; g3.shadowColor = null; g3.strokeCap = LineCap.Butt; g3.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g3.points = [new Point(0.00, 210.00), new Point(0.00, 390.00)]; g4.strokeThickness = 10; g4.name = "Toothpick I"; g4.shadowColor = null; g4.strokeCap = LineCap.Butt; g4.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g4.points = [new Point(400.00, 10.00), new Point(400.00, 190.00)]; g5.strokeThickness = 10; g5.name = "Toothpick H"; g5.shadowColor = null; g5.strokeCap = LineCap.Butt; g5.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g5.points = [new Point(200.00, 10.00), new Point(200.00, 190.00)]; g6.strokeThickness = 10; g6.name = "Toothpick G"; g6.shadowColor = null; g6.strokeCap = LineCap.Butt; g6.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g6.points = [new Point(0.00, 10.00), new Point(0.00, 190.00)]; g7.strokeThickness = 10; g7.name = "Toothpick F"; g7.shadowColor = null; g7.strokeCap = LineCap.Butt; g7.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g7.points = [new Point(210.00, 400.00), new Point(390.00, 400.00)]; g8.strokeThickness = 10; g8.name = "Toothpick E"; g8.shadowColor = null; g8.strokeCap = LineCap.Butt; g8.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g8.points = [new Point(10.00, 400.00), new Point(190.00, 400.00)]; g10.strokeThickness = 10; g10.name = "Toothpick C"; g10.shadowColor = null; g10.strokeCap = LineCap.Butt; g10.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g10.points = [new Point(10.00, 200.00), new Point(190.00, 200.00)]; g11.strokeThickness = 10; g11.name = "Toothpick B"; g11.shadowColor = null; g11.strokeCap = LineCap.Butt; g11.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g11.points = [new Point(210.00, 0.00), new Point(390.00, 0.00)]; g12.strokeThickness = 10; g12.name = "Toothpick A"; g12.shadowColor = null; g12.strokeCap = LineCap.Butt; g12.strokeColor = Color.RGB(0.647059, 0.647059, 0.647059); g12.points = [new Point(10.00, 0.00), new Point(190.00, 0.00)]; } solveToothpickPuzzle2()
omnigraffle://localhost/omnijs-run?script=function%20setupCanvasGrid%28cnvs%29%7B%0A%09cnvs%2EcanvasSizingMode%20%3D%20CanvasSizingMode%2EInfinite%0A%09cnvs%2Egrid%2EmajorSpacing%20%3D%2010%0A%09cnvs%2Egrid%2Espacing%20%3D%2010%0A%09cnvs%2Egrid%2EmajorColor%20%3D%20Color%2Eblue%0A%09cnvs%2Egrid%2EminorColor%20%3D%20Color%2Ewhite%0A%09cnvs%2Egrid%2Esnaps%20%3D%20true%0A%09cnvs%2Egrid%2Evisible%20%3D%20true%0A%09cnvs%2Egrid%2EdrawsInFront%20%3D%20false%0A%7D%0A%0Afunction%20deleteGraphicsFromCanvas%28cnvs%29%7B%0A%09cnvs%2Egraphics%2EforEach%28function%28graphic%29%7B%0A%09%09graphic%2Eremove%28%29%0A%09%7D%29%0A%7D%0A%0Afunction%20solveToothpickPuzzle2%28%29%7B%0A%09var%20cnvs%20%3D%20document%2Ewindows%5B0%5D%2Eselection%2Ecanvas%3B%0A%09deleteGraphicsFromCanvas%28cnvs%29%3B%0A%09setupCanvasGrid%28cnvs%29%3B%0A%09var%20g1%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g3%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g4%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g5%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g6%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g7%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g8%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g10%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g11%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09var%20g12%20%3D%20cnvs%2EnewLine%28%29%3B%0A%09g1%2EstrokeThickness%20%3D%2010%3B%0A%09g1%2Ename%20%3D%20%22Toothpick%20L%22%3B%0A%09g1%2EshadowColor%20%3D%20null%3B%0A%09g1%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g1%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g1%2Epoints%20%3D%20%5Bnew%20Point%28400%2E00%2C%20210%2E00%29%2C%20new%20Point%28400%2E00%2C%20390%2E00%29%5D%3B%0A%09g3%2EstrokeThickness%20%3D%2010%3B%0A%09g3%2Ename%20%3D%20%22Toothpick%20J%22%3B%0A%09g3%2EshadowColor%20%3D%20null%3B%0A%09g3%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g3%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g3%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%20210%2E00%29%2C%20new%20Point%280%2E00%2C%20390%2E00%29%5D%3B%0A%09g4%2EstrokeThickness%20%3D%2010%3B%0A%09g4%2Ename%20%3D%20%22Toothpick%20I%22%3B%0A%09g4%2EshadowColor%20%3D%20null%3B%0A%09g4%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g4%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g4%2Epoints%20%3D%20%5Bnew%20Point%28400%2E00%2C%2010%2E00%29%2C%20new%20Point%28400%2E00%2C%20190%2E00%29%5D%3B%0A%09g5%2EstrokeThickness%20%3D%2010%3B%0A%09g5%2Ename%20%3D%20%22Toothpick%20H%22%3B%0A%09g5%2EshadowColor%20%3D%20null%3B%0A%09g5%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g5%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g5%2Epoints%20%3D%20%5Bnew%20Point%28200%2E00%2C%2010%2E00%29%2C%20new%20Point%28200%2E00%2C%20190%2E00%29%5D%3B%0A%09g6%2EstrokeThickness%20%3D%2010%3B%0A%09g6%2Ename%20%3D%20%22Toothpick%20G%22%3B%0A%09g6%2EshadowColor%20%3D%20null%3B%0A%09g6%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g6%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g6%2Epoints%20%3D%20%5Bnew%20Point%280%2E00%2C%2010%2E00%29%2C%20new%20Point%280%2E00%2C%20190%2E00%29%5D%3B%0A%09g7%2EstrokeThickness%20%3D%2010%3B%0A%09g7%2Ename%20%3D%20%22Toothpick%20F%22%3B%0A%09g7%2EshadowColor%20%3D%20null%3B%0A%09g7%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g7%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g7%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%20400%2E00%29%2C%20new%20Point%28390%2E00%2C%20400%2E00%29%5D%3B%0A%09g8%2EstrokeThickness%20%3D%2010%3B%0A%09g8%2Ename%20%3D%20%22Toothpick%20E%22%3B%0A%09g8%2EshadowColor%20%3D%20null%3B%0A%09g8%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g8%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g8%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20400%2E00%29%2C%20new%20Point%28190%2E00%2C%20400%2E00%29%5D%3B%0A%09g10%2EstrokeThickness%20%3D%2010%3B%0A%09g10%2Ename%20%3D%20%22Toothpick%20C%22%3B%0A%09g10%2EshadowColor%20%3D%20null%3B%0A%09g10%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g10%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g10%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%20200%2E00%29%2C%20new%20Point%28190%2E00%2C%20200%2E00%29%5D%3B%0A%09g11%2EstrokeThickness%20%3D%2010%3B%0A%09g11%2Ename%20%3D%20%22Toothpick%20B%22%3B%0A%09g11%2EshadowColor%20%3D%20null%3B%0A%09g11%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g11%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g11%2Epoints%20%3D%20%5Bnew%20Point%28210%2E00%2C%200%2E00%29%2C%20new%20Point%28390%2E00%2C%200%2E00%29%5D%3B%0A%09g12%2EstrokeThickness%20%3D%2010%3B%0A%09g12%2Ename%20%3D%20%22Toothpick%20A%22%3B%0A%09g12%2EshadowColor%20%3D%20null%3B%0A%09g12%2EstrokeCap%20%3D%20LineCap%2EButt%3B%0A%09g12%2EstrokeColor%20%3D%20Color%2ERGB%280%2E647059%2C%200%2E647059%2C%200%2E647059%29%3B%0A%09g12%2Epoints%20%3D%20%5Bnew%20Point%2810%2E00%2C%200%2E00%29%2C%20new%20Point%28190%2E00%2C%200%2E00%29%5D%3B%0A%7D%0A%0AsolveToothpickPuzzle2%28%29

Puzzle #2: remove two toothpicks to leave only two squares:

toothpick-puzzle-2
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER