Script: Wire Projection on 3D Shape

Wire Projection on 3D Shape picture
Type
Rete logo indicatorrete
Author
matas
Date Created
Nov 15, 2023, 12:02:31 PM
Last Edit Date
Nov 3, 2025, 11:15:21 AM

Project Information

Projecting wires onto 3D shapes is a powerful feature that can help in creating various interesting geometries

View Full Project

Script Code

{
  "id": "rete-v2-json",
  "nodes": {
    "1": {
      "id": "1",
      "name": "bitbybit.occt.shapes.solid.createSphere",
      "customName": "sphere",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "radius": 2,
        "center": [
          0,
          0,
          0
        ]
      },
      "inputs": {
        "radius": {
          "connections": [
            {
              "node": "9",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        119.34221257691112,
        561.0553681983995
      ]
    },
    "2": {
      "id": "2",
      "name": "bitbybit.occt.shapes.solid.createSphere",
      "customName": "sphere",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "radius": 1.6,
        "center": [
          0,
          0,
          0
        ]
      },
      "inputs": {
        "radius": {
          "connections": [
            {
              "node": "10",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        123.57054286129306,
        965.0547506220355
      ]
    },
    "3": {
      "id": "3",
      "name": "bitbybit.occt.shapes.wire.createStarWire",
      "customName": "star",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "center": [
          0,
          0,
          0
        ],
        "direction": [
          0,
          1,
          0
        ],
        "numRays": 8,
        "outerRadius": 3.7,
        "innerRadius": 0.5,
        "offsetOuterEdges": 0,
        "half": false
      },
      "inputs": {
        "center": {
          "connections": [
            {
              "node": "4",
              "output": "result",
              "data": {}
            }
          ]
        },
        "direction": {
          "connections": [
            {
              "node": "16",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        484.64454024224,
        180.5406697804233
      ]
    },
    "4": {
      "id": "4",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": 5,
        "y": 0,
        "z": 0
      },
      "inputs": {},
      "position": [
        55.444548677462066,
        23.18021565693465
      ]
    },
    "5": {
      "id": "5",
      "name": "bitbybit.occt.shapes.wire.project",
      "customName": "project",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "direction": [
          0,
          1,
          0
        ]
      },
      "inputs": {
        "wire": {
          "connections": [
            {
              "node": "7",
              "output": "result",
              "data": {}
            }
          ]
        },
        "shape": {
          "connections": [
            {
              "node": "1",
              "output": "result",
              "data": {}
            }
          ]
        },
        "direction": {
          "connections": [
            {
              "node": "16",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1240.4776624892613,
        418.07126216264595
      ]
    },
    "7": {
      "id": "7",
      "name": "bitbybit.occt.fillets.fillet2d",
      "customName": "fillet 2d wire or face",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "radius": 0.1
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "3",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        870.9053009951144,
        229.43013926000432
      ]
    },
    "9": {
      "id": "9",
      "name": "bitbybit.math.number",
      "customName": "number",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "number": 2
      },
      "inputs": {},
      "position": [
        -397.4503942213751,
        502.2628349088084
      ]
    },
    "10": {
      "id": "10",
      "name": "bitbybit.math.twoNrOperation",
      "customName": "two numbers",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "first": 1,
        "second": 1,
        "operation": "subtract"
      },
      "inputs": {
        "first": {
          "connections": [
            {
              "node": "9",
              "output": "result",
              "data": {}
            }
          ]
        },
        "second": {
          "connections": [
            {
              "node": "0ae6b7b1d48161f4",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -249.02307693972574,
        779.5951742757744
      ]
    },
    "11": {
      "id": "11",
      "name": "bitbybit.occt.operations.splitShapeWithShapes",
      "customName": "split",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "localFuzzyTolerance": 0.0001,
        "nonDestructive": true
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "1",
              "output": "result",
              "data": {}
            }
          ]
        },
        "shapes": {
          "connections": [
            {
              "node": "abcaf9dacb79ec18",
              "output": "list",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1808.399079128558,
        545.7569819947432
      ]
    },
    "13": {
      "id": "13",
      "name": "bitbybit.occt.shapes.face.getFaces",
      "customName": "faces",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {},
      "position": [
        2126.194049292414,
        552.5948421447551
      ]
    },
    "14": {
      "id": "14",
      "name": "bitbybit.lists.getItem",
      "customName": "item by index",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "index": 7,
        "clone": true
      },
      "inputs": {
        "list": {
          "connections": [
            {
              "node": "13",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2439.568088717949,
        615.973636969476
      ]
    },
    "16": {
      "id": "16",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": 1,
        "y": 0,
        "z": 0
      },
      "inputs": {},
      "position": [
        90.33133194605325,
        348.4030770770338
      ]
    },
    "17": {
      "id": "17",
      "name": "bitbybit.occt.operations.makeThickSolidSimple",
      "customName": "thicken",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "offset": -0.3
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "14",
              "output": "result",
              "data": {}
            }
          ]
        },
        "offset": {
          "connections": [
            {
              "node": "18",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3635.4567696250397,
        893.9932252222508
      ]
    },
    "18": {
      "id": "18",
      "name": "bitbybit.math.oneNrOperation",
      "customName": "one number",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "number": 1,
        "operation": "negate"
      },
      "inputs": {
        "number": {
          "connections": [
            {
              "node": "0ae6b7b1d48161f4",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2527.0367561163885,
        905.5728747818416
      ]
    },
    "19": {
      "id": "19",
      "name": "bitbybit.occt.shapes.wire.createStarWire",
      "customName": "star",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "center": [
          0,
          0,
          0
        ],
        "direction": [
          0,
          1,
          0
        ],
        "numRays": 8,
        "outerRadius": 3,
        "innerRadius": 1,
        "offsetOuterEdges": 0,
        "half": false
      },
      "inputs": {
        "center": {
          "connections": [
            {
              "node": "4",
              "output": "result",
              "data": {}
            }
          ]
        },
        "direction": {
          "connections": [
            {
              "node": "16",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        860.2070633473331,
        1060.4580719625267
      ]
    },
    "20": {
      "id": "20",
      "name": "bitbybit.occt.fillets.fillet2d",
      "customName": "fillet 2d wire or face",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "radius": 0.1
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "19",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1365.9739808363615,
        1074.6125738843714
      ]
    },
    "21": {
      "id": "21",
      "name": "bitbybit.occt.shapes.wire.project",
      "customName": "project",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "direction": [
          0,
          1,
          0
        ]
      },
      "inputs": {
        "wire": {
          "connections": [
            {
              "node": "20",
              "output": "result",
              "data": {}
            }
          ]
        },
        "shape": {
          "connections": [
            {
              "node": "2",
              "output": "result",
              "data": {}
            }
          ]
        },
        "direction": {
          "connections": [
            {
              "node": "16",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1735.974895943832,
        1083.6978324800975
      ]
    },
    "23": {
      "id": "23",
      "name": "bitbybit.occt.operations.splitShapeWithShapes",
      "customName": "split",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "localFuzzyTolerance": 0.0001,
        "nonDestructive": true
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "2",
              "output": "result",
              "data": {}
            }
          ]
        },
        "shapes": {
          "connections": [
            {
              "node": "909a21fc76766100",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2473.8502988344517,
        1200.1390557265142
      ]
    },
    "24": {
      "id": "24",
      "name": "bitbybit.lists.getItem",
      "customName": "item by index",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "index": 0,
        "clone": true
      },
      "inputs": {
        "list": {
          "connections": [
            {
              "node": "bcf393570777fc2f",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3252.6708380604036,
        1192.2829538171559
      ]
    },
    "25": {
      "id": "25",
      "name": "bitbybit.occt.operations.makeThickSolidSimple",
      "customName": "thicken",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "offset": -0.2
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "24",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3617.1656638640247,
        1171.3549593218222
      ]
    },
    "30": {
      "id": "30",
      "name": "bitbybit.occt.shapes.compound.makeCompound",
      "customName": "make",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "shapes": {
          "connections": [
            {
              "node": "b3e9a7a52864c021",
              "output": "list",
              "data": {}
            }
          ]
        }
      },
      "position": [
        4285.831024006871,
        1024.3035049237035
      ]
    },
    "32": {
      "id": "32",
      "name": "bitbybit.draw.drawAnyAsync",
      "customName": "draw async",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "entity": {
          "connections": [
            {
              "node": "30",
              "output": "result",
              "data": {}
            }
          ]
        },
        "options": {
          "connections": [
            {
              "node": "33",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        4725.280119799183,
        897.8617527443034
      ]
    },
    "33": {
      "id": "33",
      "name": "bitbybit.draw.optionsOcctShape",
      "customName": "occt shape",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "faceOpacity": 1,
        "edgeOpacity": 1,
        "edgeColour": "#a28fff",
        "faceColour": "#3700ff",
        "vertexColour": "#ff00ff",
        "edgeWidth": 0.5,
        "vertexSize": 0.03,
        "drawEdges": true,
        "drawFaces": true,
        "drawVertices": false,
        "precision": 0.005,
        "drawEdgeIndexes": false,
        "edgeIndexHeight": 0.06,
        "edgeIndexColour": "ff00ff",
        "drawFaceIndexes": false,
        "faceIndexHeight": 0.06,
        "faceIndexColour": "#0000ff"
      },
      "inputs": {},
      "position": [
        4224.041345507986,
        1330.2541134383978
      ]
    },
    "35": {
      "id": "35",
      "name": "bitbybit.babylon.scene.drawPointLight",
      "customName": "point light",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "position": [
          0,
          0,
          0
        ],
        "intensity": 1000,
        "diffuse": "#ffffff",
        "specular": "#ffffff",
        "radius": 0.1,
        "shadowGeneratorMapSize": 2056,
        "enableShadows": true,
        "shadowDarkness": 0,
        "shadowUsePercentageCloserFiltering": true,
        "shadowContactHardeningLightSizeUVRatio": 0.2,
        "shadowBias": 0.001,
        "shadowNormalBias": 0.02,
        "shadowMaxZ": 1000,
        "shadowMinZ": 0.1
      },
      "inputs": {
        "position": {
          "connections": [
            {
              "node": "36",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1819.1869736293306,
        2418.556795416953
      ]
    },
    "36": {
      "id": "36",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": -3,
        "y": 3,
        "z": 0
      },
      "inputs": {},
      "position": [
        1347.759710541683,
        2423.4696563878188
      ]
    },
    "0ae6b7b1d48161f4": {
      "id": "0ae6b7b1d48161f4",
      "name": "bitbybit.math.numberSlider",
      "customName": "number slider",
      "data": {
        "options": {
          "min": 0.1,
          "max": 1,
          "step": 0.0001,
          "width": 350
        },
        "number": 0.2519
      },
      "inputs": {},
      "position": [
        -848.5164712569745,
        761.4251285755527
      ]
    },
    "abcaf9dacb79ec18": {
      "id": "abcaf9dacb79ec18",
      "name": "bitbybit.lists.createList",
      "customName": "create list",
      "data": {},
      "inputs": {
        "listElements": {
          "connections": [
            {
              "node": "5",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1539.687582915636,
        528.607110729851
      ]
    },
    "b3e9a7a52864c021": {
      "id": "b3e9a7a52864c021",
      "name": "bitbybit.lists.createList",
      "customName": "create list",
      "data": {},
      "inputs": {
        "listElements": {
          "connections": [
            {
              "node": "17",
              "output": "result",
              "data": {}
            },
            {
              "node": "25",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3938.1522129202644,
        1039.3645163806952
      ]
    },
    "dce8a76605669dab": {
      "id": "dce8a76605669dab",
      "name": "bitbybit.lists.getItem",
      "customName": "get item",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "index": 8,
        "clone": true
      },
      "inputs": {
        "list": {
          "connections": [
            {
              "node": "23",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2789.856705777687,
        1444.9235697941492
      ]
    },
    "909a21fc76766100": {
      "id": "909a21fc76766100",
      "name": "bitbybit.occt.shapes.wire.getWires",
      "customName": "get wires",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "21",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2103.856011670398,
        1355.7208973348622
      ]
    },
    "bcf393570777fc2f": {
      "id": "bcf393570777fc2f",
      "name": "bitbybit.occt.shapes.face.getFaces",
      "customName": "get faces",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "dce8a76605669dab",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3014.570468934963,
        1841.4856375157506
      ]
    }
  }
}