Script: Split OCCT shape

Split OCCT shape picture
Type
Rete logo indicatorrete
Date Created
Feb 5, 2025, 2:45:02 PM
Last Edit Date
Feb 27, 2025, 8:36:03 AM

Project Information

New OCCT feature implemented that allows to split shape with multiple shapes in destructive and non-destructive modes via BOPAlgo_Builder functionality

View Full Project

Script Code

{
  "id": "rete-v2-json",
  "nodes": {
    "1c4209753eca0012": {
      "id": "1c4209753eca0012",
      "name": "bitbybit.occt.shapes.solid.createSphere",
      "customName": "sphere",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "radius": 3,
        "center": [
          0,
          0,
          0
        ]
      },
      "inputs": {},
      "position": [
        -1266.459580697446,
        350.7163608705831
      ]
    },
    "e917b3d1dd1e65e6": {
      "id": "e917b3d1dd1e65e6",
      "name": "bitbybit.occt.shapes.wire.createLineWire",
      "customName": "line",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "start": [
          0,
          0,
          0
        ],
        "end": [
          0,
          1,
          0
        ]
      },
      "inputs": {
        "start": {
          "connections": [
            {
              "node": "679e1dede9683c33",
              "output": "result",
              "data": {}
            }
          ]
        },
        "end": {
          "connections": [
            {
              "node": "e8ac64f6f245d901",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -747.3890380859375,
        937.9850769042969
      ]
    },
    "679e1dede9683c33": {
      "id": "679e1dede9683c33",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": 5,
        "y": -1,
        "z": -5
      },
      "inputs": {
        "y": {
          "connections": [
            {
              "node": "0e52b942f7dfdf13",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1216.3265380859375,
        811.5827331542969
      ]
    },
    "e8ac64f6f245d901": {
      "id": "e8ac64f6f245d901",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": -5,
        "y": 1,
        "z": -5
      },
      "inputs": {
        "y": {
          "connections": [
            {
              "node": "9ccd2bc59e35c9aa",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1218.1273193359375,
        1154.4889831542969
      ]
    },
    "7662db34ec043e8a": {
      "id": "7662db34ec043e8a",
      "name": "bitbybit.occt.shapes.wire.createLineWire",
      "customName": "line",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "start": [
          0,
          0,
          0
        ],
        "end": [
          0,
          1,
          0
        ]
      },
      "inputs": {
        "start": {
          "connections": [
            {
              "node": "a5265b6fd806a213",
              "output": "result",
              "data": {}
            }
          ]
        },
        "end": {
          "connections": [
            {
              "node": "23a017ed639c95d2",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -742.3528213172974,
        1274.1142461479508
      ]
    },
    "a5265b6fd806a213": {
      "id": "a5265b6fd806a213",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": 5,
        "y": 1,
        "z": 5
      },
      "inputs": {
        "y": {
          "connections": [
            {
              "node": "9ccd2bc59e35c9aa",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1230.0897633440738,
        1500.750618794212
      ]
    },
    "23a017ed639c95d2": {
      "id": "23a017ed639c95d2",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": -5,
        "y": -1,
        "z": 5
      },
      "inputs": {
        "y": {
          "connections": [
            {
              "node": "0e52b942f7dfdf13",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1253.5708890894923,
        1876.1745529526352
      ]
    },
    "43cf5280d801b4f0": {
      "id": "43cf5280d801b4f0",
      "name": "bitbybit.occt.operations.loft",
      "customName": "loft",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "makeSolid": false
      },
      "inputs": {
        "shapes": {
          "connections": [
            {
              "node": "7e4f55a1d36fc90e",
              "output": "list",
              "data": {}
            }
          ]
        }
      },
      "position": [
        186.4826386175671,
        1108.7425514094543
      ]
    },
    "7e4f55a1d36fc90e": {
      "id": "7e4f55a1d36fc90e",
      "name": "bitbybit.lists.createList",
      "customName": "list",
      "data": {},
      "inputs": {
        "listElements": {
          "connections": [
            {
              "node": "e917b3d1dd1e65e6",
              "output": "result",
              "data": {}
            },
            {
              "node": "7662db34ec043e8a",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -225.02844804634563,
        1145.944434473797
      ]
    },
    "d760a85fa3e3d7fc": {
      "id": "d760a85fa3e3d7fc",
      "name": "bitbybit.vector.span",
      "customName": "span",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "step": 0.3,
        "min": -2,
        "max": 2
      },
      "inputs": {},
      "position": [
        153.7042929270101,
        1556.0102744088663
      ]
    },
    "d8ba80b7936706db": {
      "id": "d8ba80b7936706db",
      "name": "bitbybit.occt.transforms.translate",
      "customName": "translate",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "translation": [
          0,
          0,
          0
        ]
      },
      "inputs": {
        "translation": {
          "connections": [
            {
              "node": "9402dbdc19b393bc",
              "output": "result",
              "data": {}
            }
          ]
        },
        "shape": {
          "connections": [
            {
              "node": "43cf5280d801b4f0",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1576.4019535363573,
        1091.5693250579864
      ]
    },
    "9402dbdc19b393bc": {
      "id": "9402dbdc19b393bc",
      "name": "bitbybit.vector.vectorXYZ",
      "customName": "vector XYZ",
      "async": false,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "x": 0,
        "y": 0,
        "z": 0
      },
      "inputs": {
        "y": {
          "connections": [
            {
              "node": "258b289cd7ed78e5",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        978.6334654944926,
        1527.8738359157526
      ]
    },
    "258b289cd7ed78e5": {
      "id": "258b289cd7ed78e5",
      "name": "bitbybit.lists.flatten",
      "customName": "flatten",
      "data": {
        "nrLevels": 1
      },
      "inputs": {
        "list": {
          "connections": [
            {
              "node": "d760a85fa3e3d7fc",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        555.9493476790446,
        1612.5868802190016
      ]
    },
    "0e52b942f7dfdf13": {
      "id": "0e52b942f7dfdf13",
      "name": "bitbybit.math.negate",
      "customName": "negate",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "number": 1
      },
      "inputs": {
        "number": {
          "connections": [
            {
              "node": "9ccd2bc59e35c9aa",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -1836.5336358105108,
        1476.2838394735134
      ]
    },
    "d3bc9462cff3fca7": {
      "id": "d3bc9462cff3fca7",
      "name": "bitbybit.math.numberSlider",
      "customName": "number slider",
      "data": {
        "options": {
          "min": 0,
          "max": 10,
          "step": 0.1,
          "width": 350,
          "updateOnDrag": false
        },
        "number": 10
      },
      "inputs": {},
      "position": [
        -2743.4255274364946,
        1211.4616943158348
      ]
    },
    "f46811c63b911c8e": {
      "id": "f46811c63b911c8e",
      "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": false
      },
      "inputs": {
        "shapes": {
          "connections": [
            {
              "node": "b281a1800918b25f",
              "output": "list",
              "data": {}
            }
          ]
        },
        "shape": {
          "connections": [
            {
              "node": "bf904a3d079b03e4",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2365.7712269182575,
        847.0864420763828
      ]
    },
    "b281a1800918b25f": {
      "id": "b281a1800918b25f",
      "name": "bitbybit.lists.createList",
      "customName": "list",
      "data": {},
      "inputs": {
        "listElements": {
          "connections": [
            {
              "node": "d8ba80b7936706db",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1939.8545793039325,
        1128.4728441403677
      ]
    },
    "1bd08cb2d46a3bf5": {
      "id": "1bd08cb2d46a3bf5",
      "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": "a6cb6b3b43a8cd8a",
              "output": "result",
              "data": {}
            }
          ]
        },
        "options": {
          "connections": [
            {
              "node": "c11be3bd26bc5c15",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3712.65535885974,
        928.658522677609
      ]
    },
    "bf904a3d079b03e4": {
      "id": "bf904a3d079b03e4",
      "name": "bitbybit.occt.transforms.rotateAroundCenter",
      "customName": "rotate around center",
      "async": true,
      "drawable": true,
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "angle": -90,
        "center": [
          0,
          0,
          0
        ],
        "axis": [
          0,
          0,
          1
        ]
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "1c4209753eca0012",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -791.747265882226,
        350.98796080748514
      ]
    },
    "3f5ad610363163d1": {
      "id": "3f5ad610363163d1",
      "name": "bitbybit.lists.removeItemsAtIndexes",
      "customName": "remove items",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "clone": true
      },
      "inputs": {
        "list": {
          "connections": [
            {
              "node": "f46811c63b911c8e",
              "output": "result",
              "data": {}
            }
          ]
        },
        "indexes": {
          "connections": [
            {
              "node": "1e684d82142ee68f",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2785.370063639792,
        849.8591790008614
      ]
    },
    "1e684d82142ee68f": {
      "id": "1e684d82142ee68f",
      "name": "bitbybit.json.parse",
      "customName": "parse",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "text": "[ 0, 3, 4, 7, 8, 11, 12]"
      },
      "inputs": {},
      "position": [
        2363.52600323013,
        1239.332537469159
      ]
    },
    "a6cb6b3b43a8cd8a": {
      "id": "a6cb6b3b43a8cd8a",
      "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": "3f5ad610363163d1",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3162.0854441311467,
        842.4526998293636
      ]
    },
    "c11be3bd26bc5c15": {
      "id": "c11be3bd26bc5c15",
      "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": "#ffffff",
        "faceColour": "#9900ff",
        "vertexColour": "#ff00ff",
        "edgeWidth": 2,
        "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": [
        3173.5901786997433,
        1139.0257546060086
      ]
    },
    "636776a57c090266": {
      "id": "636776a57c090266",
      "name": "bitbybit.runner.setRunnerResultValue",
      "customName": "set runner result value",
      "data": {
        "property": "sphere"
      },
      "inputs": {
        "value": {
          "connections": [
            {
              "node": "1bd08cb2d46a3bf5",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        4321.376202230087,
        1039.004855400745
      ]
    },
    "a8debd02d3a57e07": {
      "id": "a8debd02d3a57e07",
      "name": "bitbybit.runner.getRunnerInputValue",
      "customName": "get runner input value",
      "data": {
        "property": "bending"
      },
      "inputs": {},
      "position": [
        -2637.369909980111,
        986.5382592310434
      ]
    },
    "9ccd2bc59e35c9aa": {
      "id": "9ccd2bc59e35c9aa",
      "name": "bitbybit.logic.firstDefinedValueGate",
      "customName": "first defined value gate",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        }
      },
      "inputs": {
        "value2": {
          "connections": [
            {
              "node": "d3bc9462cff3fca7",
              "output": "result",
              "data": {}
            }
          ]
        },
        "value1": {
          "connections": [
            {
              "node": "a8debd02d3a57e07",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        -2139.3553608353095,
        985.9618133277556
      ]
    },
    "a82c6fdac06d87c4": {
      "id": "a82c6fdac06d87c4",
      "name": "bitbybit.babylon.scene.drawDirectionalLight",
      "customName": "directional light",
      "async": false,
      "drawable": false,
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0,
          "forceExecution": false
        },
        "direction": [
          -100,
          -100,
          -100
        ],
        "intensity": 4,
        "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": [
        -2669.8361671836237,
        1861.445913244766
      ]
    }
  }
}
Plans & Pricing

Choose Your Plan

Editor plans for 3D development, API keys for server-side CAD algorithms

B2B

ENTERPRISE

Custom pricing

Custom software development, dedicated servers & CAD automation at scale.

CAD Automation & Software
  • Custom software development
  • Cloud CAD automation pipelines
  • 3D configurators (STEP & GLTF)
  • Batch export jobs
  • Custom algorithms & deployment
Infrastructure & Support
  • Custom compute allocation
  • Dedicated / VPS server tenants
  • Long-running computation jobs
  • Custom upload limits & overage
  • SLA & premium support