Script: Rete Example OCCT to BabylonJS to JSCAD

Rete Example OCCT to BabylonJS to JSCAD picture
Type
Rete logo indicatorrete
Date Created
Feb 19, 2024, 1:33:05 PM
Last Edit Date
Feb 19, 2024, 1:44:23 PM

Project Information

This project shows how you can convert OCCT BRep geometry to BabylonJS Mesh and then transform that mesh to JSCAD mesh and apply CSG mesh boolean operations on it

View Full Project

Script Code

{
  "id": "rete-v2-json",
  "nodes": {
    "c2a165251de7b79e": {
      "id": "c2a165251de7b79e",
      "name": "bitbybit.occt.shapes.solid.createCone",
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0
        },
        "radius1": 3,
        "radius2": 1.5,
        "height": 2,
        "angle": 360
      },
      "inputs": {},
      "position": [
        1074.6620463889087,
        558.2756255745339
      ]
    },
    "9300b398f10cfb7b": {
      "id": "9300b398f10cfb7b",
      "name": "bitbybit.occt.fillets.filletEdges",
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0
        },
        "radius": 0.5
      },
      "inputs": {
        "shape": {
          "connections": [
            {
              "node": "c2a165251de7b79e",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        1507.848213525865,
        749.3269555093859
      ]
    },
    "1632480125827359": {
      "id": "1632480125827359",
      "name": "bitbybit.draw.drawAnyAsync",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        }
      },
      "inputs": {
        "entity": {
          "connections": [
            {
              "node": "9300b398f10cfb7b",
              "output": "result",
              "data": {}
            }
          ]
        },
        "options": {
          "connections": [
            {
              "node": "af64b48f21e7d1ab",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2035.3080453259204,
        869.0166123457013
      ]
    },
    "af64b48f21e7d1ab": {
      "id": "af64b48f21e7d1ab",
      "name": "bitbybit.draw.optionsOcctShapeSimple",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        },
        "precision": 0.01,
        "drawFaces": true,
        "faceColour": "#ff0000",
        "drawEdges": false,
        "edgeColour": "#ffffff",
        "edgeWidth": 2
      },
      "inputs": {},
      "position": [
        1673.6040031126859,
        1251.7017445680644
      ]
    },
    "904ad63cf29031dd": {
      "id": "904ad63cf29031dd",
      "name": "bitbybit.babylon.mesh.getChildMeshes",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        },
        "directDescendantsOnly": false
      },
      "inputs": {
        "babylonMesh": {
          "connections": [
            {
              "node": "1632480125827359",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2498.882760995383,
        896.7695457355037
      ]
    },
    "3b0428ed978476cb": {
      "id": "3b0428ed978476cb",
      "name": "bitbybit.lists.getItem",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        },
        "index": 0,
        "clone": false
      },
      "inputs": {
        "list": {
          "connections": [
            {
              "node": "904ad63cf29031dd",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3028.924062486965,
        1001.5101473792845
      ]
    },
    "988b3b9620b16801": {
      "id": "988b3b9620b16801",
      "name": "bitbybit.babylon.mesh.getVerticesAsPolygonPoints",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        }
      },
      "inputs": {
        "babylonMesh": {
          "connections": [
            {
              "node": "3b0428ed978476cb",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        3477.9353467649757,
        1066.303623232705
      ]
    },
    "fd3da1cd36170e8e": {
      "id": "fd3da1cd36170e8e",
      "name": "bitbybit.jscad.shapes.fromPolygonPoints",
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0
        }
      },
      "inputs": {
        "polygonPoints": {
          "connections": [
            {
              "node": "988b3b9620b16801",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        4129.075962168808,
        1071.7687238681401
      ]
    },
    "6f59103fc5a7fb22": {
      "id": "6f59103fc5a7fb22",
      "name": "bitbybit.babylon.mesh.hide",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        },
        "includeChildren": true
      },
      "inputs": {
        "babylonMesh": {
          "connections": [
            {
              "node": "1632480125827359",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2472.6807706765226,
        627.5630568024095
      ]
    },
    "b1444d9d5077e397": {
      "id": "b1444d9d5077e397",
      "name": "bitbybit.jscad.shapes.geodesicSphere",
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0
        },
        "radius": 1,
        "frequency": 12
      },
      "inputs": {
        "center": {
          "connections": [
            {
              "node": "b21f330517b7c8c2",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        4164.5786147155595,
        1442.6486520704811
      ]
    },
    "b21f330517b7c8c2": {
      "id": "b21f330517b7c8c2",
      "name": "bitbybit.point.pointXYZ",
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0
        },
        "x": 0,
        "y": 2,
        "z": 0
      },
      "inputs": {},
      "position": [
        3795.346824244925,
        1449.8170923075654
      ]
    },
    "cc4417f452742496": {
      "id": "cc4417f452742496",
      "name": "bitbybit.jscad.booleans.subtract",
      "data": {
        "genericNodeData": {
          "hide": true,
          "oneOnOne": false,
          "flatten": 0
        }
      },
      "inputs": {
        "meshes": {
          "connections": [
            {
              "node": "e920eb3c39a34620",
              "output": "list",
              "data": {}
            }
          ]
        }
      },
      "position": [
        5034.734285012163,
        1254.9866554702594
      ]
    },
    "e920eb3c39a34620": {
      "id": "e920eb3c39a34620",
      "name": "bitbybit.lists.createList",
      "data": {},
      "inputs": {
        "listElements": {
          "connections": [
            {
              "node": "fd3da1cd36170e8e",
              "output": "result",
              "data": {}
            },
            {
              "node": "b1444d9d5077e397",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        4701.018818627419,
        1288.537688930951
      ]
    },
    "4b28a5af65f15cdf": {
      "id": "4b28a5af65f15cdf",
      "name": "bitbybit.draw.drawAnyAsync",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        }
      },
      "inputs": {
        "entity": {
          "connections": [
            {
              "node": "cc4417f452742496",
              "output": "result",
              "data": {}
            }
          ]
        },
        "options": {
          "connections": [
            {
              "node": "2ddf4dfd6d77d364",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        5744.816467132607,
        1419.8528356755196
      ]
    },
    "2ddf4dfd6d77d364": {
      "id": "2ddf4dfd6d77d364",
      "name": "bitbybit.draw.optionsSimple",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        },
        "size": 0.1,
        "opacity": 1,
        "updatable": false,
        "hidden": false
      },
      "inputs": {
        "colours": {
          "connections": [
            {
              "node": "fd0fd0aa6e761a72",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        5346.85059458729,
        1692.7200291387383
      ]
    },
    "fd0fd0aa6e761a72": {
      "id": "fd0fd0aa6e761a72",
      "name": "bitbybit.color.hexColor",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        },
        "color": "#11ff00"
      },
      "inputs": {},
      "position": [
        4683.501700690524,
        1846.2182269980829
      ]
    },
    "9851ab927bb67497": {
      "id": "9851ab927bb67497",
      "name": "bitbybit.draw.drawAnyAsync",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        }
      },
      "inputs": {
        "entity": {
          "connections": [
            {
              "node": "9300b398f10cfb7b",
              "output": "result",
              "data": {}
            }
          ]
        },
        "options": {
          "connections": [
            {
              "node": "a2ae5322fd4bbb78",
              "output": "result",
              "data": {}
            }
          ]
        }
      },
      "position": [
        2254.0798243704057,
        168.92837018930322
      ]
    },
    "a2ae5322fd4bbb78": {
      "id": "a2ae5322fd4bbb78",
      "name": "bitbybit.draw.optionsOcctShapeSimple",
      "data": {
        "genericNodeData": {
          "hide": false,
          "oneOnOne": false,
          "flatten": 0
        },
        "precision": 0.01,
        "drawFaces": false,
        "faceColour": "#ff0000",
        "drawEdges": true,
        "edgeColour": "#ffffff",
        "edgeWidth": 2
      },
      "inputs": {},
      "position": [
        1717.1138093675345,
        215.15563329762495
      ]
    }
  }
}