{
  "version": 1,
  "id": "gable-roof",
  "label": "Gable roof",
  "rows": [
    {
      "id": "recipe",
      "label": "Recipe",
      "tiles": [
        {
          "id": "recipe-0",
          "op": {
            "type": "group",
            "label": "Gable roof",
            "document": {
              "version": 1,
              "id": "gable-roof-construction",
              "label": "Gable roof construction",
              "rows": [
                {
                  "id": "left",
                  "label": "Left roof slope",
                  "tiles": [
                    {
                      "id": "left-panel",
                      "op": {
                        "type": "group",
                        "label": "Roof slope",
                        "document": {
                          "version": 1,
                          "id": "roof-slope-construction",
                          "label": "Roof slope construction",
                          "rows": [
                            {
                              "id": "roof",
                              "label": "Roof",
                              "tiles": [
                                {
                                  "id": "roof-0",
                                  "op": {
                                    "type": "material",
                                    "palette": 18,
                                    "roughness": 0.9,
                                    "metallic": 0
                                  }
                                }
                              ]
                            },
                            {
                              "id": "slope",
                              "label": "Slope",
                              "tiles": [
                                {
                                  "id": "slope-profile",
                                  "op": {
                                    "type": "contour",
                                    "points": [
                                      [
                                        0,
                                        0
                                      ],
                                      [
                                        1,
                                        0
                                      ],
                                      [
                                        1,
                                        0.12
                                      ],
                                      [
                                        0,
                                        0.12
                                      ]
                                    ]
                                  }
                                },
                                {
                                  "id": "slope-extrude",
                                  "op": {
                                    "type": "extrude",
                                    "depth": 1
                                  }
                                },
                                {
                                  "id": "slope-1",
                                  "op": {
                                    "type": "assign_material",
                                    "row": "roof"
                                  }
                                },
                                {
                                  "id": "slope-2",
                                  "op": {
                                    "type": "transform",
                                    "translation": [
                                      0,
                                      0,
                                      0
                                    ],
                                    "rotation": [
                                      0,
                                      0,
                                      30
                                    ],
                                    "scale": [
                                      1,
                                      1,
                                      1
                                    ]
                                  }
                                }
                              ]
                            },
                            {
                              "id": "assembly",
                              "label": "Assembly",
                              "tiles": [
                                {
                                  "id": "assembly-0",
                                  "op": {
                                    "type": "assemble",
                                    "rows": [
                                      "slope"
                                    ]
                                  }
                                }
                              ]
                            }
                          ],
                          "output": "assembly",
                          "grip": null
                        },
                        "controls": [
                          {
                            "id": "length",
                            "label": "Panel length (m)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 2.8867514,
                            "reference": 2.8867514,
                            "min": 0.2,
                            "max": 40,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point1:0"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "depth",
                            "label": "Depth (m)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 1,
                            "reference": 1,
                            "min": 0.2,
                            "max": 10,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-extrude",
                                  "parameter": "depth"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "thickness",
                            "label": "Thickness (m)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 0.12,
                            "reference": 0.12,
                            "min": 0.02,
                            "max": 0.5,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point2:1"
                                },
                                "factor": 1,
                                "offset": 0
                              },
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point3:1"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "slope",
                            "label": "Slope (degrees)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 30,
                            "reference": 30,
                            "min": 0,
                            "max": 75,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-2",
                                  "parameter": "rotation2"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "roof-color",
                            "label": "Roof color",
                            "category": "Materials",
                            "help": "Project palette color for these parts.",
                            "order": 0,
                            "value": 18,
                            "reference": 18,
                            "min": 0.0,
                            "max": 255.0,
                            "modifiers": [
                              {
                                "type": "palette",
                                "parts": [
                                  "*"
                                ]
                              }
                            ]
                          },
                          {
                            "id": "ridge_top_length",
                            "label": "Mitered ridge edge",
                            "category": "Dimensions",
                            "help": "Calculated from recipe inputs.",
                            "order": 0,
                            "value": 2.9560335,
                            "reference": 2.9560335,
                            "min": 0.2,
                            "max": 50,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point2:0"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ],
                            "expression": "length + thickness * tan_deg(slope)"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "id": "right",
                  "label": "Right roof slope",
                  "tiles": [
                    {
                      "id": "right-panel",
                      "op": {
                        "type": "group",
                        "label": "Roof slope",
                        "document": {
                          "version": 1,
                          "id": "roof-slope-construction",
                          "label": "Roof slope construction",
                          "rows": [
                            {
                              "id": "roof",
                              "label": "Roof",
                              "tiles": [
                                {
                                  "id": "roof-0",
                                  "op": {
                                    "type": "material",
                                    "palette": 18,
                                    "roughness": 0.9,
                                    "metallic": 0
                                  }
                                }
                              ]
                            },
                            {
                              "id": "slope",
                              "label": "Slope",
                              "tiles": [
                                {
                                  "id": "slope-profile",
                                  "op": {
                                    "type": "contour",
                                    "points": [
                                      [
                                        0,
                                        0
                                      ],
                                      [
                                        1,
                                        0
                                      ],
                                      [
                                        1,
                                        0.12
                                      ],
                                      [
                                        0,
                                        0.12
                                      ]
                                    ]
                                  }
                                },
                                {
                                  "id": "slope-extrude",
                                  "op": {
                                    "type": "extrude",
                                    "depth": 1
                                  }
                                },
                                {
                                  "id": "slope-1",
                                  "op": {
                                    "type": "assign_material",
                                    "row": "roof"
                                  }
                                },
                                {
                                  "id": "slope-2",
                                  "op": {
                                    "type": "transform",
                                    "translation": [
                                      0,
                                      0,
                                      0
                                    ],
                                    "rotation": [
                                      0,
                                      0,
                                      30
                                    ],
                                    "scale": [
                                      1,
                                      1,
                                      1
                                    ]
                                  }
                                }
                              ]
                            },
                            {
                              "id": "assembly",
                              "label": "Assembly",
                              "tiles": [
                                {
                                  "id": "assembly-0",
                                  "op": {
                                    "type": "assemble",
                                    "rows": [
                                      "slope"
                                    ]
                                  }
                                }
                              ]
                            }
                          ],
                          "output": "assembly",
                          "grip": null
                        },
                        "controls": [
                          {
                            "id": "length",
                            "label": "Panel length (m)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 2.8867514,
                            "reference": 2.8867514,
                            "min": 0.2,
                            "max": 40,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point1:0"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "depth",
                            "label": "Depth (m)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 1,
                            "reference": 1,
                            "min": 0.2,
                            "max": 10,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-extrude",
                                  "parameter": "depth"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "thickness",
                            "label": "Thickness (m)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 0.12,
                            "reference": 0.12,
                            "min": 0.02,
                            "max": 0.5,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point2:1"
                                },
                                "factor": 1,
                                "offset": 0
                              },
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point3:1"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "slope",
                            "label": "Slope (degrees)",
                            "category": "Construction",
                            "help": "Changes recipe inputs before constructing the mesh.",
                            "order": 0,
                            "value": 30,
                            "reference": 30,
                            "min": 0,
                            "max": 75,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-2",
                                  "parameter": "rotation2"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ]
                          },
                          {
                            "id": "roof-color",
                            "label": "Roof color",
                            "category": "Materials",
                            "help": "Project palette color for these parts.",
                            "order": 0,
                            "value": 18,
                            "reference": 18,
                            "min": 0.0,
                            "max": 255.0,
                            "modifiers": [
                              {
                                "type": "palette",
                                "parts": [
                                  "*"
                                ]
                              }
                            ]
                          },
                          {
                            "id": "ridge_top_length",
                            "label": "Mitered ridge edge",
                            "category": "Dimensions",
                            "help": "Calculated from recipe inputs.",
                            "order": 0,
                            "value": 2.9560335,
                            "reference": 2.9560335,
                            "min": 0.2,
                            "max": 50,
                            "modifiers": [
                              {
                                "type": "parameter",
                                "target": {
                                  "operation": "slope-profile",
                                  "parameter": "point2:0"
                                },
                                "factor": 1,
                                "offset": 0
                              }
                            ],
                            "expression": "length + thickness * tan_deg(slope)"
                          }
                        ]
                      }
                    },
                    {
                      "id": "right-place",
                      "op": {
                        "type": "transform",
                        "translation": [
                          5,
                          0,
                          0
                        ],
                        "rotation": [
                          0,
                          180,
                          0
                        ],
                        "scale": [
                          1,
                          1,
                          1
                        ]
                      }
                    }
                  ]
                },
                {
                  "id": "roof-module",
                  "label": "Paired roof panel",
                  "tiles": [
                    {
                      "id": "join-panels",
                      "op": {
                        "type": "assemble",
                        "rows": [
                          "left",
                          "right"
                        ]
                      }
                    },
                    {
                      "id": "roof-base",
                      "op": {
                        "type": "connector",
                        "family": "roof",
                        "translation": [
                          2.5,
                          0,
                          0
                        ],
                        "rotation": [
                          90,
                          0,
                          0
                        ]
                      }
                    }
                  ]
                }
              ],
              "output": "roof-module",
              "grip": null
            },
            "controls": [
              {
                "id": "span",
                "label": "Roof span (m)",
                "category": "Dimensions",
                "help": "",
                "order": 0,
                "value": 5,
                "reference": 5,
                "min": 1,
                "max": 20,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "right-place",
                      "parameter": "position0"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "roof-base",
                      "parameter": "position0"
                    },
                    "factor": 0.5,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "slope",
                "label": "Pitch (degrees)",
                "category": "Construction",
                "help": "Keeps the ridge joined and span fixed; panel length and ridge cuts are calculated.",
                "order": 1,
                "value": 30,
                "reference": 30,
                "min": 0,
                "max": 70,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "left-panel",
                      "parameter": "control:slope"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "right-panel",
                      "parameter": "control:slope"
                    },
                    "factor": 1,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "depth",
                "label": "Depth (m)",
                "category": "Construction",
                "help": "Changes recipe inputs before constructing the mesh.",
                "order": 2,
                "value": 1,
                "reference": 1,
                "min": 0.2,
                "max": 10,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "left-panel",
                      "parameter": "control:depth"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "right-panel",
                      "parameter": "control:depth"
                    },
                    "factor": 1,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "thickness",
                "label": "Thickness (m)",
                "category": "Construction",
                "help": "Changes recipe inputs before constructing the mesh.",
                "order": 3,
                "value": 0.12,
                "reference": 0.12,
                "min": 0.02,
                "max": 0.5,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "left-panel",
                      "parameter": "control:thickness"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "right-panel",
                      "parameter": "control:thickness"
                    },
                    "factor": 1,
                    "offset": 0
                  }
                ]
              },
              {
                "id": "half_run",
                "label": "Half run (m)",
                "category": "Dimensions",
                "help": "Calculated from recipe inputs.",
                "order": 4,
                "value": 2.5,
                "reference": 2.5,
                "min": 0.5,
                "max": 10,
                "modifiers": [],
                "expression": "span / 2"
              },
              {
                "id": "length",
                "label": "Panel length (m)",
                "category": "Dimensions",
                "help": "Calculated from recipe inputs.",
                "order": 5,
                "value": 2.8867514,
                "reference": 2.8867514,
                "min": 0.2,
                "max": 40,
                "modifiers": [
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "left-panel",
                      "parameter": "control:length"
                    },
                    "factor": 1,
                    "offset": 0
                  },
                  {
                    "type": "parameter",
                    "target": {
                      "operation": "right-panel",
                      "parameter": "control:length"
                    },
                    "factor": 1,
                    "offset": 0
                  }
                ],
                "expression": "half_run / cos_deg(slope)"
              },
              {
                "id": "rise",
                "label": "Ridge rise (m)",
                "category": "Dimensions",
                "help": "Calculated from recipe inputs.",
                "order": 6,
                "value": 1.4433757,
                "reference": 1.4433757,
                "min": 0,
                "max": 30,
                "modifiers": [],
                "expression": "half_run * tan_deg(slope)"
              },
              {
                "id": "roof-color",
                "label": "Roof color",
                "category": "Materials",
                "help": "Project palette color for these parts.",
                "order": 7,
                "value": 18,
                "reference": 18,
                "min": 0.0,
                "max": 255.0,
                "modifiers": [
                  {
                    "type": "palette",
                    "parts": [
                      "*"
                    ]
                  }
                ]
              }
            ]
          }
        }
      ]
    }
  ],
  "output": "recipe",
  "grip": null
}
