Script: plywood-texture-example

plywood-texture-example picture
Type
Rete logo indicatorrete
Author
erics
Date Created
Oct 3, 2025, 11:58:19 AM
Last Edit Date
Oct 5, 2025, 8:50:46 PM

Project Information

collection of scripts while learning

View Full Project

Script Code

{
  "id": "rete-v2-json",
  "nodes": {
    "7b4012f0905573a2": {
      "id": "7b4012f0905573a2",
      "name": "bitbybit.draw.drawAnyAsync",
      "customName": "edge-texture",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "options": {
          "connections": [
            {
              "node": "d81d7e6b23398237",
              "output": "result",
              "data": {}
            }
          ]
        },
        "entity": {
          "connections": [
            {
              "node": "ae9523c5b36809ae",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1536.2439007563548,
        4800.704127166256
      ]
    },
    "d81d7e6b23398237": {
      "id": "d81d7e6b23398237",
      "name": "bitbybit.draw.optionsOcctShapeMaterial",
      "customName": "options occt shape material",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "precision": 0.01,
        "drawEdges": true,
        "edgeColour": "#ffffff",
        "edgeWidth": 2
      },
      "inputs": {
        "faceMaterial": {
          "connections": [
            {
              "node": "d8901dd510afd880",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        937.1227950943627,
        1619.2142491364443
      ]
    },
    "d8901dd510afd880": {
      "id": "d8901dd510afd880",
      "name": "bitbybit.babylon.material.pbrMetallicRoughness.create",
      "customName": "pbr metallic roughness",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "name": "Custom Material",
        "baseColor": "#ffffff",
        "emissiveColor": "#000000",
        "metallic": 0.6,
        "roughness": 0.5,
        "alpha": 1,
        "backFaceCulling": false,
        "zOffset": 2
      },
      "inputs": {},
      "position": [
        260.3064118781524,
        1544.878461088109
      ]
    },
    "49b1832d5f9dda1e": {
      "id": "49b1832d5f9dda1e",
      "name": "bitbybit.babylon.texture.createSimple",
      "customName": "edge texture",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "name": "Custom Texture",
        "url": "https://bitbybit.dev/files/users%2FH67RPzLGlZRkuR9OzZmlQUITgfW2%2Fprojects%2FlskoeMKGPDSsCEk6XvO0%2Fassets%2Fedge.png?alt=media&token=341753b7-96e9-4486-b9a0-a428b5b7edaf",
        "invertY": false,
        "invertZ": false,
        "wAng": 0,
        "uScale": 0.25,
        "vScale": 0.5,
        "uOffset": 0,
        "vOffset": 0,
        "samplingMode": "nearest"
      },
      "inputs": {},
      "position": [
        239.51938726494868,
        2121.451520138231
      ]
    },
    "f977c840d7158244": {
      "id": "f977c840d7158244",
      "name": "bitbybit.babylon.material.pbrMetallicRoughness.setBaseTexture",
      "customName": "set base texture",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "material": {
          "connections": [
            {
              "node": "d8901dd510afd880",
              "output": "result",
              "data": {}
            }
          ]
        },
        "baseTexture": {
          "connections": [
            {
              "node": "49b1832d5f9dda1e",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        760.6175140053004,
        2070.8915857590373
      ]
    },
    "9cf113064fef4209": {
      "id": "9cf113064fef4209",
      "name": "bitbybit.babylon.scene.twoColorLinearGradient",
      "customName": "two color linear gradient",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "colorFrom": "#1a1c1f",
        "colorTo": "#93aacd",
        "direction": "to top",
        "stopFrom": 0,
        "stopTo": 100
      },
      "inputs": {},
      "position": [
        -1923.3830461619468,
        920.9338061090527
      ]
    },
    "6c3712f5b667efab": {
      "id": "6c3712f5b667efab",
      "name": "bitbybit.babylon.scene.drawDirectionalLight",
      "customName": "draw directional light",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "direction": [
          -100,
          -100,
          -100
        ],
        "intensity": 3,
        "diffuse": "#ffffff",
        "specular": "#ffffff",
        "shadowGeneratorMapSize": 1024,
        "enableShadows": true,
        "shadowDarkness": 0,
        "shadowUsePercentageCloserFiltering": true,
        "shadowContactHardeningLightSizeUVRatio": 0.2,
        "shadowBias": 0.0001,
        "shadowNormalBias": 0.002,
        "shadowMaxZ": 1000,
        "shadowMinZ": 0
      },
      "inputs": {},
      "position": [
        -2403.3942523068617,
        921.5830342751559
      ]
    },
    "cfe9dc1961c606b3": {
      "id": "cfe9dc1961c606b3",
      "name": "bitbybit.babylon.texture.createSimple",
      "customName": "face texture",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "name": "Custom Texture",
        "url": "https://bitbybit.dev/files/users%2FH67RPzLGlZRkuR9OzZmlQUITgfW2%2Fprojects%2FlskoeMKGPDSsCEk6XvO0%2Fassets%2Fplywood-face.png?alt=media&token=d0231d25-46e7-414d-95a0-00abaf4871a1",
        "invertY": false,
        "invertZ": false,
        "wAng": 0,
        "uScale": 0.25,
        "vScale": 2,
        "uOffset": 0,
        "vOffset": 0,
        "samplingMode": "nearest"
      },
      "inputs": {
        "vScale": {
          "connections": [
            {
              "node": "cf96d0beaa126523",
              "output": "result",
              "data": {}
            }
          ]
        },
        "uScale": {
          "connections": [
            {
              "node": "cf96d0beaa126523",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1117.645385275372,
        2141.3576698068596
      ]
    },
    "f1cb95b89aef2490": {
      "id": "f1cb95b89aef2490",
      "name": "bitbybit.babylon.material.pbrMetallicRoughness.setBaseTexture",
      "customName": "set base texture",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "baseTexture": {
          "connections": [
            {
              "node": "cfe9dc1961c606b3",
              "output": "result",
              "data": {}
            }
          ]
        },
        "material": {
          "connections": [
            {
              "node": "178037abb5e230f9",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -600.1895609358388,
        2094.312935981896
      ]
    },
    "178037abb5e230f9": {
      "id": "178037abb5e230f9",
      "name": "bitbybit.babylon.material.pbrMetallicRoughness.create",
      "customName": "pbr metallic roughness",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "name": "Custom Material",
        "baseColor": "#80809d",
        "emissiveColor": "#000000",
        "metallic": 0.6,
        "roughness": 0.5,
        "alpha": 1,
        "backFaceCulling": false,
        "zOffset": 0
      },
      "inputs": {},
      "position": [
        -1056.9755578490522,
        1602.0021733542842
      ]
    },
    "54c6a176a8643a9d": {
      "id": "54c6a176a8643a9d",
      "name": "bitbybit.draw.optionsOcctShapeMaterial",
      "customName": "options occt shape material",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "precision": 0.01,
        "drawEdges": true,
        "edgeColour": "#ffffff",
        "edgeWidth": 2
      },
      "inputs": {
        "faceMaterial": {
          "connections": [
            {
              "node": "178037abb5e230f9",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -520.5613510793019,
        1604.7272554748176
      ]
    },
    "c9f399e36aa0a494": {
      "id": "c9f399e36aa0a494",
      "name": "bitbybit.draw.drawAnyAsync",
      "customName": "face-texture-async",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "options": {
          "connections": [
            {
              "node": "54c6a176a8643a9d",
              "output": "result",
              "data": {}
            }
          ]
        },
        "entity": {
          "connections": [
            {
              "node": "f968af8cd735643f",
              "output": "result",
              "data": {}
            },
            {
              "node": "814eba956bd91212",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1078.4918759638454,
        4040.761604267731
      ]
    },
    "0732712bbad6f6df": {
      "id": "0732712bbad6f6df",
      "name": "bitbybit.occt.shapes.wire.createRectangleWire",
      "customName": "panel",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "width": 14,
        "length": 28,
        "center": [
          0,
          0,
          0
        ],
        "direction": [
          0,
          1,
          0
        ]
      },
      "inputs": {
        "width": {
          "connections": [
            {
              "node": "e0b8305bf36501f8",
              "output": "result",
              "data": {}
            }
          ]
        },
        "length": {
          "connections": [
            {
              "node": "6db1b1a72e152a57",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1993.1009512615474,
        3805.6180269719607
      ]
    },
    "42fdf028b40483a3": {
      "id": "42fdf028b40483a3",
      "name": "bitbybit.occt.fillets.fillet2d",
      "customName": "fillet 2d",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "radius": 0.8
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "0732712bbad6f6df",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1326.358289974414,
        3857.1659552576425
      ]
    },
    "c478fd9adfca180f": {
      "id": "c478fd9adfca180f",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector xyz",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": 0,
        "y": 2,
        "z": 0
      },
      "inputs": {},
      "position": [
        -2005.6692584443967,
        5089.473341447608
      ]
    },
    "814eba956bd91212": {
      "id": "814eba956bd91212",
      "name": "bitbybit.occt.transforms.translate",
      "customName": "translate",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "translation": [
          0,
          0,
          0
        ]
      },
      "inputs": {
        "translation": {
          "connections": [
            {
              "node": "c478fd9adfca180f",
              "output": "result",
              "data": {}
            }
          ]
        },
        "shape": {
          "connections": [
            {
              "node": "f968af8cd735643f",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        742.1426315209167,
        4548.856134482129
      ]
    },
    "74113724ead21057": {
      "id": "74113724ead21057",
      "name": "bitbybit.occt.shapes.face.createFaceFromWire",
      "customName": "face from wire",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "planar": false
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "42fdf028b40483a3",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -178.89111010683473,
        4334.014109510432
      ]
    },
    "cf96d0beaa126523": {
      "id": "cf96d0beaa126523",
      "name": "bitbybit.math.numberSlider",
      "customName": "number slider",
      "data": {
        "options": {
          "min": 0.0001,
          "max": 1,
          "step": 0.0001,
          "width": 350,
          "updateOnDrag": false
        },
        "number": 0.0262
      },
      "inputs": {},
      "position": [
        -1801.9160524194056,
        2405.5117079138336
      ]
    },
    "e0b8305bf36501f8": {
      "id": "e0b8305bf36501f8",
      "name": "bitbybit.math.numberSlider",
      "customName": "number slider",
      "data": {
        "options": {
          "min": 18,
          "max": 47.25,
          "step": 0.25,
          "width": 350,
          "updateOnDrag": false
        },
        "number": 22.75
      },
      "inputs": {},
      "position": [
        -2779.9027182311575,
        3822.371784201551
      ]
    },
    "6db1b1a72e152a57": {
      "id": "6db1b1a72e152a57",
      "name": "bitbybit.math.numberSlider",
      "customName": "number slider",
      "data": {
        "options": {
          "min": 32,
          "max": 90,
          "step": 0.25,
          "width": 350,
          "updateOnDrag": false
        },
        "number": 40.5
      },
      "inputs": {},
      "position": [
        -2740.1656697098097,
        4089.6940351183457
      ]
    },
    "5e3ce62ca3babdaf": {
      "id": "5e3ce62ca3babdaf",
      "name": "bitbybit.occt.shapes.wire.createRectangleWire",
      "customName": "cutout",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "width": 3,
        "length": 3,
        "center": [
          0,
          0,
          0
        ],
        "direction": [
          0,
          1,
          0
        ]
      },
      "inputs": {},
      "position": [
        -2009.3797906364555,
        4419.417036834843
      ]
    },
    "ae9523c5b36809ae": {
      "id": "ae9523c5b36809ae",
      "name": "bitbybit.occt.operations.extrude",
      "customName": "extrude",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "direction": [
          0,
          1,
          0
        ]
      },
      "inputs": {
        "direction": {
          "connections": [
            {
              "node": "c478fd9adfca180f",
              "output": "result",
              "data": {}
            }
          ]
        },
        "shape": {
          "connections": [
            {
              "node": "192eaf60a53e82ef",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -51.67981634738874,
        5385.216773348673
      ]
    },
    "91fb501a42a1eaba": {
      "id": "91fb501a42a1eaba",
      "name": "bitbybit.previewData",
      "customName": "preview data",
      "data": {
        "previewJSONControl": ""
      },
      "inputs": {},
      "position": [
        -435.0395046169193,
        5727.6634428276475
      ]
    },
    "192eaf60a53e82ef": {
      "id": "192eaf60a53e82ef",
      "name": "bitbybit.occt.shapes.shape.unifySameDomain",
      "customName": "unify same domain",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "unifyEdges": true,
        "unifyFaces": true,
        "concatBSplines": true
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "5e3ce62ca3babdaf",
              "output": "result",
              "data": {}
            },
            {
              "node": "42fdf028b40483a3",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -692.6065465303934,
        4896.448943575479
      ]
    },
    "f968af8cd735643f": {
      "id": "f968af8cd735643f",
      "name": "bitbybit.occt.booleans.difference",
      "customName": "difference",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "keepEdges": false
      },
      "inputs": {
        "shapes": {
          "connections": [
            {
              "node": "fcc3bcbe70d34578",
              "output": "list",
              "data": {}
            }
          ]
        },
        "shape": {
          "connections": [
            {
              "node": "74113724ead21057",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        370.55329912624177,
        4283.060960517744
      ]
    },
    "13d57d355ae98ed7": {
      "id": "13d57d355ae98ed7",
      "name": "bitbybit.occt.shapes.face.createFaceFromWire",
      "customName": "face from wire",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "planar": false
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "5e3ce62ca3babdaf",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -185.95114617521742,
        4672.622141672615
      ]
    },
    "fcc3bcbe70d34578": {
      "id": "fcc3bcbe70d34578",
      "name": "bitbybit.lists.createList",
      "customName": "create list",
      "data": {},
      "inputs": {
        "listElements": {
          "connections": [
            {
              "node": "13d57d355ae98ed7",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        224.32781115205668,
        4745.496239231931
      ]
    }
  }
}