Script: Texture on OCCT shape

Texture on OCCT shape picture
Type
Rete logo indicatorrete
Date Created
Oct 3, 2025, 11:25:09 AM
Last Edit Date
Oct 7, 2025, 6:30:16 PM

Project Information

Example on how to apply texture on OCCT shape

View Full Project

Script Code

{
  "id": "rete-v2-json",
  "nodes": {
    "7b4012f0905573a2": {
      "id": "7b4012f0905573a2",
      "name": "bitbybit.draw.drawAnyAsync",
      "customName": "draw any async",
      "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": "7f1ef8e4612bcdfc",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        109.6617431640625,
        852.3874206542969
      ]
    },
    "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": [
        -336.0804443359375,
        1165.172607421875
      ]
    },
    "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": [
        -787.6529794517454,
        1391.8957170585695
      ]
    },
    "49b1832d5f9dda1e": {
      "id": "49b1832d5f9dda1e",
      "name": "bitbybit.babylon.texture.createSimple",
      "customName": "simple texture",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "name": "Custom Texture",
        "url": "https://cdn.polyhaven.com/asset_img/primary/worn_asphalt.png?height=760&quality=95",
        "invertY": false,
        "invertZ": false,
        "wAng": 0,
        "uScale": 0.25,
        "vScale": 0.5,
        "uOffset": 0,
        "vOffset": 0,
        "samplingMode": "nearest"
      },
      "inputs": {},
      "position": [
        -797.5398908079297,
        1935.4958996810033
      ]
    },
    "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": [
        -229.48720203448892,
        1798.811261480952
      ]
    },
    "0a0e5ffeb99cc06e": {
      "id": "0a0e5ffeb99cc06e",
      "name": "bitbybit.occt.shapes.solid.createCube",
      "customName": "cube",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "size": 4,
        "center": [
          0,
          0,
          0
        ],
        "originOnCenter": true
      },
      "inputs": {},
      "position": [
        -814.9919062877075,
        638.6825137292979
      ]
    },
    "7f1ef8e4612bcdfc": {
      "id": "7f1ef8e4612bcdfc",
      "name": "bitbybit.occt.fillets.filletEdges",
      "customName": "fillet edges",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "radius": 1
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "0a0e5ffeb99cc06e",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -388.5609288011925,
        669.2263792583675
      ]
    },
    "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": [
        -2404.5510353245445,
        1658.290104832379
      ]
    },
    "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
      ]
    }
  }
}