{
  "version": 1,
  "id": "fence",
  "label": "Fence",
  "rows": [
    {
      "id": "recipe",
      "label": "Recipe",
      "tiles": [
        {
          "id": "recipe-0",
          "op": {
            "type": "group",
            "label": "Fence",
            "document": {
              "version": 1,
              "id": "fence-construction",
              "label": "Fence construction",
              "rows": [
                {
                  "id": "surface",
                  "label": "Surface",
                  "tiles": [
                    {
                      "id": "surface-0",
                      "op": {
                        "type": "material",
                        "palette": 19,
                        "roughness": 0.9,
                        "metallic": 0
                      }
                    }
                  ]
                },
                {
                  "id": "solid",
                  "label": "Post",
                  "tiles": [
                    {
                      "id": "solid-0",
                      "op": {
                        "type": "box",
                        "size": [
                          0.1,
                          1,
                          0.12
                        ]
                      }
                    },
                    {
                      "id": "solid-1",
                      "op": {
                        "type": "assign_material",
                        "row": "surface"
                      }
                    },
                    {
                      "id": "solid-2",
                      "op": {
                        "type": "transform",
                        "translation": [
                          0,
                          0.5,
                          0
                        ],
                        "rotation": [
                          0,
                          0,
                          0
                        ],
                        "scale": [
                          1,
                          1,
                          1
                        ]
                      }
                    },
                    {
                      "id": "posts-repeat",
                      "op": {
                        "type": "repeat",
                        "count": 6,
                        "translation": [
                          0.35,
                          0,
                          0
                        ],
                        "rotation": [
                          0,
                          0,
                          0
                        ]
                      }
                    }
                  ]
                },
                {
                  "id": "rails",
                  "label": "Continuous fence rails",
                  "tiles": [
                    {
                      "id": "rail-box",
                      "op": {
                        "type": "box",
                        "size": [
                          2.1,
                          0.08,
                          0.08
                        ]
                      }
                    },
                    {
                      "id": "rail-material",
                      "op": {
                        "type": "assign_material",
                        "row": "surface"
                      }
                    },
                    {
                      "id": "rail-position",
                      "op": {
                        "type": "transform",
                        "translation": [
                          1.05,
                          0.385,
                          0
                        ],
                        "rotation": [
                          0,
                          0,
                          0
                        ],
                        "scale": [
                          1,
                          1,
                          1
                        ]
                      }
                    },
                    {
                      "id": "rail-repeat",
                      "op": {
                        "type": "repeat",
                        "count": 2,
                        "translation": [
                          0,
                          0.44,
                          0
                        ],
                        "rotation": [
                          0,
                          0,
                          0
                        ]
                      }
                    }
                  ]
                },
                {
                  "id": "assembly",
                  "label": "Assembly",
                  "tiles": [
                    {
                      "id": "assembly-0",
                      "op": {
                        "type": "assemble",
                        "rows": [
                          "solid",
                          "rails"
                        ]
                      }
                    },
                    {
                      "id": "join-start",
                      "op": {
                        "type": "connector",
                        "family": "fence",
                        "translation": [
                          0,
                          0,
                          0
                        ],
                        "rotation": [
                          0,
                          -90,
                          0
                        ]
                      }
                    },
                    {
                      "id": "join-end",
                      "op": {
                        "type": "connector",
                        "family": "fence",
                        "translation": [
                          2.1,
                          0,
                          0
                        ],
                        "rotation": [
                          0,
                          90,
                          0
                        ]
                      }
                    }
                  ]
                }
              ],
              "output": "assembly",
              "grip": null
            },
            "controls": [
              {
                "id": "count",
                "label": "Post count",
                "category": "Construction",
                "help": "Changes recipe inputs before constructing the mesh.",
                "order": 0,
                "value": 6,
                "reference": 6,
                "min": 1,
                "max": 32,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "posts-repeat",
                      "parameter": "count"
                    },
                    "factor": 1,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "spacing",
                "label": "Spacing (m)",
                "category": "Construction",
                "help": "Changes recipe inputs before constructing the mesh.",
                "order": 1,
                "value": 0.35,
                "reference": 0.35,
                "min": 0.12,
                "max": 2,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "posts-repeat",
                      "parameter": "step0"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "solid-2",
                      "parameter": "position0"
                    },
                    "factor": 0.5,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "height",
                "label": "Post height (m)",
                "category": "Construction",
                "help": "Changes recipe inputs before constructing the mesh.",
                "order": 2,
                "value": 1.1,
                "reference": 1.1,
                "min": 0.2,
                "max": 4,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "solid-0",
                      "parameter": "size1"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "solid-2",
                      "parameter": "position1"
                    },
                    "factor": 0.5,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "rail-position",
                      "parameter": "position1"
                    },
                    "factor": 0.35,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "rail-repeat",
                      "parameter": "step1"
                    },
                    "factor": 0.4,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "width",
                "label": "Post width (m)",
                "category": "Construction",
                "help": "Changes recipe inputs before constructing the mesh.",
                "order": 3,
                "value": 0.1,
                "reference": 0.1,
                "min": 0.02,
                "max": 0.12,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "solid-0",
                      "parameter": "size0"
                    },
                    "factor": 1,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "length",
                "label": "Fence length (m)",
                "category": "Construction",
                "help": "Calculated from recipe inputs.",
                "order": 4,
                "value": 2.1,
                "reference": 2.1,
                "min": 0.12,
                "max": 64,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "rail-box",
                      "parameter": "size0"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "rail-position",
                      "parameter": "position0"
                    },
                    "factor": 0.5,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "join-end",
                      "parameter": "position0"
                    },
                    "factor": 1,
                    "offset": 0
                  }
                ],
                "expression": "count * spacing"
              },
              {
                "id": "wood",
                "label": "Wood",
                "category": "Materials",
                "help": "Changes recipe inputs before constructing the mesh.",
                "order": 5,
                "value": 19,
                "reference": 19,
                "min": 0,
                "max": 255,
                "modifiers": [
                  {
                    "type": "palette",
                    "parts": [
                      "*"
                    ]
                  }
                ]
              }
            ]
          }
        }
      ]
    }
  ],
  "output": "recipe",
  "grip": null
}
