diff --git a/docs/blog/2024-11-08-updated-bitbybit-runners.md b/docs/blog/2024-11-08-updated-bitbybit-runners.md index 01883110..53c45dea 100644 --- a/docs/blog/2024-11-08-updated-bitbybit-runners.md +++ b/docs/blog/2024-11-08-updated-bitbybit-runners.md @@ -121,7 +121,7 @@ We are serving the Bitbybit Runners from the **JSDelivr CDN**. You can include t ``` -**Note:** You should replace `` with an actual version number (e.g., `0.20.7`). You can find all the official versions of Bitbybit.dev here: +**Note:** You should replace `` with an actual version number (e.g., `0.20.8`). You can find all the official versions of Bitbybit.dev here: ➡️ **[Bitbybit.dev GitHub Releases](https://github.com/bitbybit-dev/bitbybit/releases)** ### Examples of the Runners diff --git a/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md b/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md index 4e5c7d60..725e535a 100644 --- a/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md +++ b/docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md @@ -110,7 +110,7 @@ Save your JSON configurator as a file, upload it to Shopify CDN as a file. Copy While our Viewer Editor is the recommended way to create and manage the Scene Config JSON, you can also edit the JSON directly using any text editor. For a better editing experience with features like syntax highlighting and autocompletion (intellisense), we provide a JSON schema. -* **JSON Schema:** You can find the schema [here](https://ik.imagekit.io/bitbybit/app/assets/start/shopify/viewer-scene-config-schema-0-20-6.json). (Note: This schema link points to version `0.20.7`. The schema may be updated in the future, so ensure you refer to the latest version compatible with your "3D Bits" app version.) +* **JSON Schema:** You can find the schema [here](https://ik.imagekit.io/bitbybit/app/assets/start/shopify/viewer-scene-config-schema-0-20-6.json). (Note: This schema link points to version `0.20.8`. The schema may be updated in the future, so ensure you refer to the latest version compatible with your "3D Bits" app version.) Many modern code editors (like VS Code) can use this schema to provide validation and autocompletion as you edit the JSON. ## Video Tutorial: BITBYBIT VIEWER Block Setup diff --git a/docs/learn/3d-bits/tutorials/product-customizable-text.mdx b/docs/learn/3d-bits/tutorials/product-customizable-text.mdx index 2558dcf3..7c722a6c 100644 --- a/docs/learn/3d-bits/tutorials/product-customizable-text.mdx +++ b/docs/learn/3d-bits/tutorials/product-customizable-text.mdx @@ -153,7 +153,7 @@ To save you time, here is the embedded Bitbybit Rete script used in this tutoria diff --git a/docs/learn/3d-bits/tutorials/product-laptop-holder.mdx b/docs/learn/3d-bits/tutorials/product-laptop-holder.mdx index abb27661..c16794bd 100644 --- a/docs/learn/3d-bits/tutorials/product-laptop-holder.mdx +++ b/docs/learn/3d-bits/tutorials/product-laptop-holder.mdx @@ -63,7 +63,7 @@ To save you time and provide a starting point, here is the embedded Bitbybit Typ {\n\n laptops.forEach(laptop => {\n laptop.center = [0, laptop.height / 2 + laptopLiftedHeight, 0] as Bit.Inputs.Base.Point3;\n });\n\n let laptopFillets = [];\n let totalDistance = 0;\n let previousLaptopLength = 0;\n\n laptops.forEach(async (laptop, index) => {\n totalDistance += distanceBetweenLaptops + laptop.length / 2 + previousLaptopLength / 2;\n previousLaptopLength = laptop.length;\n laptop.center[2] = totalDistance;\n const laptopBaseModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length,\n height: laptop.height,\n center: laptop.center\n });\n const laptopFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopBaseModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const laptopVisModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length - 0.01,\n height: laptop.height,\n center: laptop.center\n });\n const laptopVisFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopVisModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const di = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n\n di.faceOpacity = 0.2;\n di.edgeWidth = 5;\n di.edgeOpacity = 0.6;\n di.edgeColour = whiteColor;\n di.faceColour = whiteColor;\n const laptopFilletMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopVisFillet, options: di });\n laptopsFilletsMesh.push(laptopFilletMesh);\n })\n\n const polygonWire = await bitbybit.occt.shapes.wire.createPolygonWire({\n points: controlPoints\n });\n const extrusion = await bitbybit.occt.operations.extrude({\n shape: polygonWire, direction: [0, 0, totalDistance += distanceBetweenLaptops + previousLaptopLength / 2]\n });\n const laptopStandFillet = await bitbybit.occt.fillets.filletEdges({ shape: extrusion, indexes: undefined, radius: 1 });\n const laptopStandThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: laptopStandFillet, offset: -0.5 });\n\n laptopStand = await bitbybit.occt.booleans.difference({ shape: laptopStandThick, shapes: laptopFillets, keepEdges: false });\n const li = new Bit.Inputs.OCCT.DrawShapeDto(laptopStand);\n li.faceOpacity = 1;\n if (flipColor) {\n li.faceColour = \"#0000ff\";\n li.edgeColour = whiteColor;\n } else {\n li.faceColour = holderColor;\n li.edgeColour = whiteColor;\n }\n li.edgeWidth = 5;\n laptopStandMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopStand, options: li });\n const laptopsMeshes = await Promise.all(laptopsFilletsMesh);\n return [laptopStandMesh, ...laptopsMeshes];\n }\n\n const meshes = await renderLaptops(laptops);\n return { meshes };\n}\n\nclass Laptop {\n width: number;\n length: number;\n height: number;\n center?: Bit.Inputs.Base.Point3;\n}\n\nBit.setBitbybitRunnerResult(start());","version":"0.20.7","type":"typescript"}} + script={{"script":"Bit.mockBitbybitRunnerInputs({\n \"Laptop Type\": \"MacBook Pro 16\",\n \"Number Laptops\": \"3\",\n \"Color\": \"Black\",\n});\nconst inputs = Bit.getBitbybitRunnerInputs();\n\nconst laptops: Laptop[] = []\n\nlet laptop: Laptop;\n\nswitch (inputs[\"Laptop Type\"]) {\n case \"MacBook Pro 16\":\n laptop = {\n length: 1.63,\n width: 35.8,\n height: 24.6\n };\n break;\n case \"MacBook Pro 14\":\n laptop = {\n length: 1.57,\n width: 31.3,\n height: 22.2\n }\n break;\n case \"MacBook Air\":\n laptop = {\n length: 1.2,\n width: 30.5,\n height: 21.6\n }\n break;\n default:\n break;\n}\n\nlet flipColor = false;\nswitch (inputs[\"Color\"]) {\n case \"Blue\":\n flipColor = true;\n break;\n default:\n break;\n}\n\nconsole.log(\"laptop \", laptop);\n\nconst nrLaptops = +inputs[\"Number Laptops\"];\n\nfor (let i = 0; i < nrLaptops; i++) {\n laptops.push({ ...laptop });\n}\n\nconst whiteColor = \"#ffffff\";\nconst holderColor = \"#333333\";\n\nconst laptopLiftedHeight = 3;\nconst distanceBetweenLaptops = 1.7;\nconst exportSTEP = false;\n\nbitbybit.babylon.scene.backgroundColour({ colour: \"#bbbbbb\" });\n\nconst pointLightConf = new Bit.Inputs.BabylonScene.PointLightDto();\npointLightConf.position = [-15, 20, -5];\npointLightConf.intensity = 8000;\npointLightConf.diffuse = \"#3333ff\";\npointLightConf.radius = 0;\nbitbybit.babylon.scene.drawPointLight(pointLightConf);\n\nconst controlPoints = [\n [-12.5, 0, 0],\n [-8, 13, 0],\n [-4, 11, 0],\n [-2, 6, 0],\n [2, 6, 0],\n [4, 14, 0],\n [8, 17, 0],\n [12.5, 0, 0]\n] as Bit.Inputs.Base.Point3[];\n\nlet laptopStand;\nlet laptopStandMesh;\n\nconst laptopsFilletsMesh = [];\n\nasync function start() {\n const ground = await bitbybit.occt.shapes.face.createCircleFace({ center: [0, 0, 0], direction: [0, 1, 0], radius: 75, });\n const groundOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n groundOptions.faceColour = whiteColor;\n groundOptions.drawEdges = false;\n await bitbybit.draw.drawAnyAsync({ entity: ground, options: groundOptions });\n\n const renderLaptops = async (laptops) => {\n\n laptops.forEach(laptop => {\n laptop.center = [0, laptop.height / 2 + laptopLiftedHeight, 0] as Bit.Inputs.Base.Point3;\n });\n\n let laptopFillets = [];\n let totalDistance = 0;\n let previousLaptopLength = 0;\n\n laptops.forEach(async (laptop, index) => {\n totalDistance += distanceBetweenLaptops + laptop.length / 2 + previousLaptopLength / 2;\n previousLaptopLength = laptop.length;\n laptop.center[2] = totalDistance;\n const laptopBaseModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length,\n height: laptop.height,\n center: laptop.center\n });\n const laptopFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopBaseModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const laptopVisModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length - 0.01,\n height: laptop.height,\n center: laptop.center\n });\n const laptopVisFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopVisModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const di = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n\n di.faceOpacity = 0.2;\n di.edgeWidth = 5;\n di.edgeOpacity = 0.6;\n di.edgeColour = whiteColor;\n di.faceColour = whiteColor;\n const laptopFilletMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopVisFillet, options: di });\n laptopsFilletsMesh.push(laptopFilletMesh);\n })\n\n const polygonWire = await bitbybit.occt.shapes.wire.createPolygonWire({\n points: controlPoints\n });\n const extrusion = await bitbybit.occt.operations.extrude({\n shape: polygonWire, direction: [0, 0, totalDistance += distanceBetweenLaptops + previousLaptopLength / 2]\n });\n const laptopStandFillet = await bitbybit.occt.fillets.filletEdges({ shape: extrusion, indexes: undefined, radius: 1 });\n const laptopStandThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: laptopStandFillet, offset: -0.5 });\n\n laptopStand = await bitbybit.occt.booleans.difference({ shape: laptopStandThick, shapes: laptopFillets, keepEdges: false });\n const li = new Bit.Inputs.OCCT.DrawShapeDto(laptopStand);\n li.faceOpacity = 1;\n if (flipColor) {\n li.faceColour = \"#0000ff\";\n li.edgeColour = whiteColor;\n } else {\n li.faceColour = holderColor;\n li.edgeColour = whiteColor;\n }\n li.edgeWidth = 5;\n laptopStandMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopStand, options: li });\n const laptopsMeshes = await Promise.all(laptopsFilletsMesh);\n return [laptopStandMesh, ...laptopsMeshes];\n }\n\n const meshes = await renderLaptops(laptops);\n return { meshes };\n}\n\nclass Laptop {\n width: number;\n length: number;\n height: number;\n center?: Bit.Inputs.Base.Point3;\n}\n\nBit.setBitbybitRunnerResult(start());","version":"0.20.8","type":"typescript"}} title="Bitbybit Rete Editor - 3D Laptop Holder" description="3D Laptop holder configurator" /> diff --git a/docs/learn/3d-bits/tutorials/product-palm-table.mdx b/docs/learn/3d-bits/tutorials/product-palm-table.mdx index 0923e8ed..2a4e4a59 100644 --- a/docs/learn/3d-bits/tutorials/product-palm-table.mdx +++ b/docs/learn/3d-bits/tutorials/product-palm-table.mdx @@ -157,7 +157,7 @@ To save you time, here is the embedded Rete script used in this tutorial for the diff --git a/docs/learn/code/common/base/color/color-usage-examples.md b/docs/learn/code/common/base/color/color-usage-examples.md index 1ff16b93..c9ab73d8 100644 --- a/docs/learn/code/common/base/color/color-usage-examples.md +++ b/docs/learn/code/common/base/color/color-usage-examples.md @@ -48,21 +48,21 @@ Click through the tabs below to see the implementation. You can interact with th colorParamfaceColoredgeColorcolorParam0faceColorcolorParam255colorParam0255edgeColor#0000ff6000TRUE0.01TRUEfaceColorTRUEedgeColor10","version":"0.20.7","type":"blockly"}} + script={{"script":"colorParamfaceColoredgeColorcolorParam0faceColorcolorParam255colorParam0255edgeColor#0000ff6000TRUE0.01TRUEfaceColorTRUEedgeColor10","version":"0.20.8","type":"blockly"}} title="Color Usage Example" /> {\n\n const colorParam = 55;\n const rgbToHexOptions = new Bit.Inputs.Color.RGBMinMaxDto();\n rgbToHexOptions.r = colorParam;\n rgbToHexOptions.b = colorParam;\n const faceColor = bitbybit.color.rgbToHex(rgbToHexOptions);\n\n // This might look strange as you could just assign the string to edgeColor directly, \n // but this identity function is nice to have in visual prgramming editors - check Rete & Blockly\n // examples\n \n const edgeColor = bitbybit.color.hexColor({ color: \"#ff0000\" });\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 6;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOpt.faceColour = faceColor;\n drawOpt.edgeColour = edgeColor;\n drawOpt.edgeWidth = 10;\n bitbybit.draw.drawAnyAsync({ entity: cube, options: drawOpt });\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const colorParam = 55;\n const rgbToHexOptions = new Bit.Inputs.Color.RGBMinMaxDto();\n rgbToHexOptions.r = colorParam;\n rgbToHexOptions.b = colorParam;\n const faceColor = bitbybit.color.rgbToHex(rgbToHexOptions);\n\n // This might look strange as you could just assign the string to edgeColor directly, \n // but this identity function is nice to have in visual prgramming editors - check Rete & Blockly\n // examples\n \n const edgeColor = bitbybit.color.hexColor({ color: \"#ff0000\" });\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 6;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOpt.faceColour = faceColor;\n drawOpt.edgeColour = edgeColor;\n drawOpt.edgeWidth = 10;\n bitbybit.draw.drawAnyAsync({ entity: cube, options: drawOpt });\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Color Usage Example" /> diff --git a/docs/learn/code/common/base/point/point-hex-grid-example.md b/docs/learn/code/common/base/point/point-hex-grid-example.md index e8b4eae1..ea908529 100644 --- a/docs/learn/code/common/base/point/point-hex-grid-example.md +++ b/docs/learn/code/common/base/point/point-hex-grid-example.md @@ -55,21 +55,21 @@ Click through the tabs below to see the implementation. Each example will genera hexagonspointshexCornershexPolylinesihexagons20101010FALSEFALSEFALSEFALSEFALSETRUEFALSEpointshexagonscentershexCornershexagonshexagonshexPolylinesihexCornersINSERTLASThexPolylinesiTRUEpointshexPolylines","version":"0.20.7","type":"blockly"}} + script={{"script":"hexagonspointshexCornershexPolylinesihexagons20101010FALSEFALSEFALSEFALSEFALSETRUEFALSEpointshexagonscentershexCornershexagonshexagonshexPolylinesihexCornersINSERTLASThexPolylinesiTRUEpointshexPolylines","version":"0.20.8","type":"blockly"}} title="Point Hex Grid Example" /> {\n\n // 1. Configure the hexagonal grid options\n const hexOptions = new Bit.Inputs.Point.HexGridScaledToFitDto();\n // Set options different from defaults. \n // TypeScript IntelliSense (e.g., typing \"hexOptions.\") will show all available parameters.\n hexOptions.width = 20;\n hexOptions.height = 10;\n hexOptions.nrHexagonsInWidth = 10;\n hexOptions.nrHexagonsInHeight = 10;\n hexOptions.centerGrid = true; // Center the entire grid at the world origin [0,0,0]\n // Example: hexOptions.flatTop = true; // To get flat-topped hexagons\n // Example: hexOptions.pointsOnGround = true; // To project to XZ plane if original is XY\n\n // 2. Generate the hex grid data\n // This function returns an object like: \n // { centers: Point3[], hexagons: Point3[][], shortestDistEdge, longestDistEdge, maxFilletRadius }\n const hexResult = bitbybit.point.hexGridScaledToFit(hexOptions);\n\n // 3. Create polylines for each hexagon's outline\n // hexResult.hexagons is a list of lists (e.g., [[v1,v2..v6 for hex1], [v1,v2..v6 for hex2], ...])\n // We .map() over this list to create a Polyline object for each hexagon.\n const polylines = hexResult.hexagons.map(singleHexagonCornerPoints => {\n const polylineOptions = new Bit.Inputs.Polyline.PolylineCreateDto();\n polylineOptions.points = singleHexagonCornerPoints; // The 6 corner points\n polylineOptions.isClosed = true; // Ensure the polyline forms a closed loop\n return bitbybit.polyline.create(polylineOptions);\n }) as Bit.Inputs.Base.Polyline3[]; // Type assertion: the result is an array of Polyline3 objects\n\n // 4. Draw the center points of the hexagons\n // hexResult.centers is a list of 3D points: [[cx1,cy1,cz1], [cx2,cy2,cz2], ...]\n bitbybit.draw.drawAnyAsync({ entity: hexResult.centers });\n\n // 5. Draw the polylines representing the hexagon outlines\n bitbybit.draw.drawAnyAsync({ entity: polylines });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = () => {\n\n // 1. Configure the hexagonal grid options\n const hexOptions = new Bit.Inputs.Point.HexGridScaledToFitDto();\n // Set options different from defaults. \n // TypeScript IntelliSense (e.g., typing \"hexOptions.\") will show all available parameters.\n hexOptions.width = 20;\n hexOptions.height = 10;\n hexOptions.nrHexagonsInWidth = 10;\n hexOptions.nrHexagonsInHeight = 10;\n hexOptions.centerGrid = true; // Center the entire grid at the world origin [0,0,0]\n // Example: hexOptions.flatTop = true; // To get flat-topped hexagons\n // Example: hexOptions.pointsOnGround = true; // To project to XZ plane if original is XY\n\n // 2. Generate the hex grid data\n // This function returns an object like: \n // { centers: Point3[], hexagons: Point3[][], shortestDistEdge, longestDistEdge, maxFilletRadius }\n const hexResult = bitbybit.point.hexGridScaledToFit(hexOptions);\n\n // 3. Create polylines for each hexagon's outline\n // hexResult.hexagons is a list of lists (e.g., [[v1,v2..v6 for hex1], [v1,v2..v6 for hex2], ...])\n // We .map() over this list to create a Polyline object for each hexagon.\n const polylines = hexResult.hexagons.map(singleHexagonCornerPoints => {\n const polylineOptions = new Bit.Inputs.Polyline.PolylineCreateDto();\n polylineOptions.points = singleHexagonCornerPoints; // The 6 corner points\n polylineOptions.isClosed = true; // Ensure the polyline forms a closed loop\n return bitbybit.polyline.create(polylineOptions);\n }) as Bit.Inputs.Base.Polyline3[]; // Type assertion: the result is an array of Polyline3 objects\n\n // 4. Draw the center points of the hexagons\n // hexResult.centers is a list of 3D points: [[cx1,cy1,cz1], [cx2,cy2,cz2], ...]\n bitbybit.draw.drawAnyAsync({ entity: hexResult.centers });\n\n // 5. Draw the polylines representing the hexagon outlines\n bitbybit.draw.drawAnyAsync({ entity: polylines });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Point Hex Grid Example" /> diff --git a/docs/learn/code/common/base/point/point-spiral-examples.md b/docs/learn/code/common/base/point/point-spiral-examples.md index b3eef77d..d77a45e3 100644 --- a/docs/learn/code/common/base/point/point-spiral-examples.md +++ b/docs/learn/code/common/base/point/point-spiral-examples.md @@ -45,21 +45,21 @@ Click through the tabs below to see the implementation. Each example will genera 0.9300361","version":"0.20.7","type":"blockly"}} + script={{"script":"0.9300361","version":"0.20.8","type":"blockly"}} title="Point Spiral Example" /> {\n\n // 1. Configure the spiral parameters\n const spiralOptions = new Bit.Inputs.Point.SpiralDto();\n spiralOptions.numberPoints = 300;\n spiralOptions.radius = 6; // Overall extent of the spiral; default is 1\n spiralOptions.widening = 3; // Controls how tight the spiral is; default is 10\n spiralOptions.phi = 0.9; // Constant influencing the spiral pattern; default relates to Golden Angle\n spiralOptions.factor = 1; // General scaling factor; default is 1\n\n // 2. Generate the list of points forming the spiral\n // The bitbybit.point.spiral() function returns an array of 3D points.\n const points = bitbybit.point.spiral(spiralOptions);\n\n // 3. Draw the generated points in the scene\n // The drawAnyAsync function can take an array of points and will render them.\n bitbybit.draw.drawAnyAsync({ entity: points });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = () => {\n\n // 1. Configure the spiral parameters\n const spiralOptions = new Bit.Inputs.Point.SpiralDto();\n spiralOptions.numberPoints = 300;\n spiralOptions.radius = 6; // Overall extent of the spiral; default is 1\n spiralOptions.widening = 3; // Controls how tight the spiral is; default is 10\n spiralOptions.phi = 0.9; // Constant influencing the spiral pattern; default relates to Golden Angle\n spiralOptions.factor = 1; // General scaling factor; default is 1\n\n // 2. Generate the list of points forming the spiral\n // The bitbybit.point.spiral() function returns an array of 3D points.\n const points = bitbybit.point.spiral(spiralOptions);\n\n // 3. Draw the generated points in the scene\n // The drawAnyAsync function can take an array of points and will render them.\n bitbybit.draw.drawAnyAsync({ entity: points });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Point Spiral Example" /> diff --git a/docs/learn/code/common/base/text/text-usage-examples.md b/docs/learn/code/common/base/text/text-usage-examples.md index 07662f2d..e8bd4137 100644 --- a/docs/learn/code/common/base/text/text-usage-examples.md +++ b/docs/learn/code/common/base/text/text-usage-examples.md @@ -53,21 +53,21 @@ Click through the tabs below to see the implementation. Each example will create namewordwordListnameJohnwordawesomewordListnamewordHi {0}, you are {1}!wordList'Roboto''Regular'20.2180000010'centerMiddle'","version":"0.20.7","type":"blockly"}} + script={{"script":"namewordwordListnameJohnwordawesomewordListnamewordHi {0}, you are {1}!wordList'Roboto''Regular'20.2180000010'centerMiddle'","version":"0.20.8","type":"blockly"}} title="Text Formatting And 3D Fonts" /> {\n const name = \"John\";\n const word = \"awesome\";\n\n const formatOpt = new Bit.Inputs.Text.TextFormatDto();\n formatOpt.text = \"Hi {0}, you are {1}!\";\n formatOpt.values = [name, word];\n const formattedText = bitbybit.text.format(formatOpt);\n\n const text3dOptions = new Bit.Advanced.Text3D.Text3DDto();\n text3dOptions.text = formattedText;\n text3dOptions.rotation = 180;\n text3dOptions.fontSize = 2;\n const text3d = await bitbybit.advanced.text3d.create(text3dOptions);\n bitbybit.draw.drawAnyAsync({ entity: text3d });\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const name = \"John\";\n const word = \"awesome\";\n\n const formatOpt = new Bit.Inputs.Text.TextFormatDto();\n formatOpt.text = \"Hi {0}, you are {1}!\";\n formatOpt.values = [name, word];\n const formattedText = bitbybit.text.format(formatOpt);\n\n const text3dOptions = new Bit.Advanced.Text3D.Text3DDto();\n text3dOptions.text = formattedText;\n text3dOptions.rotation = 180;\n text3dOptions.fontSize = 2;\n const text3d = await bitbybit.advanced.text3d.create(text3dOptions);\n bitbybit.draw.drawAnyAsync({ entity: text3d });\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Text Formatting And 3D Fonts" /> diff --git a/docs/learn/code/common/base/vector/vector-usage-examples.md b/docs/learn/code/common/base/vector/vector-usage-examples.md index f04543f2..53092370 100644 --- a/docs/learn/code/common/base/vector/vector-usage-examples.md +++ b/docs/learn/code/common/base/vector/vector-usage-examples.md @@ -60,21 +60,21 @@ Click through the tabs below to see the implementation in Rete, Blockly, and Typ spanItemsspanEaseItemsvectorsj40040010100.450.50.5FALSE#ffffff#ffffffspanItems0.205spanEaseItemsspanItems05'easeInSine'FALSEvectorsj1spanItems1INSERTLASTvectorsGETFROM_STARTspanItemsjGETFROM_STARTspanEaseItemsj0vectorsvectors","version":"0.20.7","type":"blockly"}} + script={{"script":"spanItemsspanEaseItemsvectorsj40040010100.450.50.5FALSE#ffffff#ffffffspanItems0.205spanEaseItemsspanItems05'easeInSine'FALSEvectorsj1spanItems1INSERTLASTvectorsGETFROM_STARTspanItemsjGETFROM_STARTspanEaseItemsj0vectorsvectors","version":"0.20.8","type":"blockly"}} title="Vector Span & Ease In Combination" /> {\n\n const spanOptions = new Bit.Inputs.Vector.SpanDto();\n spanOptions.step = 0.2;\n spanOptions.min = 0;\n spanOptions.max = 5;\n const spanItems = bitbybit.vector.span(spanOptions);\n\n const spanEaseOptions = new Bit.Inputs.Vector.SpanEaseItemsDto();\n spanEaseOptions.ease = Bit.Inputs.Math.easeEnum.easeInSine;\n spanEaseOptions.min = 0;\n spanEaseOptions.max = 5;\n spanEaseOptions.nrItems = spanItems.length;\n const spanEaseItems = bitbybit.vector.spanEaseItems(spanEaseOptions);\n\n const vectors = spanItems.map((s, index) => [s, spanEaseItems[index], 0]) as Bit.Inputs.Base.Vector3[];\n\n bitbybit.draw.drawGridMesh(new Bit.Inputs.Draw.SceneDrawGridMeshDto());\n bitbybit.draw.drawAnyAsync({ entity: vectors });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = () => {\n\n const spanOptions = new Bit.Inputs.Vector.SpanDto();\n spanOptions.step = 0.2;\n spanOptions.min = 0;\n spanOptions.max = 5;\n const spanItems = bitbybit.vector.span(spanOptions);\n\n const spanEaseOptions = new Bit.Inputs.Vector.SpanEaseItemsDto();\n spanEaseOptions.ease = Bit.Inputs.Math.easeEnum.easeInSine;\n spanEaseOptions.min = 0;\n spanEaseOptions.max = 5;\n spanEaseOptions.nrItems = spanItems.length;\n const spanEaseItems = bitbybit.vector.spanEaseItems(spanEaseOptions);\n\n const vectors = spanItems.map((s, index) => [s, spanEaseItems[index], 0]) as Bit.Inputs.Base.Vector3[];\n\n bitbybit.draw.drawGridMesh(new Bit.Inputs.Draw.SceneDrawGridMeshDto());\n bitbybit.draw.drawAnyAsync({ entity: vectors });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Vector Span & Ease In Combination" /> diff --git a/docs/learn/code/common/draw/examples.mdx b/docs/learn/code/common/draw/examples.mdx index e0405a43..344bf444 100644 --- a/docs/learn/code/common/draw/examples.mdx +++ b/docs/learn/code/common/draw/examples.mdx @@ -28,7 +28,7 @@ The primary component for custom drawing is typically found under the path: **Rete Example: Filleted Cube with Custom Drawing Options** @@ -44,7 +44,7 @@ The primary block for custom drawing is typically found under: 5000TRUE111#ff6600#000099#cc33cc20.3TRUETRUETRUE0.01FALSE0.06#ff00ffFALSE0.06#0000ff","version":"0.20.7","type":"blockly"}} + script={{"script":"5000TRUE111#ff6600#000099#cc33cc20.3TRUETRUETRUE0.01FALSE0.06#ff00ffFALSE0.06#0000ff","version":"0.20.8","type":"blockly"}} title="Blockly Drawing Example" description="Draws simple filletted cube geometry." /> @@ -55,7 +55,7 @@ Finally, we achieve the same result using TypeScript. The code follows a similar {\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 5;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n const filletOptions = new Bit.Inputs.OCCT.FilletDto()\n filletOptions.shape = cube;\n filletOptions.radius = 1;\n const roundedCube = await bitbybit.occt.fillets.filletEdges(filletOptions);\n\n const drawOcctOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOcctOptions.faceColour = \"#0000ff\";\n drawOcctOptions.edgeColour = \"#ff5555\";\n drawOcctOptions.drawVertices = true;\n drawOcctOptions.vertexSize = 0.3;\n // The rest of options remain default (initialized inside the instance)\n const drawnMesh = await bitbybit.draw.drawAnyAsync({ entity: roundedCube, options: drawOcctOptions })\n // drawnMesh is BABYLONJS Mesh if BabylonJS engine is used. In Three.JS it turns into Group.\n return drawnMesh;\n \n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = 5;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n const filletOptions = new Bit.Inputs.OCCT.FilletDto()\n filletOptions.shape = cube;\n filletOptions.radius = 1;\n const roundedCube = await bitbybit.occt.fillets.filletEdges(filletOptions);\n\n const drawOcctOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOcctOptions.faceColour = \"#0000ff\";\n drawOcctOptions.edgeColour = \"#ff5555\";\n drawOcctOptions.drawVertices = true;\n drawOcctOptions.vertexSize = 0.3;\n // The rest of options remain default (initialized inside the instance)\n const drawnMesh = await bitbybit.draw.drawAnyAsync({ entity: roundedCube, options: drawOcctOptions })\n // drawnMesh is BABYLONJS Mesh if BabylonJS engine is used. In Three.JS it turns into Group.\n return drawnMesh;\n \n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="TypeScript Drawing Example" description="Draws simple filletted cube geometry." /> \ No newline at end of file diff --git a/docs/learn/code/common/occt/booleans/operations.mdx b/docs/learn/code/common/occt/booleans/operations.mdx index ec651871..5a91837c 100644 --- a/docs/learn/code/common/occt/booleans/operations.mdx +++ b/docs/learn/code/common/occt/booleans/operations.mdx @@ -49,21 +49,21 @@ The following scripts demonstrate creating three solids (a box, a cylinder, and **TypeScript Example: Union of Solids** {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const union = await bitbybit.occt.booleans.union({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: union\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const union = await bitbybit.occt.booleans.union({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: union\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Union Three Solids" /> **Blockly Example: Union of Solids** boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.7","type":"blockly"}} + script={{"script":"boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.8","type":"blockly"}} title="Union Three Solids" /> **Rete Example: Union of Solids** @@ -94,21 +94,21 @@ These scripts demonstrate creating a box, cylinder, and sphere, then subtracting **TypeScript Example: Difference of Solids** {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Difference of Solids" /> **Blockly Example: Difference of Solids** boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.7","type":"blockly"}} + script={{"script":"boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.8","type":"blockly"}} title="Difference of Solids" /> **Rete Example: Difference of Solids** @@ -138,21 +138,21 @@ These scripts create a box, cylinder, and sphere, and then compute their common **TypeScript Example: Intersection of Solids** {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.intersection({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 5;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.radius = 3;\n cylinderOpt.height = 7;\n cylinderOpt.center = [3, 0, 3];\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt);\n\n\n const sphereOpt = new Bit.Inputs.OCCT.SphereDto();\n sphereOpt.radius = 3;\n sphereOpt.center = [-1.5, 1.5, -5];\n const sphere = await bitbybit.occt.shapes.solid.createSphere(sphereOpt);\n\n const diff = await bitbybit.occt.booleans.intersection({\n shapes: [box, cylinder, sphere],\n keepEdges: false\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: diff\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Intersection of Solids" /> **Blockly Example: Intersection of Solids** boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.7","type":"blockly"}} + script={{"script":"boxspherecylinderbox585000sphere3-1.51.5-5cylinder37303010boxcylindersphereFALSE","version":"0.20.8","type":"blockly"}} title="Intersection of Solids" /> **Rete Example: Intersection of Solids** diff --git a/docs/learn/code/common/occt/dimensions/angular-dimension.md b/docs/learn/code/common/occt/dimensions/angular-dimension.md index 9d97133b..668155db 100644 --- a/docs/learn/code/common/occt/dimensions/angular-dimension.md +++ b/docs/learn/code/common/occt/dimensions/angular-dimension.md @@ -32,21 +32,21 @@ Angular dimensions measure the angle between two direction vectors and display t direction1direction2centerdirection1100direction2011center000direction1direction2center20.30.11deg0.30.4FALSE","version":"0.20.7","type":"blockly"}} + script={{"script":"direction1direction2centerdirection1100direction2011center000direction1direction2center20.30.11deg0.30.4FALSE","version":"0.20.8","type":"blockly"}} title="Simple angular dimension between two directions" /> {\n // Define two direction vectors to measure angle between\n const direction1: Vector3 = [1, 0, 0]; // X-axis direction\n const direction2: Vector3 = [0, 1, 1]; // Direction at 45deg from Y and Z\n const center: Point3 = [0, 0, 0]; // Origin point\n\n // Create an angular dimension between the directions\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = direction2;\n dimensionOptions.center = center;\n dimensionOptions.radius = 2;\n dimensionOptions.offsetFromCenter = 0.3;\n dimensionOptions.extraSize = 0.1;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"deg\";\n dimensionOptions.labelSize = 0.3;\n dimensionOptions.labelOffset = 0.4;\n dimensionOptions.radians = false;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import the required DTO for angular dimensions\nconst { SimpleAngularDimensionDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Define two direction vectors to measure angle between\n const direction1: Vector3 = [1, 0, 0]; // X-axis direction\n const direction2: Vector3 = [0, 1, 1]; // Direction at 45deg from Y and Z\n const center: Point3 = [0, 0, 0]; // Origin point\n\n // Create an angular dimension between the directions\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = direction2;\n dimensionOptions.center = center;\n dimensionOptions.radius = 2;\n dimensionOptions.offsetFromCenter = 0.3;\n dimensionOptions.extraSize = 0.1;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"deg\";\n dimensionOptions.labelSize = 0.3;\n dimensionOptions.labelOffset = 0.4;\n dimensionOptions.radians = false;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Simple angular dimension between two directions" /> @@ -62,21 +62,21 @@ Angular dimensions are particularly useful for complex 3D geometry like cones, w conerotatedConeconeEdgetranslatedEdgestartPointendPointdirection1cone52.75360000010rotatedConecone010-90coneEdgerotatedCone2translatedEdgeconeEdge-100startPointtranslatedEdgeendPointtranslatedEdgedirection1endPointstartPointrotatedConedirection1-100startPoint7202(deg)0.40.6FALSE","version":"0.20.7","type":"blockly"}} + script={{"script":"conerotatedConeconeEdgetranslatedEdgestartPointendPointdirection1cone52.75360000010rotatedConecone010-90coneEdgerotatedCone2translatedEdgeconeEdge-100startPointtranslatedEdgeendPointtranslatedEdgedirection1endPointstartPointrotatedConedirection1-100startPoint7202(deg)0.40.6FALSE","version":"0.20.8","type":"blockly"}} title="Cone with apex angle measurement" /> {\n // Create a cone with specific dimensions\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 5;\n coneOptions.radius2 = 2.7; // Variable radius for apex angle\n coneOptions.height = 5;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0];\n coneOptions.direction = [0, 1, 0];\n const cone = await solid.createCone(coneOptions);\n\n // Rotate the cone -90 degrees around Y axis for better visualization\n const rotatedCone = await transforms.rotate({\n shape: cone,\n axis: [0, 1, 0],\n angle: -90\n });\n\n // Draw the rotated cone\n bitbybit.draw.drawAnyAsync({ entity: rotatedCone });\n\n // Get edge 2 from the cone (this is a generatrix line)\n const coneEdge = await edge.getEdge({ shape: rotatedCone, index: 2 });\n\n // Translate the edge to position it for measurement\n const translatedEdge = await transforms.translate({\n shape: coneEdge,\n translation: [-1, 0, 0]\n });\n\n // Get start and end points from the translated edge\n const startPoint = await edge.startPointOnEdge({ shape: translatedEdge });\n const endPoint = await edge.endPointOnEdge({ shape: translatedEdge });\n\n // Calculate direction vector from start to end point\n const direction1 = bitbybit.vector.sub({ first: endPoint, second: startPoint }) as Vector3;\n\n // Create angular dimension to measure apex angle\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = [-1, 0, 0]; // Reference direction\n dimensionOptions.center = startPoint; // Apex point\n dimensionOptions.radius = 7;\n dimensionOptions.offsetFromCenter = 2;\n dimensionOptions.extraSize = 0;\n dimensionOptions.decimalPlaces = 2;\n dimensionOptions.labelSuffix = \"(deg)\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.6;\n dimensionOptions.radians = false;\n\n // Create and draw the angular dimension\n const dimension = await dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating shapes and dimensions\nconst { ConeDto, SimpleAngularDimensionDto } = Bit.Inputs.OCCT;\n// Import types for type safety\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT modules\nconst { shapes, dimensions, transforms } = bitbybit.occt;\nconst { solid, edge } = shapes;\n\n// Define the main function to create a cone with angular dimension\nconst start = async () => {\n // Create a cone with specific dimensions\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 5;\n coneOptions.radius2 = 2.7; // Variable radius for apex angle\n coneOptions.height = 5;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0];\n coneOptions.direction = [0, 1, 0];\n const cone = await solid.createCone(coneOptions);\n\n // Rotate the cone -90 degrees around Y axis for better visualization\n const rotatedCone = await transforms.rotate({\n shape: cone,\n axis: [0, 1, 0],\n angle: -90\n });\n\n // Draw the rotated cone\n bitbybit.draw.drawAnyAsync({ entity: rotatedCone });\n\n // Get edge 2 from the cone (this is a generatrix line)\n const coneEdge = await edge.getEdge({ shape: rotatedCone, index: 2 });\n\n // Translate the edge to position it for measurement\n const translatedEdge = await transforms.translate({\n shape: coneEdge,\n translation: [-1, 0, 0]\n });\n\n // Get start and end points from the translated edge\n const startPoint = await edge.startPointOnEdge({ shape: translatedEdge });\n const endPoint = await edge.endPointOnEdge({ shape: translatedEdge });\n\n // Calculate direction vector from start to end point\n const direction1 = bitbybit.vector.sub({ first: endPoint, second: startPoint }) as Vector3;\n\n // Create angular dimension to measure apex angle\n const dimensionOptions = new SimpleAngularDimensionDto();\n dimensionOptions.direction1 = direction1;\n dimensionOptions.direction2 = [-1, 0, 0]; // Reference direction\n dimensionOptions.center = startPoint; // Apex point\n dimensionOptions.radius = 7;\n dimensionOptions.offsetFromCenter = 2;\n dimensionOptions.extraSize = 0;\n dimensionOptions.decimalPlaces = 2;\n dimensionOptions.labelSuffix = \"(deg)\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.6;\n dimensionOptions.radians = false;\n\n // Create and draw the angular dimension\n const dimension = await dimensions.simpleAngularDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Cone with apex angle measurement" /> diff --git a/docs/learn/code/common/occt/dimensions/linear-dimension.md b/docs/learn/code/common/occt/dimensions/linear-dimension.md index d304283a..2915bdd9 100644 --- a/docs/learn/code/common/occt/dimensions/linear-dimension.md +++ b/docs/learn/code/common/occt/dimensions/linear-dimension.md @@ -26,21 +26,21 @@ Linear dimensions measure straight-line distances between two points and display point1point2point1-500point2500point1point2point1point20100.30.21cm0.40.80","version":"0.20.7","type":"blockly"}} + script={{"script":"point1point2point1-500point2500point1point2point1point20100.30.21cm0.40.80","version":"0.20.8","type":"blockly"}} title="Simple linear dimension between two points" /> {\n // Define two points to measure between\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Draw the points for reference\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n\n // Create a linear dimension between the points\n const dimensionOptions = new SimpleLinearLengthDimensionDto();\n dimensionOptions.start = startPoint;\n dimensionOptions.end = endPoint;\n dimensionOptions.direction = [0, 1, 0]; // Offset in Y direction\n dimensionOptions.offsetFromPoints = 0.3;\n dimensionOptions.crossingSize = 0.2;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"cm\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.8;\n dimensionOptions.labelRotation = 0;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleLinearLengthDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import the required DTO for linear dimensions\nconst { SimpleLinearLengthDimensionDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Define the main function\nconst start = async () => {\n // Define two points to measure between\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Draw the points for reference\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n\n // Create a linear dimension between the points\n const dimensionOptions = new SimpleLinearLengthDimensionDto();\n dimensionOptions.start = startPoint;\n dimensionOptions.end = endPoint;\n dimensionOptions.direction = [0, 1, 0]; // Offset in Y direction\n dimensionOptions.offsetFromPoints = 0.3;\n dimensionOptions.crossingSize = 0.2;\n dimensionOptions.decimalPlaces = 1;\n dimensionOptions.labelSuffix = \"cm\";\n dimensionOptions.labelSize = 0.4;\n dimensionOptions.labelOffset = 0.8;\n dimensionOptions.labelRotation = 0;\n\n // Create and draw the dimension\n const dimension = await bitbybit.occt.dimensions.simpleLinearLengthDimension(dimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: dimension });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Simple linear dimension between two points" /> @@ -51,21 +51,21 @@ Linear dimensions update automatically when geometry changes, keeping your docum widthlengthheightboxfirstEdgesecondEdgethirdEdgewidth13.2length9.1height5.3boxwidthlengthheight000TRUEfirstEdgebox1secondEdgebox8thirdEdgebox11firstEdgefirstEdge-2000.20.22(cm)0.51180secondEdgesecondEdge2000.20.22(cm)0.51180thirdEdgethirdEdge00-20.20.22(cm)0.51180box","version":"0.20.7","type":"blockly"}} + script={{"script":"widthlengthheightboxfirstEdgesecondEdgethirdEdgewidth13.2length9.1height5.3boxwidthlengthheight000TRUEfirstEdgebox1secondEdgebox8thirdEdgebox11firstEdgefirstEdge-2000.20.22(cm)0.51180secondEdgesecondEdge2000.20.22(cm)0.51180thirdEdgethirdEdge00-20.20.22(cm)0.51180box","version":"0.20.8","type":"blockly"}} title="Linear dimensions applied on box" /> {\n // Create a box with specific dimensions\n const boxOptions = new BoxDto();\n boxOptions.width = 13.2;\n boxOptions.length = 9.1;\n boxOptions.height = 5.3;\n boxOptions.center = [0, 0, 0];\n boxOptions.originOnCenter = true;\n const box = await solid.createBox(boxOptions);\n\n // Draw the box first\n bitbybit.draw.drawAnyAsync({ entity: box });\n\n // Get all edges from the box for dimension measurements\n const edges = await edge.getEdges({ shape: box });\n\n // Create width dimension (measuring edge 0)\n const widthEdge = edges[0];\n const widthStartPoint = await edge.startPointOnEdge({ shape: widthEdge });\n const widthEndPoint = await edge.endPointOnEdge({ shape: widthEdge });\n\n const widthDimensionOptions = new SimpleLinearLengthDimensionDto();\n widthDimensionOptions.start = widthStartPoint;\n widthDimensionOptions.end = widthEndPoint;\n widthDimensionOptions.direction = [-2, 0, 0]; // Offset to the left\n widthDimensionOptions.offsetFromPoints = 0.2;\n widthDimensionOptions.crossingSize = 0.2;\n widthDimensionOptions.decimalPlaces = 2;\n widthDimensionOptions.labelSuffix = \"(cm)\";\n widthDimensionOptions.labelSize = 0.5;\n widthDimensionOptions.labelOffset = 1;\n widthDimensionOptions.labelRotation = 180;\n \n const widthDimension = await dimensions.simpleLinearLengthDimension(widthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: widthDimension });\n\n // Create height dimension (measuring edge 10)\n const heightEdge = edges[10];\n const heightStartPoint = await edge.startPointOnEdge({ shape: heightEdge });\n const heightEndPoint = await edge.endPointOnEdge({ shape: heightEdge });\n\n const heightDimensionOptions = new SimpleLinearLengthDimensionDto();\n heightDimensionOptions.start = heightStartPoint;\n heightDimensionOptions.end = heightEndPoint;\n heightDimensionOptions.direction = [0, 0, -2]; // Offset toward the back\n heightDimensionOptions.offsetFromPoints = 0.2;\n heightDimensionOptions.crossingSize = 0.2;\n heightDimensionOptions.decimalPlaces = 2;\n heightDimensionOptions.labelSuffix = \"(cm)\";\n heightDimensionOptions.labelSize = 0.5;\n heightDimensionOptions.labelOffset = 1;\n heightDimensionOptions.labelRotation = 180;\n \n const heightDimension = await dimensions.simpleLinearLengthDimension(heightDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: heightDimension });\n\n // Create depth dimension (measuring edge 7)\n const depthEdge = edges[7];\n const depthStartPoint = await edge.endPointOnEdge({ shape: depthEdge });\n const depthEndPoint = await edge.startPointOnEdge({ shape: depthEdge });\n\n const depthDimensionOptions = new SimpleLinearLengthDimensionDto();\n depthDimensionOptions.start = depthStartPoint;\n depthDimensionOptions.end = depthEndPoint;\n depthDimensionOptions.direction = [2, 0, 0]; // Offset to the right\n depthDimensionOptions.offsetFromPoints = 0.2;\n depthDimensionOptions.crossingSize = 0.2;\n depthDimensionOptions.decimalPlaces = 2;\n depthDimensionOptions.labelSuffix = \"(cm)\";\n depthDimensionOptions.labelSize = 0.5;\n depthDimensionOptions.labelOffset = 1;\n depthDimensionOptions.labelRotation = 180;\n \n const depthDimension = await dimensions.simpleLinearLengthDimension(depthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: depthDimension });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating shapes and dimensions\nconst { BoxDto, SimpleLinearLengthDimensionDto } = Bit.Inputs.OCCT;\n// Import types for type safety\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Get access to OCCT modules\nconst { shapes, dimensions } = bitbybit.occt;\nconst { solid, edge } = shapes;\n\n// Define the main function to create a box with linear dimensions\nconst start = async () => {\n // Create a box with specific dimensions\n const boxOptions = new BoxDto();\n boxOptions.width = 13.2;\n boxOptions.length = 9.1;\n boxOptions.height = 5.3;\n boxOptions.center = [0, 0, 0];\n boxOptions.originOnCenter = true;\n const box = await solid.createBox(boxOptions);\n\n // Draw the box first\n bitbybit.draw.drawAnyAsync({ entity: box });\n\n // Get all edges from the box for dimension measurements\n const edges = await edge.getEdges({ shape: box });\n\n // Create width dimension (measuring edge 0)\n const widthEdge = edges[0];\n const widthStartPoint = await edge.startPointOnEdge({ shape: widthEdge });\n const widthEndPoint = await edge.endPointOnEdge({ shape: widthEdge });\n\n const widthDimensionOptions = new SimpleLinearLengthDimensionDto();\n widthDimensionOptions.start = widthStartPoint;\n widthDimensionOptions.end = widthEndPoint;\n widthDimensionOptions.direction = [-2, 0, 0]; // Offset to the left\n widthDimensionOptions.offsetFromPoints = 0.2;\n widthDimensionOptions.crossingSize = 0.2;\n widthDimensionOptions.decimalPlaces = 2;\n widthDimensionOptions.labelSuffix = \"(cm)\";\n widthDimensionOptions.labelSize = 0.5;\n widthDimensionOptions.labelOffset = 1;\n widthDimensionOptions.labelRotation = 180;\n \n const widthDimension = await dimensions.simpleLinearLengthDimension(widthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: widthDimension });\n\n // Create height dimension (measuring edge 10)\n const heightEdge = edges[10];\n const heightStartPoint = await edge.startPointOnEdge({ shape: heightEdge });\n const heightEndPoint = await edge.endPointOnEdge({ shape: heightEdge });\n\n const heightDimensionOptions = new SimpleLinearLengthDimensionDto();\n heightDimensionOptions.start = heightStartPoint;\n heightDimensionOptions.end = heightEndPoint;\n heightDimensionOptions.direction = [0, 0, -2]; // Offset toward the back\n heightDimensionOptions.offsetFromPoints = 0.2;\n heightDimensionOptions.crossingSize = 0.2;\n heightDimensionOptions.decimalPlaces = 2;\n heightDimensionOptions.labelSuffix = \"(cm)\";\n heightDimensionOptions.labelSize = 0.5;\n heightDimensionOptions.labelOffset = 1;\n heightDimensionOptions.labelRotation = 180;\n \n const heightDimension = await dimensions.simpleLinearLengthDimension(heightDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: heightDimension });\n\n // Create depth dimension (measuring edge 7)\n const depthEdge = edges[7];\n const depthStartPoint = await edge.endPointOnEdge({ shape: depthEdge });\n const depthEndPoint = await edge.startPointOnEdge({ shape: depthEdge });\n\n const depthDimensionOptions = new SimpleLinearLengthDimensionDto();\n depthDimensionOptions.start = depthStartPoint;\n depthDimensionOptions.end = depthEndPoint;\n depthDimensionOptions.direction = [2, 0, 0]; // Offset to the right\n depthDimensionOptions.offsetFromPoints = 0.2;\n depthDimensionOptions.crossingSize = 0.2;\n depthDimensionOptions.decimalPlaces = 2;\n depthDimensionOptions.labelSuffix = \"(cm)\";\n depthDimensionOptions.labelSize = 0.5;\n depthDimensionOptions.labelOffset = 1;\n depthDimensionOptions.labelRotation = 180;\n \n const depthDimension = await dimensions.simpleLinearLengthDimension(depthDimensionOptions);\n bitbybit.draw.drawAnyAsync({ entity: depthDimension });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Linear dimensions applied on box" /> diff --git a/docs/learn/code/common/occt/dimensions/pin-with-label.md b/docs/learn/code/common/occt/dimensions/pin-with-label.md index a2738bbc..f085bc71 100644 --- a/docs/learn/code/common/occt/dimensions/pin-with-label.md +++ b/docs/learn/code/common/occt/dimensions/pin-with-label.md @@ -39,21 +39,21 @@ The most basic use case is creating a pin with static text to mark important poi 0003211000Important Point0.30.4","version":"0.20.7","type":"blockly"}} + script={{"script":"0003211000Important Point0.30.4","version":"0.20.8","type":"blockly"}} title="Simple pin with static label" /> {\n // Define points for the pin\n const startPoint: Point3 = [0, 0, 0];\n const endPoint: Point3 = [3, 2, 1];\n const direction: Vector3 = [1, 0, 0];\n\n // Create pin with label options\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = startPoint;\n pinOptions.endPoint = endPoint;\n pinOptions.direction = direction;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = \"Important Point\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await bitbybit.occt.dimensions.pinWithLabel(pinOptions);\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import the required DTO for pin with label\nconst { PinWithLabelDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Define points for the pin\n const startPoint: Point3 = [0, 0, 0];\n const endPoint: Point3 = [3, 2, 1];\n const direction: Vector3 = [1, 0, 0];\n\n // Create pin with label options\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = startPoint;\n pinOptions.endPoint = endPoint;\n pinOptions.direction = direction;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = \"Important Point\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await bitbybit.occt.dimensions.pinWithLabel(pinOptions);\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Simple pin with static label" /> @@ -74,21 +74,21 @@ A more practical application combines pin labels with calculated geometric prope radiusspherevolumeradius2.5sphereradius000volumesphere00radius43ADDradius21000Vol: {0} m3volume20.30.4sphere","version":"0.20.7","type":"blockly"}} + script={{"script":"radiusspherevolumeradius2.5sphereradius000volumesphere00radius43ADDradius21000Vol: {0} m3volume20.30.4sphere","version":"0.20.8","type":"blockly"}} title="Sphere with volume pin label" /> {\n // Parametric radius value\n const radius = 2.5;\n\n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = radius;\n sphereOptions.center = [0, 0, 0] as Point3;\n\n const sphere = await solid.createSphere(sphereOptions);\n\n // Calculate sphere volume\n const volume = await solid.getSolidVolume({ shape: sphere });\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n\n // Format volume as text with units\n const volumeText = text.format({\n text: \"Vol: {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n\n // Create pin with calculated volume label\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = [0, 0, radius] as Point3; // Start at top of sphere\n pinOptions.endPoint = [4, 3, radius + 2] as Point3; // Position for visibility\n pinOptions.direction = [1, 0, 0] as Vector3;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = volumeText;\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await dimensions.pinWithLabel(pinOptions);\n \n // Draw both sphere and pin\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types\nconst { SphereDto, PinWithLabelDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT modules\nconst { solid } = bitbybit.occt.shapes;\nconst { dimensions } = bitbybit.occt;\nconst { math, text } = bitbybit;\n\n// Define the main function\nconst start = async () => {\n // Parametric radius value\n const radius = 2.5;\n\n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = radius;\n sphereOptions.center = [0, 0, 0] as Point3;\n\n const sphere = await solid.createSphere(sphereOptions);\n\n // Calculate sphere volume\n const volume = await solid.getSolidVolume({ shape: sphere });\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n\n // Format volume as text with units\n const volumeText = text.format({\n text: \"Vol: {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n\n // Create pin with calculated volume label\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = [0, 0, radius] as Point3; // Start at top of sphere\n pinOptions.endPoint = [4, 3, radius + 2] as Point3; // Position for visibility\n pinOptions.direction = [1, 0, 0] as Vector3;\n pinOptions.offsetFromStart = 0;\n pinOptions.label = volumeText;\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.4;\n\n // Create and draw the pin\n const pin = await dimensions.pinWithLabel(pinOptions);\n \n // Draw both sphere and pin\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Sphere with volume pin label" /> diff --git a/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx b/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx index d9a45b0e..2b00e3f4 100644 --- a/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx +++ b/docs/learn/code/common/occt/fillets/chamfer-circular-edges.mdx @@ -25,21 +25,21 @@ The examples below demonstrate creating a box with a cylindrical hole through it **TypeScript Example: Chamfer Circular Edge of a Hole** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.direction = [1, 0, 0];\n cylinderOpt.center = [-5, 0, 0];\n cylinderOpt.radius = 2;\n cylinderOpt.height = 10;\n\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt)\n\n const difference = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder],\n keepEdges: false\n });\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: difference,\n distance: 0.4\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n const cylinderOpt = new Bit.Inputs.OCCT.CylinderDto();\n cylinderOpt.direction = [1, 0, 0];\n cylinderOpt.center = [-5, 0, 0];\n cylinderOpt.radius = 2;\n cylinderOpt.height = 10;\n\n const cylinder = await bitbybit.occt.shapes.solid.createCylinder(cylinderOpt)\n\n const difference = await bitbybit.occt.booleans.difference({\n shape: box,\n shapes: [cylinder],\n keepEdges: false\n });\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: difference,\n distance: 0.4\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Chamfer Circular Edge" /> **Blockly Example: Chamfer Circular Edge of a Hole** differenceSoliddifferenceSolid5810000210-500100FALSEdifferenceSolid0.4","version":"0.20.7","type":"blockly"}} + script={{"script":"differenceSoliddifferenceSolid5810000210-500100FALSEdifferenceSolid0.4","version":"0.20.8","type":"blockly"}} title="Chamfer Circular Edge" /> **Rete Example: Chamfer Circular Edge of a Hole** diff --git a/docs/learn/code/common/occt/fillets/chamfers-intro.mdx b/docs/learn/code/common/occt/fillets/chamfers-intro.mdx index cb889ac5..ff897ad9 100644 --- a/docs/learn/code/common/occt/fillets/chamfers-intro.mdx +++ b/docs/learn/code/common/occt/fillets/chamfers-intro.mdx @@ -48,21 +48,21 @@ The following examples in TypeScript, Rete, and Blockly demonstrate creating a s **TypeScript Example: Chamfer All Edges of a Solid** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distance: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distance: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Chamfer All Edges of Solid" /> **Blockly Example: Chamfer All Edges of a Solid** 58100001","version":"0.20.7","type":"blockly"}} + script={{"script":"58100001","version":"0.20.8","type":"blockly"}} title="Chamfer All Edges of Solid" /> **Rete Example: Chamfer All Edges of a Solid** diff --git a/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx b/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx index b74cf7ab..877b7b6a 100644 --- a/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx +++ b/docs/learn/code/common/occt/fillets/chamfers-var-radius-on-spec-edges.mdx @@ -28,21 +28,21 @@ The examples below demonstrate creating a solid box and then applying chamfers w **TypeScript Example: Chamfer Specific Edges with Variable Distances** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distanceList: [0.2, 1.2, 2],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const chamfered = await bitbybit.occt.fillets.chamferEdges({\n shape: box,\n distanceList: [0.2, 1.2, 2],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: chamfered,\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Chamfer Specific Edges of Solid" /> **Blockly Example: Chamfer Specific Edges with Variable Distances** 58100000.10.31.22123","version":"0.20.7","type":"blockly"}} + script={{"script":"58100000.10.31.22123","version":"0.20.8","type":"blockly"}} title="Chamfer Specific Edges of Solid" /> **Rete Example: Chamfer Specific Edges with Variable Distances** diff --git a/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx b/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx index 9cc6f872..a3259d14 100644 --- a/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx +++ b/docs/learn/code/common/occt/fillets/fillet-3d-wires.mdx @@ -55,21 +55,21 @@ In these examples, we first construct a 3D star-shaped wire. Then, we apply diff **TypeScript Example: Fillet Specific Corners of a 3D Wire** {\n\n const repeatOpt = new Bit.Inputs.Lists.MultiplyItemDto([innerFillet, outerFillet], nrRays);\n const radiusList = bitbybit.lists.repeat(repeatOpt).flat();\n const spanOptions = new Bit.Inputs.Vector.SpanDto(1, 1, nrRays * 2);\n const indexes = bitbybit.vector.span(spanOptions);\n\n const starOptions = new Bit.Inputs.OCCT.StarDto(outerStarRadius, innerStarRadius, nrRays, [0, 0, 0], [0, 1, 0], 4, false);\n const star = await bitbybit.occt.shapes.wire.createStarWire(starOptions);\n\n const filletOptions = new Bit.Inputs.OCCT.Fillet3DWireDto(star, undefined, [0, 1, 0], radiusList, indexes);\n const starFillet = await bitbybit.occt.fillets.fillet3DWire(filletOptions);\n\n const startFilletTranslated1 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 5, 0] })\n const startFilletTranslated2 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 10, 0] })\n\n\n const starFace = await bitbybit.occt.shapes.face.createFaceFromWire({ shape: startFilletTranslated2, planar: false });\n const starThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: starFace, offset: -1 });\n const starThickFillet = await bitbybit.occt.fillets.filletEdges({ shape: starThick, radius: 0.3 });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.edgeWidth = 15;\n bitbybit.draw.drawAnyAsync({ entity: star, options: drawOptions });\n bitbybit.draw.drawAnyAsync({ entity: startFilletTranslated1, options: drawOptions });\n drawOptions.faceColour = \"#5555ff\";\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 2;\n drawOptions.precision = 0.005;\n bitbybit.draw.drawAnyAsync({ entity: starThickFillet, options: drawOptions });\n\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const nrRays = 7;\nconst outerStarRadius = 10;\nconst innerStarRadius = 4;\nconst outerFillet = 0.6;\nconst innerFillet = 1.7;\n\nconst start = async () => {\n\n const repeatOpt = new Bit.Inputs.Lists.MultiplyItemDto([innerFillet, outerFillet], nrRays);\n const radiusList = bitbybit.lists.repeat(repeatOpt).flat();\n const spanOptions = new Bit.Inputs.Vector.SpanDto(1, 1, nrRays * 2);\n const indexes = bitbybit.vector.span(spanOptions);\n\n const starOptions = new Bit.Inputs.OCCT.StarDto(outerStarRadius, innerStarRadius, nrRays, [0, 0, 0], [0, 1, 0], 4, false);\n const star = await bitbybit.occt.shapes.wire.createStarWire(starOptions);\n\n const filletOptions = new Bit.Inputs.OCCT.Fillet3DWireDto(star, undefined, [0, 1, 0], radiusList, indexes);\n const starFillet = await bitbybit.occt.fillets.fillet3DWire(filletOptions);\n\n const startFilletTranslated1 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 5, 0] })\n const startFilletTranslated2 = await bitbybit.occt.transforms.translate({ shape: starFillet, translation: [0, 10, 0] })\n\n\n const starFace = await bitbybit.occt.shapes.face.createFaceFromWire({ shape: startFilletTranslated2, planar: false });\n const starThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: starFace, offset: -1 });\n const starThickFillet = await bitbybit.occt.fillets.filletEdges({ shape: starThick, radius: 0.3 });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOptions.edgeWidth = 15;\n bitbybit.draw.drawAnyAsync({ entity: star, options: drawOptions });\n bitbybit.draw.drawAnyAsync({ entity: startFilletTranslated1, options: drawOptions });\n drawOptions.faceColour = \"#5555ff\";\n drawOptions.edgeColour = \"#000000\";\n drawOptions.edgeWidth = 2;\n drawOptions.precision = 0.005;\n bitbybit.draw.drawAnyAsync({ entity: starThickFillet, options: drawOptions });\n\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Fillet 3D Wire Specific Corners" /> **Blockly Example: Fillet Specific Corners of a 3D Wire** nrRaysinnerFilletRadiusouterRadiusFilletfilletIndexesradiusLististarPromisestarFilletPromisenrRays7innerFilletRadius1.7outerRadiusFillet0.6filletIndexes11MULTIPLYnrRays2'clearSky'10000.10.7radiusListi1MULTIPLYnrRays21EQi20INSERTLASTradiusListouterRadiusFilletINSERTLASTradiusListinnerFilletRadiusstarPromise000010nrRays1044FALSEstarFilletPromisestarPromiseradiusListfilletIndexes010starPromise0.01FALSE#ff0000TRUE#ffffff15starFilletPromise0500.01FALSE#ff0000TRUE#ffffff15starFilletPromise0100FALSE-10.30.005TRUE#3333ffTRUE#000000240040010100.450.50.5FALSE#ffffff#ffffff","version":"0.20.7","type":"blockly"}} + script={{"script":"nrRaysinnerFilletRadiusouterRadiusFilletfilletIndexesradiusLististarPromisestarFilletPromisenrRays7innerFilletRadius1.7outerRadiusFillet0.6filletIndexes11MULTIPLYnrRays2'clearSky'10000.10.7radiusListi1MULTIPLYnrRays21EQi20INSERTLASTradiusListouterRadiusFilletINSERTLASTradiusListinnerFilletRadiusstarPromise000010nrRays1044FALSEstarFilletPromisestarPromiseradiusListfilletIndexes010starPromise0.01FALSE#ff0000TRUE#ffffff15starFilletPromise0500.01FALSE#ff0000TRUE#ffffff15starFilletPromise0100FALSE-10.30.005TRUE#3333ffTRUE#000000240040010100.450.50.5FALSE#ffffff#ffffff","version":"0.20.8","type":"blockly"}} title="Fillet 3D Wire Specific Corners" /> **Rete Example: Fillet Specific Corners of a 3D Wire** diff --git a/docs/learn/code/common/occt/fillets/fillets-intro.mdx b/docs/learn/code/common/occt/fillets/fillets-intro.mdx index f59cdbb5..b2a5a77d 100644 --- a/docs/learn/code/common/occt/fillets/fillets-intro.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-intro.mdx @@ -43,21 +43,21 @@ The following examples in TypeScript, Rete, and Blockly demonstrate creating a s **TypeScript Example: Fillet All Edges of a Solid** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radius: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radius: 1,\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Fillet Solid" /> **Blockly Example: Fillet All Edges of a Solid** 58100001","version":"0.20.7","type":"blockly"}} + script={{"script":"58100001","version":"0.20.8","type":"blockly"}} title="Fillet Solid" /> **Rete Example: Fillet All Edges of a Solid** diff --git a/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx b/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx index 16b2b766..4432d4b8 100644 --- a/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-on-2d-wire-corners.mdx @@ -30,21 +30,21 @@ The examples below demonstrate creating a 2D wire and then applying fillets with **TypeScript Example: Fillet Specific Corners of a Wire with Variable Radii** {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radiusList: [0.1, 0.3],\n indexes: [1, 3]\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radiusList: [0.1, 0.3],\n indexes: [1, 3]\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Fillet Specific Corners of Wire" /> **Blockly Example: Fillet Specific Corners of a Wire with Variable Radii** 10000100.10.313","version":"0.20.7","type":"blockly"}} + script={{"script":"10000100.10.313","version":"0.20.8","type":"blockly"}} title="Fillet Specific Corners of Wire" /> **Rete Example: Fillet Specific Corners of a Wire with Variable Radii** diff --git a/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx b/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx index 23f1d4f0..24829045 100644 --- a/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-on-2d-wires.mdx @@ -29,21 +29,21 @@ The examples below demonstrate how to create a simple 2D wire (e.g., a polyline **TypeScript Example: Fillet All Corners of a Wire** {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radius: 0.25\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const squareOpt = new Bit.Inputs.OCCT.SquareDto();\n const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);\n const squareFillet = await bitbybit.occt.fillets.fillet2d({\n shape: square,\n radius: 0.25\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: squareFillet\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Fillet All Corners of Wire" /> **Blockly Example: Fillet All Corners of a Wire** 10000100.24","version":"0.20.7","type":"blockly"}} + script={{"script":"10000100.24","version":"0.20.8","type":"blockly"}} title="Fillet All Corners of Wire" /> **Rete Example: Fillet All Corners of a Wire** diff --git a/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx b/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx index b7d5742e..fa689a55 100644 --- a/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx +++ b/docs/learn/code/common/occt/fillets/fillets-var-radius-on-spec-edges.mdx @@ -31,7 +31,7 @@ The examples below demonstrate creating a solid box and then applying fillets wi **TypeScript Example: Fillet Specific Edges with Variable Radii** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radiusList: [1, 2, 0.3],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const filleted = await bitbybit.occt.fillets.filletEdges({\n shape: box,\n radiusList: [1, 2, 0.3],\n indexes: [1, 2, 3]\n })\n\n bitbybit.draw.drawAnyAsync({\n entity: filleted,\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Variable Fillet Radius On Spec Edges" /> @@ -39,7 +39,7 @@ The examples below demonstrate creating a solid box and then applying fillets wi **Blockly Example: Fillet Specific Edges with Variable Radii** 5810000120.3123","version":"0.20.7","type":"blockly"}} + script={{"script":"5810000120.3123","version":"0.20.8","type":"blockly"}} title="Variable Fillet Radius On Spec Edges" /> @@ -47,7 +47,7 @@ The examples below demonstrate creating a solid box and then applying fillets wi **Rete Example: Fillet Specific Edges with Variable Radii** diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md index b6682b97..5109bc30 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive-flat.md @@ -22,21 +22,21 @@ Flat hexagon hive construction creates optimized honeycomb panels by treating th widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagonFacesiwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.70.7randomHeights12wiresHexLargehexagonFacesi1wiresHexLarge1INSERTLASThexagonFacesGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUEhexagonFaces1e-7TRUETRUETRUE010","version":"0.20.7","type":"blockly"}} + script={{"script":"widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagonFacesiwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.70.7randomHeights12wiresHexLargehexagonFacesi1wiresHexLarge1INSERTLASThexagonFacesGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUEhexagonFaces1e-7TRUETRUETRUE010","version":"0.20.8","type":"blockly"}} title="Hexagon hive" /> {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridLargeOptions.flatTop = false;\n hexGridLargeOptions.extendTop = false;\n hexGridLargeOptions.extendBottom = false;\n hexGridLargeOptions.extendLeft = false;\n hexGridLargeOptions.extendRight = false;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.flatTop = false;\n hexGridSmallOptions.extendTop = false;\n hexGridSmallOptions.extendBottom = false;\n hexGridSmallOptions.extendLeft = false;\n hexGridSmallOptions.extendRight = false;\n hexGridSmallOptions.scalePatternWidth = [0.7];\n hexGridSmallOptions.scalePatternHeight = [0.7];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for creating individual faces\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Create faces with holes for each hexagon cell\n const hexagonFaces: TopoDSFacePointer[] = [];\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n hexagonFaces.push(hexFaceWithHole);\n }\n\n // Sew faces together\n const sewOptions = new SewDto(hexagonFaces);\n sewOptions.tolerance = 1e-7;\n const sewedFaces = await shell.sewFaces(sewOptions);\n\n // Unify same domain for cleaner geometry\n const unifyOptions = new UnifySameDomainDto();\n unifyOptions.shape = sewedFaces;\n unifyOptions.unifyEdges = true;\n unifyOptions.unifyFaces = true;\n unifyOptions.concatBSplines = true;\n const unifiedShape = await shape.unifySameDomain(unifyOptions);\n\n // Extrude the unified shape\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = unifiedShape;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedHive = await operations.extrude(extrudeOptions);\n\n // Draw the resulting flat hive structure\n bitbybit.draw.drawAnyAsync({\n entity: extrudedHive\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for hexagon grid creation and operations\nconst { HexagonsInGridDto, FaceFromWiresDto, ExtrudeDto, ShapesDto, SewDto, UnifySameDomainDto, ShapeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShellPointer = Bit.Inputs.OCCT.TopoDSShellPointer;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\n\n// Get access to OCCT modules and utilities\nconst { wire, face, shell, shape } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { math } = bitbybit;\n\n// Define the main function to create a flat hexagon hive\nconst start = async () => {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridLargeOptions.flatTop = false;\n hexGridLargeOptions.extendTop = false;\n hexGridLargeOptions.extendBottom = false;\n hexGridLargeOptions.extendLeft = false;\n hexGridLargeOptions.extendRight = false;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.flatTop = false;\n hexGridSmallOptions.extendTop = false;\n hexGridSmallOptions.extendBottom = false;\n hexGridSmallOptions.extendLeft = false;\n hexGridSmallOptions.extendRight = false;\n hexGridSmallOptions.scalePatternWidth = [0.7];\n hexGridSmallOptions.scalePatternHeight = [0.7];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for creating individual faces\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Create faces with holes for each hexagon cell\n const hexagonFaces: TopoDSFacePointer[] = [];\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n hexagonFaces.push(hexFaceWithHole);\n }\n\n // Sew faces together\n const sewOptions = new SewDto(hexagonFaces);\n sewOptions.tolerance = 1e-7;\n const sewedFaces = await shell.sewFaces(sewOptions);\n\n // Unify same domain for cleaner geometry\n const unifyOptions = new UnifySameDomainDto();\n unifyOptions.shape = sewedFaces;\n unifyOptions.unifyEdges = true;\n unifyOptions.unifyFaces = true;\n unifyOptions.concatBSplines = true;\n const unifiedShape = await shape.unifySameDomain(unifyOptions);\n\n // Extrude the unified shape\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = unifiedShape;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedHive = await operations.extrude(extrudeOptions);\n\n // Draw the resulting flat hive structure\n bitbybit.draw.drawAnyAsync({\n entity: extrudedHive\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Hexagon hive" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md index 9c91197f..8c84f703 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-hive.md @@ -22,21 +22,21 @@ Moving beyond simple perforated patterns, three-dimensional hive structures crea widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagons3DicompoundShapeForFastRenderingwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.80.8randomHeights12wiresHexLargehexagons3Di1wiresHexLarge1INSERTLASThexagons3DGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUE0GETFROM_STARTrandomHeightsi0compoundShapeForFastRenderinghexagons3DcompoundShapeForFastRendering","version":"0.20.7","type":"blockly"}} + script={{"script":"widthheightnrHexWidthnrHexHeightwiresHexLargewiresHexSmallrandomHeightshexagons3DicompoundShapeForFastRenderingwidth10height20nrHexWidth10nrHexHeight20wiresHexLargewidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSEwiresHexSmallwidthheightnrHexWidthnrHexHeightFALSEFALSEFALSEFALSEFALSE0.80.8randomHeights12wiresHexLargehexagons3Di1wiresHexLarge1INSERTLASThexagons3DGETFROM_STARTwiresHexLargeiGETFROM_STARTwiresHexSmalliTRUE0GETFROM_STARTrandomHeightsi0compoundShapeForFastRenderinghexagons3DcompoundShapeForFastRendering","version":"0.20.8","type":"blockly"}} title="Hexagon hive" /> {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.scalePatternWidth = [0.8];\n hexGridSmallOptions.scalePatternHeight = [0.8];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for each hexagon cell\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Process each hexagon to create 3D cells with holes\n const hexagons3D: TopoDSSolidPointer[] = [];\n\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face with random height\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = hexFaceWithHole;\n extrudeOptions.direction = [0, randomHeights[i], 0];\n\n const extrudedCell = await operations.extrude(extrudeOptions);\n hexagons3D.push(extrudedCell);\n }\n\n // Combine all extruded cells into a compound shape for fast rendering\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = hexagons3D;\n const compoundShapeForFastRendering = await compound.makeCompound(compoundOptions);\n\n // Draw the resulting three-dimensional hive structure\n bitbybit.draw.drawAnyAsync({\n entity: compoundShapeForFastRendering\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for hexagon grid creation and operations\nconst { HexagonsInGridDto, FaceFromWiresDto, ExtrudeDto, CompoundShapesDto, ShapeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\n\n// Get access to OCCT modules and utilities\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { math } = bitbybit;\n\n// Define the main function to create a three-dimensional hexagon hive\nconst start = async () => {\n // Create hexagonal grid parameters\n const gridWidth = 10;\n const gridHeight = 20;\n const hexagonsInWidth = 10;\n const hexagonsInHeight = 20;\n\n // Generate large hexagonal wire grid (outer walls)\n const hexGridLargeOptions = new HexagonsInGridDto();\n hexGridLargeOptions.width = gridWidth;\n hexGridLargeOptions.height = gridHeight;\n hexGridLargeOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridLargeOptions.nrHexagonsInHeight = hexagonsInHeight;\n\n const wiresHexLarge = await wire.hexagonsInGrid(hexGridLargeOptions);\n\n // Generate small hexagonal wire grid (inner holes)\n const hexGridSmallOptions = new HexagonsInGridDto();\n hexGridSmallOptions.width = gridWidth;\n hexGridSmallOptions.height = gridHeight;\n hexGridSmallOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridSmallOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridSmallOptions.scalePatternWidth = [0.8];\n hexGridSmallOptions.scalePatternHeight = [0.8];\n\n const wiresHexSmall = await wire.hexagonsInGrid(hexGridSmallOptions);\n\n // Generate random heights for each hexagon cell\n const randomHeights = math.randomNumbers({\n low: 1,\n high: 2,\n count: wiresHexLarge.length\n });\n\n // Process each hexagon to create 3D cells with holes\n const hexagons3D: TopoDSSolidPointer[] = [];\n\n for (let i = 0; i < wiresHexLarge.length; i++) {\n // Get the outer and inner wires for this cell\n const outerWire = wiresHexLarge[i];\n const innerWire = wiresHexSmall[i];\n\n // Reverse the inner wire to create a hole\n const reverseOptions = new ShapeDto();\n reverseOptions.shape = innerWire;\n const reversedInnerWire = await wire.reversedWire(reverseOptions);\n\n // Create face with hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const hexFaceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face with random height\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = hexFaceWithHole;\n extrudeOptions.direction = [0, randomHeights[i], 0];\n\n const extrudedCell = await operations.extrude(extrudeOptions);\n hexagons3D.push(extrudedCell);\n }\n\n // Combine all extruded cells into a compound shape for fast rendering\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = hexagons3D;\n const compoundShapeForFastRendering = await compound.makeCompound(compoundOptions);\n\n // Draw the resulting three-dimensional hive structure\n bitbybit.draw.drawAnyAsync({\n entity: compoundShapeForFastRendering\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Hexagon hive" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md index 82190242..3c6615b6 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/hexagon-holes-on-face.md @@ -22,21 +22,21 @@ Hexagonal patterns are found throughout nature - from honeycomb structures to cr recFacefacesrecFace2014000010facesrecFace1010[0.9][0.9]FALSEFALSE0.010.01GETFIRSTfaces010","version":"0.20.7","type":"blockly"}} + script={{"script":"recFacefacesrecFace2014000010facesrecFace1010[0.9][0.9]FALSEFALSE0.010.01GETFIRSTfaces010","version":"0.20.8","type":"blockly"}} title="Hexagon holes on face" /> {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // For hexagons, uniform scaling often works best due to natural packing\n const scalePatternU = [0.9]; // Uniform hexagon size in U direction\n const scalePatternV = [0.9]; // Uniform hexagon size in V direction\n\n // Subdivide the face into hexagonal holes\n const subdivideOptions = new FaceSubdivideToHexagonHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrHexagonsU = 10; // Number of hexagon divisions in U direction\n subdivideOptions.nrHexagonsV = 10; // Number of hexagon divisions in V direction\n subdivideOptions.flatU = false; // Pointy-top orientation (false) vs flat-top (true)\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.01; // Small border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.01; // Small border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToHexagonHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with hexagonal holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D honeycomb structure\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hexagonal holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for face creation, subdivision, and extrusion\nconst { RectangleDto, FaceSubdivideToHexagonHolesDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get access to OCCT modules for face operations\nconst { face } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { lists } = bitbybit;\n\n// Define the main function to create hexagon holes on a face\nconst start = async () => {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // For hexagons, uniform scaling often works best due to natural packing\n const scalePatternU = [0.9]; // Uniform hexagon size in U direction\n const scalePatternV = [0.9]; // Uniform hexagon size in V direction\n\n // Subdivide the face into hexagonal holes\n const subdivideOptions = new FaceSubdivideToHexagonHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrHexagonsU = 10; // Number of hexagon divisions in U direction\n subdivideOptions.nrHexagonsV = 10; // Number of hexagon divisions in V direction\n subdivideOptions.flatU = false; // Pointy-top orientation (false) vs flat-top (true)\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.01; // Small border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.01; // Small border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToHexagonHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with hexagonal holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D honeycomb structure\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hexagonal holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Hexagon holes on face" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md b/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md index 30c52bbf..252e46e8 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/rectangle-holes-on-face.md @@ -22,21 +22,21 @@ Creating regular patterns of holes manually can be time-consuming and error-pron recFacefacesrecFace2014000010facesrecFace1010[0.8,0.5,0.5][0.8,0.5,0.5]FALSE00GETFIRSTfaces010","version":"0.20.7","type":"blockly"}} + script={{"script":"recFacefacesrecFace2014000010facesrecFace1010[0.8,0.5,0.5][0.8,0.5,0.5]FALSE00GETFIRSTfaces010","version":"0.20.8","type":"blockly"}} title="Rectangle holes on face" /> {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // These arrays control the size of holes in each row and column\n const scalePatternU = [0.8, 0.5, 0.5]; // Varying hole sizes in U direction\n const scalePatternV = [0.8, 0.5, 0.5]; // Varying hole sizes in V direction\n\n // Subdivide the face into rectangular holes\n const subdivideOptions = new FaceSubdivideToRectangleHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrRectanglesU = 10; // Number of divisions in U direction\n subdivideOptions.nrRectanglesV = 10; // Number of divisions in V direction\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.05; // Border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.05; // Border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToRectangleHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with rectangular holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for face creation, subdivision, and extrusion\nconst { RectangleDto, FaceSubdivideToRectangleHolesDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get access to OCCT modules for face operations\nconst { face } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { lists } = bitbybit;\n\n// Define the main function to create rectangle holes on a face\nconst start = async () => {\n // Create a rectangular face as the base shape\n const faceOptions = new RectangleDto();\n faceOptions.width = 20;\n faceOptions.length = 14;\n faceOptions.center = [0, 0, 0];\n faceOptions.direction = [0, 1, 0];\n const rectangleFace = await face.createRectangleFace(faceOptions);\n\n // Define scale patterns for U and V directions\n // These arrays control the size of holes in each row and column\n const scalePatternU = [0.8, 0.5, 0.5]; // Varying hole sizes in U direction\n const scalePatternV = [0.8, 0.5, 0.5]; // Varying hole sizes in V direction\n\n // Subdivide the face into rectangular holes\n const subdivideOptions = new FaceSubdivideToRectangleHolesDto();\n subdivideOptions.shape = rectangleFace;\n subdivideOptions.nrRectanglesU = 10; // Number of divisions in U direction\n subdivideOptions.nrRectanglesV = 10; // Number of divisions in V direction\n subdivideOptions.holesToFaces = false; // Return wires instead of faces\n subdivideOptions.offsetFromBorderU = 0.05; // Border offset in U direction\n subdivideOptions.offsetFromBorderV = 0.05; // Border offset in V direction\n subdivideOptions.scalePatternU = scalePatternU;\n subdivideOptions.scalePatternV = scalePatternV;\n\n const holes = await face.subdivideToRectangleHoles(subdivideOptions);\n\n // Get the first hole (the outer boundary with holes)\n const firstHole = lists.getItem({ list: holes, index: 0, clone: true });\n\n // Extrude the face with holes to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = firstHole;\n extrudeOptions.direction = [0, 1, 0];\n const extrudedSolid = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with rectangular holes\n bitbybit.draw.drawAnyAsync({\n entity: extrudedSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Rectangle holes on face" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md index dd2cbc01..ca82562f 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hole.md @@ -30,21 +30,21 @@ This technique is fundamental because it establishes the basic principle that ap 200000107000010TRUE","version":"0.20.7","type":"blockly"}} + script={{"script":"200000107000010TRUE","version":"0.20.8","type":"blockly"}} title="Simple hole from two wires" /> {\n // Create the outer square wire (boundary of the shape)\n const outerWireOptions = new SquareDto();\n outerWireOptions.size = 20;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createSquareWire(outerWireOptions);\n\n // Create the inner square wire (defines the hole)\n const innerWireOptions = new SquareDto();\n innerWireOptions.size = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createSquareWire(innerWireOptions);\n\n // Reverse the inner wire - this is crucial for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: innerWire });\n\n // Create a face from both wires - outer boundary and inner hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Draw the resulting face with hole\n bitbybit.draw.drawAnyAsync({\n entity: faceWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required types and DTOs for creating wire shapes and faces\nconst { SquareDto, FaceFromWiresDto } = Bit.Inputs.OCCT;\n// Import the wire pointer type for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get direct access to OCCT wire and face creation functions\nconst { wire } = bitbybit.occt.shapes;\nconst { face } = bitbybit.occt.shapes;\n\n// Define the main function to create a simple hole\nconst start = async () => {\n // Create the outer square wire (boundary of the shape)\n const outerWireOptions = new SquareDto();\n outerWireOptions.size = 20;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createSquareWire(outerWireOptions);\n\n // Create the inner square wire (defines the hole)\n const innerWireOptions = new SquareDto();\n innerWireOptions.size = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createSquareWire(innerWireOptions);\n\n // Reverse the inner wire - this is crucial for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: innerWire });\n\n // Create a face from both wires - outer boundary and inner hole\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [outerWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Draw the resulting face with hole\n bitbybit.draw.drawAnyAsync({\n entity: faceWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Simple hole from two wires" /> @@ -60,21 +60,21 @@ The transition from a 2D hollow face to a 3D hollow solid is achieved through ex 2014000010177000010101045TRUE020","version":"0.20.7","type":"blockly"}} + script={{"script":"2014000010177000010101045TRUE020","version":"0.20.8","type":"blockly"}} title="More complex solid with the hole" /> {\n // Create the outer rectangular wire\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 20;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire for rounded corners\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Create the inner rectangular wire (hole)\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire by 45 degrees for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Reverse the rotated inner wire for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: rotatedInnerWire });\n\n // Create a face from both wires\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [filletedOuterWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHole;\n extrudeOptions.direction = [0, 2, 0]; // Extrude 2 units in Y direction\n const solidWithHole = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hole\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating wires, fillets, faces, and extrusion operations\nconst { RectangleDto, FilletDto, FaceFromWiresDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import wire pointer type for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT modules for creating shapes and operations\nconst { wire, face } = bitbybit.occt.shapes;\nconst { fillets, operations, transforms } = bitbybit.occt;\n\n// Define the main function to create an extruded solid with a hole\nconst start = async () => {\n // Create the outer rectangular wire\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 20;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire for rounded corners\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Create the inner rectangular wire (hole)\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire by 45 degrees for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Reverse the rotated inner wire for proper hole creation\n const reversedInnerWire = await wire.reversedWire({ shape: rotatedInnerWire });\n\n // Create a face from both wires\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [filletedOuterWire, reversedInnerWire];\n faceOptions.planar = true;\n const faceWithHole = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHole;\n extrudeOptions.direction = [0, 2, 0]; // Extrude 2 units in Y direction\n const solidWithHole = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with hole\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHole\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="More complex solid with the hole" /> @@ -90,21 +90,21 @@ The process simply involves creating additional inner wires and including them a 231400001017700001010104550077000010101045-500TRUE020","version":"0.20.7","type":"blockly"}} + script={{"script":"231400001017700001010104550077000010101045-500TRUE020","version":"0.20.8","type":"blockly"}} title="Solid with 2 holes" /> {\n // Create the outer rectangular wire (larger this time)\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 23;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Reverse the outer wire (optimization - reverse once instead of multiple inner wires)\n const reversedOuterWire = await wire.reversedWire({ shape: filletedOuterWire });\n\n // Create the base inner rectangular wire\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Create first hole by translating the rotated wire to the right\n const firstHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [5, 0, 0]\n });\n\n // Create second hole by translating the rotated wire to the left\n const secondHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [-5, 0, 0]\n });\n\n // Create a face from the outer boundary and multiple holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [reversedOuterWire, firstHole, secondHole];\n faceOptions.planar = true;\n const faceWithHoles = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid with multiple holes\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHoles;\n extrudeOptions.direction = [0, 2, 0];\n const solidWithHoles = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with multiple holes\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHoles\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating complex shapes with multiple holes\nconst { RectangleDto, FilletDto, FaceFromWiresDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT modules\nconst { wire, face } = bitbybit.occt.shapes;\nconst { fillets, operations, transforms } = bitbybit.occt;\n\n// Define the main function to create a solid with multiple holes\nconst start = async () => {\n // Create the outer rectangular wire (larger this time)\n const outerWireOptions = new RectangleDto();\n outerWireOptions.width = 23;\n outerWireOptions.length = 14;\n outerWireOptions.center = [0, 0, 0];\n outerWireOptions.direction = [0, 1, 0];\n const outerWire = await wire.createRectangleWire(outerWireOptions);\n\n // Apply fillet to the outer wire\n const outerFilletOptions = new FilletDto();\n outerFilletOptions.radius = 1;\n outerFilletOptions.shape = outerWire;\n const filletedOuterWire = await fillets.fillet2d(outerFilletOptions);\n\n // Reverse the outer wire (optimization - reverse once instead of multiple inner wires)\n const reversedOuterWire = await wire.reversedWire({ shape: filletedOuterWire });\n\n // Create the base inner rectangular wire\n const innerWireOptions = new RectangleDto();\n innerWireOptions.width = 7;\n innerWireOptions.length = 7;\n innerWireOptions.center = [0, 0, 0];\n innerWireOptions.direction = [0, 1, 0];\n const innerWire = await wire.createRectangleWire(innerWireOptions);\n\n // Apply fillet to the inner wire\n const innerFilletOptions = new FilletDto();\n innerFilletOptions.radius = 1;\n innerFilletOptions.shape = innerWire;\n const filletedInnerWire = await fillets.fillet2d(innerFilletOptions);\n\n // Rotate the inner wire for visual interest\n const rotatedInnerWire = await transforms.rotate({\n shape: filletedInnerWire,\n axis: [0, 1, 0],\n angle: 45\n });\n\n // Create first hole by translating the rotated wire to the right\n const firstHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [5, 0, 0]\n });\n\n // Create second hole by translating the rotated wire to the left\n const secondHole = await transforms.translate({\n shape: rotatedInnerWire,\n translation: [-5, 0, 0]\n });\n\n // Create a face from the outer boundary and multiple holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = [reversedOuterWire, firstHole, secondHole];\n faceOptions.planar = true;\n const faceWithHoles = await face.createFaceFromWires(faceOptions);\n\n // Extrude the face to create a 3D solid with multiple holes\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = faceWithHoles;\n extrudeOptions.direction = [0, 2, 0];\n const solidWithHoles = await operations.extrude(extrudeOptions);\n\n // Draw the resulting 3D solid with multiple holes\n bitbybit.draw.drawAnyAsync({\n entity: solidWithHoles\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Solid with 2 holes" /> diff --git a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md index 131f376e..4b92787e 100644 --- a/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md +++ b/docs/learn/code/common/occt/modeling/hollow-shapes/simple-hollow-grids.md @@ -30,21 +30,21 @@ This approach not only saves time but also ensures perfect regularity and makes gridSizeholeRadiusholeSpacingextrudeHeighthalfGridboundarySizesquarexPositionsyPositionswiresxzhollowFacehollowGridSolidgridSize14holeRadius0.8holeSpacing2extrudeHeight0.5halfGridDIVIDEgridSize2boundarySizeADDgridSize4squareboundarySize000010xPositionsholeSpacingNEGhalfGridhalfGridyPositionsholeSpacingNEGhalfGridhalfGridwiressquarex1xPositions1z1xPositions1INSERTLASTwiresholeRadiusGETFROM_STARTxPositionsx0GETFROM_STARTyPositionsz010hollowFacewiresTRUEhollowGridSolidhollowFace0extrudeHeight0hollowGridSolid","version":"0.20.7","type":"blockly"}} + script={{"script":"gridSizeholeRadiusholeSpacingextrudeHeighthalfGridboundarySizesquarexPositionsyPositionswiresxzhollowFacehollowGridSolidgridSize14holeRadius0.8holeSpacing2extrudeHeight0.5halfGridDIVIDEgridSize2boundarySizeADDgridSize4squareboundarySize000010xPositionsholeSpacingNEGhalfGridhalfGridyPositionsholeSpacingNEGhalfGridhalfGridwiressquarex1xPositions1z1xPositions1INSERTLASTwiresholeRadiusGETFROM_STARTxPositionsx0GETFROM_STARTyPositionsz010hollowFacewiresTRUEhollowGridSolidhollowFace0extrudeHeight0hollowGridSolid","version":"0.20.8","type":"blockly"}} title="Simple hollow grid" /> {\n // Grid parameters - easily adjustable for different requirements\n const gridSize = 14; // Overall grid dimension\n const holeRadius = 0.8; // Radius of each circular hole\n const holeSpacing = 2; // Distance between hole centers\n const extrudeHeight = 0.5; // Thickness of the final solid\n \n // Calculate grid boundaries\n const halfGrid = gridSize / 2;\n const boundarySize = gridSize + 4; // Add padding around holes\n \n // Create the outer boundary wire (square frame)\n const boundaryOptions = new SquareDto();\n boundaryOptions.size = boundarySize;\n boundaryOptions.center = [0, 0, 0];\n boundaryOptions.direction = [0, 1, 0];\n const boundaryWire = await wire.createSquareWire(boundaryOptions);\n \n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n // Create grid points by combining X and Z coordinates\n const gridPoints: Point3[] = [];\n for (const xPos of xPositions) {\n for (const zPos of zPositions) {\n gridPoints.push([xPos, 0, zPos]);\n }\n }\n \n // Create the hole template (circular wire)\n const holeOptions = new CircleDto();\n holeOptions.radius = holeRadius;\n holeOptions.center = [0, 0, 0];\n holeOptions.direction = [0, 1, 0];\n const holeTemplate = await wire.createCircleWire(holeOptions);\n \n // Create holes at each grid position\n const holes: TopoDSWirePointer[] = [];\n for (const position of gridPoints) {\n const translatedHole = await transforms.translate({\n shape: holeTemplate,\n translation: position\n });\n \n // Reverse each hole wire for proper orientation\n const reversedHole = await wire.reversedWire({ shape: translatedHole });\n holes.push(reversedHole);\n }\n \n // Combine boundary and all holes into a single wire list\n const allWires = [boundaryWire, ...holes];\n \n // Create a face from the boundary and all holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = allWires;\n faceOptions.planar = true;\n const gridFace = await face.createFaceFromWires(faceOptions);\n \n // Extrude the face to create a 3D hollow grid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = gridFace;\n extrudeOptions.direction = [0, extrudeHeight, 0];\n const hollowGrid = await operations.extrude(extrudeOptions);\n \n // Draw the resulting hollow grid\n bitbybit.draw.drawAnyAsync({\n entity: hollowGrid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating grids, shapes, and operations\nconst { SquareDto, CircleDto, FaceFromWiresDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT modules and utility functions\nconst { wire, face } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\n\n// Define the main function to create a parametric hollow grid\nconst start = async () => {\n // Grid parameters - easily adjustable for different requirements\n const gridSize = 14; // Overall grid dimension\n const holeRadius = 0.8; // Radius of each circular hole\n const holeSpacing = 2; // Distance between hole centers\n const extrudeHeight = 0.5; // Thickness of the final solid\n \n // Calculate grid boundaries\n const halfGrid = gridSize / 2;\n const boundarySize = gridSize + 4; // Add padding around holes\n \n // Create the outer boundary wire (square frame)\n const boundaryOptions = new SquareDto();\n boundaryOptions.size = boundarySize;\n boundaryOptions.center = [0, 0, 0];\n boundaryOptions.direction = [0, 1, 0];\n const boundaryWire = await wire.createSquareWire(boundaryOptions);\n \n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: holeSpacing\n });\n \n // Create grid points by combining X and Z coordinates\n const gridPoints: Point3[] = [];\n for (const xPos of xPositions) {\n for (const zPos of zPositions) {\n gridPoints.push([xPos, 0, zPos]);\n }\n }\n \n // Create the hole template (circular wire)\n const holeOptions = new CircleDto();\n holeOptions.radius = holeRadius;\n holeOptions.center = [0, 0, 0];\n holeOptions.direction = [0, 1, 0];\n const holeTemplate = await wire.createCircleWire(holeOptions);\n \n // Create holes at each grid position\n const holes: TopoDSWirePointer[] = [];\n for (const position of gridPoints) {\n const translatedHole = await transforms.translate({\n shape: holeTemplate,\n translation: position\n });\n \n // Reverse each hole wire for proper orientation\n const reversedHole = await wire.reversedWire({ shape: translatedHole });\n holes.push(reversedHole);\n }\n \n // Combine boundary and all holes into a single wire list\n const allWires = [boundaryWire, ...holes];\n \n // Create a face from the boundary and all holes\n const faceOptions = new FaceFromWiresDto();\n faceOptions.shapes = allWires;\n faceOptions.planar = true;\n const gridFace = await face.createFaceFromWires(faceOptions);\n \n // Extrude the face to create a 3D hollow grid\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = gridFace;\n extrudeOptions.direction = [0, extrudeHeight, 0];\n const hollowGrid = await operations.extrude(extrudeOptions);\n \n // Draw the resulting hollow grid\n bitbybit.draw.drawAnyAsync({\n entity: hollowGrid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Simple hollow grid" /> diff --git a/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md b/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md index 69b87c7f..23656114 100644 --- a/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md +++ b/docs/learn/code/common/occt/modeling/parametric-art/simple-flower.md @@ -30,21 +30,21 @@ This method is highly parametric—by adjusting the control points, rotation ang controlPointscurvemirrorNormalmirroredCurvecombinedWiresflowerFacethickFlowerrotationAxisrotationAnglesflowerPetalsanglerotatedPetalfinalFlowercontrolPoints00020.531.1-0.570010curvecontrolPointsFALSE1e-7mirrorNormal100mirroredCurvecurve000mirrorNormalcombinedWirescurvemirroredCurveflowerFacecombinedWiresFALSEthickFlowerflowerFace0.1rotationAxis220rotationAngles300360flowerPetalsangle1rotationAngles1rotatedPetalthickFlowerrotationAxisGETFROM_STARTrotationAnglesangleINSERTLASTflowerPetalsrotatedPetalfinalFlowerflowerPetalsfinalFlower0.01Custom Material#14ffa5#0000000.60.51FALSE2TRUE#0000002-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000#090a0b#a4f9ef'to top'0100","version":"0.20.7","type":"blockly"}} + script={{"script":"controlPointscurvemirrorNormalmirroredCurvecombinedWiresflowerFacethickFlowerrotationAxisrotationAnglesflowerPetalsanglerotatedPetalfinalFlowercontrolPoints00020.531.1-0.570010curvecontrolPointsFALSE1e-7mirrorNormal100mirroredCurvecurve000mirrorNormalcombinedWirescurvemirroredCurveflowerFacecombinedWiresFALSEthickFlowerflowerFace0.1rotationAxis220rotationAngles300360flowerPetalsangle1rotationAngles1rotatedPetalthickFlowerrotationAxisGETFROM_STARTrotationAnglesangleINSERTLASTflowerPetalsrotatedPetalfinalFlowerflowerPetalsfinalFlower0.01Custom Material#14ffa5#0000000.60.51FALSE2TRUE#0000002-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000#090a0b#a4f9ef'to top'0100","version":"0.20.8","type":"blockly"}} title="Simple flower" /> {\n const backgroundOpt = new SceneTwoColorLinearGradientDto();\n backgroundOpt.colorFrom = \"#090a0b\";\n backgroundOpt.colorTo = \"#a4f9ef\";\n backgroundOpt.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(backgroundOpt);\n\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 30; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [2, 0.5, 3], // First control point (petal width)\n [1.1, -0.5, 7], // Second control point (petal curve)\n [0, 0, 10] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#14ffa5\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#000000\";\n\n // Draw the completed flower with material options\n bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n}\n\n// Execute the flower creation function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating curves, shapes, and operations\nconst { InterpolationDto, MirrorAlongNormalDto, ShapesDto, CompoundShapesDto,\n FaceFromWireDto, ThisckSolidSimpleDto, RotateDto } = Bit.Inputs.OCCT;\nconst { SceneTwoColorLinearGradientDto, DirectionalLightDto } = Bit.Inputs.BabylonScene;\nconst { gradientDirectionEnum } = Bit.Inputs.Base;\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Get access to OCCT modules and utility functions\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\nconst { scene } = bitbybit.babylon;\nconst { pbrMetallicRoughness } = bitbybit.babylon.material;\n\n\nconst createEnvironment = async () => {\n const backgroundOpt = new SceneTwoColorLinearGradientDto();\n backgroundOpt.colorFrom = \"#090a0b\";\n backgroundOpt.colorTo = \"#a4f9ef\";\n backgroundOpt.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(backgroundOpt);\n\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 30; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [2, 0.5, 3], // First control point (petal width)\n [1.1, -0.5, 7], // Second control point (petal curve)\n [0, 0, 10] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#14ffa5\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#000000\";\n\n // Draw the completed flower with material options\n bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n}\n\n// Execute the flower creation function\nstart();","version":"0.20.8","type":"typescript"}} title="Simple flower" /> @@ -107,7 +107,7 @@ Despite managing up to 25,000 particles simultaneously, the system maintains smo {\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 60; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [5, 1.25, 7.5], // First control point (petal width)\n [2.75, -1.25, 17.5], // Second control point (petal curve)\n [0, 0, 25] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n const rotationAngles2 = vector.span({\n min: 30,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n const flowerPetalPromises2: Promise[] = [];\n\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n for (const angle of rotationAngles2) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises2.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n const flowerPetals2 = await Promise.all(flowerPetalPromises2);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n compoundOptions.shapes = flowerPetals2;\n const flower2 = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#111111\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.alpha = 0.4;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#ffffff\";\n drawOpt.drawEdges = true;\n drawOpt.precision = 0.1;\n\n // Draw the completed flower with material options\n const flowerMesh = await bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n\n const flowerMesh2 = await bitbybit.draw.drawAnyAsync({\n entity: flower2,\n options: drawOpt\n });\n\n const emitterMesh = flowerMesh.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh.isPickable = false;\n\n const emitterMesh2 = flowerMesh2.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh2.isPickable = false;\n\n const scene = bitbybit.babylon.scene.getScene();\n\n const purpleStartColor = new BABYLON.Color4(0.7, 0.3, 1.0, 1.0);\n const purpleMidColor = new BABYLON.Color4(1.0, 0.4, 0.8, 1.0);\n\n const blueStartColor = new BABYLON.Color4(0.2, 0.7, 1.0, 1.0);\n const blueMidColor = new BABYLON.Color4(0.5, 0.8, 1.0, 1.0);\n\n // This object will be shared with both particle systems to track the mouse.\n const mouseTracker = { position: null as BABYLON.Vector3 | null };\n\n // Create all the 3D assets: emitters, particle systems, and the interaction plane.\n\n // Remove any old observable before adding a new one.\n if (scene.metadata && scene.metadata.observable) {\n scene.metadata.observable.remove();\n }\n\n // Centralized mouse interaction logic.\n const resObs = scene.onPointerObservable.add((pointerInfo) => {\n if (pointerInfo.type === BABYLON.PointerEventTypes.POINTERMOVE) {\n // We only check for hits against our single, invisible interaction plane.\n const pickInfo = scene.pick(scene.pointerX, scene.pointerY, (mesh) => mesh === emitterMesh);\n if (pickInfo.hit) {\n // If we hit the plane, update the shared tracker object's position.\n mouseTracker.position = pickInfo.pickedPoint;\n } else {\n // If the mouse is not over the plane, clear the position.\n mouseTracker.position = null;\n }\n }\n });\n\n if (scene.metadata) {\n scene.metadata.observable = resObs;\n } else {\n scene.metadata = { observable: resObs };\n }\n\n createParticleSystemForMesh(emitterMesh, scene, purpleStartColor, purpleMidColor, mouseTracker);\n createParticleSystemForMesh(emitterMesh2, scene, blueStartColor, blueMidColor, mouseTracker);\n\n}\n\n// Execute the flower creation function\nstart();\n\n\n// The core particle system definition.\nfunction createParticleSystemForMesh(\n emitterMesh: BABYLON.Mesh,\n scene: BABYLON.Scene,\n animStartColor: BABYLON.Color4,\n animMidColor: BABYLON.Color4,\n mouseTracker: { position: BABYLON.Vector3 | null }\n): BABYLON.ParticleSystem {\n\n const animEndColor = new BABYLON.Color4(0.1, 0.2, 0.8, 0.0);\n const DRIFTER_CHANCE = 0.07;\n const DRIFTER_SPEED = 0.4;\n\n const particleSystem = new BABYLON.ParticleSystem(\"particles_\" + emitterMesh.name, 25000, scene);\n particleSystem.particleTexture = new BABYLON.Texture(\"https://assets.babylonjs.com/textures/flare.png\", scene);\n particleSystem.emitter = emitterMesh;\n particleSystem.particleEmitterType = createUniformMeshParticleEmitter(emitterMesh);\n\n particleSystem.color1 = animEndColor.clone();\n particleSystem.color2 = animEndColor.clone();\n particleSystem.colorDead = animEndColor.clone();\n particleSystem.minSize = 0;\n particleSystem.maxSize = 0;\n particleSystem.blendMode = BABYLON.ParticleSystem.BLENDMODE_ONEONE;\n particleSystem.minLifeTime = 4.0;\n particleSystem.maxLifeTime = 8.0;\n particleSystem.emitRate = 2000;\n particleSystem.minEmitPower = 0.1;\n particleSystem.maxEmitPower = 0.5;\n particleSystem.gravity = new BABYLON.Vector3(0, -1.0, 0);\n (particleSystem as any).dragFactor = 0.97;\n\n particleSystem.updateFunction = function (particles) {\n const repulsionRadius = 20.0, repulsionStrength = 30;\n const scaledUpdateSpeed = this._scaledUpdateSpeed;\n const mousePickPosition = mouseTracker.position;\n const regularStartSize = 0.35, regularEndSize = 0.1;\n const largeStartSize = 0.8, largeEndSize = 0.2;\n\n for (let index = 0; index < particles.length; index++) {\n const particle = particles[index] as Particle;\n particle.age += scaledUpdateSpeed;\n if (particle.age >= particle.lifeTime) {\n particles.splice(index, 1); this._stockParticles.push(particle); index--; continue;\n }\n\n if (particle.age === scaledUpdateSpeed) {\n particle.isLarge = (Math.random() < 0.05);\n particle.isDrifter = (Math.random() < DRIFTER_CHANCE);\n if (particle.isDrifter) {\n const driftVector = new BABYLON.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n particle.driftDirection = driftVector.normalize();\n }\n }\n\n particle.direction.scaleInPlace(this.dragFactor);\n if (particle.isDrifter) {\n const driftForce = particle.driftDirection.scale(DRIFTER_SPEED * scaledUpdateSpeed);\n particle.direction.addInPlace(driftForce);\n } else {\n particle.direction.addInPlace(this.gravity.scale(scaledUpdateSpeed));\n }\n\n if (mousePickPosition) {\n const distance = BABYLON.Vector3.Distance(particle.position, mousePickPosition);\n if (distance < repulsionRadius) {\n const forceDirection = particle.position.subtract(mousePickPosition).normalize();\n const forceMagnitude = repulsionStrength * (1 - distance / repulsionRadius);\n const forceVector = forceDirection.scale(forceMagnitude * scaledUpdateSpeed);\n particle.direction.addInPlace(forceVector);\n }\n }\n\n particle.position.addInPlace(particle.direction.scale(scaledUpdateSpeed));\n\n const startSize = particle.isLarge ? largeStartSize : regularStartSize;\n const endSize = particle.isLarge ? largeEndSize : regularEndSize;\n const lifeRatio = particle.age / particle.lifeTime;\n const fadeInDuration = 0.1;\n\n if (lifeRatio < fadeInDuration) {\n const fadeInRatio = lifeRatio / fadeInDuration;\n particle.size = BABYLON.Scalar.Lerp(0, startSize, fadeInRatio);\n BABYLON.Color4.LerpToRef(animEndColor, animStartColor, fadeInRatio, particle.color);\n } else {\n const mainLifeRatio = (lifeRatio - fadeInDuration) / (1 - fadeInDuration);\n particle.size = BABYLON.Scalar.Lerp(startSize, endSize, mainLifeRatio);\n if (mainLifeRatio < 0.5) {\n BABYLON.Color4.LerpToRef(animStartColor, animMidColor, mainLifeRatio * 2, particle.color);\n } else {\n BABYLON.Color4.LerpToRef(animMidColor, animEndColor, (mainLifeRatio - 0.5) * 2, particle.color);\n }\n }\n }\n };\n\n particleSystem.start();\n return particleSystem;\n}\n\n// Creates a custom emitter to ensure particles are distributed evenly across a mesh surface.\nfunction createUniformMeshParticleEmitter(mesh: BABYLON.Mesh): BABYLON.CustomParticleEmitter {\n const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind);\n const indices = mesh.getIndices();\n const totalFaces = indices.length / 3;\n const cumulativeTriangleAreas: number[] = [];\n let totalArea = 0;\n const vA = new BABYLON.Vector3(), vB = new BABYLON.Vector3(), vC = new BABYLON.Vector3();\n const edge1 = new BABYLON.Vector3(), edge2 = new BABYLON.Vector3();\n\n for (let i = 0; i < totalFaces; i++) {\n const indexA = indices[i * 3], indexB = indices[i * 3 + 1], indexC = indices[i * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, indexA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, indexB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, indexC * 3, vC);\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n const area = BABYLON.Vector3.Cross(edge1, edge2).length() * 0.5;\n totalArea += area;\n cumulativeTriangleAreas.push(totalArea);\n }\n\n for (let i = 0; i < totalFaces; i++) cumulativeTriangleAreas[i] /= totalArea;\n\n const customEmitter = new BABYLON.CustomParticleEmitter();\n customEmitter.particlePositionGenerator = (index, particle, out) => {\n const random = Math.random();\n let triangleIndex = 0;\n for (let i = 0; i < totalFaces; i++) if (random < cumulativeTriangleAreas[i]) { triangleIndex = i; break; }\n const iA = indices[triangleIndex * 3], iB = indices[triangleIndex * 3 + 1], iC = indices[triangleIndex * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, iA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, iB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, iC * 3, vC);\n let r1 = Math.random(), r2 = Math.random();\n if (r1 + r2 > 1) { r1 = 1 - r1; r2 = 1 - r2; }\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n out.copyFrom(vA).addInPlace(edge1.scaleInPlace(r1)).addInPlace(edge2.scaleInPlace(r2));\n };\n customEmitter.particleDestinationGenerator = (index, particle, out) => {\n out.set(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n };\n return customEmitter;\n}\n","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating curves, shapes, and operations\nconst { InterpolationDto, MirrorAlongNormalDto, ShapesDto, CompoundShapesDto,\n FaceFromWireDto, ThisckSolidSimpleDto, RotateDto } = Bit.Inputs.OCCT;\nconst { SceneTwoColorLinearGradientDto, DirectionalLightDto } = Bit.Inputs.BabylonScene;\nconst { gradientDirectionEnum } = Bit.Inputs.Base;\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\ninterface Particle extends BABYLON.Particle {\n isLarge: boolean,\n isDrifter: boolean,\n driftDirection: BABYLON.Vector3\n}\n\n// Get access to OCCT modules and utility functions\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\nconst { scene } = bitbybit.babylon;\nconst { pbrMetallicRoughness } = bitbybit.babylon.material;\n\n\nconst createEnvironment = async () => {\n const dirLightOpt = new DirectionalLightDto();\n dirLightOpt.intensity = 3;\n scene.drawDirectionalLight(dirLightOpt);\n}\n\n// Define the main function to create a parametric flower\nconst start = async () => {\n createEnvironment();\n // Flower parameters - easily adjustable for different designs\n const thickness = 0.1; // Thickness of the flower petals\n const rotationStep = 60; // Degrees between each petal (12 petals total)\n const rotationAxis: Vector3 = [2, 2, 0]; // Axis for petal rotation\n\n // Define control points for the flower petal curve\n const controlPoints: Point3[] = [\n [0, 0, 0], // Start point (flower center)\n [5, 1.25, 7.5], // First control point (petal width)\n [2.75, -1.25, 17.5], // Second control point (petal curve)\n [0, 0, 25] // End point (petal tip)\n ];\n\n // Create interpolated curve through control points\n const curveOptions = new InterpolationDto();\n curveOptions.points = controlPoints;\n curveOptions.periodic = false;\n curveOptions.tolerance = 1e-7;\n const petalCurve = await wire.interpolatePoints(curveOptions);\n\n // Mirror the curve to create symmetry for the petal\n const mirrorOptions = new MirrorAlongNormalDto();\n mirrorOptions.shape = petalCurve;\n mirrorOptions.origin = [0, 0, 0];\n mirrorOptions.normal = [1, 0, 0]; // Mirror along X-axis\n const mirroredCurve = await transforms.mirrorAlongNormal(mirrorOptions);\n\n // Combine the original and mirrored curves into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [petalCurve, mirroredCurve];\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Create a face from the combined wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = combinedWire;\n faceOptions.planar = false; // Allow non-planar surface\n const petalFace = await face.createFaceFromWire(faceOptions);\n\n // Create a thick solid from the face\n const thickOptions = new ThisckSolidSimpleDto();\n thickOptions.shape = petalFace;\n thickOptions.offset = thickness;\n const thickPetal = await operations.makeThickSolidSimple(thickOptions);\n\n // Generate rotation angles for petals (0° to 360° in steps)\n const rotationAngles = vector.span({\n min: 0,\n max: 360,\n step: rotationStep\n });\n\n const rotationAngles2 = vector.span({\n min: 30,\n max: 360,\n step: rotationStep\n });\n\n // Create all flower petals by rotating the base petal\n const flowerPetalPromises: Promise[] = [];\n const flowerPetalPromises2: Promise[] = [];\n\n for (const angle of rotationAngles) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises.push(rotatedPetal);\n }\n\n for (const angle of rotationAngles2) {\n const rotateOptions = new RotateDto();\n rotateOptions.shape = thickPetal;\n rotateOptions.axis = rotationAxis;\n rotateOptions.angle = angle;\n\n const rotatedPetal = transforms.rotate(rotateOptions);\n flowerPetalPromises2.push(rotatedPetal);\n }\n\n const flowerPetals = await Promise.all(flowerPetalPromises);\n const flowerPetals2 = await Promise.all(flowerPetalPromises2);\n\n // Combine all petals into a single compound shape\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = flowerPetals;\n const flower = await compound.makeCompound(compoundOptions);\n compoundOptions.shapes = flowerPetals2;\n const flower2 = await compound.makeCompound(compoundOptions);\n\n const pbrOptions = new Bit.Inputs.BabylonMaterial.PBRMetallicRoughnessDto();\n pbrOptions.baseColor = \"#111111\";\n pbrOptions.metallic = 0.6;\n pbrOptions.roughness = 0.6;\n pbrOptions.alpha = 0.4;\n pbrOptions.zOffset = 2;\n const pbrMaterial = pbrMetallicRoughness.create(pbrOptions);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeMaterialOptions();\n drawOpt.faceMaterial = pbrMaterial;\n drawOpt.edgeColour = \"#ffffff\";\n drawOpt.drawEdges = true;\n drawOpt.precision = 0.1;\n\n // Draw the completed flower with material options\n const flowerMesh = await bitbybit.draw.drawAnyAsync({\n entity: flower,\n options: drawOpt\n });\n\n const flowerMesh2 = await bitbybit.draw.drawAnyAsync({\n entity: flower2,\n options: drawOpt\n });\n\n const emitterMesh = flowerMesh.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh.isPickable = false;\n\n const emitterMesh2 = flowerMesh2.getChildMeshes()[0] as BABYLON.Mesh;\n emitterMesh2.isPickable = false;\n\n const scene = bitbybit.babylon.scene.getScene();\n\n const purpleStartColor = new BABYLON.Color4(0.7, 0.3, 1.0, 1.0);\n const purpleMidColor = new BABYLON.Color4(1.0, 0.4, 0.8, 1.0);\n\n const blueStartColor = new BABYLON.Color4(0.2, 0.7, 1.0, 1.0);\n const blueMidColor = new BABYLON.Color4(0.5, 0.8, 1.0, 1.0);\n\n // This object will be shared with both particle systems to track the mouse.\n const mouseTracker = { position: null as BABYLON.Vector3 | null };\n\n // Create all the 3D assets: emitters, particle systems, and the interaction plane.\n\n // Remove any old observable before adding a new one.\n if (scene.metadata && scene.metadata.observable) {\n scene.metadata.observable.remove();\n }\n\n // Centralized mouse interaction logic.\n const resObs = scene.onPointerObservable.add((pointerInfo) => {\n if (pointerInfo.type === BABYLON.PointerEventTypes.POINTERMOVE) {\n // We only check for hits against our single, invisible interaction plane.\n const pickInfo = scene.pick(scene.pointerX, scene.pointerY, (mesh) => mesh === emitterMesh);\n if (pickInfo.hit) {\n // If we hit the plane, update the shared tracker object's position.\n mouseTracker.position = pickInfo.pickedPoint;\n } else {\n // If the mouse is not over the plane, clear the position.\n mouseTracker.position = null;\n }\n }\n });\n\n if (scene.metadata) {\n scene.metadata.observable = resObs;\n } else {\n scene.metadata = { observable: resObs };\n }\n\n createParticleSystemForMesh(emitterMesh, scene, purpleStartColor, purpleMidColor, mouseTracker);\n createParticleSystemForMesh(emitterMesh2, scene, blueStartColor, blueMidColor, mouseTracker);\n\n}\n\n// Execute the flower creation function\nstart();\n\n\n// The core particle system definition.\nfunction createParticleSystemForMesh(\n emitterMesh: BABYLON.Mesh,\n scene: BABYLON.Scene,\n animStartColor: BABYLON.Color4,\n animMidColor: BABYLON.Color4,\n mouseTracker: { position: BABYLON.Vector3 | null }\n): BABYLON.ParticleSystem {\n\n const animEndColor = new BABYLON.Color4(0.1, 0.2, 0.8, 0.0);\n const DRIFTER_CHANCE = 0.07;\n const DRIFTER_SPEED = 0.4;\n\n const particleSystem = new BABYLON.ParticleSystem(\"particles_\" + emitterMesh.name, 25000, scene);\n particleSystem.particleTexture = new BABYLON.Texture(\"https://assets.babylonjs.com/textures/flare.png\", scene);\n particleSystem.emitter = emitterMesh;\n particleSystem.particleEmitterType = createUniformMeshParticleEmitter(emitterMesh);\n\n particleSystem.color1 = animEndColor.clone();\n particleSystem.color2 = animEndColor.clone();\n particleSystem.colorDead = animEndColor.clone();\n particleSystem.minSize = 0;\n particleSystem.maxSize = 0;\n particleSystem.blendMode = BABYLON.ParticleSystem.BLENDMODE_ONEONE;\n particleSystem.minLifeTime = 4.0;\n particleSystem.maxLifeTime = 8.0;\n particleSystem.emitRate = 2000;\n particleSystem.minEmitPower = 0.1;\n particleSystem.maxEmitPower = 0.5;\n particleSystem.gravity = new BABYLON.Vector3(0, -1.0, 0);\n (particleSystem as any).dragFactor = 0.97;\n\n particleSystem.updateFunction = function (particles) {\n const repulsionRadius = 20.0, repulsionStrength = 30;\n const scaledUpdateSpeed = this._scaledUpdateSpeed;\n const mousePickPosition = mouseTracker.position;\n const regularStartSize = 0.35, regularEndSize = 0.1;\n const largeStartSize = 0.8, largeEndSize = 0.2;\n\n for (let index = 0; index < particles.length; index++) {\n const particle = particles[index] as Particle;\n particle.age += scaledUpdateSpeed;\n if (particle.age >= particle.lifeTime) {\n particles.splice(index, 1); this._stockParticles.push(particle); index--; continue;\n }\n\n if (particle.age === scaledUpdateSpeed) {\n particle.isLarge = (Math.random() < 0.05);\n particle.isDrifter = (Math.random() < DRIFTER_CHANCE);\n if (particle.isDrifter) {\n const driftVector = new BABYLON.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n particle.driftDirection = driftVector.normalize();\n }\n }\n\n particle.direction.scaleInPlace(this.dragFactor);\n if (particle.isDrifter) {\n const driftForce = particle.driftDirection.scale(DRIFTER_SPEED * scaledUpdateSpeed);\n particle.direction.addInPlace(driftForce);\n } else {\n particle.direction.addInPlace(this.gravity.scale(scaledUpdateSpeed));\n }\n\n if (mousePickPosition) {\n const distance = BABYLON.Vector3.Distance(particle.position, mousePickPosition);\n if (distance < repulsionRadius) {\n const forceDirection = particle.position.subtract(mousePickPosition).normalize();\n const forceMagnitude = repulsionStrength * (1 - distance / repulsionRadius);\n const forceVector = forceDirection.scale(forceMagnitude * scaledUpdateSpeed);\n particle.direction.addInPlace(forceVector);\n }\n }\n\n particle.position.addInPlace(particle.direction.scale(scaledUpdateSpeed));\n\n const startSize = particle.isLarge ? largeStartSize : regularStartSize;\n const endSize = particle.isLarge ? largeEndSize : regularEndSize;\n const lifeRatio = particle.age / particle.lifeTime;\n const fadeInDuration = 0.1;\n\n if (lifeRatio < fadeInDuration) {\n const fadeInRatio = lifeRatio / fadeInDuration;\n particle.size = BABYLON.Scalar.Lerp(0, startSize, fadeInRatio);\n BABYLON.Color4.LerpToRef(animEndColor, animStartColor, fadeInRatio, particle.color);\n } else {\n const mainLifeRatio = (lifeRatio - fadeInDuration) / (1 - fadeInDuration);\n particle.size = BABYLON.Scalar.Lerp(startSize, endSize, mainLifeRatio);\n if (mainLifeRatio < 0.5) {\n BABYLON.Color4.LerpToRef(animStartColor, animMidColor, mainLifeRatio * 2, particle.color);\n } else {\n BABYLON.Color4.LerpToRef(animMidColor, animEndColor, (mainLifeRatio - 0.5) * 2, particle.color);\n }\n }\n }\n };\n\n particleSystem.start();\n return particleSystem;\n}\n\n// Creates a custom emitter to ensure particles are distributed evenly across a mesh surface.\nfunction createUniformMeshParticleEmitter(mesh: BABYLON.Mesh): BABYLON.CustomParticleEmitter {\n const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind);\n const indices = mesh.getIndices();\n const totalFaces = indices.length / 3;\n const cumulativeTriangleAreas: number[] = [];\n let totalArea = 0;\n const vA = new BABYLON.Vector3(), vB = new BABYLON.Vector3(), vC = new BABYLON.Vector3();\n const edge1 = new BABYLON.Vector3(), edge2 = new BABYLON.Vector3();\n\n for (let i = 0; i < totalFaces; i++) {\n const indexA = indices[i * 3], indexB = indices[i * 3 + 1], indexC = indices[i * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, indexA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, indexB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, indexC * 3, vC);\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n const area = BABYLON.Vector3.Cross(edge1, edge2).length() * 0.5;\n totalArea += area;\n cumulativeTriangleAreas.push(totalArea);\n }\n\n for (let i = 0; i < totalFaces; i++) cumulativeTriangleAreas[i] /= totalArea;\n\n const customEmitter = new BABYLON.CustomParticleEmitter();\n customEmitter.particlePositionGenerator = (index, particle, out) => {\n const random = Math.random();\n let triangleIndex = 0;\n for (let i = 0; i < totalFaces; i++) if (random < cumulativeTriangleAreas[i]) { triangleIndex = i; break; }\n const iA = indices[triangleIndex * 3], iB = indices[triangleIndex * 3 + 1], iC = indices[triangleIndex * 3 + 2];\n BABYLON.Vector3.FromArrayToRef(positions, iA * 3, vA);\n BABYLON.Vector3.FromArrayToRef(positions, iB * 3, vB);\n BABYLON.Vector3.FromArrayToRef(positions, iC * 3, vC);\n let r1 = Math.random(), r2 = Math.random();\n if (r1 + r2 > 1) { r1 = 1 - r1; r2 = 1 - r2; }\n vB.subtractToRef(vA, edge1);\n vC.subtractToRef(vA, edge2);\n out.copyFrom(vA).addInPlace(edge1.scaleInPlace(r1)).addInPlace(edge2.scaleInPlace(r2));\n };\n customEmitter.particleDestinationGenerator = (index, particle, out) => {\n out.set(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);\n };\n return customEmitter;\n}\n","version":"0.20.8","type":"typescript"}} title="Simple flower" /> diff --git a/docs/learn/code/common/occt/operations/advanced-loft.md b/docs/learn/code/common/occt/operations/advanced-loft.md index 02b56cba..f9970186 100644 --- a/docs/learn/code/common/occt/operations/advanced-loft.md +++ b/docs/learn/code/common/occt/operations/advanced-loft.md @@ -45,21 +45,21 @@ Here's a breakdown of the process described: nrCornerswire1wire2wire3nrCorners10151515030117910001000100010003wire1000010nrCorners31wire2030010nrCorners10.3wire3070010nrCorners60.5wire3wire2wire1FALSEFALSEFALSEFALSE10FALSE31e-7'approxChordLength'01000-300.01TRUE#cc33ccTRUE#ffffff2","version":"0.20.7","type":"blockly"}} + script={{"script":"nrCornerswire1wire2wire3nrCorners10151515030117910001000100010003wire1000010nrCorners31wire2030010nrCorners10.3wire3070010nrCorners60.5wire3wire2wire1FALSEFALSEFALSEFALSE10FALSE31e-7'approxChordLength'01000-300.01TRUE#cc33ccTRUE#ffffff2","version":"0.20.8","type":"blockly"}} title="Advanced Loft Operation" /> {\n\n // --- 1. Camera Configuration ---\n // Create a new configuration object for the scene's Arc Rotate Camera.\n const arcCameraOptions = new CameraConfigurationDto();\n // Set the camera's position in 3D space (x, y, z).\n arcCameraOptions.position = [15, 15, 15];\n // Set the point the camera will look at.\n arcCameraOptions.lookAt = [0, 3, 0];\n // Apply these settings to the active camera in the scene.\n scene.adjustActiveArcRotateCamera(arcCameraOptions);\n\n // Define the number of corners for the polygonal profiles.\n const nrCorners = 10;\n\n // --- 2. Create the First Profile (Bottom) ---\n // Create a DTO to define an n-sided polygon wire.\n const ngonOpt = new NGonWireDto();\n ngonOpt.nrCorners = nrCorners;\n ngonOpt.radius = 3;\n // Asynchronously create the first polygon wire shape at the default center [0,0,0].\n const wire1 = await wire.createNGonWire(ngonOpt);\n\n // Create a DTO for a 2D fillet operation to round the corners of a wire.\n const filletOpt = new FilletDto();\n filletOpt.radius = 0.3; // The radius of the rounded corners.\n filletOpt.shape = wire1; // Specify that the fillet should be applied to wire1.\n // Asynchronously apply the fillet and store the new, smoothed wire.\n const filletedWire1 = await fillets.fillet2d(filletOpt);\n\n // --- 3. Create the Second Profile (Middle) ---\n // Reuse the ngonOpt DTO but modify its properties for the next shape.\n ngonOpt.center = [0, 3, 0]; // Move the center up along the Y-axis.\n ngonOpt.radius = 1; // Make this polygon smaller.\n const wire2 = await wire.createNGonWire(ngonOpt);\n\n // Reuse the filletOpt DTO to apply the same fillet radius to the new wire.\n filletOpt.shape = wire2;\n const filletedWire2 = await fillets.fillet2d(filletOpt);\n\n // --- 4. Create the Third Profile (Top) ---\n // Reuse and modify the DTOs again for the third and final profile.\n ngonOpt.center = [0, 7, 0]; // Move this one even higher.\n ngonOpt.radius = 6; // Make this polygon the largest.\n const wire3 = await wire.createNGonWire(ngonOpt);\n\n // Use a larger fillet radius for this larger wire.\n filletOpt.radius = 0.5;\n filletOpt.shape = wire3;\n const filletedWire3 = await fillets.fillet2d(filletOpt);\n\n // --- 5. Perform the Loft Operation ---\n // A loft creates a 3D solid by connecting a series of 2D profiles.\n const loftAdvancedOptions = new LoftAdvancedDto();\n // Specify a single point where the loft should begin, creating a pointed top.\n loftAdvancedOptions.startVertex = [0, 10, 0];\n // Specify a single point where the loft should end, creating a pointed bottom.\n loftAdvancedOptions.endVertex = [0, -3, 0];\n // Provide the array of profiles to connect. The order matters.\n loftAdvancedOptions.shapes = [filletedWire3, filletedWire2, filletedWire1];\n // Asynchronously execute the loft operation to create the final 3D shape.\n const loftedShape = await operations.loftAdvanced(loftAdvancedOptions)\n\n // --- 6. Draw the Final Shape ---\n // Create a DTO to define how the shape should be drawn.\n const drawOptions = new DrawOcctShapeSimpleOptions();\n // Set the color of the shape's faces to magenta.\n drawOptions.faceColour = \"#ff00ff\";\n\n // Call the generic drawing function to render the OCCT shape in the scene.\n bitbybit.draw.drawAnyAsync({\n entity: loftedShape, // The shape to draw.\n options: drawOptions // The drawing options to apply.\n });\n\n}\n\n// Execute the main function to start the script.\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"\n// Import DTOs for configuring various operations. DTOs are objects used to pass data.\n// Import camera configuration for setting up the scene view.\nconst { CameraConfigurationDto } = Bit.Inputs.BabylonScene;\n// Import DTOs for OpenCASCADE (OCCT) geometric modeling: creating polygons, fillets, and lofts.\nconst { NGonWireDto, FilletDto, LoftAdvancedDto } = Bit.Inputs.OCCT;\n// Import DTO for specifying drawing options, like color and opacity.\nconst { DrawOcctShapeSimpleOptions } = Bit.Inputs.Draw;\n// Import a specific type for an OCCT wire, ensuring type safety in our code.\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Destructure the bitbybit API to get direct access to its main modules.\n// 'scene' provides access to Babylon.js scene controls.\nconst { scene } = bitbybit.babylon;\n// 'wire', 'fillets', and 'operations' are part of the OCCT module for creating and manipulating shapes.\nconst { wire } = bitbybit.occt.shapes;\nconst { fillets, operations } = bitbybit.occt;\n\n// Define an asynchronous function to execute the main logic.\n// Using async/await is necessary because geometry creation and drawing are non-blocking operations.\nconst start = async () => {\n\n // --- 1. Camera Configuration ---\n // Create a new configuration object for the scene's Arc Rotate Camera.\n const arcCameraOptions = new CameraConfigurationDto();\n // Set the camera's position in 3D space (x, y, z).\n arcCameraOptions.position = [15, 15, 15];\n // Set the point the camera will look at.\n arcCameraOptions.lookAt = [0, 3, 0];\n // Apply these settings to the active camera in the scene.\n scene.adjustActiveArcRotateCamera(arcCameraOptions);\n\n // Define the number of corners for the polygonal profiles.\n const nrCorners = 10;\n\n // --- 2. Create the First Profile (Bottom) ---\n // Create a DTO to define an n-sided polygon wire.\n const ngonOpt = new NGonWireDto();\n ngonOpt.nrCorners = nrCorners;\n ngonOpt.radius = 3;\n // Asynchronously create the first polygon wire shape at the default center [0,0,0].\n const wire1 = await wire.createNGonWire(ngonOpt);\n\n // Create a DTO for a 2D fillet operation to round the corners of a wire.\n const filletOpt = new FilletDto();\n filletOpt.radius = 0.3; // The radius of the rounded corners.\n filletOpt.shape = wire1; // Specify that the fillet should be applied to wire1.\n // Asynchronously apply the fillet and store the new, smoothed wire.\n const filletedWire1 = await fillets.fillet2d(filletOpt);\n\n // --- 3. Create the Second Profile (Middle) ---\n // Reuse the ngonOpt DTO but modify its properties for the next shape.\n ngonOpt.center = [0, 3, 0]; // Move the center up along the Y-axis.\n ngonOpt.radius = 1; // Make this polygon smaller.\n const wire2 = await wire.createNGonWire(ngonOpt);\n\n // Reuse the filletOpt DTO to apply the same fillet radius to the new wire.\n filletOpt.shape = wire2;\n const filletedWire2 = await fillets.fillet2d(filletOpt);\n\n // --- 4. Create the Third Profile (Top) ---\n // Reuse and modify the DTOs again for the third and final profile.\n ngonOpt.center = [0, 7, 0]; // Move this one even higher.\n ngonOpt.radius = 6; // Make this polygon the largest.\n const wire3 = await wire.createNGonWire(ngonOpt);\n\n // Use a larger fillet radius for this larger wire.\n filletOpt.radius = 0.5;\n filletOpt.shape = wire3;\n const filletedWire3 = await fillets.fillet2d(filletOpt);\n\n // --- 5. Perform the Loft Operation ---\n // A loft creates a 3D solid by connecting a series of 2D profiles.\n const loftAdvancedOptions = new LoftAdvancedDto();\n // Specify a single point where the loft should begin, creating a pointed top.\n loftAdvancedOptions.startVertex = [0, 10, 0];\n // Specify a single point where the loft should end, creating a pointed bottom.\n loftAdvancedOptions.endVertex = [0, -3, 0];\n // Provide the array of profiles to connect. The order matters.\n loftAdvancedOptions.shapes = [filletedWire3, filletedWire2, filletedWire1];\n // Asynchronously execute the loft operation to create the final 3D shape.\n const loftedShape = await operations.loftAdvanced(loftAdvancedOptions)\n\n // --- 6. Draw the Final Shape ---\n // Create a DTO to define how the shape should be drawn.\n const drawOptions = new DrawOcctShapeSimpleOptions();\n // Set the color of the shape's faces to magenta.\n drawOptions.faceColour = \"#ff00ff\";\n\n // Call the generic drawing function to render the OCCT shape in the scene.\n bitbybit.draw.drawAnyAsync({\n entity: loftedShape, // The shape to draw.\n options: drawOptions // The drawing options to apply.\n });\n\n}\n\n// Execute the main function to start the script.\nstart();","version":"0.20.8","type":"typescript"}} title="Advanced Loft Operation" /> diff --git a/docs/learn/code/common/occt/operations/extrusions.md b/docs/learn/code/common/occt/operations/extrusions.md index c74a59b1..4cb37578 100644 --- a/docs/learn/code/common/occt/operations/extrusions.md +++ b/docs/learn/code/common/occt/operations/extrusions.md @@ -35,21 +35,21 @@ By understanding extrusion, you gain a powerful tool for your 3D modeling toolki heightheight40000107740FALSE0.50height0","version":"0.20.7","type":"blockly"}} + script={{"script":"heightheight40000107740FALSE0.50height0","version":"0.20.8","type":"blockly"}} title="Extrude the wire into shell kind of shape" /> {\n\n // Define a constant 'height' for the extrusion operation.\n const height = 4;\n\n // Create a new StarDto instance to configure the properties of a star-shaped wire.\n const starOpt = new StarDto();\n // Set the inner radius of the star.\n starOpt.innerRadius = 4;\n // Set the outer radius of the star.\n starOpt.outerRadius = 7;\n // Asynchronously create the star-shaped wire using the configured options.\n // The 'await' keyword pauses execution until the wire creation is complete.\n // Bitbybit runs such CAD operations in the worker thread, which doesn't block UI\n // and is usually faster.\n const star = await wire.createStarWire(starOpt);\n\n // Create a new FilletDto instance to configure a 2D fillet operation.\n // The generic type specifies that this fillet will be applied to a wire.\n const filletOpt = new FilletDto();\n // Set the shape to be filleted to the previously created star wire.\n filletOpt.shape = star;\n // Set the radius for the fillet (rounding of corners).\n filletOpt.radius = 0.5;\n // Asynchronously apply the 2D fillet to the star wire.\n const roundedStar = await fillets.fillet2d(filletOpt);\n\n // Create a new ExtrudeDto instance to configure an extrusion operation.\n // The generic type specifies that a wire will be extruded.\n const extrudeOpt = new ExtrudeDto();\n // Set the shape to be extruded to the previously created rounded star wire.\n extrudeOpt.shape = roundedStar;\n // Set the direction and magnitude of the extrusion as a 3D vector [x, y, z].\n // Here, it extrudes along the Y-axis by the value of 'height'.\n extrudeOpt.direction = [0, height, 0];\n // Asynchronously perform the extrusion operation on the rounded star wire.\n const extrudedRoundStar = await operations.extrude(extrudeOpt);\n\n // Asynchronously draw the final extruded shape in the 3D scene.\n // 'entity' specifies the shape to be drawn.\n bitbybit.draw.drawAnyAsync({ entity: extrudedRoundStar });\n\n}\n\n// Call the 'start' function to execute the script.\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import the 'wire' module for creating wire shapes from the OCCT (OpenCASCADE Technology) library.\nconst { wire } = bitbybit.occt.shapes;\n// Import 'fillets' and 'operations' modules for performing filleting and extrusion operations on OCCT shapes.\nconst { fillets, operations } = bitbybit.occt;\n// Import Data Transfer Objects (DTOs) for configuring star creation, filleting, and extrusion.\n// DTOs are used to pass parameters to the respective functions.\nconst { StarDto, FilletDto, ExtrudeDto } = Bit.Inputs.OCCT;\n// Define a type alias for a pointer to a TopoDS_Wire, which is an OCCT data structure representing a wire.\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Define an asynchronous function named 'start' which will contain the main logic for creating and drawing the shape.\n// The 'async' keyword allows the use of 'await' for operations that might take time, like geometry creation.\nconst start = async () => {\n\n // Define a constant 'height' for the extrusion operation.\n const height = 4;\n\n // Create a new StarDto instance to configure the properties of a star-shaped wire.\n const starOpt = new StarDto();\n // Set the inner radius of the star.\n starOpt.innerRadius = 4;\n // Set the outer radius of the star.\n starOpt.outerRadius = 7;\n // Asynchronously create the star-shaped wire using the configured options.\n // The 'await' keyword pauses execution until the wire creation is complete.\n // Bitbybit runs such CAD operations in the worker thread, which doesn't block UI\n // and is usually faster.\n const star = await wire.createStarWire(starOpt);\n\n // Create a new FilletDto instance to configure a 2D fillet operation.\n // The generic type specifies that this fillet will be applied to a wire.\n const filletOpt = new FilletDto();\n // Set the shape to be filleted to the previously created star wire.\n filletOpt.shape = star;\n // Set the radius for the fillet (rounding of corners).\n filletOpt.radius = 0.5;\n // Asynchronously apply the 2D fillet to the star wire.\n const roundedStar = await fillets.fillet2d(filletOpt);\n\n // Create a new ExtrudeDto instance to configure an extrusion operation.\n // The generic type specifies that a wire will be extruded.\n const extrudeOpt = new ExtrudeDto();\n // Set the shape to be extruded to the previously created rounded star wire.\n extrudeOpt.shape = roundedStar;\n // Set the direction and magnitude of the extrusion as a 3D vector [x, y, z].\n // Here, it extrudes along the Y-axis by the value of 'height'.\n extrudeOpt.direction = [0, height, 0];\n // Asynchronously perform the extrusion operation on the rounded star wire.\n const extrudedRoundStar = await operations.extrude(extrudeOpt);\n\n // Asynchronously draw the final extruded shape in the 3D scene.\n // 'entity' specifies the shape to be drawn.\n bitbybit.draw.drawAnyAsync({ entity: extrudedRoundStar });\n\n}\n\n// Call the 'start' function to execute the script.\nstart();","version":"0.20.8","type":"typescript"}} title="Extrude the wire into shell kind of shape" /> @@ -69,21 +69,21 @@ In the following examples, we first construct a complex wire, then create a plan heightheight4000010070000100520FALSEFALSETRUETRUE0height0","version":"0.20.7","type":"blockly"}} + script={{"script":"heightheight4000010070000100520FALSEFALSETRUETRUE0height0","version":"0.20.8","type":"blockly"}} title="Extrude the face into solid shape" /> {\n\n const height = 4;\n\n const heartOpt = new Heart2DDto();\n heartOpt.sizeApprox = 7;\n const heart1 = await wire.createHeartWire(heartOpt);\n\n heartOpt.sizeApprox = 5;\n const heart2 = await wire.createHeartWire(heartOpt);\n\n const zigZagOpt = new ZigZagBetweenTwoWiresDto(heart1, heart2, 31);\n const zigZagWire = await wire.createZigZagBetweenTwoWires(zigZagOpt);\n\n const faceFromWireOpt = new FaceFromWireDto(zigZagWire, true);\n const zigZagFace = await face.createFaceFromWire(faceFromWireOpt);\n \n const extrudeOpt = new ExtrudeDto();\n extrudeOpt.shape = zigZagFace;\n extrudeOpt.direction = [0, height, 0];\n const extrudedZigZag = await operations.extrude(extrudeOpt);\n\n bitbybit.draw.drawAnyAsync({ entity: extrudedZigZag });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { wire, face } = bitbybit.occt.shapes;\nconst { fillets, operations } = bitbybit.occt;\nconst { FilletDto, ExtrudeDto, Heart2DDto, ZigZagBetweenTwoWiresDto, FaceFromWireDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\nconst start = async () => {\n\n const height = 4;\n\n const heartOpt = new Heart2DDto();\n heartOpt.sizeApprox = 7;\n const heart1 = await wire.createHeartWire(heartOpt);\n\n heartOpt.sizeApprox = 5;\n const heart2 = await wire.createHeartWire(heartOpt);\n\n const zigZagOpt = new ZigZagBetweenTwoWiresDto(heart1, heart2, 31);\n const zigZagWire = await wire.createZigZagBetweenTwoWires(zigZagOpt);\n\n const faceFromWireOpt = new FaceFromWireDto(zigZagWire, true);\n const zigZagFace = await face.createFaceFromWire(faceFromWireOpt);\n \n const extrudeOpt = new ExtrudeDto();\n extrudeOpt.shape = zigZagFace;\n extrudeOpt.direction = [0, height, 0];\n const extrudedZigZag = await operations.extrude(extrudeOpt);\n\n bitbybit.draw.drawAnyAsync({ entity: extrudedZigZag });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Extrude the face into solid shape" /> diff --git a/docs/learn/code/common/occt/operations/offset-operations.md b/docs/learn/code/common/occt/operations/offset-operations.md index 994ba8f0..747eb3ed 100644 --- a/docs/learn/code/common/occt/operations/offset-operations.md +++ b/docs/learn/code/common/occt/operations/offset-operations.md @@ -44,21 +44,21 @@ Key parameters for wire offset include: hexagonoffsetDistanceoffsetShapehexagon00001046offsetDistance1.2offsetShapehexagonoffsetDistance0.1hexagon#00ff004offsetShape#ff00004","version":"0.20.7","type":"blockly"}} + script={{"script":"hexagonoffsetDistanceoffsetShapehexagon00001046offsetDistance1.2offsetShapehexagonoffsetDistance0.1hexagon#00ff004offsetShape#ff00004","version":"0.20.8","type":"blockly"}} title="Basic Wire Offset Operation" /> {\n\n // Define the offset distance - positive values expand the shape, negative values contract it\n const offsetDistance = 1.2;\n\n // Create a new NGonWireDto instance to configure a hexagonal wire\n const hexagonOpt = new Bit.Inputs.OCCT.NGonWireDto();\n // Set the center point of the polygon\n hexagonOpt.center = [0, 0, 0];\n // Set the direction vector (normal to the plane of the polygon)\n hexagonOpt.direction = [0, 1, 0];\n // Set the radius from center to vertices\n hexagonOpt.radius = 4;\n // Set the number of corners (6 for hexagon)\n hexagonOpt.nrCorners = 6;\n \n // Create the hexagonal wire\n const hexagon = await wire.createNGonWire(hexagonOpt);\n\n // Create a new OffsetDto instance to configure the offset operation\n const offsetOpt = new OffsetDto();\n // Set the shape to be offset\n offsetOpt.shape = hexagon;\n // Set the offset distance (positive = outward, negative = inward)\n offsetOpt.distance = offsetDistance;\n // Set the tolerance for the offset calculation\n offsetOpt.tolerance = 0.1;\n \n // Perform the offset operation\n const offsetShape = await operations.offset(offsetOpt);\n\n // Draw both the original and offset shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: hexagon, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\n// Call the 'start' function to execute the script\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import the 'wire' module for creating wire shapes from the OCCT library\nconst { wire } = bitbybit.occt.shapes;\n// Import the 'operations' module for offset operations\nconst { operations } = bitbybit.occt;\n// Import Data Transfer Objects (DTOs) for configuring polygon creation and offset operations\nconst { NGonWireDto, OffsetDto } = Bit.Inputs.OCCT;\n// Define a type alias for a pointer to a TopoDS_Wire\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Define an asynchronous function named 'start' which will contain the main logic\nconst start = async () => {\n\n // Define the offset distance - positive values expand the shape, negative values contract it\n const offsetDistance = 1.2;\n\n // Create a new NGonWireDto instance to configure a hexagonal wire\n const hexagonOpt = new Bit.Inputs.OCCT.NGonWireDto();\n // Set the center point of the polygon\n hexagonOpt.center = [0, 0, 0];\n // Set the direction vector (normal to the plane of the polygon)\n hexagonOpt.direction = [0, 1, 0];\n // Set the radius from center to vertices\n hexagonOpt.radius = 4;\n // Set the number of corners (6 for hexagon)\n hexagonOpt.nrCorners = 6;\n \n // Create the hexagonal wire\n const hexagon = await wire.createNGonWire(hexagonOpt);\n\n // Create a new OffsetDto instance to configure the offset operation\n const offsetOpt = new OffsetDto();\n // Set the shape to be offset\n offsetOpt.shape = hexagon;\n // Set the offset distance (positive = outward, negative = inward)\n offsetOpt.distance = offsetDistance;\n // Set the tolerance for the offset calculation\n offsetOpt.tolerance = 0.1;\n \n // Perform the offset operation\n const offsetShape = await operations.offset(offsetOpt);\n\n // Draw both the original and offset shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: hexagon, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\n// Call the 'start' function to execute the script\nstart();","version":"0.20.8","type":"typescript"}} title="Basic Wire Offset Operation" /> @@ -83,21 +83,21 @@ The join types available are: starWireoffsetDistanceoffsetShapestarWire000010531.50FALSEoffsetDistance0.8offsetShapestarWireoffsetDistance0.1intersectionFALSEstarWire#00ff004offsetShape#ff00004","version":"0.20.7","type":"blockly"}} + script={{"script":"starWireoffsetDistanceoffsetShapestarWire000010531.50FALSEoffsetDistance0.8offsetShapestarWireoffsetDistance0.1intersectionFALSEstarWire#00ff004offsetShape#ff00004","version":"0.20.8","type":"blockly"}} title="Advanced Offset with Join Type Control" /> {\n\n // Define the offset distance\n const offsetDistance = 0.8;\n\n // Create a star-shaped wire for demonstration\n const starOpt = new StarDto();\n starOpt.center = [0, 0, 0];\n starOpt.direction = [0, 1, 0];\n starOpt.numRays = 5;\n starOpt.outerRadius = 3;\n starOpt.innerRadius = 1.5;\n \n const starWire = await wire.createStarWire(starOpt);\n\n // Create an advanced offset with specific join type\n const offsetAdvOpt = new OffsetAdvancedDto();\n offsetAdvOpt.shape = starWire;\n offsetAdvOpt.distance = offsetDistance;\n offsetAdvOpt.tolerance = 0.1;\n // Set join type to 'intersection' for sharp corners\n // Other options: 'arc' (rounded), 'tangent' (beveled)\n offsetAdvOpt.joinType = Bit.Inputs.OCCT.joinTypeEnum.intersection;\n offsetAdvOpt.removeIntEdges = false;\n \n const offsetShape = await operations.offsetAdv(offsetAdvOpt);\n\n // Draw both shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: starWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required modules for wire creation and operations\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\n// Import DTOs and enums for star creation and advanced offset\nconst { StarDto, OffsetAdvancedDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\nconst start = async () => {\n\n // Define the offset distance\n const offsetDistance = 0.8;\n\n // Create a star-shaped wire for demonstration\n const starOpt = new StarDto();\n starOpt.center = [0, 0, 0];\n starOpt.direction = [0, 1, 0];\n starOpt.numRays = 5;\n starOpt.outerRadius = 3;\n starOpt.innerRadius = 1.5;\n \n const starWire = await wire.createStarWire(starOpt);\n\n // Create an advanced offset with specific join type\n const offsetAdvOpt = new OffsetAdvancedDto();\n offsetAdvOpt.shape = starWire;\n offsetAdvOpt.distance = offsetDistance;\n offsetAdvOpt.tolerance = 0.1;\n // Set join type to 'intersection' for sharp corners\n // Other options: 'arc' (rounded), 'tangent' (beveled)\n offsetAdvOpt.joinType = Bit.Inputs.OCCT.joinTypeEnum.intersection;\n offsetAdvOpt.removeIntEdges = false;\n \n const offsetShape = await operations.offsetAdv(offsetAdvOpt);\n\n // Draw both shapes with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: starWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offsetShape, options: offsetOptions });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Advanced Offset with Join Type Control" /> @@ -117,21 +117,21 @@ The thick solid operation takes a shell (collection of connected faces) or a fac circleWirecircularFacethicknessthickSolidcircleWire0000103circularFacecircleWireTRUEthickness0.5thickSolidcircularFacethicknesstranslatedSolidthickSolid010circularFace#00ff004translatedSolid#ff00004","version":"0.20.7","type":"blockly"}} + script={{"script":"circleWirecircularFacethicknessthickSolidcircleWire0000103circularFacecircleWireTRUEthickness0.5thickSolidcircularFacethicknesstranslatedSolidthickSolid010circularFace#00ff004translatedSolid#ff00004","version":"0.20.8","type":"blockly"}} title="Creating Thick Solid from Face" /> {\n\n // Define the thickness for the solid\n const thickness = 0.5;\n\n // Step 1: Create a circular wire\n const circleOpt = new CircleDto();\n circleOpt.center = [0, 0, 0];\n circleOpt.direction = [0, 1, 0];\n circleOpt.radius = 3;\n \n const circleWire = await wire.createCircleWire(circleOpt);\n\n // Step 2: Convert the wire to a face\n const faceOpt = new FaceFromWireDto();\n faceOpt.shape = circleWire;\n faceOpt.planar = true;\n \n const circularFace = await face.createFaceFromWire(faceOpt);\n\n // Step 3: Create a thick solid from the face\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = circularFace;\n // Positive offset creates thickness in the direction of the face normal\n thickSolidOpt.offset = thickness;\n \n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Step 4: Translate the thick solid upwards to make the original face visible\n const translationOpt = new TranslateDto();\n translationOpt.shape = thickSolid;\n translationOpt.translation = [0, 1, 0]; // Move up by 1 unit\n \n const translatedSolid = await transforms.translate(translationOpt);\n\n // Draw both the original face and resulting thick solid with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const thickSolidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n thickSolidOptions.edgeWidth = 4;\n thickSolidOptions.edgeColour = \"#ff0000\"; // Red for thick solid\n \n bitbybit.draw.drawAnyAsync({ entity: circularFace, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: thickSolidOptions });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required modules for wire, face creation and operations\nconst { wire, face } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\n// Import DTOs for circle, face and thick solid creation\nconst { CircleDto, FaceFromWireDto, ThisckSolidSimpleDto, TranslateDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\nconst start = async () => {\n\n // Define the thickness for the solid\n const thickness = 0.5;\n\n // Step 1: Create a circular wire\n const circleOpt = new CircleDto();\n circleOpt.center = [0, 0, 0];\n circleOpt.direction = [0, 1, 0];\n circleOpt.radius = 3;\n \n const circleWire = await wire.createCircleWire(circleOpt);\n\n // Step 2: Convert the wire to a face\n const faceOpt = new FaceFromWireDto();\n faceOpt.shape = circleWire;\n faceOpt.planar = true;\n \n const circularFace = await face.createFaceFromWire(faceOpt);\n\n // Step 3: Create a thick solid from the face\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = circularFace;\n // Positive offset creates thickness in the direction of the face normal\n thickSolidOpt.offset = thickness;\n \n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Step 4: Translate the thick solid upwards to make the original face visible\n const translationOpt = new TranslateDto();\n translationOpt.shape = thickSolid;\n translationOpt.translation = [0, 1, 0]; // Move up by 1 unit\n \n const translatedSolid = await transforms.translate(translationOpt);\n\n // Draw both the original face and resulting thick solid with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const thickSolidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n thickSolidOptions.edgeWidth = 4;\n thickSolidOptions.edgeColour = \"#ff0000\"; // Red for thick solid\n \n bitbybit.draw.drawAnyAsync({ entity: circularFace, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: thickSolidOptions });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Creating Thick Solid from Face" /> @@ -151,21 +151,21 @@ This operation works by: curvedWireoffsetDistanceextrusionDirectionoffset3DWirecurvedWire0002124-11623FALSEoffsetDistance0.5extrusionDirection010offset3DWirecurvedWireextrusionDirectionoffsetDistancecurvedWire#00ff004offset3DWire#ff00004","version":"0.20.7","type":"blockly"}} + script={{"script":"curvedWireoffsetDistanceextrusionDirectionoffset3DWirecurvedWire0002124-11623FALSEoffsetDistance0.5extrusionDirection010offset3DWirecurvedWireextrusionDirectionoffsetDistancecurvedWire#00ff004offset3DWire#ff00004","version":"0.20.8","type":"blockly"}} title="3D Wire Offset Operation" /> {\n\n // Define parameters for the 3D offset\n const offsetDistance = 0.5;\n const extrusionDirection = [0, 1, 0]; // Y-axis direction\n\n // Step 1: Create a curved 3D wire using B-spline\n const curveOpt = new BSplineDto();\n // Define control points for a truly 3D curve with varying Y coordinates\n curveOpt.points = [\n [0, 0, 0], // Start point\n [2, 1, 2], // First control point (elevated in Y)\n [4, -1, 1], // Second control point (lowered in Y)\n [6, 2, 3] // End point (elevated in Y and Z)\n ];\n curveOpt.closed = false;\n \n const curvedWire = await wire.createBSpline(curveOpt);\n\n // Step 2: Create 3D offset of the wire\n const offset3DOpt = new Offset3DWireDto();\n offset3DOpt.shape = curvedWire;\n // Direction for the temporary extrusion used in the offset calculation\n offset3DOpt.direction = extrusionDirection as Bit.Inputs.Base.Point3;\n // Distance to offset the wire\n offset3DOpt.offset = offsetDistance;\n \n const offset3DWire = await operations.offset3DWire(offset3DOpt);\n\n // Draw both the original and offset wires with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: curvedWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset3DWire, options: offsetOptions });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required modules for wire creation and operations\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\n// Import DTOs for BSpline and 3D wire offset\nconst { BSplineDto, Offset3DWireDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\nconst start = async () => {\n\n // Define parameters for the 3D offset\n const offsetDistance = 0.5;\n const extrusionDirection = [0, 1, 0]; // Y-axis direction\n\n // Step 1: Create a curved 3D wire using B-spline\n const curveOpt = new BSplineDto();\n // Define control points for a truly 3D curve with varying Y coordinates\n curveOpt.points = [\n [0, 0, 0], // Start point\n [2, 1, 2], // First control point (elevated in Y)\n [4, -1, 1], // Second control point (lowered in Y)\n [6, 2, 3] // End point (elevated in Y and Z)\n ];\n curveOpt.closed = false;\n \n const curvedWire = await wire.createBSpline(curveOpt);\n\n // Step 2: Create 3D offset of the wire\n const offset3DOpt = new Offset3DWireDto();\n offset3DOpt.shape = curvedWire;\n // Direction for the temporary extrusion used in the offset calculation\n offset3DOpt.direction = extrusionDirection as Bit.Inputs.Base.Point3;\n // Distance to offset the wire\n offset3DOpt.offset = offsetDistance;\n \n const offset3DWire = await operations.offset3DWire(offset3DOpt);\n\n // Draw both the original and offset wires with different colors for comparison\n const originalOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n originalOptions.edgeWidth = 4;\n originalOptions.edgeColour = \"#00ff00\"; // Green for original\n \n const offsetOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offsetOptions.edgeWidth = 4;\n offsetOptions.edgeColour = \"#ff0000\"; // Red for offset\n \n bitbybit.draw.drawAnyAsync({ entity: curvedWire, options: originalOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset3DWire, options: offsetOptions });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="3D Wire Offset Operation" /> diff --git a/docs/learn/code/common/occt/operations/rotated-extrusions.md b/docs/learn/code/common/occt/operations/rotated-extrusions.md index 10d77303..4bd6cdc6 100644 --- a/docs/learn/code/common/occt/operations/rotated-extrusions.md +++ b/docs/learn/code/common/occt/operations/rotated-extrusions.md @@ -34,21 +34,21 @@ In the examples below, we will demonstrate how to create a simple solid 3D helic 130000104360TRUE","version":"0.20.7","type":"blockly"}} + script={{"script":"130000104360TRUE","version":"0.20.8","type":"blockly"}} title="Extrude the wire into shell kind of shape" /> {\n\n const recOpt = new Bit.Inputs.OCCT.RectangleDto(1, 3);\n const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire(recOpt);\n const rotatedExtrudeOpt = new Bit.Inputs.OCCT.RotationExtrudeDto(rectangle, 4);\n const rotatedExtrude = await bitbybit.occt.operations.rotatedExtrude(rotatedExtrudeOpt)\n\n bitbybit.draw.drawAnyAsync({ entity: rotatedExtrude });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const recOpt = new Bit.Inputs.OCCT.RectangleDto(1, 3);\n const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire(recOpt);\n const rotatedExtrudeOpt = new Bit.Inputs.OCCT.RotationExtrudeDto(rectangle, 4);\n const rotatedExtrude = await bitbybit.occt.operations.rotatedExtrude(rotatedExtrudeOpt)\n\n bitbybit.draw.drawAnyAsync({ entity: rotatedExtrude });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Extrude the wire into shell kind of shape" /> @@ -62,21 +62,21 @@ When the profile is further from the center it will form a helix like shape. Thi pointPromisespointsngonRotationPromisesi3050300150117910001000100010003pointPromises00001061012FALSETRUEpointspointPromisesngonRotationPromisesipointsINSERTLASTngonRotationPromisesi01061.530270TRUEngonRotationPromises","version":"0.20.7","type":"blockly"}} + script={{"script":"pointPromisespointsngonRotationPromisesi3050300150117910001000100010003pointPromises00001061012FALSETRUEpointspointPromisesngonRotationPromisesipointsINSERTLASTngonRotationPromisesi01061.530270TRUEngonRotationPromises","version":"0.20.8","type":"blockly"}} title="Extrude the wire into shell kind of shape" /> {\n\n // Adjust the default camera position to face the object\n const cameraOptions = new CameraConfigurationDto();\n cameraOptions.position = [30, 50, 50];\n cameraOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraOptions);\n\n // This ellipse will be used to derive origins for ngons on the ground plane\n const ellipseOptions = new EllipseDto();\n ellipseOptions.radiusMinor = 6;\n ellipseOptions.radiusMajor = 10;\n const ellipse = await wire.createEllipseWire(ellipseOptions);\n\n // We divide the wire into 12 segments and return the points\n const divideOptions = new DivideDto(ellipse);\n divideOptions.removeEndPoint = true;\n divideOptions.nrOfDivisions = 12;\n const points = await wire.divideWireByEqualDistanceToPoints(divideOptions);\n\n // Create ngons on these points\n const ngonOptions = new NGonWireDto();\n ngonOptions.radius = 1.5;\n const ngonPromises = points.map(point => {\n ngonOptions.center = point;\n return wire.createNGonWire(ngonOptions);\n });\n\n const ngons = await Promise.all(ngonPromises);\n\n // Form rotated extrusions on all of the points\n const rotatedExtrudeOptions = new RotationExtrudeDto();\n rotatedExtrudeOptions.angle = 270;\n rotatedExtrudeOptions.height = 30;\n const rotatedExtrusionPromises = ngons.map(ngon => {\n rotatedExtrudeOptions.shape = ngon;\n return operations.rotatedExtrude(rotatedExtrudeOptions);\n });\n\n const rotatedExtrusions = await Promise.all(rotatedExtrusionPromises);\n\n // Compounding multiple shapes will generally deliver much better rendering performance\n // as it will form a single mesh for all of the geometries involved in compound\n const compoundOptions = new CompoundShapesDto(rotatedExtrusions);\n const ngonCompound = await compound.makeCompound(compoundOptions);\n\n // As a last step we draw the ngon with default occt settings (defualt because we omit specifying options property)\n bitbybit.draw.drawAnyAsync({ entity: ngonCompound });\n\n}\n\n// Let's not forget to execute the start function, otherwise nothing will happen.\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// These destructured imports are optional, but convenient later on - option DTO's are classes\nconst { EllipseDto, RotationExtrudeDto, DivideDto, NGonWireDto, CompoundShapesDto } = Bit.Inputs.OCCT;\nconst { CameraConfigurationDto } = Bit.Inputs.BabylonScene;\n// These are parts of the bitbybit API that will be used in the script\nconst { wire, compound } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { scene } = bitbybit.babylon;\n// Types need to be destructured one by one\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Async definition of the start function where we can await on asynchronous CAD algorithms running inside the web workers\nconst start = async () => {\n\n // Adjust the default camera position to face the object\n const cameraOptions = new CameraConfigurationDto();\n cameraOptions.position = [30, 50, 50];\n cameraOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraOptions);\n\n // This ellipse will be used to derive origins for ngons on the ground plane\n const ellipseOptions = new EllipseDto();\n ellipseOptions.radiusMinor = 6;\n ellipseOptions.radiusMajor = 10;\n const ellipse = await wire.createEllipseWire(ellipseOptions);\n\n // We divide the wire into 12 segments and return the points\n const divideOptions = new DivideDto(ellipse);\n divideOptions.removeEndPoint = true;\n divideOptions.nrOfDivisions = 12;\n const points = await wire.divideWireByEqualDistanceToPoints(divideOptions);\n\n // Create ngons on these points\n const ngonOptions = new NGonWireDto();\n ngonOptions.radius = 1.5;\n const ngonPromises = points.map(point => {\n ngonOptions.center = point;\n return wire.createNGonWire(ngonOptions);\n });\n\n const ngons = await Promise.all(ngonPromises);\n\n // Form rotated extrusions on all of the points\n const rotatedExtrudeOptions = new RotationExtrudeDto();\n rotatedExtrudeOptions.angle = 270;\n rotatedExtrudeOptions.height = 30;\n const rotatedExtrusionPromises = ngons.map(ngon => {\n rotatedExtrudeOptions.shape = ngon;\n return operations.rotatedExtrude(rotatedExtrudeOptions);\n });\n\n const rotatedExtrusions = await Promise.all(rotatedExtrusionPromises);\n\n // Compounding multiple shapes will generally deliver much better rendering performance\n // as it will form a single mesh for all of the geometries involved in compound\n const compoundOptions = new CompoundShapesDto(rotatedExtrusions);\n const ngonCompound = await compound.makeCompound(compoundOptions);\n\n // As a last step we draw the ngon with default occt settings (defualt because we omit specifying options property)\n bitbybit.draw.drawAnyAsync({ entity: ngonCompound });\n\n}\n\n// Let's not forget to execute the start function, otherwise nothing will happen.\nstart();","version":"0.20.8","type":"typescript"}} title="Extrude the wire into shell kind of shape" /> diff --git a/docs/learn/code/common/occt/operations/simple-loft.md b/docs/learn/code/common/occt/operations/simple-loft.md index e5feabbd..6c7eca80 100644 --- a/docs/learn/code/common/occt/operations/simple-loft.md +++ b/docs/learn/code/common/occt/operations/simple-loft.md @@ -37,21 +37,21 @@ In this tutorial, we'll walk through the process of creating a simple lofted sha ellipse1ellipse2ellipse3ellipsesloftellipse100001048ellipse203001014ellipse307001026ellipsesellipse1ellipse2ellipse3loftellipsesFALSEloft0.001TRUE#6600ccTRUE#ffffff2","version":"0.20.7","type":"blockly"}} + script={{"script":"ellipse1ellipse2ellipse3ellipsesloftellipse100001048ellipse203001014ellipse307001026ellipsesellipse1ellipse2ellipse3loftellipsesFALSEloft0.001TRUE#6600ccTRUE#ffffff2","version":"0.20.8","type":"blockly"}} title="Simple Loft Operation" /> {\n\n // Create an instance of EllipseDto to define the properties of the first ellipse.\n const ellipseOpt = new EllipseDto();\n // Set the minor radius of the ellipse.\n ellipseOpt.radiusMinor = 4;\n // Set the major radius of the ellipse.\n ellipseOpt.radiusMajor = 8;\n // Create the first elliptical wire. The center defaults to [0,0,0] and direction to [0,1,0] if not specified.\n // 'await' is used because shape creation is an asynchronous operation.\n const ellipse1 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the second ellipse.\n // Set the center of the second ellipse.\n ellipseOpt.center = [0, 3, 0];\n // Set the minor radius for the second ellipse.\n ellipseOpt.radiusMinor = 1;\n // Set the major radius for the second ellipse.\n ellipseOpt.radiusMajor = 4;\n // Create the second elliptical wire with the updated options.\n const ellipse2 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the third ellipse.\n // Set the center of the third ellipse.\n ellipseOpt.center = [0, 7, 0];\n // Set the minor radius for the third ellipse.\n ellipseOpt.radiusMinor = 2;\n // Set the major radius for the third ellipse.\n ellipseOpt.radiusMajor = 6;\n // Create the third elliptical wire with the updated options.\n const ellipse3 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Create an instance of LoftDto to define the parameters for the loft operation.\n // The generic type TopoDSShapePointer indicates the type of shapes to be lofted.\n const loftOpt = new LoftDto();\n // Assign an array of the created ellipse wires to the 'shapes' property of loftOpt.\n // These are the profiles that will be connected by the loft.\n loftOpt.shapes = [ellipse1, ellipse2, ellipse3];\n // Perform the loft operation using the defined options.\n // This will create a surface (or shell) connecting the three ellipses.\n // 'makeSolid' defaults to false, creating a shell.\n const loft = await operations.loft(loftOpt);\n\n // Create an instance of DrawOcctShapeSimpleOptions to define how the lofted shape will be displayed.\n const drawOpt = new DrawOcctShapeSimpleOptions();\n // Set the precision for drawing the shape. This affects the tessellation quality.\n drawOpt.precision = 0.001;\n // Set the color of the faces of the lofted shape.\n drawOpt.faceColour = \"#ff00ff\"; // Magenta\n // Draw the lofted shape asynchronously using the specified entity and drawing options.\n draw.drawAnyAsync({ entity: loft, options: drawOpt });\n\n}\n\n// Call the start function to execute the script.\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import necessary modules from the bitbybit library.\n// 'operations' and 'shapes' are for OpenCascade Technology (OCCT) functionalities like lofting and creating wires.\nconst { operations, shapes } = bitbybit.occt;\n// 'draw' module is used for rendering shapes on the canvas.\nconst { draw } = bitbybit;\n// Import Data Transfer Objects (DTOs) for defining OCCT inputs.\n// 'EllipseDto' for creating ellipses, 'LoftDto' for loft operation parameters.\nconst { EllipseDto, LoftDto } = Bit.Inputs.OCCT;\n// Import DTO for drawing options.\nconst { DrawOcctShapeSimpleOptions } = Bit.Inputs.Draw;\n// Define a type alias for OCCT shape pointers for better readability.\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Define an asynchronous function 'start' which will contain the main logic.\nconst start = async () => {\n\n // Create an instance of EllipseDto to define the properties of the first ellipse.\n const ellipseOpt = new EllipseDto();\n // Set the minor radius of the ellipse.\n ellipseOpt.radiusMinor = 4;\n // Set the major radius of the ellipse.\n ellipseOpt.radiusMajor = 8;\n // Create the first elliptical wire. The center defaults to [0,0,0] and direction to [0,1,0] if not specified.\n // 'await' is used because shape creation is an asynchronous operation.\n const ellipse1 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the second ellipse.\n // Set the center of the second ellipse.\n ellipseOpt.center = [0, 3, 0];\n // Set the minor radius for the second ellipse.\n ellipseOpt.radiusMinor = 1;\n // Set the major radius for the second ellipse.\n ellipseOpt.radiusMajor = 4;\n // Create the second elliptical wire with the updated options.\n const ellipse2 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Modify the ellipseOpt for the third ellipse.\n // Set the center of the third ellipse.\n ellipseOpt.center = [0, 7, 0];\n // Set the minor radius for the third ellipse.\n ellipseOpt.radiusMinor = 2;\n // Set the major radius for the third ellipse.\n ellipseOpt.radiusMajor = 6;\n // Create the third elliptical wire with the updated options.\n const ellipse3 = await shapes.wire.createEllipseWire(ellipseOpt);\n\n // Create an instance of LoftDto to define the parameters for the loft operation.\n // The generic type TopoDSShapePointer indicates the type of shapes to be lofted.\n const loftOpt = new LoftDto();\n // Assign an array of the created ellipse wires to the 'shapes' property of loftOpt.\n // These are the profiles that will be connected by the loft.\n loftOpt.shapes = [ellipse1, ellipse2, ellipse3];\n // Perform the loft operation using the defined options.\n // This will create a surface (or shell) connecting the three ellipses.\n // 'makeSolid' defaults to false, creating a shell.\n const loft = await operations.loft(loftOpt);\n\n // Create an instance of DrawOcctShapeSimpleOptions to define how the lofted shape will be displayed.\n const drawOpt = new DrawOcctShapeSimpleOptions();\n // Set the precision for drawing the shape. This affects the tessellation quality.\n drawOpt.precision = 0.001;\n // Set the color of the faces of the lofted shape.\n drawOpt.faceColour = \"#ff00ff\"; // Magenta\n // Draw the lofted shape asynchronously using the specified entity and drawing options.\n draw.drawAnyAsync({ entity: loft, options: drawOpt });\n\n}\n\n// Call the start function to execute the script.\nstart();","version":"0.20.8","type":"typescript"}} title="Simple Loft Operation" /> diff --git a/docs/learn/code/common/occt/operations/thick-solids.md b/docs/learn/code/common/occt/operations/thick-solids.md index be797edf..03cdec70 100644 --- a/docs/learn/code/common/occt/operations/thick-solids.md +++ b/docs/learn/code/common/occt/operations/thick-solids.md @@ -63,21 +63,21 @@ The following examples demonstrate creating thick solids from complex lofted sur bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewireListloftSurfacethickSolidtranslatedSolidthicknessoffsetVectorsurfaceOptionssolidOptionsbottomPoints-30-2-10000110030-2middlePoints-22-1-0.521.50220.521.522-1topPoints-1.540-0.540.50410.540.51.540bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wireListbottomWiremiddleWiretopWireloftSurfacewireListFALSEthickness0.1thickSolidloftSurfacethicknessoffsetVector003translatedSolidthickSolidoffsetVectorsurfaceOptions0.01TRUE#00ff00TRUE#ffffff2solidOptions0.01TRUE#ff6600TRUE#ffffff2loftSurfacesurfaceOptionstranslatedSolidsolidOptions","version":"0.20.7","type":"blockly"}} + script={{"script":"bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewireListloftSurfacethickSolidtranslatedSolidthicknessoffsetVectorsurfaceOptionssolidOptionsbottomPoints-30-2-10000110030-2middlePoints-22-1-0.521.50220.521.522-1topPoints-1.540-0.540.50410.540.51.540bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wireListbottomWiremiddleWiretopWireloftSurfacewireListFALSEthickness0.1thickSolidloftSurfacethicknessoffsetVector003translatedSolidthickSolidoffsetVectorsurfaceOptions0.01TRUE#00ff00TRUE#ffffff2solidOptions0.01TRUE#ff6600TRUE#ffffff2loftSurfacesurfaceOptionstranslatedSolidsolidOptions","version":"0.20.8","type":"blockly"}} title="Thick Solid from Lofted Surface (Blockly)" /> {\n\n // Define points for bottom curve (wave-like pattern)\n const bottomPoints = [\n [-3, 0, -2],\n [-1, 0, 0],\n [0, 0, 1],\n [1, 0, 0],\n [3, 0, -2]\n ] as Point3[];\n\n // Define points for middle curve (elevated and more curved)\n const middlePoints = [\n [-2, 2, -1],\n [-0.5, 2, 1.5],\n [0, 2, 2],\n [0.5, 2, 1.5],\n [2, 2, -1]\n ] as Point3[];\n\n // Define points for top curve (simpler, less curved)\n const topPoints = [\n [-1.5, 4, 0],\n [-0.5, 4, 0.5],\n [0, 4, 1],\n [0.5, 4, 0.5],\n [1.5, 4, 0]\n ] as Point3[];\n\n // Create interpolated wires from points\n const bottomWireOpt = new InterpolationDto();\n bottomWireOpt.points = bottomPoints;\n bottomWireOpt.periodic = false;\n bottomWireOpt.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOpt);\n\n const middleWireOpt = new InterpolationDto();\n middleWireOpt.points = middlePoints;\n middleWireOpt.periodic = false;\n middleWireOpt.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOpt);\n\n const topWireOpt = new InterpolationDto();\n topWireOpt.points = topPoints;\n topWireOpt.periodic = false;\n topWireOpt.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOpt);\n\n // Create lofted surface from the three wires\n const loftOpt = new LoftDto();\n loftOpt.shapes = [bottomWire, middleWire, topWire];\n loftOpt.makeSolid = false;\n const loftSurface = await operations.loft(loftOpt);\n\n // Create thick solid from the lofted surface\n const thickness = 0.1;\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = loftSurface;\n thickSolidOpt.offset = thickness;\n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Translate the thick solid for better visualization\n const offsetVector = [0, 0, 3] as Vector3;\n const translateOpt = new TranslateDto();\n translateOpt.shape = thickSolid;\n translateOpt.translation = offsetVector;\n const translatedSolid = await transforms.translate(translateOpt);\n\n // Create drawing options for the original surface (green)\n const surfaceOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n surfaceOptions.precision = 0.01;\n surfaceOptions.drawFaces = true;\n surfaceOptions.faceColour = \"#00ff00\";\n surfaceOptions.drawEdges = true;\n surfaceOptions.edgeColour = \"#ffffff\";\n surfaceOptions.edgeWidth = 2;\n\n // Create drawing options for the thick solid (orange)\n const solidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n solidOptions.precision = 0.01;\n solidOptions.drawFaces = true;\n solidOptions.faceColour = \"#ff6600\";\n solidOptions.drawEdges = true;\n solidOptions.edgeColour = \"#ffffff\";\n solidOptions.edgeWidth = 2;\n\n // Draw both the original lofted surface and the thick solid\n bitbybit.draw.drawAnyAsync({ entity: loftSurface, options: surfaceOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: solidOptions });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required modules from global bitbybit variable\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { transforms } = bitbybit.occt;\n\nconst { InterpolationDto, LoftDto, ThisckSolidSimpleDto, TranslateDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define a type alias for pointers\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\nconst start = async () => {\n\n // Define points for bottom curve (wave-like pattern)\n const bottomPoints = [\n [-3, 0, -2],\n [-1, 0, 0],\n [0, 0, 1],\n [1, 0, 0],\n [3, 0, -2]\n ] as Point3[];\n\n // Define points for middle curve (elevated and more curved)\n const middlePoints = [\n [-2, 2, -1],\n [-0.5, 2, 1.5],\n [0, 2, 2],\n [0.5, 2, 1.5],\n [2, 2, -1]\n ] as Point3[];\n\n // Define points for top curve (simpler, less curved)\n const topPoints = [\n [-1.5, 4, 0],\n [-0.5, 4, 0.5],\n [0, 4, 1],\n [0.5, 4, 0.5],\n [1.5, 4, 0]\n ] as Point3[];\n\n // Create interpolated wires from points\n const bottomWireOpt = new InterpolationDto();\n bottomWireOpt.points = bottomPoints;\n bottomWireOpt.periodic = false;\n bottomWireOpt.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOpt);\n\n const middleWireOpt = new InterpolationDto();\n middleWireOpt.points = middlePoints;\n middleWireOpt.periodic = false;\n middleWireOpt.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOpt);\n\n const topWireOpt = new InterpolationDto();\n topWireOpt.points = topPoints;\n topWireOpt.periodic = false;\n topWireOpt.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOpt);\n\n // Create lofted surface from the three wires\n const loftOpt = new LoftDto();\n loftOpt.shapes = [bottomWire, middleWire, topWire];\n loftOpt.makeSolid = false;\n const loftSurface = await operations.loft(loftOpt);\n\n // Create thick solid from the lofted surface\n const thickness = 0.1;\n const thickSolidOpt = new ThisckSolidSimpleDto();\n thickSolidOpt.shape = loftSurface;\n thickSolidOpt.offset = thickness;\n const thickSolid = await operations.makeThickSolidSimple(thickSolidOpt);\n\n // Translate the thick solid for better visualization\n const offsetVector = [0, 0, 3] as Vector3;\n const translateOpt = new TranslateDto();\n translateOpt.shape = thickSolid;\n translateOpt.translation = offsetVector;\n const translatedSolid = await transforms.translate(translateOpt);\n\n // Create drawing options for the original surface (green)\n const surfaceOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n surfaceOptions.precision = 0.01;\n surfaceOptions.drawFaces = true;\n surfaceOptions.faceColour = \"#00ff00\";\n surfaceOptions.drawEdges = true;\n surfaceOptions.edgeColour = \"#ffffff\";\n surfaceOptions.edgeWidth = 2;\n\n // Create drawing options for the thick solid (orange)\n const solidOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n solidOptions.precision = 0.01;\n solidOptions.drawFaces = true;\n solidOptions.faceColour = \"#ff6600\";\n solidOptions.drawEdges = true;\n solidOptions.edgeColour = \"#ffffff\";\n solidOptions.edgeWidth = 2;\n\n // Draw both the original lofted surface and the thick solid\n bitbybit.draw.drawAnyAsync({ entity: loftSurface, options: surfaceOptions });\n bitbybit.draw.drawAnyAsync({ entity: translatedSolid, options: solidOptions });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Thick Solid from Lofted Surface" /> diff --git a/docs/learn/code/common/occt/operations/wire-offset-multiple.md b/docs/learn/code/common/occt/operations/wire-offset-multiple.md index d39f0972..66511866 100644 --- a/docs/learn/code/common/occt/operations/wire-offset-multiple.md +++ b/docs/learn/code/common/occt/operations/wire-offset-multiple.md @@ -31,7 +31,7 @@ The following example demonstrates creating multiple offset curves from a single @@ -39,7 +39,7 @@ The following example demonstrates creating multiple offset curves from a single controlPointsbaseWirestepoverDistanceoffset1offset2offset3baseStyleoffset1Styleoffset2Styleoffset3StylecontrolPoints-40-2-202001203400stepoverDistance0.5baseWirecontrolPointsFALSE0.01offset1baseWirestepoverDistance0.01offset2baseWireMULTIPLYstepoverDistance20.01offset3baseWireMULTIPLYstepoverDistance30.01baseStyle0.01FALSETRUE#00ff004offset1Style0.01FALSETRUE#ff99003offset2Style0.01FALSETRUE#ff66003offset3Style0.01FALSETRUE#ff33003baseWirebaseStyleoffset1offset1Styleoffset2offset2Styleoffset3offset3Style","version":"0.20.7","type":"blockly"}} + script={{"script":"controlPointsbaseWirestepoverDistanceoffset1offset2offset3baseStyleoffset1Styleoffset2Styleoffset3StylecontrolPoints-40-2-202001203400stepoverDistance0.5baseWirecontrolPointsFALSE0.01offset1baseWirestepoverDistance0.01offset2baseWireMULTIPLYstepoverDistance20.01offset3baseWireMULTIPLYstepoverDistance30.01baseStyle0.01FALSETRUE#00ff004offset1Style0.01FALSETRUE#ff99003offset2Style0.01FALSETRUE#ff66003offset3Style0.01FALSETRUE#ff33003baseWirebaseStyleoffset1offset1Styleoffset2offset2Styleoffset3offset3Style","version":"0.20.8","type":"blockly"}} title="Multiple Wire Offsets" /> @@ -47,7 +47,7 @@ The following example demonstrates creating multiple offset curves from a single {\n\n // Define the stepover distance for CNC toolpaths\n const stepoverDistance = 0.5;\n\n // Step 1: Define control points for the base toolpath\n const points = [\n [-4, 0, -2],\n [-2, 0, 2],\n [0, 0, 1],\n [2, 0, 3],\n [4, 0, 0]\n ] as Point3[];\n\n // Step 2: Create base wire through interpolation\n const interpolationOpt = new InterpolationDto();\n interpolationOpt.points = points;\n interpolationOpt.periodic = false;\n interpolationOpt.tolerance = 0.01;\n \n const baseWire = await wire.interpolatePoints(interpolationOpt);\n\n // Step 3: Create multiple offset toolpaths\n // First offset\n const offset1Opt = new OffsetDto();\n offset1Opt.shape = baseWire;\n offset1Opt.distance = stepoverDistance;\n offset1Opt.tolerance = 0.01;\n \n const offset1 = await operations.offset(offset1Opt);\n\n // Second offset\n const offset2Opt = new OffsetDto();\n offset2Opt.shape = baseWire;\n offset2Opt.distance = stepoverDistance * 2;\n offset2Opt.tolerance = 0.01;\n \n const offset2 = await operations.offset(offset2Opt);\n\n // Third offset\n const offset3Opt = new OffsetDto();\n offset3Opt.shape = baseWire;\n offset3Opt.distance = stepoverDistance * 3;\n offset3Opt.tolerance = 0.01;\n \n const offset3 = await operations.offset(offset3Opt);\n\n // Step 4: Visualize all toolpaths with different colors\n // Base wire (green - reference path)\n const baseOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n baseOptions.edgeWidth = 4;\n baseOptions.edgeColour = \"#00ff00\"; // Green\n baseOptions.drawFaces = false;\n \n // Offset 1 (orange)\n const offset1Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset1Options.edgeWidth = 3;\n offset1Options.edgeColour = \"#ff9900\"; // Orange\n offset1Options.drawFaces = false;\n \n // Offset 2 (red-orange)\n const offset2Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset2Options.edgeWidth = 3;\n offset2Options.edgeColour = \"#ff6600\"; // Red-orange\n offset2Options.drawFaces = false;\n \n // Offset 3 (red)\n const offset3Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset3Options.edgeWidth = 3;\n offset3Options.edgeColour = \"#ff3300\"; // Red\n offset3Options.drawFaces = false;\n \n // Draw all toolpaths\n bitbybit.draw.drawAnyAsync({ entity: baseWire, options: baseOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset1, options: offset1Options });\n bitbybit.draw.drawAnyAsync({ entity: offset2, options: offset2Options });\n bitbybit.draw.drawAnyAsync({ entity: offset3, options: offset3Options });\n\n}\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required modules for wire creation and operations\nconst { wire } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\n// Import DTOs for interpolation and offset operations\nconst { InterpolationDto, OffsetDto } = Bit.Inputs.OCCT;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\n\nconst start = async () => {\n\n // Define the stepover distance for CNC toolpaths\n const stepoverDistance = 0.5;\n\n // Step 1: Define control points for the base toolpath\n const points = [\n [-4, 0, -2],\n [-2, 0, 2],\n [0, 0, 1],\n [2, 0, 3],\n [4, 0, 0]\n ] as Point3[];\n\n // Step 2: Create base wire through interpolation\n const interpolationOpt = new InterpolationDto();\n interpolationOpt.points = points;\n interpolationOpt.periodic = false;\n interpolationOpt.tolerance = 0.01;\n \n const baseWire = await wire.interpolatePoints(interpolationOpt);\n\n // Step 3: Create multiple offset toolpaths\n // First offset\n const offset1Opt = new OffsetDto();\n offset1Opt.shape = baseWire;\n offset1Opt.distance = stepoverDistance;\n offset1Opt.tolerance = 0.01;\n \n const offset1 = await operations.offset(offset1Opt);\n\n // Second offset\n const offset2Opt = new OffsetDto();\n offset2Opt.shape = baseWire;\n offset2Opt.distance = stepoverDistance * 2;\n offset2Opt.tolerance = 0.01;\n \n const offset2 = await operations.offset(offset2Opt);\n\n // Third offset\n const offset3Opt = new OffsetDto();\n offset3Opt.shape = baseWire;\n offset3Opt.distance = stepoverDistance * 3;\n offset3Opt.tolerance = 0.01;\n \n const offset3 = await operations.offset(offset3Opt);\n\n // Step 4: Visualize all toolpaths with different colors\n // Base wire (green - reference path)\n const baseOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n baseOptions.edgeWidth = 4;\n baseOptions.edgeColour = \"#00ff00\"; // Green\n baseOptions.drawFaces = false;\n \n // Offset 1 (orange)\n const offset1Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset1Options.edgeWidth = 3;\n offset1Options.edgeColour = \"#ff9900\"; // Orange\n offset1Options.drawFaces = false;\n \n // Offset 2 (red-orange)\n const offset2Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset2Options.edgeWidth = 3;\n offset2Options.edgeColour = \"#ff6600\"; // Red-orange\n offset2Options.drawFaces = false;\n \n // Offset 3 (red)\n const offset3Options = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n offset3Options.edgeWidth = 3;\n offset3Options.edgeColour = \"#ff3300\"; // Red\n offset3Options.drawFaces = false;\n \n // Draw all toolpaths\n bitbybit.draw.drawAnyAsync({ entity: baseWire, options: baseOptions });\n bitbybit.draw.drawAnyAsync({ entity: offset1, options: offset1Options });\n bitbybit.draw.drawAnyAsync({ entity: offset2, options: offset2Options });\n bitbybit.draw.drawAnyAsync({ entity: offset3, options: offset3Options });\n\n}\n\nstart();","version":"0.20.8","type":"typescript"}} title="Multiple Wire Offsets" /> diff --git a/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md b/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md index 83f172d6..fbf01746 100644 --- a/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md +++ b/docs/learn/code/common/occt/shapes/compound/compounded-drawing.md @@ -40,21 +40,21 @@ The example below demonstrates this principle through a complex workflow that cr bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewiresListloftedSurfacemainFacenrHexagonsUnrHexagonsVscalePatternhexWires1hexWires2reversedWiresiframesfirstFramesCompoundsecondFramesCompoundmaterial1material2bottomPoints[[-30, 0, -20], [-10, 0, 0], [0, 0, 10], [10, 0, 0],[30, 0, -20]]middlePoints[[-20, 20, -10], [-5, 20, 15], [0, 20, 20], [5, 20, 15],[20, 20, -10]]topPoints[[-15, 30, 0], [-5, 30, 5], [0, 30, 10], [5, 30, 5],[15, 30, 0]]bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wiresListbottomWiremiddleWiretopWireloftedSurfacewiresListFALSEmainFaceloftedSurface0nrHexagonsU28nrHexagonsV10scalePattern0.7hexWires1mainFacenrHexagonsUnrHexagonsVFALSE00FALSEFALSEFALSEFALSEhexWires2mainFacenrHexagonsUnrHexagonsVFALSEscalePatternscalePattern00FALSEFALSEFALSEFALSEreversedWiresi1hexWires21INSERTLASTreversedWiresGETFROM_STARThexWires2iframesi1hexWires11INSERTLASTframesGETFROM_STARThexWires1iGETFROM_STARTreversedWiresiFALSEfirstFramesCompoundframes[true, true, false]secondFramesCompoundframes[false,false,true]material1First#9155ff#0000000.150.91FALSE3material2Second#000000#0000000.90.151FALSE3firstFramesCompound0.01material1TRUE#00000010secondFramesCompound0.01material2TRUE#00000010-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000'default'10000.10.7TRUE442244015011791000100010001000340040010100.450.50.5FALSE#ffffff#ffffff#050506#627a9d'to top'0100","version":"0.20.7","type":"blockly"}} + script={{"script":"bottomPointsmiddlePointstopPointsbottomWiremiddleWiretopWirewiresListloftedSurfacemainFacenrHexagonsUnrHexagonsVscalePatternhexWires1hexWires2reversedWiresiframesfirstFramesCompoundsecondFramesCompoundmaterial1material2bottomPoints[[-30, 0, -20], [-10, 0, 0], [0, 0, 10], [10, 0, 0],[30, 0, -20]]middlePoints[[-20, 20, -10], [-5, 20, 15], [0, 20, 20], [5, 20, 15],[20, 20, -10]]topPoints[[-15, 30, 0], [-5, 30, 5], [0, 30, 10], [5, 30, 5],[15, 30, 0]]bottomWirebottomPointsFALSE0.1middleWiremiddlePointsFALSE0.1topWiretopPointsFALSE0.1wiresListbottomWiremiddleWiretopWireloftedSurfacewiresListFALSEmainFaceloftedSurface0nrHexagonsU28nrHexagonsV10scalePattern0.7hexWires1mainFacenrHexagonsUnrHexagonsVFALSE00FALSEFALSEFALSEFALSEhexWires2mainFacenrHexagonsUnrHexagonsVFALSEscalePatternscalePattern00FALSEFALSEFALSEFALSEreversedWiresi1hexWires21INSERTLASTreversedWiresGETFROM_STARThexWires2iframesi1hexWires11INSERTLASTframesGETFROM_STARThexWires1iGETFROM_STARTreversedWiresiFALSEfirstFramesCompoundframes[true, true, false]secondFramesCompoundframes[false,false,true]material1First#9155ff#0000000.150.91FALSE3material2Second#000000#0000000.90.151FALSE3firstFramesCompound0.01material1TRUE#00000010secondFramesCompound0.01material2TRUE#00000010-100-100-1003#ffffff#ffffff1024TRUE0TRUE0.20.00010.00210000'default'10000.10.7TRUE442244015011791000100010001000340040010100.450.50.5FALSE#ffffff#ffffff#050506#627a9d'to top'0100","version":"0.20.8","type":"blockly"}} title="Compounding hex frames into single entity will render faster" /> {\n // Define point sets for three different wire levels\n const bottomPoints: Point3[] = [\n [-30, 0, -20],\n [-10, 0, 0],\n [0, 0, 10],\n [10, 0, 0],\n [30, 0, -20]\n ];\n\n const middlePoints: Point3[] = [\n [-20, 20, -10],\n [-5, 20, 15],\n [0, 20, 20],\n [5, 20, 15],\n [20, 20, -10]\n ];\n\n const topPoints: Point3[] = [\n [-15, 30, 0],\n [-5, 30, 5],\n [0, 30, 10],\n [5, 30, 5],\n [15, 30, 0]\n ];\n\n // Create wires by interpolating points\n const bottomWireOptions = new InterpolationDto();\n bottomWireOptions.points = bottomPoints;\n bottomWireOptions.periodic = false;\n bottomWireOptions.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOptions);\n\n const middleWireOptions = new InterpolationDto();\n middleWireOptions.points = middlePoints;\n middleWireOptions.periodic = false;\n middleWireOptions.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOptions);\n\n const topWireOptions = new InterpolationDto();\n topWireOptions.points = topPoints;\n topWireOptions.periodic = false;\n topWireOptions.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOptions);\n\n // Create list of wires for lofting\n const wiresList = [bottomWire, middleWire, topWire];\n\n // Loft the wires to create a surface\n const loftOptions = new LoftDto();\n loftOptions.shapes = wiresList;\n loftOptions.makeSolid = false;\n const loftedSurface = await operations.loft(loftOptions);\n\n // Get the face from the lofted surface\n const getFaceOptions = new ShapeIndexDto();\n getFaceOptions.shape = loftedSurface;\n getFaceOptions.index = 0;\n const mainFace = await face.getFace(getFaceOptions);\n\n // Subdivision parameters\n const nrHexagonsU = 28;\n const nrHexagonsV = 10;\n const scalePattern = [0.7];\n\n // Create first hexagon subdivision (regular pattern)\n const hexSubdivision1Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision1Options.shape = mainFace;\n hexSubdivision1Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision1Options.nrHexagonsV = nrHexagonsV;\n const hexWires1 = await face.subdivideToHexagonWires(hexSubdivision1Options);\n\n // Create second hexagon subdivision (scaled pattern)\n const hexSubdivision2Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision2Options.shape = mainFace;\n hexSubdivision2Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision2Options.nrHexagonsV = nrHexagonsV;\n hexSubdivision2Options.scalePatternU = scalePattern;\n hexSubdivision2Options.scalePatternV = scalePattern;\n const hexWires2 = await face.subdivideToHexagonWires(hexSubdivision2Options);\n\n // Reverse the wires from the second subdivision using for loop\n const reversedWiresPromises: Promise[] = [];\n for (const hexWire of hexWires2) {\n const reversedWire = wire.reversedWire({ shape: hexWire });\n reversedWiresPromises.push(reversedWire);\n }\n\n const reversedWires = await Promise.all(reversedWiresPromises);\n\n // Combine both wire sets - equivalent to flip lists operation in Rete\n const frameWiresGrouped = hexWires1.map((h, i) => [h, reversedWires[i]]);\n\n // Create frames\n const framePromises = frameWiresGrouped.map(f => {\n const faceFromWires2Options = new FaceFromWiresDto();\n faceFromWires2Options.shapes = f;\n faceFromWires2Options.planar = false;\n return face.createFaceFromWires(faceFromWires2Options);\n });\n\n const frames = await Promise.all(framePromises);\n\n const firstFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [true, true, false]\n });\n\n const secondFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [false, false, true]\n })\n\n // Create first compound from the first pattern of hexagon faces\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = firstFrames;\n const firstCompound = await compound.makeCompound(compoundOptions);\n\n // Create second compound from the first pattern of hexagon faces\n compoundOptions.shapes = secondFrames;\n const secondCompound = await compound.makeCompound(compoundOptions);\n\n // Create materials for rendering\n const firstMaterial = new PBRMetallicRoughnessDto();\n firstMaterial.name = \"Blue Material\";\n firstMaterial.baseColor = \"#9155ff\";\n firstMaterial.metallic = 0.1;\n firstMaterial.roughness = 0.9;\n firstMaterial.backFaceCulling = false;\n firstMaterial.zOffset = 3;\n const blueMatResult = material.pbrMetallicRoughness.create(firstMaterial);\n\n // Create drawing options for the first frames\n const firstDrawOptions = new DrawOcctShapeOptions();\n firstDrawOptions.drawEdges = true;\n firstDrawOptions.edgeColour = \"#000000\";\n firstDrawOptions.edgeWidth = 10;\n firstDrawOptions.faceMaterial = blueMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: firstCompound,\n options: firstDrawOptions\n });\n\n // Create materials for rendering\n const secondMaterial = new PBRMetallicRoughnessDto();\n secondMaterial.name = \"Black Material\";\n secondMaterial.baseColor = \"#000000\";\n secondMaterial.metallic = 0.9;\n secondMaterial.roughness = 0.23;\n secondMaterial.backFaceCulling = false;\n secondMaterial.zOffset = 3;\n const secondMatResult = material.pbrMetallicRoughness.create(secondMaterial);\n\n // Create drawing options for the first frames\n const secondDrawOptions = new DrawOcctShapeOptions();\n secondDrawOptions.drawEdges = true;\n secondDrawOptions.edgeColour = \"#000000\";\n secondDrawOptions.edgeWidth = 10;\n secondDrawOptions.faceMaterial = secondMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: secondCompound,\n options: secondDrawOptions\n });\n\n // Set up scene lighting and camera\n const skyboxOptions = new SkyboxDto();\n skyboxOptions.skybox = skyboxEnum.city;\n skyboxOptions.hideSkybox = true;\n scene.enableSkybox(skyboxOptions);\n\n const dirLightOptions = new DirectionalLightDto();\n dirLightOptions.intensity = 3;\n scene.drawDirectionalLight(dirLightOptions);\n\n const gradientBackgroundOptions = new SceneTwoColorLinearGradientDto();\n gradientBackgroundOptions.colorFrom = \"#050506\";\n gradientBackgroundOptions.colorTo = \"#627a9d\";\n gradientBackgroundOptions.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(gradientBackgroundOptions);\n\n const cameraConfigurationOptions = new CameraConfigurationDto();\n cameraConfigurationOptions.position = [44, 30, 44];\n cameraConfigurationOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraConfigurationOptions);\n\n const gridOptions = new SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for wire creation, lofting, face operations, and compounds\nconst { InterpolationDto, LoftDto, ShapeIndexDto, FaceSubdivideToHexagonWiresDto, FaceFromWiresDto, CompoundShapesDto } = Bit.Inputs.OCCT;\nconst { DrawOcctShapeOptions, SceneDrawGridMeshDto } = Bit.Inputs.Draw;\nconst { PBRMetallicRoughnessDto } = Bit.Inputs.BabylonMaterial;\nconst { CameraConfigurationDto, DirectionalLightDto, SceneTwoColorLinearGradientDto, SkyboxDto } = Bit.Inputs.BabylonScene;\nconst { skyboxEnum, gradientDirectionEnum } = Bit.Inputs.Base;\n\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSCompoundPointer = Bit.Inputs.OCCT.TopoDSCompoundPointer;\n// Get access to OCCT modules\nconst { wire, face, compound } = bitbybit.occt.shapes;\nconst { operations } = bitbybit.occt;\nconst { material } = bitbybit.babylon;\nconst { scene } = bitbybit.babylon;\n\n// Define the main function to create complex face compound\nconst start = async () => {\n // Define point sets for three different wire levels\n const bottomPoints: Point3[] = [\n [-30, 0, -20],\n [-10, 0, 0],\n [0, 0, 10],\n [10, 0, 0],\n [30, 0, -20]\n ];\n\n const middlePoints: Point3[] = [\n [-20, 20, -10],\n [-5, 20, 15],\n [0, 20, 20],\n [5, 20, 15],\n [20, 20, -10]\n ];\n\n const topPoints: Point3[] = [\n [-15, 30, 0],\n [-5, 30, 5],\n [0, 30, 10],\n [5, 30, 5],\n [15, 30, 0]\n ];\n\n // Create wires by interpolating points\n const bottomWireOptions = new InterpolationDto();\n bottomWireOptions.points = bottomPoints;\n bottomWireOptions.periodic = false;\n bottomWireOptions.tolerance = 0.1;\n const bottomWire = await wire.interpolatePoints(bottomWireOptions);\n\n const middleWireOptions = new InterpolationDto();\n middleWireOptions.points = middlePoints;\n middleWireOptions.periodic = false;\n middleWireOptions.tolerance = 0.1;\n const middleWire = await wire.interpolatePoints(middleWireOptions);\n\n const topWireOptions = new InterpolationDto();\n topWireOptions.points = topPoints;\n topWireOptions.periodic = false;\n topWireOptions.tolerance = 0.1;\n const topWire = await wire.interpolatePoints(topWireOptions);\n\n // Create list of wires for lofting\n const wiresList = [bottomWire, middleWire, topWire];\n\n // Loft the wires to create a surface\n const loftOptions = new LoftDto();\n loftOptions.shapes = wiresList;\n loftOptions.makeSolid = false;\n const loftedSurface = await operations.loft(loftOptions);\n\n // Get the face from the lofted surface\n const getFaceOptions = new ShapeIndexDto();\n getFaceOptions.shape = loftedSurface;\n getFaceOptions.index = 0;\n const mainFace = await face.getFace(getFaceOptions);\n\n // Subdivision parameters\n const nrHexagonsU = 28;\n const nrHexagonsV = 10;\n const scalePattern = [0.7];\n\n // Create first hexagon subdivision (regular pattern)\n const hexSubdivision1Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision1Options.shape = mainFace;\n hexSubdivision1Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision1Options.nrHexagonsV = nrHexagonsV;\n const hexWires1 = await face.subdivideToHexagonWires(hexSubdivision1Options);\n\n // Create second hexagon subdivision (scaled pattern)\n const hexSubdivision2Options = new FaceSubdivideToHexagonWiresDto();\n hexSubdivision2Options.shape = mainFace;\n hexSubdivision2Options.nrHexagonsU = nrHexagonsU;\n hexSubdivision2Options.nrHexagonsV = nrHexagonsV;\n hexSubdivision2Options.scalePatternU = scalePattern;\n hexSubdivision2Options.scalePatternV = scalePattern;\n const hexWires2 = await face.subdivideToHexagonWires(hexSubdivision2Options);\n\n // Reverse the wires from the second subdivision using for loop\n const reversedWiresPromises: Promise[] = [];\n for (const hexWire of hexWires2) {\n const reversedWire = wire.reversedWire({ shape: hexWire });\n reversedWiresPromises.push(reversedWire);\n }\n\n const reversedWires = await Promise.all(reversedWiresPromises);\n\n // Combine both wire sets - equivalent to flip lists operation in Rete\n const frameWiresGrouped = hexWires1.map((h, i) => [h, reversedWires[i]]);\n\n // Create frames\n const framePromises = frameWiresGrouped.map(f => {\n const faceFromWires2Options = new FaceFromWiresDto();\n faceFromWires2Options.shapes = f;\n faceFromWires2Options.planar = false;\n return face.createFaceFromWires(faceFromWires2Options);\n });\n\n const frames = await Promise.all(framePromises);\n\n const firstFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [true, true, false]\n });\n\n const secondFrames = await bitbybit.lists.getByPattern({\n list: frames,\n pattern: [false, false, true]\n })\n\n // Create first compound from the first pattern of hexagon faces\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = firstFrames;\n const firstCompound = await compound.makeCompound(compoundOptions);\n\n // Create second compound from the first pattern of hexagon faces\n compoundOptions.shapes = secondFrames;\n const secondCompound = await compound.makeCompound(compoundOptions);\n\n // Create materials for rendering\n const firstMaterial = new PBRMetallicRoughnessDto();\n firstMaterial.name = \"Blue Material\";\n firstMaterial.baseColor = \"#9155ff\";\n firstMaterial.metallic = 0.1;\n firstMaterial.roughness = 0.9;\n firstMaterial.backFaceCulling = false;\n firstMaterial.zOffset = 3;\n const blueMatResult = material.pbrMetallicRoughness.create(firstMaterial);\n\n // Create drawing options for the first frames\n const firstDrawOptions = new DrawOcctShapeOptions();\n firstDrawOptions.drawEdges = true;\n firstDrawOptions.edgeColour = \"#000000\";\n firstDrawOptions.edgeWidth = 10;\n firstDrawOptions.faceMaterial = blueMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: firstCompound,\n options: firstDrawOptions\n });\n\n // Create materials for rendering\n const secondMaterial = new PBRMetallicRoughnessDto();\n secondMaterial.name = \"Black Material\";\n secondMaterial.baseColor = \"#000000\";\n secondMaterial.metallic = 0.9;\n secondMaterial.roughness = 0.23;\n secondMaterial.backFaceCulling = false;\n secondMaterial.zOffset = 3;\n const secondMatResult = material.pbrMetallicRoughness.create(secondMaterial);\n\n // Create drawing options for the first frames\n const secondDrawOptions = new DrawOcctShapeOptions();\n secondDrawOptions.drawEdges = true;\n secondDrawOptions.edgeColour = \"#000000\";\n secondDrawOptions.edgeWidth = 10;\n secondDrawOptions.faceMaterial = secondMatResult;\n\n bitbybit.draw.drawAnyAsync({\n entity: secondCompound,\n options: secondDrawOptions\n });\n\n // Set up scene lighting and camera\n const skyboxOptions = new SkyboxDto();\n skyboxOptions.skybox = skyboxEnum.city;\n skyboxOptions.hideSkybox = true;\n scene.enableSkybox(skyboxOptions);\n\n const dirLightOptions = new DirectionalLightDto();\n dirLightOptions.intensity = 3;\n scene.drawDirectionalLight(dirLightOptions);\n\n const gradientBackgroundOptions = new SceneTwoColorLinearGradientDto();\n gradientBackgroundOptions.colorFrom = \"#050506\";\n gradientBackgroundOptions.colorTo = \"#627a9d\";\n gradientBackgroundOptions.direction = gradientDirectionEnum.toTop;\n scene.twoColorLinearGradient(gradientBackgroundOptions);\n\n const cameraConfigurationOptions = new CameraConfigurationDto();\n cameraConfigurationOptions.position = [44, 30, 44];\n cameraConfigurationOptions.lookAt = [0, 15, 0];\n scene.adjustActiveArcRotateCamera(cameraConfigurationOptions);\n\n const gridOptions = new SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Compounding hex frames into single entity will render faster" /> diff --git a/docs/learn/code/common/occt/shapes/compound/intro.md b/docs/learn/code/common/occt/shapes/compound/intro.md index f451fcef..b380a76b 100644 --- a/docs/learn/code/common/occt/shapes/compound/intro.md +++ b/docs/learn/code/common/occt/shapes/compound/intro.md @@ -48,21 +48,21 @@ If you're not experiencing noticeable performance issues in the first example, t gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsxyzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridx1xPositions1y1yPositions1z1zPositions1GETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionsz","version":"0.20.7","type":"blockly"}} + script={{"script":"gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsxyzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridx1xPositions1y1yPositions1z1zPositions1GETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionsz","version":"0.20.8","type":"blockly"}} title="Creating individual spheres leads to performance issues" /> {\n // Grid parameters\n const gridSize = 3; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n \n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n \n // Generate grid positions using span functions for 3D grid\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n // Create individual spheres using nested loops for 3D grid\n // This approach creates each sphere separately, leading to performance issues\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n \n // Create and immediately draw each sphere individually\n // This is inefficient as each sphere requires its own mesh and draw call\n const sphere = await solid.createSphere(sphereOptions);\n \n // Each draw call is separate, creating performance overhead\n bitbybit.draw.drawAnyAsync({\n entity: sphere\n });\n }\n }\n }\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating spheres\nconst { SphereDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Get access to OCCT modules and utility functions\nconst { solid } = bitbybit.occt.shapes;\nconst { vector } = bitbybit;\n\n// Define the main function to create individual spheres (performance problem)\nconst start = async () => {\n // Grid parameters\n const gridSize = 3; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n \n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n \n // Generate grid positions using span functions for 3D grid\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n \n // Create individual spheres using nested loops for 3D grid\n // This approach creates each sphere separately, leading to performance issues\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n \n // Create and immediately draw each sphere individually\n // This is inefficient as each sphere requires its own mesh and draw call\n const sphere = await solid.createSphere(sphereOptions);\n \n // Each draw call is separate, creating performance overhead\n bitbybit.draw.drawAnyAsync({\n entity: sphere\n });\n }\n }\n }\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating individual spheres leads to performance issues" /> @@ -76,21 +76,21 @@ The solution to this performance problem is to use compounds. Instead of creatin gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspherescompound","version":"0.20.7","type":"blockly"}} + script={{"script":"gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzgridSize3sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspherescompound","version":"0.20.8","type":"blockly"}} title="Compounded spheres provide significantly better performance" /> {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Draw compound\n bitbybit.draw.drawAnyAsync({\n entity: sphereCompound\n });\n\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating spheres, compounds, and transformations\nconst { SphereDto, CompoundShapesDto, RotateDto, TranslateDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSCompoundPointer = Bit.Inputs.OCCT.TopoDSCompoundPointer;\n\n// Get access to OCCT modules and utility functions\nconst { solid, compound } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\n\n// Define the main function to create a compound\nconst start = async () => {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Draw compound\n bitbybit.draw.drawAnyAsync({\n entity: sphereCompound\n });\n\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Compounded spheres provide significantly better performance" /> @@ -105,21 +105,21 @@ Another major advantage of compounds is the ability to transform the entire grou gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzrotatedCompoundgridSize5sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspheresrotatedCompoundcompound00145rotatedCompound","version":"0.20.7","type":"blockly"}} + script={{"script":"gridSizesphereRadiusspacinghalfGridxPositionsyPositionszPositionsspheresxycompoundzrotatedCompoundgridSize5sphereRadius1spacing2.5halfGridDIVIDEMULTIPLYgridSizespacing2xPositionsspacingNEGhalfGridhalfGridyPositionsspacingNEGhalfGridhalfGridzPositionsspacingNEGhalfGridhalfGridspheresx1xPositions1y1yPositions1z1zPositions1INSERTLASTspheressphereRadiusGETFROM_STARTxPositionsxGETFROM_STARTyPositionsyGETFROM_STARTzPositionszcompoundspheresrotatedCompoundcompound00145rotatedCompound","version":"0.20.8","type":"blockly"}} title="Compound can be rotated and translated as a single grouped entity" /> {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Transform the entire compound as a single entity\n // First, rotate the compound around the Z-axis\n const rotateOptions = new RotateDto();\n rotateOptions.shape = sphereCompound;\n rotateOptions.axis = [0, 0, 1]; // Z-axis rotation\n rotateOptions.angle = 45; // 45 degrees\n const rotatedCompound = await transforms.rotate(rotateOptions);\n\n // Draw the transformed compound\n // All spheres move together as a single unified entity\n bitbybit.draw.drawAnyAsync({\n entity: rotatedCompound\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating spheres, compounds, and transformations\nconst { SphereDto, CompoundShapesDto, RotateDto, TranslateDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSSolidPointer = Bit.Inputs.OCCT.TopoDSSolidPointer;\ntype TopoDSCompoundPointer = Bit.Inputs.OCCT.TopoDSCompoundPointer;\n\n// Get access to OCCT modules and utility functions\nconst { solid, compound } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\nconst { vector } = bitbybit;\n\n// Define the main function to create and transform a compound (unified transformation)\nconst start = async () => {\n // Grid parameters\n const gridSize = 5; // Number of spheres per side\n const sphereRadius = 1; // Radius of each sphere\n const spacing = 2.5; // Distance between sphere centers\n\n // Calculate grid boundaries\n const halfGrid = (gridSize * spacing) / 2;\n\n // Generate grid positions using span functions\n const xPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const yPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n const zPositions = vector.span({\n min: -halfGrid,\n max: halfGrid,\n step: spacing\n });\n\n // Create array to store all spheres before compounding\n const spheres: TopoDSSolidPointer[] = [];\n\n // Create all spheres first and store them in the array\n for (const xPos of xPositions) {\n for (const yPos of yPositions) {\n for (const zPos of zPositions) {\n // Define sphere creation options\n const sphereOptions = new SphereDto();\n sphereOptions.radius = sphereRadius;\n sphereOptions.center = [xPos, yPos, zPos];\n\n // Create sphere and add to array\n const sphere = await solid.createSphere(sphereOptions);\n spheres.push(sphere);\n }\n }\n }\n\n // Create compound from all spheres\n const compoundOptions = new CompoundShapesDto();\n compoundOptions.shapes = spheres;\n const sphereCompound = await compound.makeCompound(compoundOptions);\n\n // Transform the entire compound as a single entity\n // First, rotate the compound around the Z-axis\n const rotateOptions = new RotateDto();\n rotateOptions.shape = sphereCompound;\n rotateOptions.axis = [0, 0, 1]; // Z-axis rotation\n rotateOptions.angle = 45; // 45 degrees\n const rotatedCompound = await transforms.rotate(rotateOptions);\n\n // Draw the transformed compound\n // All spheres move together as a single unified entity\n bitbybit.draw.drawAnyAsync({\n entity: rotatedCompound\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Compound can be rotated and translated as a single grouped entity" /> diff --git a/docs/learn/code/common/occt/shapes/edge/edge-constraints.md b/docs/learn/code/common/occt/shapes/edge/edge-constraints.md index 04c9cc75..6f2130b9 100644 --- a/docs/learn/code/common/occt/shapes/edge/edge-constraints.md +++ b/docs/learn/code/common/occt/shapes/edge/edge-constraints.md @@ -46,21 +46,21 @@ This is particularly useful in mechanical design when you need to connect two sp circlepoint1point2tangentLinescircle4000010point1007point2909tangentLinescirclepoint1point21e-7'all''none'tangentLinescirclepoint1point2","version":"0.20.7","type":"blockly"}} + script={{"script":"circlepoint1point2tangentLinescircle4000010point1007point2909tangentLinescirclepoint1point21e-7'all''none'tangentLinescirclepoint1point2","version":"0.20.8","type":"blockly"}} title="Constraint tangent lines from two points to circle" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define two points\n const point1: Point3 = [0, 0, 7];\n const point2: Point3 = [9, 0, 9];\n\n // Create constraint options for tangent lines from two points to circle\n const constraintOptions = new ConstraintTanLinesFromTwoPtsToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point1 = point1;\n constraintOptions.point2 = point2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromTwoPtsToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the two points\n bitbybit.draw.drawAnyAsync({ entity: [point1] });\n bitbybit.draw.drawAnyAsync({ entity: [point2] });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanLinesFromTwoPtsToCircleDto, positionResultEnum, circleInclusionEnum } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define two points\n const point1: Point3 = [0, 0, 7];\n const point2: Point3 = [9, 0, 9];\n\n // Create constraint options for tangent lines from two points to circle\n const constraintOptions = new ConstraintTanLinesFromTwoPtsToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point1 = point1;\n constraintOptions.point2 = point2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromTwoPtsToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the two points\n bitbybit.draw.drawAnyAsync({ entity: [point1] });\n bitbybit.draw.drawAnyAsync({ entity: [point2] });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Constraint tangent lines from two points to circle" /> @@ -77,21 +77,21 @@ This operation is commonly used in architectural drawings when you need to creat circlepointtangentLinescircle4000010point807tangentLinescirclepoint1e-7'all''none'tangentLinescirclepoint","version":"0.20.7","type":"blockly"}} + script={{"script":"circlepointtangentLinescircle4000010point807tangentLinescirclepoint1e-7'all''none'tangentLinescirclepoint","version":"0.20.8","type":"blockly"}} title="Constraint tangent lines from point to circle" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [8, 0, 7];\n\n // Create constraint options for tangent lines from point to circle\n const constraintOptions = new ConstraintTanLinesFromPtToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromPtToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanLinesFromPtToCircleDto, positionResultEnum, circleInclusionEnum } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [8, 0, 7];\n\n // Create constraint options for tangent lines from point to circle\n const constraintOptions = new ConstraintTanLinesFromPtToCircleDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainder = circleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesFromPtToCircle(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Constraint tangent lines from point to circle" /> @@ -107,21 +107,21 @@ This is especially valuable in gear design, pulley systems, or any mechanical ap circle1circle2tangentLinescircle13000010circle22700010tangentLinescircle1circle21e-7'all''none'tangentLinescircle1circle2","version":"0.20.7","type":"blockly"}} + script={{"script":"circle1circle2tangentLinescircle13000010circle22700010tangentLinescircle1circle21e-7'all''none'tangentLinescircle1circle2","version":"0.20.8","type":"blockly"}} title="Constraint tangent lines on two circles" /> {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 2;\n circle2Options.center = [7, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent lines between two circles\n const constraintOptions = new ConstraintTanLinesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainders = twoCircleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesOnTwoCircles(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanLinesOnTwoCirclesDto, positionResultEnum, twoCircleInclusionEnum } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 2;\n circle2Options.center = [7, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent lines between two circles\n const constraintOptions = new ConstraintTanLinesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.positionResult = positionResultEnum.all;\n constraintOptions.circleRemainders = twoCircleInclusionEnum.none;\n\n // Create the constraint tangent lines\n const tangentLines = await bitbybit.occt.shapes.edge.constraintTanLinesOnTwoCircles(constraintOptions);\n\n // Draw the tangent lines\n bitbybit.draw.drawAnyAsync({ entity: tangentLines });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Constraint tangent lines on two circles" /> @@ -138,21 +138,21 @@ This is particularly useful for creating buffer zones around existing circular f circle1circle2tangentCirclescircle13000010circle21.5500010tangentCirclescircle1circle21e-70.8tangentCirclescircle1circle2","version":"0.20.7","type":"blockly"}} + script={{"script":"circle1circle2tangentCirclescircle13000010circle21.5500010tangentCirclescircle1circle21e-70.8tangentCirclescircle1circle2","version":"0.20.8","type":"blockly"}} title="Constraint tangent circles on two circles" /> {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 1.5;\n circle2Options.center = [5, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent circles between two circles\n const constraintOptions = new ConstraintTanCirclesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 0.8;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnTwoCircles(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanCirclesOnTwoCirclesDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create first circle edge\n const circle1Options = new CircleDto();\n circle1Options.radius = 3;\n circle1Options.center = [0, 0, 0] as Point3;\n circle1Options.direction = [0, 1, 0] as Vector3;\n\n const circle1 = await bitbybit.occt.shapes.edge.createCircleEdge(circle1Options);\n\n // Create second circle edge\n const circle2Options = new CircleDto();\n circle2Options.radius = 1.5;\n circle2Options.center = [5, 0, 0] as Point3;\n circle2Options.direction = [0, 1, 0] as Vector3;\n\n const circle2 = await bitbybit.occt.shapes.edge.createCircleEdge(circle2Options);\n\n // Create constraint options for tangent circles between two circles\n const constraintOptions = new ConstraintTanCirclesOnTwoCirclesDto();\n constraintOptions.circle1 = circle1;\n constraintOptions.circle2 = circle2;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 0.8;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnTwoCircles(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the first circle\n bitbybit.draw.drawAnyAsync({ entity: circle1 });\n // Draw the second circle\n bitbybit.draw.drawAnyAsync({ entity: circle2 });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Constraint tangent circles on two circles" /> @@ -169,21 +169,21 @@ This constraint is perfect for creating rounded transitions in designs where you circlepointtangentCirclescircle3000010point400tangentCirclescirclepoint1e-72tangentCirclescirclepoint","version":"0.20.7","type":"blockly"}} + script={{"script":"circlepointtangentCirclescircle3000010point400tangentCirclescirclepoint1e-72tangentCirclescirclepoint","version":"0.20.8","type":"blockly"}} title="Constraint tangent circles on circle and point" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [4, 0, 0];\n\n // Create constraint options for tangent circles between circle and point\n const constraintOptions = new ConstraintTanCirclesOnCircleAndPntDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 2;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnCircleAndPnt(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ConstraintTanCirclesOnCircleAndPntDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Define a point\n const point: Point3 = [4, 0, 0];\n\n // Create constraint options for tangent circles between circle and point\n const constraintOptions = new ConstraintTanCirclesOnCircleAndPntDto();\n constraintOptions.circle = circle;\n constraintOptions.point = point;\n constraintOptions.tolerance = 1e-7;\n constraintOptions.radius = 2;\n\n // Create the constraint tangent circles\n const tangentCircles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnCircleAndPnt(constraintOptions);\n\n // Draw the tangent circles\n bitbybit.draw.drawAnyAsync({ entity: tangentCircles });\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n // Draw the point\n bitbybit.draw.drawAnyAsync({ entity: point });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Constraint tangent circles on circle and point" /> diff --git a/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx b/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx index e39c5a46..7d7dc705 100644 --- a/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx +++ b/docs/learn/code/common/occt/shapes/edge/edge-indexes.mdx @@ -42,21 +42,21 @@ Below are examples in TypeScript, Blockly, and Rete that demonstrate creating a **TypeScript Example: Drawing Edge Indexes** {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOpt.drawEdgeIndexes = true;\n drawOpt.faceOpacity = 0.3;\n drawOpt.edgeOpacity = 0.3;\n drawOpt.edgeIndexHeight = 0.24\n\n bitbybit.draw.drawAnyAsync({\n entity: box,\n options: drawOpt\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const boxOpt = new Bit.Inputs.OCCT.BoxDto();\n boxOpt.width = 5;\n boxOpt.length = 8;\n boxOpt.height = 10;\n const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);\n\n const drawOpt = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n drawOpt.drawEdgeIndexes = true;\n drawOpt.faceOpacity = 0.3;\n drawOpt.edgeOpacity = 0.3;\n drawOpt.edgeIndexHeight = 0.24\n\n bitbybit.draw.drawAnyAsync({\n entity: box,\n options: drawOpt\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Edge Indexing" /> **Blockly Example: Drawing Edge Indexes** 58100000.30.3#ffffff#ff00002TRUETRUE0.01TRUE0.24#ff00ffFALSE0.06#0000ff","version":"0.20.7","type":"blockly"}} + script={{"script":"58100000.30.3#ffffff#ff00002TRUETRUE0.01TRUE0.24#ff00ffFALSE0.06#0000ff","version":"0.20.8","type":"blockly"}} title="Edge Indexing" /> **Rete Example: Drawing Edge Indexes** diff --git a/docs/learn/code/common/occt/shapes/edge/edge-primitives.md b/docs/learn/code/common/occt/shapes/edge/edge-primitives.md index befb86a9..7bbd8feb 100644 --- a/docs/learn/code/common/occt/shapes/edge/edge-primitives.md +++ b/docs/learn/code/common/occt/shapes/edge/edge-primitives.md @@ -48,21 +48,21 @@ Let's start with the most basic edge primitive - the line edge. startPointendPointstartPoint-500endPoint500startPointendPointstartPointendPoint","version":"0.20.7","type":"blockly"}} + script={{"script":"startPointendPointstartPoint-500endPoint500startPointendPointstartPointendPoint","version":"0.20.8","type":"blockly"}} title="Creating primitive solids" /> {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a line between the points\n const lineOptions = new LineDto();\n lineOptions.start = startPoint;\n lineOptions.end = endPoint;\n\n const line = await bitbybit.occt.shapes.edge.line(lineOptions);\n\n // Draw the line and points\n bitbybit.draw.drawAnyAsync({ entity: line });\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { LineDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Define the main function\nconst start = async () => {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a line between the points\n const lineOptions = new LineDto();\n lineOptions.start = startPoint;\n lineOptions.end = endPoint;\n\n const line = await bitbybit.occt.shapes.edge.line(lineOptions);\n\n // Draw the line and points\n bitbybit.draw.drawAnyAsync({ entity: line });\n bitbybit.draw.drawAnyAsync({ entity: startPoint });\n bitbybit.draw.drawAnyAsync({ entity: endPoint });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating primitive solids" /> @@ -88,21 +88,21 @@ This example demonstrates how to create a simple straight line edge in 3D space. startPointmidPointendPointstartPoint-500midPoint060endPoint500startPointmidPointendPointstartPointmidPointendPoint","version":"0.20.7","type":"blockly"}} + script={{"script":"startPointmidPointendPointstartPoint-500midPoint060endPoint500startPointmidPointendPointstartPointmidPointendPoint","version":"0.20.8","type":"blockly"}} title="Arc edge through 3 points" /> {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const midPoint: Point3 = [0, 6, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a arc between three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = startPoint;\n arcOptions.middle = midPoint;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughThreePoints(arcOptions);\n\n // Draw the arc and points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, midPoint, endPoint] });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { ArcEdgeThreePointsDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Define the main function\nconst start = async () => {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const midPoint: Point3 = [0, 6, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create a arc between three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = startPoint;\n arcOptions.middle = midPoint;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughThreePoints(arcOptions);\n\n // Draw the arc and points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, midPoint, endPoint] });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Arc edge through 3 points" /> @@ -128,21 +128,21 @@ This example shows how to create an arc edge that passes through three specific startPointvecEndPtendPointvectorstartPoint-500vecEndPt-230endPoint500vectorstartPointvecEndPtstartPointvectorendPointstartPointvecEndPtendPointstartPointvecEndPt","version":"0.20.7","type":"blockly"}} + script={{"script":"startPointvecEndPtendPointvectorstartPoint-500vecEndPt-230endPoint500vectorstartPointvecEndPtstartPointvectorendPointstartPointvecEndPtendPointstartPointvecEndPt","version":"0.20.8","type":"blockly"}} title="Arc edge from two points and tangent" /> {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const vecEndPt: Point3 = [-2, 3, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create tangent vector\n const vecOpt = new TwoVectorsDto();\n vecOpt.first = startPoint;\n vecOpt.second = vecEndPt;\n const vector = bitbybit.vector.sub(vecOpt) as Vector3;\n\n // Create an arc\n const arcOptions = new ArcEdgeTwoPointsTangentDto();\n arcOptions.start = startPoint;\n arcOptions.tangentVec = vector;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughTwoPointsAndTangent(arcOptions);\n\n // Draw the arc, points and tangent\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt, endPoint] });\n\n // When two points are provided Bitbybit draws them as a line segment\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt] });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { ArcEdgeTwoPointsTangentDto } = Bit.Inputs.OCCT;\nconst { TwoVectorsDto } = Bit.Inputs.Vector;\n\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n\n// Define the main function\nconst start = async () => {\n // Create start and end points\n const startPoint: Point3 = [-5, 0, 0];\n const vecEndPt: Point3 = [-2, 3, 0];\n const endPoint: Point3 = [5, 0, 0];\n\n // Create tangent vector\n const vecOpt = new TwoVectorsDto();\n vecOpt.first = startPoint;\n vecOpt.second = vecEndPt;\n const vector = bitbybit.vector.sub(vecOpt) as Vector3;\n\n // Create an arc\n const arcOptions = new ArcEdgeTwoPointsTangentDto();\n arcOptions.start = startPoint;\n arcOptions.tangentVec = vector;\n arcOptions.end = endPoint;\n\n const arc = await bitbybit.occt.shapes.edge.arcThroughTwoPointsAndTangent(arcOptions);\n\n // Draw the arc, points and tangent\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt, endPoint] });\n\n // When two points are provided Bitbybit draws them as a line segment\n bitbybit.draw.drawAnyAsync({ entity: [startPoint, vecEndPt] });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Arc edge from two points and tangent" /> @@ -169,21 +169,21 @@ This example demonstrates creating an arc using two endpoints and a tangent vect circlestartPointendPointcenterPointarccircle5000010startPoint800endPoint808centerPoint000arccirclestartPointendPointTRUEarccenterPointstartPointcenterPointendPointstartPointcenterPointendPoint","version":"0.20.7","type":"blockly"}} + script={{"script":"circlestartPointendPointcenterPointarccircle5000010startPoint800endPoint808centerPoint000arccirclestartPointendPointTRUEarccenterPointstartPointcenterPointendPointstartPointcenterPointendPoint","version":"0.20.8","type":"blockly"}} title="Arc edge from circle and two points" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create start and end points for the arc\n const startPoint: Point3 = [8, 0, 0];\n const endPoint: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle and two points\n const arcOptions = new ArcEdgeCircleTwoPointsDto();\n arcOptions.circle = circle;\n arcOptions.start = startPoint;\n arcOptions.end = endPoint;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoPoints(arcOptions);\n // Draw the arc and helper points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [endPoint, centerPoint, startPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, endPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, startPoint] });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ArcEdgeCircleTwoPointsDto } = Bit.Inputs.OCCT;\n// Import required types\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create start and end points for the arc\n const startPoint: Point3 = [8, 0, 0];\n const endPoint: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle and two points\n const arcOptions = new ArcEdgeCircleTwoPointsDto();\n arcOptions.circle = circle;\n arcOptions.start = startPoint;\n arcOptions.end = endPoint;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoPoints(arcOptions);\n // Draw the arc and helper points\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [endPoint, centerPoint, startPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, endPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, startPoint] });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Arc edge from circle and two points" /> @@ -211,21 +211,21 @@ This example shows how to create an arc by extracting a portion of an existing c 500001045270TRUE","version":"0.20.7","type":"blockly"}} + script={{"script":"500001045270TRUE","version":"0.20.8","type":"blockly"}} title="Arc edge from circle and two points" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create arc from circle and two angles\n const arcOptions = new ArcEdgeCircleTwoAnglesDto();\n arcOptions.circle = circle;\n arcOptions.alphaAngle1 = 45;\n arcOptions.alphaAngle2 = 270;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoAngles(arcOptions);\n\n // Draw the arc\n bitbybit.draw.drawAnyAsync({ entity: arc });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ArcEdgeCircleTwoAnglesDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create arc from circle and two angles\n const arcOptions = new ArcEdgeCircleTwoAnglesDto();\n arcOptions.circle = circle;\n arcOptions.alphaAngle1 = 45;\n arcOptions.alphaAngle2 = 270;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoAngles(arcOptions);\n\n // Draw the arc\n bitbybit.draw.drawAnyAsync({ entity: arc });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Arc edge from circle and two angles" /> @@ -252,21 +252,21 @@ This example demonstrates creating an arc by specifying a base circle and two an circlepointcenterPointarccircle5000010point808centerPoint000arccirclepoint360TRUEarccenterPointpointcenterPointpoint","version":"0.20.7","type":"blockly"}} + script={{"script":"circlepointcenterPointarccircle5000010point808centerPoint000arccirclepoint360TRUEarccenterPointpointcenterPointpoint","version":"0.20.8","type":"blockly"}} title="Arc edge from circle point and an angle" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create a point on the circle\n const point: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle, point and angle\n const arcOptions = new ArcEdgeCirclePointAngleDto();\n arcOptions.circle = circle;\n arcOptions.point = point;\n arcOptions.alphaAngle = 360;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCirclePointAndAngle(arcOptions);\n\n // Draw the arc and helper elements\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, point] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [point] });\n\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto, ArcEdgeCirclePointAngleDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Create a point on the circle\n const point: Point3 = [8, 0, 8];\n const centerPoint: Point3 = [0, 0, 0];\n\n // Create arc from circle, point and angle\n const arcOptions = new ArcEdgeCirclePointAngleDto();\n arcOptions.circle = circle;\n arcOptions.point = point;\n arcOptions.alphaAngle = 360;\n arcOptions.sense = true;\n\n const arc = await bitbybit.occt.shapes.edge.arcFromCirclePointAndAngle(arcOptions);\n\n // Draw the arc and helper elements\n bitbybit.draw.drawAnyAsync({ entity: arc });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint, point] });\n bitbybit.draw.drawAnyAsync({ entity: [centerPoint] });\n bitbybit.draw.drawAnyAsync({ entity: [point] });\n\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Arc edge from circle point and an angle" /> @@ -294,21 +294,21 @@ This example shows how to create an arc starting from a specific point on a circ 5000010","version":"0.20.7","type":"blockly"}} + script={{"script":"5000010","version":"0.20.8","type":"blockly"}} title="Circle edge" /> {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { CircleDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Create a circle edge\n const circleOptions = new CircleDto();\n circleOptions.radius = 5;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circle = await bitbybit.occt.shapes.edge.createCircleEdge(circleOptions);\n\n // Draw the circle\n bitbybit.draw.drawAnyAsync({ entity: circle });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Circle edge" /> @@ -335,21 +335,21 @@ This example demonstrates creating a complete circular edge, which is one of the 000010310","version":"0.20.7","type":"blockly"}} + script={{"script":"000010310","version":"0.20.8","type":"blockly"}} title="Ellipse edge" /> {\n // Create an ellipse edge\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 3;\n ellipseOptions.radiusMajor = 10;\n\n const ellipse = await bitbybit.occt.shapes.edge.createEllipseEdge(ellipseOptions);\n\n // Draw the ellipse\n bitbybit.draw.drawAnyAsync({ entity: ellipse });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { EllipseDto } = Bit.Inputs.OCCT;\n// Import required types\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Create an ellipse edge\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 3;\n ellipseOptions.radiusMajor = 10;\n\n const ellipse = await bitbybit.occt.shapes.edge.createEllipseEdge(ellipseOptions);\n\n // Draw the ellipse\n bitbybit.draw.drawAnyAsync({ entity: ellipse });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Ellipse edge" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md b/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md index a4677480..2be234c3 100644 --- a/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md +++ b/docs/learn/code/common/occt/shapes/face/face-basic-primitives.md @@ -26,21 +26,21 @@ Think of wires as the frame of a window, and faces as the glass that fills the f circleFacesquareFacerectangleFaceellipseFacecircleFace4000010squareFace3700010rectangleFace37-700010ellipseFace00-901013circleFacesquareFacerectangleFaceellipseFace","version":"0.20.7","type":"blockly"}} + script={{"script":"circleFacesquareFacerectangleFaceellipseFacecircleFace4000010squareFace3700010rectangleFace37-700010ellipseFace00-901013circleFacesquareFacerectangleFaceellipseFace","version":"0.20.8","type":"blockly"}} title="Creating basic face primitives" /> {\n // Create a circle face\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleFace = await face.createCircleFace(circleOptions);\n\n // Create a square face at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [7, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareFace = await face.createSquareFace(squareOptions);\n\n // Create a rectangle face\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 3;\n rectangleOptions.length = 7;\n rectangleOptions.center = [-7, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create an ellipse face\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, -9] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 3;\n\n const ellipseFace = await face.createEllipseFace(ellipseOptions);\n\n // Draw all the created faces\n bitbybit.draw.drawAnyAsync({ entity: circleFace });\n bitbybit.draw.drawAnyAsync({ entity: squareFace });\n bitbybit.draw.drawAnyAsync({ entity: rectangleFace });\n bitbybit.draw.drawAnyAsync({ entity: ellipseFace });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for face creation\nconst { CircleDto, SquareDto, RectangleDto, EllipseDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT face creation functions\nconst { face } = bitbybit.occt.shapes;\n\n// Define the main function to create various primitive faces\nconst start = async () => {\n // Create a circle face\n const circleOptions = new CircleDto();\n circleOptions.radius = 4;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleFace = await face.createCircleFace(circleOptions);\n\n // Create a square face at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [7, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareFace = await face.createSquareFace(squareOptions);\n\n // Create a rectangle face\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 3;\n rectangleOptions.length = 7;\n rectangleOptions.center = [-7, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create an ellipse face\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [0, 0, -9] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 3;\n\n const ellipseFace = await face.createEllipseFace(ellipseOptions);\n\n // Draw all the created faces\n bitbybit.draw.drawAnyAsync({ entity: circleFace });\n bitbybit.draw.drawAnyAsync({ entity: squareFace });\n bitbybit.draw.drawAnyAsync({ entity: rectangleFace });\n bitbybit.draw.drawAnyAsync({ entity: ellipseFace });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating basic face primitives" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-from-points.md b/docs/learn/code/common/occt/shapes/face/face-from-points.md index e2dd4be0..33278bae 100644 --- a/docs/learn/code/common/occt/shapes/face/face-from-points.md +++ b/docs/learn/code/common/occt/shapes/face/face-from-points.md @@ -28,21 +28,21 @@ This example demonstrates creating a quadrilateral face from four strategically point1point2point3point4pointsListpolygonFacepoint1-30-8point2-303point3303point4500pointsListpoint1point2point3point4polygonFacepointsListpolygonFacepointsList","version":"0.20.7","type":"blockly"}} + script={{"script":"point1point2point3point4pointsListpolygonFacepoint1-30-8point2-303point3303point4500pointsListpoint1point2point3point4polygonFacepointsListpolygonFacepointsList","version":"0.20.8","type":"blockly"}} title="Creating face from points" /> {\n // Define the four points that will form the polygon face\n const point1: Point3 = [-3, 0, -8];\n const point2: Point3 = [-3, 0, 3];\n const point3: Point3 = [3, 0, 3];\n const point4: Point3 = [5, 0, 0];\n\n // Create a list of points in the correct order\n const points: Point3[] = [point1, point2, point3, point4];\n\n // Create the polygon face options\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n\n // Create the polygon face from the points\n const polygonFace = await face.createPolygonFace(polygonOptions);\n\n // Draw the polygon face\n bitbybit.draw.drawAnyAsync({ entity: polygonFace });\n\n // Optionally, draw the points to visualize the vertices\n bitbybit.draw.drawAnyAsync({ entity: points });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for polygon face creation\nconst { PolygonDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\n\n// Get access to OCCT face creation functions\nconst { face } = bitbybit.occt.shapes;\n\n// Define the main function to create a polygon face from points\nconst start = async () => {\n // Define the four points that will form the polygon face\n const point1: Point3 = [-3, 0, -8];\n const point2: Point3 = [-3, 0, 3];\n const point3: Point3 = [3, 0, 3];\n const point4: Point3 = [5, 0, 0];\n\n // Create a list of points in the correct order\n const points: Point3[] = [point1, point2, point3, point4];\n\n // Create the polygon face options\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n\n // Create the polygon face from the points\n const polygonFace = await face.createPolygonFace(polygonOptions);\n\n // Draw the polygon face\n bitbybit.draw.drawAnyAsync({ entity: polygonFace });\n\n // Optionally, draw the points to visualize the vertices\n bitbybit.draw.drawAnyAsync({ entity: points });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating face from points" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-from-wire.md b/docs/learn/code/common/occt/shapes/face/face-from-wire.md index 32cf9a23..37b8ee55 100644 --- a/docs/learn/code/common/occt/shapes/face/face-from-wire.md +++ b/docs/learn/code/common/occt/shapes/face/face-from-wire.md @@ -36,21 +36,21 @@ This example demonstrates creating a star-shaped face from a reversed wire to co starWirereversedWirefaceFromWirestarWire0000107730FALSEreversedWirestarWirefaceFromWirereversedWireTRUEfaceFromWire","version":"0.20.7","type":"blockly"}} + script={{"script":"starWirereversedWirefaceFromWirestarWire0000107730FALSEreversedWirestarWirefaceFromWirereversedWireTRUEfaceFromWire","version":"0.20.8","type":"blockly"}} title="Creating face from wire" /> {\n // Create a star wire\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 7;\n starOptions.outerRadius = 7;\n starOptions.innerRadius = 3;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Reverse the wire orientation\n const reversedWire = await wire.reversedWire({ shape: starWire });\n\n // Create a face from the reversed wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = reversedWire;\n faceOptions.planar = true;\n\n const faceFromWire = await face.createFaceFromWire(faceOptions);\n\n // Draw the created face\n bitbybit.draw.drawAnyAsync({ entity: faceFromWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for wire and face creation\nconst { StarDto, FaceFromWireDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\n\n// Get access to OCCT wire and face creation functions\nconst { wire, face } = bitbybit.occt.shapes;\n\n// Define the main function to create a face from a wire\nconst start = async () => {\n // Create a star wire\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 7;\n starOptions.outerRadius = 7;\n starOptions.innerRadius = 3;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Reverse the wire orientation\n const reversedWire = await wire.reversedWire({ shape: starWire });\n\n // Create a face from the reversed wire\n const faceOptions = new FaceFromWireDto();\n faceOptions.shape = reversedWire;\n faceOptions.planar = true;\n\n const faceFromWire = await face.createFaceFromWire(faceOptions);\n\n // Draw the created face\n bitbybit.draw.drawAnyAsync({ entity: faceFromWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating face from wire" /> diff --git a/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md b/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md index 478a0985..4b814f85 100644 --- a/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md +++ b/docs/learn/code/common/occt/shapes/face/face-hex-grid-pattern.md @@ -23,21 +23,21 @@ Learn how to create hexagonal face patterns that respond to a control point. Hex gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointUcontrolPointVrectangleFacecontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatterndistancescaledValueinclusionPatternhexagonFacesaffectorPointpingridWidth16.5gridHeight9hexagonsInWidth29hexagonsInHeight29controlPointU0controlPointV0.49rectangleFacegridWidthgridHeight000010controlPointrectangleFacecontrolPointUcontrolPointVhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.2110.9INSERTLASTscalePatternscaledValueinclusionPattern[true, true, true, true, false]hexagonFacesgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternaffectorPointcontrolPoint030pincontrolPointaffectorPoint0010.1Affector0.30.1hexagonFacespincontrolPoint","version":"0.20.7","type":"blockly"}} + script={{"script":"gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointUcontrolPointVrectangleFacecontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatterndistancescaledValueinclusionPatternhexagonFacesaffectorPointpingridWidth16.5gridHeight9hexagonsInWidth29hexagonsInHeight29controlPointU0controlPointV0.49rectangleFacegridWidthgridHeight000010controlPointrectangleFacecontrolPointUcontrolPointVhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.2110.9INSERTLASTscalePatternscaledValueinclusionPattern[true, true, true, true, false]hexagonFacesgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternaffectorPointcontrolPoint030pincontrolPointaffectorPoint0010.1Affector0.30.1hexagonFacespincontrolPoint","version":"0.20.8","type":"blockly"}} title="Creating face from wire" /> {\n // Define grid parameters\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 29;\n const hexagonsInHeight = 29;\n const controlPointU = 0; // UV parameter for control point position\n const controlPointV = 0.49; // UV parameter for control point position\n\n // Create a reference rectangle face to define the control point\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = gridWidth;\n rectangleOptions.length = gridHeight;\n rectangleOptions.center = [0, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create control point on the rectangle face using UV parameters\n const pointOnUVOptions = new DataOnUVDto();\n pointOnUVOptions.shape = rectangleFace;\n pointOnUVOptions.paramU = controlPointU;\n pointOnUVOptions.paramV = controlPointV;\n\n const controlPoint = await face.pointOnUV(pointOnUVOptions);\n\n // Generate hexagon grid centers for distance calculation\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid = point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hexagon centers\n const distances = point.distancesToPoints({\n startPoint: controlPoint,\n endPoints: hexCenters\n });\n\n // Flatten the distance array and find min/max values\n const minDistance = vector.min({ vector: distances });\n const maxDistance = vector.max({ vector: distances });\n\n // Remap distances to scale factors (0.211 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.211;\n remapOptions.toHigh = 0.9;\n\n const scalePattern = distances.map(x => {\n remapOptions.number = x;\n return math.remap(remapOptions);\n })\n\n // Create inclusion pattern for selective hexagon removal\n const inclusionPattern = json.parse({ text: \"[true, true, true, true, false]\" });\n\n // Create the hexagon faces with advanced patterns\n const hexFaceOptions = new HexagonsInGridDto();\n hexFaceOptions.width = gridWidth;\n hexFaceOptions.height = gridHeight;\n hexFaceOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexFaceOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexFaceOptions.flatTop = true;\n hexFaceOptions.extendTop = false;\n hexFaceOptions.extendBottom = false;\n hexFaceOptions.extendLeft = false;\n hexFaceOptions.extendRight = false;\n hexFaceOptions.scalePatternWidth = scalePattern;\n hexFaceOptions.scalePatternHeight = scalePattern;\n hexFaceOptions.inclusionPattern = inclusionPattern;\n\n const hexagonFaces = await face.hexagonsInGrid(hexFaceOptions);\n\n // Create affector point visualization (control point elevated)\n const affectorPoint = vector.add({\n first: controlPoint,\n second: [0, 3, 0] as Vector3\n }) as Point3;\n\n // Create pin with label to show the affector point\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = controlPoint;\n pinOptions.endPoint = affectorPoint;\n pinOptions.direction = [0, 0, 1] as Vector3;\n pinOptions.offsetFromStart = 0.1;\n pinOptions.label = \"Affector\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.1;\n\n const pin = await dimensions.pinWithLabel(pinOptions);\n\n // Draw the hexagon faces and affector pin\n bitbybit.draw.drawAnyAsync({ entity: hexagonFaces });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n\n // Optional: Draw the control point for reference\n bitbybit.draw.drawAnyAsync({\n entity: controlPoint,\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for face hexagon grid creation\nconst { HexagonsInGridDto, RectangleDto, DataOnUVDto, PinWithLabelDto } = Bit.Inputs.OCCT;\nconst { HexGridScaledToFitDto } = Bit.Inputs.Point;\nconst { RemapNumberDto } = Bit.Inputs.Math;\nconst { HexGridData } = Bit.Models.Point;\n\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\n\n// Get access to OCCT face, point, and utility functions\nconst { face } = bitbybit.occt.shapes;\nconst { point } = bitbybit;\nconst { math, vector, json, lists } = bitbybit;\nconst { dimensions } = bitbybit.occt;\n\n// Define the main function to create advanced hexagon face pattern\nconst start = async () => {\n // Define grid parameters\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 29;\n const hexagonsInHeight = 29;\n const controlPointU = 0; // UV parameter for control point position\n const controlPointV = 0.49; // UV parameter for control point position\n\n // Create a reference rectangle face to define the control point\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = gridWidth;\n rectangleOptions.length = gridHeight;\n rectangleOptions.center = [0, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleFace = await face.createRectangleFace(rectangleOptions);\n\n // Create control point on the rectangle face using UV parameters\n const pointOnUVOptions = new DataOnUVDto();\n pointOnUVOptions.shape = rectangleFace;\n pointOnUVOptions.paramU = controlPointU;\n pointOnUVOptions.paramV = controlPointV;\n\n const controlPoint = await face.pointOnUV(pointOnUVOptions);\n\n // Generate hexagon grid centers for distance calculation\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid = point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hexagon centers\n const distances = point.distancesToPoints({\n startPoint: controlPoint,\n endPoints: hexCenters\n });\n\n // Flatten the distance array and find min/max values\n const minDistance = vector.min({ vector: distances });\n const maxDistance = vector.max({ vector: distances });\n\n // Remap distances to scale factors (0.211 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.211;\n remapOptions.toHigh = 0.9;\n\n const scalePattern = distances.map(x => {\n remapOptions.number = x;\n return math.remap(remapOptions);\n })\n\n // Create inclusion pattern for selective hexagon removal\n const inclusionPattern = json.parse({ text: \"[true, true, true, true, false]\" });\n\n // Create the hexagon faces with advanced patterns\n const hexFaceOptions = new HexagonsInGridDto();\n hexFaceOptions.width = gridWidth;\n hexFaceOptions.height = gridHeight;\n hexFaceOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexFaceOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexFaceOptions.flatTop = true;\n hexFaceOptions.extendTop = false;\n hexFaceOptions.extendBottom = false;\n hexFaceOptions.extendLeft = false;\n hexFaceOptions.extendRight = false;\n hexFaceOptions.scalePatternWidth = scalePattern;\n hexFaceOptions.scalePatternHeight = scalePattern;\n hexFaceOptions.inclusionPattern = inclusionPattern;\n\n const hexagonFaces = await face.hexagonsInGrid(hexFaceOptions);\n\n // Create affector point visualization (control point elevated)\n const affectorPoint = vector.add({\n first: controlPoint,\n second: [0, 3, 0] as Vector3\n }) as Point3;\n\n // Create pin with label to show the affector point\n const pinOptions = new PinWithLabelDto();\n pinOptions.startPoint = controlPoint;\n pinOptions.endPoint = affectorPoint;\n pinOptions.direction = [0, 0, 1] as Vector3;\n pinOptions.offsetFromStart = 0.1;\n pinOptions.label = \"Affector\";\n pinOptions.labelOffset = 0.3;\n pinOptions.labelSize = 0.1;\n\n const pin = await dimensions.pinWithLabel(pinOptions);\n\n // Draw the hexagon faces and affector pin\n bitbybit.draw.drawAnyAsync({ entity: hexagonFaces });\n bitbybit.draw.drawAnyAsync({ entity: pin });\n\n // Optional: Draw the control point for reference\n bitbybit.draw.drawAnyAsync({\n entity: controlPoint,\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating face from wire" /> diff --git a/docs/learn/code/common/occt/shapes/shells/intro-shells.md b/docs/learn/code/common/occt/shapes/shells/intro-shells.md index 255196bc..2c6465fd 100644 --- a/docs/learn/code/common/occt/shapes/shells/intro-shells.md +++ b/docs/learn/code/common/occt/shapes/shells/intro-shells.md @@ -40,21 +40,21 @@ This first example demonstrates the fundamental concept of shell creation by sew sizeface1face2rotatedFace2translatedFace2facesshellsize5face1size000010face2size000010rotatedFace2face200190translatedFace2rotatedFace2DIVIDEsize2DIVIDEsize20facesface1translatedFace2shellfaces0.0000001shell","version":"0.20.7","type":"blockly"}} + script={{"script":"sizeface1face2rotatedFace2translatedFace2facesshellsize5face1size000010face2size000010rotatedFace2face200190translatedFace2rotatedFace2DIVIDEsize2DIVIDEsize20facesface1translatedFace2shellfaces0.0000001shell","version":"0.20.8","type":"blockly"}} title="Creating shells by sewing two square faces" /> {\n // Define the size for both square faces\n const size = 5;\n\n // Create first square face at origin\n const face1Options = new SquareDto();\n face1Options.size = size;\n face1Options.center = [0, 0, 0] as Point3;\n face1Options.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const face1 = await face.createSquareFace(face1Options);\n\n // Create second square face (initially identical to first)\n const face2Options = new SquareDto();\n face2Options.size = size;\n face2Options.center = [0, 0, 0] as Point3;\n face2Options.direction = [0, 1, 0] as Vector3;\n\n const face2 = await face.createSquareFace(face2Options);\n\n // Rotate the second face 90 degrees around Z-axis to create perpendicular orientation\n const rotateOptions = new RotateDto();\n rotateOptions.shape = face2;\n rotateOptions.axis = [0, 0, 1] as Vector3; // Z-axis\n rotateOptions.angle = 90; // 90 degrees\n\n const rotatedFace2 = await transforms.rotate(rotateOptions);\n\n // Translate the rotated face to share an edge with the first face\n const translateOptions = new TranslateDto();\n translateOptions.shape = rotatedFace2;\n translateOptions.translation = [size / 2, size / 2, 0] as Vector3;\n\n const translatedFace2 = await transforms.translate(translateOptions);\n\n // Create array of faces to sew together\n const faces = [face1, translatedFace2];\n\n // Sew the faces together to create a shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // Very tight tolerance for precise sewing\n\n const resultShell = await shell.sewFaces(sewOptions);\n\n // Verify that we created a shell (not just individual faces)\n const shapeType = await shape.getShapeType({ shape: resultShell });\n console.log('Shell shape type:', shapeType); // Should output \"shell\"\n\n // Draw the resulting shell\n bitbybit.draw.drawAnyAsync({\n entity: resultShell\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating faces, shells, and transformations\nconst { SquareDto, SewDto, RotateDto, TranslateDto } = Bit.Inputs.OCCT;\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShellPointer = Bit.Inputs.OCCT.TopoDSShellPointer;\n\n// Get access to OCCT modules and utility functions\nconst { face, shell, shape } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\n\n// Define the main function to create a simple shell from two faces\nconst start = async () => {\n // Define the size for both square faces\n const size = 5;\n\n // Create first square face at origin\n const face1Options = new SquareDto();\n face1Options.size = size;\n face1Options.center = [0, 0, 0] as Point3;\n face1Options.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const face1 = await face.createSquareFace(face1Options);\n\n // Create second square face (initially identical to first)\n const face2Options = new SquareDto();\n face2Options.size = size;\n face2Options.center = [0, 0, 0] as Point3;\n face2Options.direction = [0, 1, 0] as Vector3;\n\n const face2 = await face.createSquareFace(face2Options);\n\n // Rotate the second face 90 degrees around Z-axis to create perpendicular orientation\n const rotateOptions = new RotateDto();\n rotateOptions.shape = face2;\n rotateOptions.axis = [0, 0, 1] as Vector3; // Z-axis\n rotateOptions.angle = 90; // 90 degrees\n\n const rotatedFace2 = await transforms.rotate(rotateOptions);\n\n // Translate the rotated face to share an edge with the first face\n const translateOptions = new TranslateDto();\n translateOptions.shape = rotatedFace2;\n translateOptions.translation = [size / 2, size / 2, 0] as Vector3;\n\n const translatedFace2 = await transforms.translate(translateOptions);\n\n // Create array of faces to sew together\n const faces = [face1, translatedFace2];\n\n // Sew the faces together to create a shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // Very tight tolerance for precise sewing\n\n const resultShell = await shell.sewFaces(sewOptions);\n\n // Verify that we created a shell (not just individual faces)\n const shapeType = await shape.getShapeType({ shape: resultShell });\n console.log('Shell shape type:', shapeType); // Should output \"shell\"\n\n // Draw the resulting shell\n bitbybit.draw.drawAnyAsync({\n entity: resultShell\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating shells by sewing two square faces" /> @@ -81,21 +81,21 @@ While this cylindrical solid **can be constructed in Bitbybit using the simple s radiusheightcircleWireextrusionVectorcylindricalSurfacebottomFacetopFacefacesshellsolidradius5height5circleWireradius000010extrusionVector0height0cylindricalSurfacecircleWireextrusionVectorbottomFacecircleWireTRUEtopFacebottomFaceextrusionVectorfacestopFacecylindricalSurfacebottomFaceshellfaces1e-7solidshellsolid","version":"0.20.7","type":"blockly"}} + script={{"script":"radiusheightcircleWireextrusionVectorcylindricalSurfacebottomFacetopFacefacesshellsolidradius5height5circleWireradius000010extrusionVector0height0cylindricalSurfacecircleWireextrusionVectorbottomFacecircleWireTRUEtopFacebottomFaceextrusionVectorfacestopFacecylindricalSurfacebottomFaceshellfaces1e-7solidshellsolid","version":"0.20.8","type":"blockly"}} title="Creating closed shells and converting to solids" /> {\n // Define geometric parameters\n const radius = 5;\n const height = 5;\n\n // Step 1: Create base circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = radius;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Step 2: Create extrusion vector for cylindrical surface\n const extrusionVector: Vector3 = [0, height, 0];\n\n // Step 3: Create cylindrical surface by extruding the circle wire\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = circleWire;\n extrudeOptions.direction = extrusionVector;\n\n const cylindricalSurface = await operations.extrude(extrudeOptions);\n\n // Step 4: Create bottom face from the circle wire\n const bottomFaceOptions = new FaceFromWireDto();\n bottomFaceOptions.shape = circleWire;\n bottomFaceOptions.planar = true; // Ensure flat circular face\n\n const bottomFace = await face.createFaceFromWire(bottomFaceOptions);\n\n // Step 5: Create top face by translating bottom face\n const translateOptions = new TranslateDto();\n translateOptions.shape = bottomFace;\n translateOptions.translation = extrusionVector;\n\n const topFace = await transforms.translate(translateOptions);\n\n // Step 6: Collect all faces that will form the closed shell\n const faces = [topFace, cylindricalSurface, bottomFace];\n\n // Step 7: Sew faces together to create a closed shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // High precision for closed shell\n\n const closedShell = await shell.sewFaces(sewOptions);\n\n // Step 8: Convert closed shell to solid\n const solidOptions = new ShapeDto();\n solidOptions.shape = closedShell;\n\n const cylinderSolid = await solid.fromClosedShell(solidOptions);\n\n // Step 9: Verify the shape types\n const shellType = await shape.getShapeType({ shape: closedShell });\n const solidType = await shape.getShapeType({ shape: cylinderSolid });\n\n console.log('Shell type:', shellType); // Should output \"shell\"\n console.log('Solid type:', solidType); // Should output \"solid\"\n\n // Step 10: Draw the final solid\n bitbybit.draw.drawAnyAsync({\n entity: cylinderSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs for creating complex geometries\nconst { CircleDto, FaceFromWireDto, ShapeDto, SewDto, ExtrudeDto, TranslateDto } = Bit.Inputs.OCCT;\n\n// Import type definitions for type safety\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype TopoDSFacePointer = Bit.Inputs.OCCT.TopoDSFacePointer;\ntype TopoDSShellPointer = Bit.Inputs.OCCT.TopoDSShellPointer;\n\n// Get access to OCCT modules and utility functions\nconst { wire, face, shell, solid, shape } = bitbybit.occt.shapes;\nconst { operations, transforms } = bitbybit.occt;\n\n// Define the main function to create a complex shell and convert to solid\nconst start = async () => {\n // Define geometric parameters\n const radius = 5;\n const height = 5;\n\n // Step 1: Create base circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = radius;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3; // Y-up orientation\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Step 2: Create extrusion vector for cylindrical surface\n const extrusionVector: Vector3 = [0, height, 0];\n\n // Step 3: Create cylindrical surface by extruding the circle wire\n const extrudeOptions = new ExtrudeDto();\n extrudeOptions.shape = circleWire;\n extrudeOptions.direction = extrusionVector;\n\n const cylindricalSurface = await operations.extrude(extrudeOptions);\n\n // Step 4: Create bottom face from the circle wire\n const bottomFaceOptions = new FaceFromWireDto();\n bottomFaceOptions.shape = circleWire;\n bottomFaceOptions.planar = true; // Ensure flat circular face\n\n const bottomFace = await face.createFaceFromWire(bottomFaceOptions);\n\n // Step 5: Create top face by translating bottom face\n const translateOptions = new TranslateDto();\n translateOptions.shape = bottomFace;\n translateOptions.translation = extrusionVector;\n\n const topFace = await transforms.translate(translateOptions);\n\n // Step 6: Collect all faces that will form the closed shell\n const faces = [topFace, cylindricalSurface, bottomFace];\n\n // Step 7: Sew faces together to create a closed shell\n const sewOptions = new SewDto(faces);\n sewOptions.tolerance = 1e-7; // High precision for closed shell\n\n const closedShell = await shell.sewFaces(sewOptions);\n\n // Step 8: Convert closed shell to solid\n const solidOptions = new ShapeDto();\n solidOptions.shape = closedShell;\n\n const cylinderSolid = await solid.fromClosedShell(solidOptions);\n\n // Step 9: Verify the shape types\n const shellType = await shape.getShapeType({ shape: closedShell });\n const solidType = await shape.getShapeType({ shape: cylinderSolid });\n\n console.log('Shell type:', shellType); // Should output \"shell\"\n console.log('Solid type:', solidType); // Should output \"solid\"\n\n // Step 10: Draw the final solid\n bitbybit.draw.drawAnyAsync({\n entity: cylinderSolid\n });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating closed shells and converting to solids" /> diff --git a/docs/learn/code/common/occt/shapes/solids/intro-solids.md b/docs/learn/code/common/occt/shapes/solids/intro-solids.md index ab256a6b..64140ef9 100644 --- a/docs/learn/code/common/occt/shapes/solids/intro-solids.md +++ b/docs/learn/code/common/occt/shapes/solids/intro-solids.md @@ -32,21 +32,21 @@ This example demonstrates the creation of the most common primitive solid types: boxcubecylindersphereconebox378000TRUEcube5500TRUEcylinder23-500010360TRUEsphere1.51000cone213360-1000010boxcubecylinderspherecone","version":"0.20.7","type":"blockly"}} + script={{"script":"boxcubecylindersphereconebox378000TRUEcube5500TRUEcylinder23-500010360TRUEsphere1.51000cone213360-1000010boxcubecylinderspherecone","version":"0.20.8","type":"blockly"}} title="Creating primitive solids" /> {\n // Create a rectangular box\n const boxOptions = new BoxDto();\n boxOptions.width = 3;\n boxOptions.length = 7;\n boxOptions.height = 8;\n boxOptions.center = [0, 0, 0] as Point3;\n boxOptions.originOnCenter = true;\n \n const box = await solid.createBox(boxOptions);\n \n // Create a cube at a different position\n const cubeOptions = new CubeDto();\n cubeOptions.size = 5;\n cubeOptions.center = [5, 0, 0] as Point3;\n cubeOptions.originOnCenter = true;\n \n const cube = await solid.createCube(cubeOptions);\n \n // Create a cylinder\n const cylinderOptions = new CylinderDto();\n cylinderOptions.radius = 2;\n cylinderOptions.height = 3;\n cylinderOptions.center = [-5, 0, 0] as Point3;\n cylinderOptions.direction = [0, 1, 0] as Vector3;\n cylinderOptions.angle = 360;\n cylinderOptions.originOnCenter = true;\n \n const cylinder = await solid.createCylinder(cylinderOptions);\n \n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 1.5;\n sphereOptions.center = [10, 0, 0] as Point3;\n \n const sphere = await solid.createSphere(sphereOptions);\n \n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = 3;\n coneOptions.angle = 360;\n coneOptions.center = [-10, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n \n const cone = await solid.createCone(coneOptions);\n \n // Draw all the created solids\n bitbybit.draw.drawAnyAsync({ entity: box });\n bitbybit.draw.drawAnyAsync({ entity: cube });\n bitbybit.draw.drawAnyAsync({ entity: cylinder });\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: cone });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for solid creation\nconst { BoxDto, CubeDto, CylinderDto, SphereDto, ConeDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT solid creation functions\nconst { solid } = bitbybit.occt.shapes;\n\n// Define the main function to create various primitive solids\nconst start = async () => {\n // Create a rectangular box\n const boxOptions = new BoxDto();\n boxOptions.width = 3;\n boxOptions.length = 7;\n boxOptions.height = 8;\n boxOptions.center = [0, 0, 0] as Point3;\n boxOptions.originOnCenter = true;\n \n const box = await solid.createBox(boxOptions);\n \n // Create a cube at a different position\n const cubeOptions = new CubeDto();\n cubeOptions.size = 5;\n cubeOptions.center = [5, 0, 0] as Point3;\n cubeOptions.originOnCenter = true;\n \n const cube = await solid.createCube(cubeOptions);\n \n // Create a cylinder\n const cylinderOptions = new CylinderDto();\n cylinderOptions.radius = 2;\n cylinderOptions.height = 3;\n cylinderOptions.center = [-5, 0, 0] as Point3;\n cylinderOptions.direction = [0, 1, 0] as Vector3;\n cylinderOptions.angle = 360;\n cylinderOptions.originOnCenter = true;\n \n const cylinder = await solid.createCylinder(cylinderOptions);\n \n // Create a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 1.5;\n sphereOptions.center = [10, 0, 0] as Point3;\n \n const sphere = await solid.createSphere(sphereOptions);\n \n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = 3;\n coneOptions.angle = 360;\n coneOptions.center = [-10, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n \n const cone = await solid.createCone(coneOptions);\n \n // Draw all the created solids\n bitbybit.draw.drawAnyAsync({ entity: box });\n bitbybit.draw.drawAnyAsync({ entity: cube });\n bitbybit.draw.drawAnyAsync({ entity: cylinder });\n bitbybit.draw.drawAnyAsync({ entity: sphere });\n bitbybit.draw.drawAnyAsync({ entity: cone });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating primitive solids" /> diff --git a/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md b/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md index dffd9762..5ef8d1c2 100644 --- a/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md +++ b/docs/learn/code/common/occt/shapes/solids/volume-and-surface-area.md @@ -32,21 +32,21 @@ The example shows a practical workflow for measuring and displaying geometric pr heightconevolumesurfaceArearoundedVolumeroundedSurfaceAreavolumeTextareaTextvolumePinareaPinheight5cone21height360000010volumeconesurfaceAreaconeroundedVolumevolume2roundedSurfaceAreasurfaceArea2volumeTextVolume {0} m3roundedVolumeareaTextArea {0} m3roundedSurfaceAreavolumePin0height01ADDheight301000volumeText0.30.3areaPin0height01ADDheight401000areaText0.30.3conevolumePinareaPin","version":"0.20.7","type":"blockly"}} + script={{"script":"heightconevolumesurfaceArearoundedVolumeroundedSurfaceAreavolumeTextareaTextvolumePinareaPinheight5cone21height360000010volumeconesurfaceAreaconeroundedVolumevolume2roundedSurfaceAreasurfaceArea2volumeTextVolume {0} m3roundedVolumeareaTextArea {0} m3roundedSurfaceAreavolumePin0height01ADDheight301000volumeText0.30.3areaPin0height01ADDheight401000areaText0.30.3conevolumePinareaPin","version":"0.20.8","type":"blockly"}} title="Get volume and surface area from solid" /> {\n // Parametric height value\n const height = 5;\n\n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = height;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n\n const cone = await solid.createCone(coneOptions);\n\n // Get volume and surface area\n const volume = await solid.getSolidVolume({ shape: cone });\n const surfaceArea = await solid.getSolidSurfaceArea({ shape: cone });\n\n // Round to 2 decimal places\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n const roundedSurfaceArea = math.roundToDecimals({ number: surfaceArea, decimalPlaces: 2 });\n\n // Format as text with units\n const volumeText = text.format({\n text: \"Volume {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n const areaText = text.format({\n text: \"Area {0} m2\",\n values: [text.toString({ item: roundedSurfaceArea })]\n });\n\n // Create pin labels to display the measurements\n const volumePinOptions = new PinWithLabelDto();\n volumePinOptions.startPoint = [0, height, 0] as Point3;\n volumePinOptions.endPoint = [1, height + 3, 0] as Point3;\n volumePinOptions.direction = [1, 0, 0] as Vector3;\n volumePinOptions.offsetFromStart = 0;\n volumePinOptions.label = volumeText;\n volumePinOptions.labelOffset = 0.3;\n volumePinOptions.labelSize = 0.3;\n\n const volumePin = await dimensions.pinWithLabel(volumePinOptions);\n\n const areaPinOptions = new PinWithLabelDto();\n areaPinOptions.startPoint = [0, height, 0] as Point3;\n areaPinOptions.endPoint = [1, height + 4, 0] as Point3;\n areaPinOptions.direction = [1, 0, 0] as Vector3;\n areaPinOptions.offsetFromStart = 0;\n areaPinOptions.label = areaText;\n areaPinOptions.labelOffset = 0.3;\n areaPinOptions.labelSize = 0.3;\n\n const areaPin = await dimensions.pinWithLabel(areaPinOptions);\n\n // Draw the cone and labels\n bitbybit.draw.drawAnyAsync({ entity: cone });\n bitbybit.draw.drawAnyAsync({ entity: volumePin });\n bitbybit.draw.drawAnyAsync({ entity: areaPin });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types\nconst { ConeDto, PinWithLabelDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT modules\nconst { solid } = bitbybit.occt.shapes;\nconst { dimensions } = bitbybit.occt;\nconst { math, text } = bitbybit;\n\n// Define the main function to demonstrate volume and surface area calculation\nconst start = async () => {\n // Parametric height value\n const height = 5;\n\n // Create a cone\n const coneOptions = new ConeDto();\n coneOptions.radius1 = 2;\n coneOptions.radius2 = 1;\n coneOptions.height = height;\n coneOptions.angle = 360;\n coneOptions.center = [0, 0, 0] as Point3;\n coneOptions.direction = [0, 1, 0] as Vector3;\n\n const cone = await solid.createCone(coneOptions);\n\n // Get volume and surface area\n const volume = await solid.getSolidVolume({ shape: cone });\n const surfaceArea = await solid.getSolidSurfaceArea({ shape: cone });\n\n // Round to 2 decimal places\n const roundedVolume = math.roundToDecimals({ number: volume, decimalPlaces: 2 });\n const roundedSurfaceArea = math.roundToDecimals({ number: surfaceArea, decimalPlaces: 2 });\n\n // Format as text with units\n const volumeText = text.format({\n text: \"Volume {0} m3\",\n values: [text.toString({ item: roundedVolume })]\n });\n const areaText = text.format({\n text: \"Area {0} m2\",\n values: [text.toString({ item: roundedSurfaceArea })]\n });\n\n // Create pin labels to display the measurements\n const volumePinOptions = new PinWithLabelDto();\n volumePinOptions.startPoint = [0, height, 0] as Point3;\n volumePinOptions.endPoint = [1, height + 3, 0] as Point3;\n volumePinOptions.direction = [1, 0, 0] as Vector3;\n volumePinOptions.offsetFromStart = 0;\n volumePinOptions.label = volumeText;\n volumePinOptions.labelOffset = 0.3;\n volumePinOptions.labelSize = 0.3;\n\n const volumePin = await dimensions.pinWithLabel(volumePinOptions);\n\n const areaPinOptions = new PinWithLabelDto();\n areaPinOptions.startPoint = [0, height, 0] as Point3;\n areaPinOptions.endPoint = [1, height + 4, 0] as Point3;\n areaPinOptions.direction = [1, 0, 0] as Vector3;\n areaPinOptions.offsetFromStart = 0;\n areaPinOptions.label = areaText;\n areaPinOptions.labelOffset = 0.3;\n areaPinOptions.labelSize = 0.3;\n\n const areaPin = await dimensions.pinWithLabel(areaPinOptions);\n\n // Draw the cone and labels\n bitbybit.draw.drawAnyAsync({ entity: cone });\n bitbybit.draw.drawAnyAsync({ entity: volumePin });\n bitbybit.draw.drawAnyAsync({ entity: areaPin });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Get volume and surface area from solid" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md b/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md index fe51f7ec..9e3013fc 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-basic-primitives.md @@ -33,21 +33,21 @@ This example demonstrates the creation of the most common primitive wire types: circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWirecircleWire3000010squareWire3500010ngonWire-60001062parallelogramWire-1100010TRUE3230rectangleWire26900010ellipseWire120001014circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWire","version":"0.20.7","type":"blockly"}} + script={{"script":"circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWirecircleWire3000010squareWire3500010ngonWire-60001062parallelogramWire-1100010TRUE3230rectangleWire26900010ellipseWire120001014circleWiresquareWirengonWireparallelogramWirerectangleWireellipseWire","version":"0.20.8","type":"blockly"}} title="Creating basic wire primitives" /> {\n // Create a circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Create a square wire at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [5, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareWire = await wire.createSquareWire(squareOptions);\n\n // Create an NGon wire (hexagon)\n const ngonOptions = new NGonWireDto();\n ngonOptions.center = [-6, 0, 0] as Point3;\n ngonOptions.direction = [0, 1, 0] as Vector3;\n ngonOptions.nrCorners = 6;\n ngonOptions.radius = 2;\n\n const ngonWire = await wire.createNGonWire(ngonOptions);\n\n // Create a parallelogram wire\n const parallelogramOptions = new ParallelogramDto();\n parallelogramOptions.center = [-11, 0, 0] as Point3;\n parallelogramOptions.direction = [0, 1, 0] as Vector3;\n parallelogramOptions.aroundCenter = true;\n parallelogramOptions.width = 3;\n parallelogramOptions.height = 2;\n parallelogramOptions.angle = 30;\n\n const parallelogramWire = await wire.createParallelogramWire(parallelogramOptions);\n\n // Create a rectangle wire\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 2;\n rectangleOptions.length = 6;\n rectangleOptions.center = [9, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleWire = await wire.createRectangleWire(rectangleOptions);\n\n // Create an ellipse wire\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [12, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 4;\n\n const ellipseWire = await wire.createEllipseWire(ellipseOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: circleWire });\n bitbybit.draw.drawAnyAsync({ entity: squareWire });\n bitbybit.draw.drawAnyAsync({ entity: ngonWire });\n bitbybit.draw.drawAnyAsync({ entity: parallelogramWire });\n bitbybit.draw.drawAnyAsync({ entity: rectangleWire });\n bitbybit.draw.drawAnyAsync({ entity: ellipseWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for wire creation\nconst { CircleDto, SquareDto, NGonWireDto, ParallelogramDto, RectangleDto, EllipseDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create various primitive wires\nconst start = async () => {\n // Create a circle wire\n const circleOptions = new CircleDto();\n circleOptions.radius = 3;\n circleOptions.center = [0, 0, 0] as Point3;\n circleOptions.direction = [0, 1, 0] as Vector3;\n\n const circleWire = await wire.createCircleWire(circleOptions);\n\n // Create a square wire at a different position\n const squareOptions = new SquareDto();\n squareOptions.size = 3;\n squareOptions.center = [5, 0, 0] as Point3;\n squareOptions.direction = [0, 1, 0] as Vector3;\n\n const squareWire = await wire.createSquareWire(squareOptions);\n\n // Create an NGon wire (hexagon)\n const ngonOptions = new NGonWireDto();\n ngonOptions.center = [-6, 0, 0] as Point3;\n ngonOptions.direction = [0, 1, 0] as Vector3;\n ngonOptions.nrCorners = 6;\n ngonOptions.radius = 2;\n\n const ngonWire = await wire.createNGonWire(ngonOptions);\n\n // Create a parallelogram wire\n const parallelogramOptions = new ParallelogramDto();\n parallelogramOptions.center = [-11, 0, 0] as Point3;\n parallelogramOptions.direction = [0, 1, 0] as Vector3;\n parallelogramOptions.aroundCenter = true;\n parallelogramOptions.width = 3;\n parallelogramOptions.height = 2;\n parallelogramOptions.angle = 30;\n\n const parallelogramWire = await wire.createParallelogramWire(parallelogramOptions);\n\n // Create a rectangle wire\n const rectangleOptions = new RectangleDto();\n rectangleOptions.width = 2;\n rectangleOptions.length = 6;\n rectangleOptions.center = [9, 0, 0] as Point3;\n rectangleOptions.direction = [0, 1, 0] as Vector3;\n\n const rectangleWire = await wire.createRectangleWire(rectangleOptions);\n\n // Create an ellipse wire\n const ellipseOptions = new EllipseDto();\n ellipseOptions.center = [12, 0, 0] as Point3;\n ellipseOptions.direction = [0, 1, 0] as Vector3;\n ellipseOptions.radiusMinor = 1;\n ellipseOptions.radiusMajor = 4;\n\n const ellipseWire = await wire.createEllipseWire(ellipseOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: circleWire });\n bitbybit.draw.drawAnyAsync({ entity: squareWire });\n bitbybit.draw.drawAnyAsync({ entity: ngonWire });\n bitbybit.draw.drawAnyAsync({ entity: parallelogramWire });\n bitbybit.draw.drawAnyAsync({ entity: rectangleWire });\n bitbybit.draw.drawAnyAsync({ entity: ellipseWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating basic wire primitives" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md b/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md index bec525a8..cad7b7e1 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-bezier-weights.md @@ -34,21 +34,21 @@ This technique is invaluable for design work where you need the curve to emphasi point1point2point3point4point5pointsListweightsbezierWirepolylineRefminWeightmaxWeightspheressphere1sphere2sphere3sphere4sphere5point1-1000point2-503point307-5point4503point51000pointsListpoint1point2point3point4point5weights10602003010bezierWirepointsListweightsFALSEbezierWire0.01FALSETRUE#e4ff1a10polylineRefpointsListFALSEpolylineRefminWeightweightsmaxWeightweightssphere1point110minWeightmaxWeight0.30.9sphere2point260minWeightmaxWeight0.30.9sphere3point3200minWeightmaxWeight0.30.9sphere4point430minWeightmaxWeight0.30.9sphere5point510minWeightmaxWeight0.30.9spheressphere1sphere2sphere3sphere4sphere5spheres0.05TRUEFALSE#37ff00","version":"0.20.7","type":"blockly"}} + script={{"script":"point1point2point3point4point5pointsListweightsbezierWirepolylineRefminWeightmaxWeightspheressphere1sphere2sphere3sphere4sphere5point1-1000point2-503point307-5point4503point51000pointsListpoint1point2point3point4point5weights10602003010bezierWirepointsListweightsFALSEbezierWire0.01FALSETRUE#e4ff1a10polylineRefpointsListFALSEpolylineRefminWeightweightsmaxWeightweightssphere1point110minWeightmaxWeight0.30.9sphere2point260minWeightmaxWeight0.30.9sphere3point3200minWeightmaxWeight0.30.9sphere4point430minWeightmaxWeight0.30.9sphere5point510minWeightmaxWeight0.30.9spheressphere1sphere2sphere3sphere4sphere5spheres0.05TRUEFALSE#37ff00","version":"0.20.8","type":"blockly"}} title="Bezier curves with different weight distributions" /> {\n // Define control points for the Bezier curve\n const controlPoints: Point3[] = [\n [-10, 0, 0],\n [-5, 0, 3],\n [0, 7, -5],\n [5, 0, 3],\n [10, 0, 0]\n ];\n\n // Weight values - higher weights pull the curve closer to that point\n const weights: number[] = [10, 60, 200, 30, 10];\n \n // Create weighted Bezier curve\n const bezierOptions = new BezierWeightsDto();\n bezierOptions.points = controlPoints;\n bezierOptions.weights = weights;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezierWeights(bezierOptions);\n\n // Draw the Bezier curve with thick yellow line\n const wireDrawOptions = new DrawOcctShapeSimpleOptions();\n wireDrawOptions.precision = 0.01;\n wireDrawOptions.drawFaces = false;\n wireDrawOptions.drawEdges = true;\n wireDrawOptions.edgeColour = \"#e4ff1a\";\n wireDrawOptions.edgeWidth = 10;\n\n await draw.drawAnyAsync({ entity: bezierWire, options: wireDrawOptions });\n\n // Draw reference polyline connecting control points\n const plnOptions = new PolylineCreateDto();\n plnOptions.points = controlPoints;\n const pln = polyline.create(plnOptions) as Bit.Inputs.Draw.Entity;\n await draw.drawAnyAsync({ entity: pln });\n\n // Calculate weight range for sphere scaling\n const minWeight = vector.min({ vector: weights });\n const maxWeight = vector.max({ vector: weights });\n\n // Create spheres at control points, sized by their weights\n const spherePromises = [];\n for (let i = 0; i < controlPoints.length; i++) {\n // Remap weight to sphere radius (0.3 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.number = weights[i];\n remapOptions.fromLow = minWeight;\n remapOptions.fromHigh = maxWeight;\n remapOptions.toLow = 0.3;\n remapOptions.toHigh = 0.9;\n\n const sphereOptions = new SphereDto();\n sphereOptions.center = controlPoints[i];\n sphereOptions.radius = bitbybit.math.remap(remapOptions);\n\n spherePromises.push(shapes.solid.createSphere(sphereOptions));\n }\n\n const spheres = await Promise.all(spherePromises);\n\n // Draw spheres in green\n const sphereDrawOptions = new DrawOcctShapeSimpleOptions();\n sphereDrawOptions.precision = 0.05;\n sphereDrawOptions.drawFaces = true;\n sphereDrawOptions.drawEdges = false;\n sphereDrawOptions.faceColour = \"#37ff00\";\n \n draw.drawAnyAsync({ entity: spheres, options: sphereDrawOptions });\n};\n\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types\nconst { BezierWeightsDto, SphereDto } = Bit.Inputs.OCCT;\nconst { DrawOcctShapeSimpleOptions } = Bit.Inputs.Draw;\nconst { RemapNumberDto } = Bit.Inputs.Math;\nconst { PolylineCreateDto } = Bit.Inputs.Polyline;\n\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Get access to BitByBit functions\nconst { wire } = bitbybit.occt.shapes;\nconst { shapes } = bitbybit.occt;\nconst { draw, vector, polyline } = bitbybit;\n\nconst start = async () => {\n // Define control points for the Bezier curve\n const controlPoints: Point3[] = [\n [-10, 0, 0],\n [-5, 0, 3],\n [0, 7, -5],\n [5, 0, 3],\n [10, 0, 0]\n ];\n\n // Weight values - higher weights pull the curve closer to that point\n const weights: number[] = [10, 60, 200, 30, 10];\n \n // Create weighted Bezier curve\n const bezierOptions = new BezierWeightsDto();\n bezierOptions.points = controlPoints;\n bezierOptions.weights = weights;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezierWeights(bezierOptions);\n\n // Draw the Bezier curve with thick yellow line\n const wireDrawOptions = new DrawOcctShapeSimpleOptions();\n wireDrawOptions.precision = 0.01;\n wireDrawOptions.drawFaces = false;\n wireDrawOptions.drawEdges = true;\n wireDrawOptions.edgeColour = \"#e4ff1a\";\n wireDrawOptions.edgeWidth = 10;\n\n await draw.drawAnyAsync({ entity: bezierWire, options: wireDrawOptions });\n\n // Draw reference polyline connecting control points\n const plnOptions = new PolylineCreateDto();\n plnOptions.points = controlPoints;\n const pln = polyline.create(plnOptions) as Bit.Inputs.Draw.Entity;\n await draw.drawAnyAsync({ entity: pln });\n\n // Calculate weight range for sphere scaling\n const minWeight = vector.min({ vector: weights });\n const maxWeight = vector.max({ vector: weights });\n\n // Create spheres at control points, sized by their weights\n const spherePromises = [];\n for (let i = 0; i < controlPoints.length; i++) {\n // Remap weight to sphere radius (0.3 to 0.9)\n const remapOptions = new RemapNumberDto();\n remapOptions.number = weights[i];\n remapOptions.fromLow = minWeight;\n remapOptions.fromHigh = maxWeight;\n remapOptions.toLow = 0.3;\n remapOptions.toHigh = 0.9;\n\n const sphereOptions = new SphereDto();\n sphereOptions.center = controlPoints[i];\n sphereOptions.radius = bitbybit.math.remap(remapOptions);\n\n spherePromises.push(shapes.solid.createSphere(sphereOptions));\n }\n\n const spheres = await Promise.all(spherePromises);\n\n // Draw spheres in green\n const sphereDrawOptions = new DrawOcctShapeSimpleOptions();\n sphereDrawOptions.precision = 0.05;\n sphereDrawOptions.drawFaces = true;\n sphereDrawOptions.drawEdges = false;\n sphereDrawOptions.faceColour = \"#37ff00\";\n \n draw.drawAnyAsync({ entity: spheres, options: sphereDrawOptions });\n};\n\nstart();","version":"0.20.8","type":"typescript"}} title="Bezier curves with different weight distributions" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md b/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md index 67980b87..5633563f 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-from-edges.md @@ -60,21 +60,21 @@ This example showcases how simple geometric operations (arc creation and rotatio arc1arc2arc3arc4edgesListcombinedWirearc1505003-505arc2arc101090arc3arc201090arc4arc301090edgesListarc1arc2arc3arc4combinedWireedgesListcombinedWire","version":"0.20.7","type":"blockly"}} + script={{"script":"arc1arc2arc3arc4edgesListcombinedWirearc1505003-505arc2arc101090arc3arc201090arc4arc301090edgesListarc1arc2arc3arc4combinedWireedgesListcombinedWire","version":"0.20.8","type":"blockly"}} title="Combining edges into a wire" /> {\n // Create the first arc through three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = [5, 0, 5] as Point3;\n arcOptions.middle = [0, 0, 3] as Point3;\n arcOptions.end = [-5, 0, 5] as Point3;\n\n const arc1 = await edge.arcThroughThreePoints(arcOptions);\n\n // Create rotation options for Y-axis rotation\n const rotateOptions = new RotateDto();\n rotateOptions.axis = [0, 1, 0] as Vector3;\n rotateOptions.angle = 90; // 90 degrees\n\n // Create three more arcs by rotating the first arc\n rotateOptions.shape = arc1;\n const arc2 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc2;\n const arc3 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc3;\n const arc4 = await transforms.rotate(rotateOptions);\n\n // Combine all arc edges into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [arc1, arc2, arc3, arc4];\n\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Draw the combined wire\n bitbybit.draw.drawAnyAsync({ entity: combinedWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for edge and wire creation\nconst { ArcEdgeThreePointsDto, RotateDto, ShapesDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\ntype TopoDSEdgePointer = Bit.Inputs.OCCT.TopoDSEdgePointer;\n\n// Get access to OCCT edge, wire, and transform functions\nconst { edge, wire } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\n\n// Define the main function to create a wire from multiple edges\nconst start = async () => {\n // Create the first arc through three points\n const arcOptions = new ArcEdgeThreePointsDto();\n arcOptions.start = [5, 0, 5] as Point3;\n arcOptions.middle = [0, 0, 3] as Point3;\n arcOptions.end = [-5, 0, 5] as Point3;\n\n const arc1 = await edge.arcThroughThreePoints(arcOptions);\n\n // Create rotation options for Y-axis rotation\n const rotateOptions = new RotateDto();\n rotateOptions.axis = [0, 1, 0] as Vector3;\n rotateOptions.angle = 90; // 90 degrees\n\n // Create three more arcs by rotating the first arc\n rotateOptions.shape = arc1;\n const arc2 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc2;\n const arc3 = await transforms.rotate(rotateOptions);\n\n rotateOptions.shape = arc3;\n const arc4 = await transforms.rotate(rotateOptions);\n\n // Combine all arc edges into a single wire\n const combineOptions = new ShapesDto();\n combineOptions.shapes = [arc1, arc2, arc3, arc4];\n\n const combinedWire = await wire.combineEdgesAndWiresIntoAWire(combineOptions);\n\n // Draw the combined wire\n bitbybit.draw.drawAnyAsync({ entity: combinedWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Combining edges into a wire" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md index 54238d81..704adb92 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-advanced-pattern.md @@ -35,21 +35,21 @@ This approach demonstrates the power of parametric design thinking, where simple gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointXcontrolPointZcontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatternidistancescaledValueinclusionPatternhexagonWiresboundaryWiregridWidth16.5gridHeight9hexagonsInWidth20hexagonsInHeight20controlPointX2.2controlPointZ2.8controlPointcontrolPointX0controlPointZhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.1110.999INSERTLASTscalePatternscaledValueinclusionPattern[true, true, false]hexagonWiresgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternboundaryWiregridWidthgridHeight000010hexagonWiresboundaryWirecontrolPoint","version":"0.20.7","type":"blockly"}} + script={{"script":"gridWidthgridHeighthexagonsInWidthhexagonsInHeightcontrolPointXcontrolPointZcontrolPointhexGridhexCentersdistancesminDistancemaxDistancescalePatternidistancescaledValueinclusionPatternhexagonWiresboundaryWiregridWidth16.5gridHeight9hexagonsInWidth20hexagonsInHeight20controlPointX2.2controlPointZ2.8controlPointcontrolPointX0controlPointZhexGridgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSETRUETRUEhexCentershexGridcentersdistancescontrolPointhexCentersminDistancedistancesmaxDistancedistancesscalePatterndistancedistancesscaledValuedistanceminDistancemaxDistance0.1110.999INSERTLASTscalePatternscaledValueinclusionPattern[true, true, false]hexagonWiresgridWidthgridHeighthexagonsInWidthhexagonsInHeightTRUEFALSEFALSEFALSEFALSEscalePatternscalePatterninclusionPatternboundaryWiregridWidthgridHeight000010hexagonWiresboundaryWirecontrolPoint","version":"0.20.8","type":"blockly"}} title="Creating hexagon grids in beautiful patterns" /> {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 20;\n const hexagonsInHeight = 20;\n\n // Control point for distance calculation\n const controlPointX = 2.2;\n const controlPointZ = 2.8;\n const controlPoint: Point3 = [controlPointX, 0, controlPointZ];\n\n // Generate hex grid to get center points\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid: HexGridData = bitbybit.point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hex centers\n const distanceOptions = new StartEndPointsListDto();\n distanceOptions.startPoint = controlPoint;\n distanceOptions.endPoints = hexCenters;\n\n const distances = bitbybit.point.distancesToPoints(distanceOptions);\n\n // Find min and max distances for remapping\n const minDistance = bitbybit.vector.min({ vector: distances });\n const maxDistance = bitbybit.vector.max({ vector: distances });\n\n // Remap distances to scale values between 0.111 and 0.999\n const scalePattern: number[] = [];\n\n for (const distance of distances) {\n const remapOptions = new RemapNumberDto();\n remapOptions.number = distance;\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.111;\n remapOptions.toHigh = 0.999;\n\n const scaledValue = bitbybit.math.remap(remapOptions);\n scalePattern.push(scaledValue);\n }\n\n // Create hexagonal grid with patterns\n const hexGridPatternOptions = new HexagonsInGridDto();\n hexGridPatternOptions.width = gridWidth;\n hexGridPatternOptions.height = gridHeight;\n hexGridPatternOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridPatternOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridPatternOptions.flatTop = true;\n hexGridPatternOptions.extendTop = false;\n hexGridPatternOptions.extendBottom = false;\n hexGridPatternOptions.extendLeft = false;\n hexGridPatternOptions.extendRight = false;\n\n // Apply the distance-based scale pattern to both width and height\n hexGridPatternOptions.scalePatternWidth = scalePattern;\n hexGridPatternOptions.scalePatternHeight = scalePattern;\n\n // Apply inclusion pattern to selectively remove some hexagons\n const inclusionPattern = [true, true, false]; // Pattern repeats across the grid\n hexGridPatternOptions.inclusionPattern = inclusionPattern;\n\n // Generate the patterned hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridPatternOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the patterned hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n\n // Optionally draw the control point for reference\n bitbybit.draw.drawAnyAsync({ entity: controlPoint });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { HexagonsInGridDto, RectangleDto } = Bit.Inputs.OCCT;\nconst { HexGridScaledToFitDto, StartEndPointsListDto } = Bit.Inputs.Point;\nconst { RemapNumberDto } = Bit.Inputs.Math;\n// Import required types\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype HexGridData = Bit.Models.Point.HexGridData;\n\n// Define the main function\nconst start = async () => {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 20;\n const hexagonsInHeight = 20;\n\n // Control point for distance calculation\n const controlPointX = 2.2;\n const controlPointZ = 2.8;\n const controlPoint: Point3 = [controlPointX, 0, controlPointZ];\n\n // Generate hex grid to get center points\n const hexGridOptions = new HexGridScaledToFitDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = true;\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n hexGridOptions.centerGrid = true;\n hexGridOptions.pointsOnGround = true;\n\n const hexGrid: HexGridData = bitbybit.point.hexGridScaledToFit(hexGridOptions);\n const hexCenters = hexGrid.centers;\n\n // Calculate distances from control point to all hex centers\n const distanceOptions = new StartEndPointsListDto();\n distanceOptions.startPoint = controlPoint;\n distanceOptions.endPoints = hexCenters;\n\n const distances = bitbybit.point.distancesToPoints(distanceOptions);\n\n // Find min and max distances for remapping\n const minDistance = bitbybit.vector.min({ vector: distances });\n const maxDistance = bitbybit.vector.max({ vector: distances });\n\n // Remap distances to scale values between 0.111 and 0.999\n const scalePattern: number[] = [];\n\n for (const distance of distances) {\n const remapOptions = new RemapNumberDto();\n remapOptions.number = distance;\n remapOptions.fromLow = minDistance;\n remapOptions.fromHigh = maxDistance;\n remapOptions.toLow = 0.111;\n remapOptions.toHigh = 0.999;\n\n const scaledValue = bitbybit.math.remap(remapOptions);\n scalePattern.push(scaledValue);\n }\n\n // Create hexagonal grid with patterns\n const hexGridPatternOptions = new HexagonsInGridDto();\n hexGridPatternOptions.width = gridWidth;\n hexGridPatternOptions.height = gridHeight;\n hexGridPatternOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridPatternOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridPatternOptions.flatTop = true;\n hexGridPatternOptions.extendTop = false;\n hexGridPatternOptions.extendBottom = false;\n hexGridPatternOptions.extendLeft = false;\n hexGridPatternOptions.extendRight = false;\n\n // Apply the distance-based scale pattern to both width and height\n hexGridPatternOptions.scalePatternWidth = scalePattern;\n hexGridPatternOptions.scalePatternHeight = scalePattern;\n\n // Apply inclusion pattern to selectively remove some hexagons\n const inclusionPattern = [true, true, false]; // Pattern repeats across the grid\n hexGridPatternOptions.inclusionPattern = inclusionPattern;\n\n // Generate the patterned hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridPatternOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the patterned hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n\n // Optionally draw the control point for reference\n bitbybit.draw.drawAnyAsync({ entity: controlPoint });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating hexagon grids" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md index 9bcca828..ad5c1ef2 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-hexagons-in-grid.md @@ -50,21 +50,21 @@ The component also includes advanced patterning capabilities through optional ar widthheightwidth16.5height9widthheight2318FALSEFALSEFALSEFALSEFALSEwidthheight000010","version":"0.20.7","type":"blockly"}} + script={{"script":"widthheightwidth16.5height9widthheight2318FALSEFALSEFALSEFALSEFALSEwidthheight000010","version":"0.20.8","type":"blockly"}} title="Creating hexagon grids" /> {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 23;\n const hexagonsInHeight = 18;\n\n // Create hexagonal grid parameters\n const hexGridOptions = new HexagonsInGridDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = false; // Pointed-top hexagons\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n\n // Generate the hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"const { HexagonsInGridDto, RectangleDto } = Bit.Inputs.OCCT;\n// Import required types\ntype TopoDSWirePointer = Bit.Inputs.OCCT.TopoDSWirePointer;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Define the main function\nconst start = async () => {\n // Define grid dimensions\n const gridWidth = 16.5;\n const gridHeight = 9;\n const hexagonsInWidth = 23;\n const hexagonsInHeight = 18;\n\n // Create hexagonal grid parameters\n const hexGridOptions = new HexagonsInGridDto();\n hexGridOptions.width = gridWidth;\n hexGridOptions.height = gridHeight;\n hexGridOptions.nrHexagonsInWidth = hexagonsInWidth;\n hexGridOptions.nrHexagonsInHeight = hexagonsInHeight;\n hexGridOptions.flatTop = false; // Pointed-top hexagons\n hexGridOptions.extendTop = false;\n hexGridOptions.extendBottom = false;\n hexGridOptions.extendLeft = false;\n hexGridOptions.extendRight = false;\n\n // Generate the hexagon grid\n const hexagonWires = await bitbybit.occt.shapes.wire.hexagonsInGrid(hexGridOptions);\n\n // Create a boundary rectangle for reference\n const boundaryOptions = new RectangleDto();\n boundaryOptions.width = gridWidth;\n boundaryOptions.length = gridHeight;\n boundaryOptions.center = [0, 0, 0] as Point3;\n boundaryOptions.direction = [0, 1, 0] as Vector3;\n\n const boundaryWire = await bitbybit.occt.shapes.wire.createRectangleWire(boundaryOptions);\n\n // Draw the hexagon grid and boundary\n bitbybit.draw.drawAnyAsync({ entity: hexagonWires });\n bitbybit.draw.drawAnyAsync({ entity: boundaryWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating hexagon grids" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md b/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md index 6a1ebdb7..a7986c81 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-shape-primitives.md @@ -50,21 +50,21 @@ The star wire creates beautiful star-shaped patterns with customizable rays, rad starWirestarWire000010107.83.70FALSEstarWire","version":"0.20.7","type":"blockly"}} + script={{"script":"starWirestarWire000010107.83.70FALSEstarWire","version":"0.20.8","type":"blockly"}} title="Creating basic wire star primitive" /> {\n // Create a star wire with customizable parameters\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 10;\n starOptions.outerRadius = 7.8;\n starOptions.innerRadius = 3.7;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Draw the created star wire\n bitbybit.draw.drawAnyAsync({ entity: starWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for star wire creation\nconst { StarDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create a star wire\nconst start = async () => {\n // Create a star wire with customizable parameters\n const starOptions = new StarDto();\n starOptions.center = [0, 0, 0] as Point3;\n starOptions.direction = [0, 1, 0] as Vector3;\n starOptions.numRays = 10;\n starOptions.outerRadius = 7.8;\n starOptions.innerRadius = 3.7;\n starOptions.offsetOuterEdges = 0;\n starOptions.half = false;\n\n const starWire = await wire.createStarWire(starOptions);\n\n // Draw the created star wire\n bitbybit.draw.drawAnyAsync({ entity: starWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating basic wire star primitive" /> @@ -86,21 +86,21 @@ The Christmas tree wire creates detailed tree-like structures perfect for season christmasTreeWirechristmasTreeWire61.53511FALSE0000010christmasTreeWire","version":"0.20.7","type":"blockly"}} + script={{"script":"christmasTreeWirechristmasTreeWire61.53511FALSE0000010christmasTreeWire","version":"0.20.8","type":"blockly"}} title="Creating basic wire primitive of christmass tree" /> {\n // Create a Christmas tree wire with customizable parameters\n const treeOptions = new ChristmasTreeDto();\n treeOptions.height = 6;\n treeOptions.innerDist = 1.5;\n treeOptions.outerDist = 3;\n treeOptions.nrSkirts = 5;\n treeOptions.trunkHeight = 1;\n treeOptions.trunkWidth = 1;\n treeOptions.half = false;\n treeOptions.rotation = 0;\n treeOptions.origin = [0, 0, 0] as Point3;\n treeOptions.direction = [0, 1, 0] as Vector3;\n\n const christmasTreeWire = await wire.createChristmasTreeWire(treeOptions);\n\n // Draw the created Christmas tree wire\n bitbybit.draw.drawAnyAsync({ entity: christmasTreeWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for Christmas tree wire creation\nconst { ChristmasTreeDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create a Christmas tree wire\nconst start = async () => {\n // Create a Christmas tree wire with customizable parameters\n const treeOptions = new ChristmasTreeDto();\n treeOptions.height = 6;\n treeOptions.innerDist = 1.5;\n treeOptions.outerDist = 3;\n treeOptions.nrSkirts = 5;\n treeOptions.trunkHeight = 1;\n treeOptions.trunkWidth = 1;\n treeOptions.half = false;\n treeOptions.rotation = 0;\n treeOptions.origin = [0, 0, 0] as Point3;\n treeOptions.direction = [0, 1, 0] as Vector3;\n\n const christmasTreeWire = await wire.createChristmasTreeWire(treeOptions);\n\n // Draw the created Christmas tree wire\n bitbybit.draw.drawAnyAsync({ entity: christmasTreeWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating basic wire primitive of christmass tree" /> @@ -122,21 +122,21 @@ The heart wire creates elegant heart-shaped curves, perfect for decorative appli heartWireheartWire00001008heartWire","version":"0.20.7","type":"blockly"}} + script={{"script":"heartWireheartWire00001008heartWire","version":"0.20.8","type":"blockly"}} title="Creating basic wire primitive of heart" /> {\n // Create a heart wire with customizable parameters\n const heartOptions = new Heart2DDto();\n heartOptions.center = [0, 0, 0] as Point3;\n heartOptions.direction = [0, 1, 0] as Vector3;\n heartOptions.rotation = 0;\n heartOptions.sizeApprox = 8;\n\n const heartWire = await wire.createHeartWire(heartOptions);\n\n // Draw the created heart wire\n bitbybit.draw.drawAnyAsync({ entity: heartWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for heart wire creation\nconst { Heart2DDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create a heart wire\nconst start = async () => {\n // Create a heart wire with customizable parameters\n const heartOptions = new Heart2DDto();\n heartOptions.center = [0, 0, 0] as Point3;\n heartOptions.direction = [0, 1, 0] as Vector3;\n heartOptions.rotation = 0;\n heartOptions.sizeApprox = 8;\n\n const heartWire = await wire.createHeartWire(heartOptions);\n\n // Draw the created heart wire\n bitbybit.draw.drawAnyAsync({ entity: heartWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating basic wire primitive of heart" /> @@ -156,21 +156,21 @@ The L-polygon wire creates precise L-shaped structures essential for architectur lPolygonWirelPolygonWire3537'outside'0000010lPolygonWire","version":"0.20.7","type":"blockly"}} + script={{"script":"lPolygonWirelPolygonWire3537'outside'0000010lPolygonWire","version":"0.20.8","type":"blockly"}} title="Creating basic wire primitive of L polygon" /> {\n // Create an L polygon wire with customizable parameters\n const lPolygonOptions = new LPolygonDto();\n lPolygonOptions.widthFirst = 3;\n lPolygonOptions.lengthFirst = 5;\n lPolygonOptions.widthSecond = 3;\n lPolygonOptions.lengthSecond = 7;\n lPolygonOptions.align = directionEnum.outside;\n lPolygonOptions.rotation = 0;\n lPolygonOptions.center = [0, 0, 0] as Point3;\n lPolygonOptions.direction = [0, 1, 0] as Vector3;\n\n const lPolygonWire = await wire.createLPolygonWire(lPolygonOptions);\n\n // Draw the created L polygon wire\n bitbybit.draw.drawAnyAsync({ entity: lPolygonWire });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for L polygon wire creation\nconst { LPolygonDto, directionEnum } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\n\n// Get access to OCCT wire creation functions\nconst { wire } = bitbybit.occt.shapes;\n\n// Define the main function to create an L polygon wire\nconst start = async () => {\n // Create an L polygon wire with customizable parameters\n const lPolygonOptions = new LPolygonDto();\n lPolygonOptions.widthFirst = 3;\n lPolygonOptions.lengthFirst = 5;\n lPolygonOptions.widthSecond = 3;\n lPolygonOptions.lengthSecond = 7;\n lPolygonOptions.align = directionEnum.outside;\n lPolygonOptions.rotation = 0;\n lPolygonOptions.center = [0, 0, 0] as Point3;\n lPolygonOptions.direction = [0, 1, 0] as Vector3;\n\n const lPolygonWire = await wire.createLPolygonWire(lPolygonOptions);\n\n // Draw the created L polygon wire\n bitbybit.draw.drawAnyAsync({ entity: lPolygonWire });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Creating basic wire primitive of L polygon" /> diff --git a/docs/learn/code/common/occt/shapes/wire/wire-via-points.md b/docs/learn/code/common/occt/shapes/wire/wire-via-points.md index 24aabc83..fceb9d4b 100644 --- a/docs/learn/code/common/occt/shapes/wire/wire-via-points.md +++ b/docs/learn/code/common/occt/shapes/wire/wire-via-points.md @@ -75,21 +75,21 @@ This example demonstrates all major methods for creating wires from points, show point1point2point3point4point5pointsListlineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWirepoint1-400point2-201point300-1point4202point5400pointsListpoint1point2point3point4point5lineWirepoint1point5polylineWirepointsList010polygonWirepointsList020interpolatedWirepointsListFALSE1e-7030interpolatedPeriodicWirepointsListTRUE1e-7040bezierWirepointsList050bsplineWirepointsListFALSE3060lineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWire","version":"0.20.7","type":"blockly"}} + script={{"script":"point1point2point3point4point5pointsListlineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWirepoint1-400point2-201point300-1point4202point5400pointsListpoint1point2point3point4point5lineWirepoint1point5polylineWirepointsList010polygonWirepointsList020interpolatedWirepointsListFALSE1e-7030interpolatedPeriodicWirepointsListTRUE1e-7040bezierWirepointsList050bsplineWirepointsListFALSE3060lineWirepolylineWirepolygonWireinterpolatedWireinterpolatedPeriodicWirebezierWirebsplineWire","version":"0.20.8","type":"blockly"}} title="Comprehensive wire creation from points" /> {\n // Define a set of control points for wire creation\n const points: Point3[] = [\n [-4, 0, 0], // Start point\n [-2, 0, 1], // First control point\n [0, 0, -1], // Second control point\n [2, 0, 2], // Third control point\n [4, 0, 0] // End point\n ];\n\n // 1. Create a simple line wire between first and last points\n const lineOptions = new LineDto();\n lineOptions.start = points[0];\n lineOptions.end = points[4];\n const lineWire = await wire.createLineWire(lineOptions);\n\n // 2. Create a polyline wire connecting all points with straight segments\n const polylineOptions = new PolylineDto();\n polylineOptions.points = points;\n const polylineWire = await wire.createPolylineWire(polylineOptions);\n\n // 3. Create a polygon wire (closed shape) from the points\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n const polygonWire = await wire.createPolygonWire(polygonOptions);\n\n // 4. Create an interpolated wire that passes smoothly through all points\n const interpolationOptions = new InterpolationDto();\n interpolationOptions.points = points;\n interpolationOptions.periodic = false;\n interpolationOptions.tolerance = 1e-7;\n const interpolatedWire = await wire.interpolatePoints(interpolationOptions);\n\n // 5. Create an interpolated periodic wire that creates a closed smooth curve\n const interpolationPeriodicOptions = new InterpolationDto();\n interpolationPeriodicOptions.points = points;\n interpolationPeriodicOptions.periodic = true;\n interpolationPeriodicOptions.tolerance = 1e-7;\n const interpolatedPeriodicWire = await wire.interpolatePoints(interpolationPeriodicOptions);\n\n // 6. Create a Bezier curve using points as control points\n const bezierOptions = new BezierDto();\n bezierOptions.points = points;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezier(bezierOptions);\n\n // 7. Create a BSpline curve with specified degree\n const bsplineOptions = new BSplineDto();\n bsplineOptions.points = points;\n bsplineOptions.closed = false;\n const bsplineWire = await wire.createBSpline(bsplineOptions);\n\n // Translate wires to different Y positions for better visualization\n const translateOptions = new TranslateDto();\n\n // Translate polyline\n translateOptions.shape = polylineWire;\n translateOptions.translation = [0, 1, 0] as Vector3;\n const translatedPolyline = await transforms.translate(translateOptions);\n\n // Translate polygon\n translateOptions.shape = polygonWire;\n translateOptions.translation = [0, 2, 0] as Vector3;\n const translatedPolygon = await transforms.translate(translateOptions);\n\n // Translate interpolated wire\n translateOptions.shape = interpolatedWire;\n translateOptions.translation = [0, 3, 0] as Vector3;\n const translatedInterpolated = await transforms.translate(translateOptions);\n\n // Translate interpolated periodic wire\n translateOptions.shape = interpolatedPeriodicWire;\n translateOptions.translation = [0, 4, 0] as Vector3;\n const translatedInterpolatedPeriodic = await transforms.translate(translateOptions);\n\n // Translate Bezier wire\n translateOptions.shape = bezierWire;\n translateOptions.translation = [0, 5, 0] as Vector3;\n const translatedBezier = await transforms.translate(translateOptions);\n\n // Translate BSpline wire\n translateOptions.shape = bsplineWire;\n translateOptions.translation = [0, 6, 0] as Vector3;\n const translatedBSpline = await transforms.translate(translateOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: lineWire });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolyline });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolygon });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolated });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolatedPeriodic });\n bitbybit.draw.drawAnyAsync({ entity: translatedBezier });\n bitbybit.draw.drawAnyAsync({ entity: translatedBSpline });\n}\n\n// Execute the function\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Import required DTOs and types for wire creation\nconst { LineDto, PolylineDto, PolygonDto, InterpolationDto, BezierDto, BSplineDto, TranslateDto } = Bit.Inputs.OCCT;\ntype Point3 = Bit.Inputs.Base.Point3;\ntype Vector3 = Bit.Inputs.Base.Vector3;\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;\n\n// Get access to OCCT wire creation and transform functions\nconst { wire } = bitbybit.occt.shapes;\nconst { transforms } = bitbybit.occt;\n\n// Define the main function to demonstrate various wire creation methods\nconst start = async () => {\n // Define a set of control points for wire creation\n const points: Point3[] = [\n [-4, 0, 0], // Start point\n [-2, 0, 1], // First control point\n [0, 0, -1], // Second control point\n [2, 0, 2], // Third control point\n [4, 0, 0] // End point\n ];\n\n // 1. Create a simple line wire between first and last points\n const lineOptions = new LineDto();\n lineOptions.start = points[0];\n lineOptions.end = points[4];\n const lineWire = await wire.createLineWire(lineOptions);\n\n // 2. Create a polyline wire connecting all points with straight segments\n const polylineOptions = new PolylineDto();\n polylineOptions.points = points;\n const polylineWire = await wire.createPolylineWire(polylineOptions);\n\n // 3. Create a polygon wire (closed shape) from the points\n const polygonOptions = new PolygonDto();\n polygonOptions.points = points;\n const polygonWire = await wire.createPolygonWire(polygonOptions);\n\n // 4. Create an interpolated wire that passes smoothly through all points\n const interpolationOptions = new InterpolationDto();\n interpolationOptions.points = points;\n interpolationOptions.periodic = false;\n interpolationOptions.tolerance = 1e-7;\n const interpolatedWire = await wire.interpolatePoints(interpolationOptions);\n\n // 5. Create an interpolated periodic wire that creates a closed smooth curve\n const interpolationPeriodicOptions = new InterpolationDto();\n interpolationPeriodicOptions.points = points;\n interpolationPeriodicOptions.periodic = true;\n interpolationPeriodicOptions.tolerance = 1e-7;\n const interpolatedPeriodicWire = await wire.interpolatePoints(interpolationPeriodicOptions);\n\n // 6. Create a Bezier curve using points as control points\n const bezierOptions = new BezierDto();\n bezierOptions.points = points;\n bezierOptions.closed = false;\n const bezierWire = await wire.createBezier(bezierOptions);\n\n // 7. Create a BSpline curve with specified degree\n const bsplineOptions = new BSplineDto();\n bsplineOptions.points = points;\n bsplineOptions.closed = false;\n const bsplineWire = await wire.createBSpline(bsplineOptions);\n\n // Translate wires to different Y positions for better visualization\n const translateOptions = new TranslateDto();\n\n // Translate polyline\n translateOptions.shape = polylineWire;\n translateOptions.translation = [0, 1, 0] as Vector3;\n const translatedPolyline = await transforms.translate(translateOptions);\n\n // Translate polygon\n translateOptions.shape = polygonWire;\n translateOptions.translation = [0, 2, 0] as Vector3;\n const translatedPolygon = await transforms.translate(translateOptions);\n\n // Translate interpolated wire\n translateOptions.shape = interpolatedWire;\n translateOptions.translation = [0, 3, 0] as Vector3;\n const translatedInterpolated = await transforms.translate(translateOptions);\n\n // Translate interpolated periodic wire\n translateOptions.shape = interpolatedPeriodicWire;\n translateOptions.translation = [0, 4, 0] as Vector3;\n const translatedInterpolatedPeriodic = await transforms.translate(translateOptions);\n\n // Translate Bezier wire\n translateOptions.shape = bezierWire;\n translateOptions.translation = [0, 5, 0] as Vector3;\n const translatedBezier = await transforms.translate(translateOptions);\n\n // Translate BSpline wire\n translateOptions.shape = bsplineWire;\n translateOptions.translation = [0, 6, 0] as Vector3;\n const translatedBSpline = await transforms.translate(translateOptions);\n\n // Draw all the created wires\n bitbybit.draw.drawAnyAsync({ entity: lineWire });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolyline });\n bitbybit.draw.drawAnyAsync({ entity: translatedPolygon });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolated });\n bitbybit.draw.drawAnyAsync({ entity: translatedInterpolatedPeriodic });\n bitbybit.draw.drawAnyAsync({ entity: translatedBezier });\n bitbybit.draw.drawAnyAsync({ entity: translatedBSpline });\n}\n\n// Execute the function\nstart();","version":"0.20.8","type":"typescript"}} title="Comprehensive wire creation from points" /> diff --git a/docs/learn/getting-started/basics/assets/local/gltf.mdx b/docs/learn/getting-started/basics/assets/local/gltf.mdx index 26703fbf..8ff16b8d 100644 --- a/docs/learn/getting-started/basics/assets/local/gltf.mdx +++ b/docs/learn/getting-started/basics/assets/local/gltf.mdx @@ -59,7 +59,7 @@ Your Rete graph should now look similar to the setup in the embedded editor belo **Rete Editor Example:** @@ -101,7 +101,7 @@ After assembling the blocks, click "Run". You should see the BoomBox model. **Blockly Editor Example:** TRUEBoomBoxFALSE","version":"0.20.7","type":"blockly"}} + script={{"script":"TRUEBoomBoxFALSE","version":"0.20.8","type":"blockly"}} title="Bitbybit Blockly Editor - Using Local glTF Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> @@ -126,7 +126,7 @@ Here's the example code, which should be fairly self-explanatory for those famil **TypeScript Editor Example:** {\n bitbybit.babylon.scene.useRightHandedSystem({\n use: true,\n });\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"BoomBox\"\n }) as File;\n await bitbybit.babylon.io.loadAssetIntoScene({\n assetFile: file,\n hidden: false\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n bitbybit.babylon.scene.useRightHandedSystem({\n use: true,\n });\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"BoomBox\"\n }) as File;\n await bitbybit.babylon.io.loadAssetIntoScene({\n assetFile: file,\n hidden: false\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Bitbybit Blockly Editor - Using Local glTF Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> diff --git a/docs/learn/getting-started/basics/assets/local/step.mdx b/docs/learn/getting-started/basics/assets/local/step.mdx index 09114a6a..ab535b50 100644 --- a/docs/learn/getting-started/basics/assets/local/step.mdx +++ b/docs/learn/getting-started/basics/assets/local/step.mdx @@ -54,7 +54,7 @@ That's it! Your Rete graph should be set up. It might take a moment for the Kuka **Rete Editor Example:** @@ -95,7 +95,7 @@ After assembling the blocks, click "Run". **Blockly Editor Example:** KukaRobotTRUE","version":"0.20.7","type":"blockly"}} + script={{"script":"KukaRobotTRUE","version":"0.20.8","type":"blockly"}} title="Bitbybit Blockly Editor - Using Local STEP Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> @@ -122,7 +122,7 @@ Here's an example of how to do that: **TypeScript Editor Example:** {\n\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"KukaRobot\"\n }) as File;\n\n const shape = await bitbybit.occt.io.loadSTEPorIGES({\n assetFile: file,\n adjustZtoY: true,\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: shape\n })\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n\n const file = await bitbybit.asset.getLocalFile({\n fileName: \"KukaRobot\"\n }) as File;\n\n const shape = await bitbybit.occt.io.loadSTEPorIGES({\n assetFile: file,\n adjustZtoY: true,\n });\n\n bitbybit.draw.drawAnyAsync({\n entity: shape\n })\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Bitbybit TypeScript Editor - Using Local STEP Asset" description="Upload local asset from tutorial named accordingly and it will appear in 3D scene after you hit run." /> diff --git a/docs/learn/getting-started/blockly/hello-world.mdx b/docs/learn/getting-started/blockly/hello-world.mdx index d92465a4..dc0269ac 100644 --- a/docs/learn/getting-started/blockly/hello-world.mdx +++ b/docs/learn/getting-started/blockly/hello-world.mdx @@ -56,7 +56,7 @@ Your setup should resemble this interactive example: Hello World!'Aboreto''Regular'1.50.20000010'leftTop'","version":"0.20.7","type":"blockly"}} + script={{"script":"Hello World!'Aboreto''Regular'1.50.20000010'leftTop'","version":"0.20.8","type":"blockly"}} title="Draw 3D Text" description="Draws the text on the screen." /> @@ -88,7 +88,7 @@ After completing these steps, your Blockly script should look similar to this: 40040010100.450.50.5FALSE#ffffff#ffffffHello World!'Roboto''Regular'1.50.2-9000000-1'centerBottom'","version":"0.20.7","type":"blockly"}} + script={{"script":"40040010100.450.50.5FALSE#ffffff#ffffffHello World!'Roboto''Regular'1.50.2-9000000-1'centerBottom'","version":"0.20.8","type":"blockly"}} title="Draw 3D text and grid" description="Draws 3D text and the grid on the screen. Text is placed in better orientation." /> diff --git a/docs/learn/getting-started/blockly/parametric-cube.mdx b/docs/learn/getting-started/blockly/parametric-cube.mdx index 3d53a204..fcc06980 100644 --- a/docs/learn/getting-started/blockly/parametric-cube.mdx +++ b/docs/learn/getting-started/blockly/parametric-cube.mdx @@ -69,7 +69,7 @@ Your Blockly workspace should now look something like this interactive example: sizesize3size000","version":"0.20.7","type":"blockly"}} + script={{"script":"sizesize3size000","version":"0.20.8","type":"blockly"}} title="Parametric cube example" description="Draws the parametrically controlled cube." /> diff --git a/docs/learn/getting-started/rete/hello-world.mdx b/docs/learn/getting-started/rete/hello-world.mdx index 20e72293..72d6627a 100644 --- a/docs/learn/getting-started/rete/hello-world.mdx +++ b/docs/learn/getting-started/rete/hello-world.mdx @@ -41,7 +41,7 @@ If you've done it correctly, your canvas should have the "Draw Grid Mesh" compon @@ -79,7 +79,7 @@ The setup should resemble this: @@ -109,7 +109,7 @@ Here's the final result you should aim for: diff --git a/docs/learn/getting-started/rete/parametric-cube.mdx b/docs/learn/getting-started/rete/parametric-cube.mdx index 19cbf1a2..1ec3f925 100644 --- a/docs/learn/getting-started/rete/parametric-cube.mdx +++ b/docs/learn/getting-started/rete/parametric-cube.mdx @@ -44,7 +44,7 @@ We'll use the OpenCascade Technology (OCCT) geometry kernel to create our cube. @@ -69,7 +69,7 @@ If you've connected them correctly, your setup should resemble the following int diff --git a/docs/learn/getting-started/typescript/hello-world.mdx b/docs/learn/getting-started/typescript/hello-world.mdx index f08b0f73..76dc5da4 100644 --- a/docs/learn/getting-started/typescript/hello-world.mdx +++ b/docs/learn/getting-started/typescript/hello-world.mdx @@ -26,7 +26,7 @@ Check out the script below: {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Draw the grid" description="Draws the grid mesh with lines in 3D space." /> @@ -51,7 +51,7 @@ The script below shows a working example. We've set the `rotation` to -90 degree {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n\n const textOpt = new Bit.Advanced.Text3D.Text3DDto();\n textOpt.text = \"Hello World!\";\n textOpt.rotation = -90;\n textOpt.originAlignment = Bit.Advanced.Text3D.recAlignmentEnum.centerBottom;\n textOpt.direction = [0, 0, -1];\n const text3D = await bitbybit.advanced.text3d.create(textOpt);\n\n bitbybit.draw.drawAnyAsync({\n entity: text3D\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const gridOptions = new Bit.Inputs.Draw.SceneDrawGridMeshDto();\n bitbybit.draw.drawGridMesh(gridOptions);\n\n const textOpt = new Bit.Advanced.Text3D.Text3DDto();\n textOpt.text = \"Hello World!\";\n textOpt.rotation = -90;\n textOpt.originAlignment = Bit.Advanced.Text3D.recAlignmentEnum.centerBottom;\n textOpt.direction = [0, 0, -1];\n const text3D = await bitbybit.advanced.text3d.create(textOpt);\n\n bitbybit.draw.drawAnyAsync({\n entity: text3D\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Draw the text & grid" description="Draws the grid mesh with text in 3D space." /> diff --git a/docs/learn/getting-started/typescript/how-to-code-in-monaco.md b/docs/learn/getting-started/typescript/how-to-code-in-monaco.md index 58d05e19..19ebac5f 100644 --- a/docs/learn/getting-started/typescript/how-to-code-in-monaco.md +++ b/docs/learn/getting-started/typescript/how-to-code-in-monaco.md @@ -197,7 +197,7 @@ start(); {\n // Step 3a: Create input objects (DTOs) and set their properties for a cube\n const cubeOptions = new CubeDto(); // Instantiate the DTO\n cubeOptions.size = 6; // Set the cube's size\n // Call the bitbybit function to create the cube, awaiting its promise\n const cube: TopoDSShapePointer = await solid.createCube(cubeOptions);\n\n // Step 3b: Create input objects (DTOs) for a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 3;\n sphereOptions.center = [3, 3, -3]; // Define center as [x, y, z] coordinates\n const sphere: TopoDSShapePointer = await solid.createSphere(sphereOptions);\n\n // Step 4: Perform geometric operations\n // Example: Boolean difference (subtract sphere from cube)\n const diffOptions = new DifferenceDto(); // Generic type for the shapes involved\n diffOptions.shape = cube; // The base shape\n diffOptions.shapes = [sphere]; // An array of shapes to subtract\n const diff: TopoDSShapePointer = await booleans.difference(diffOptions);\n\n // Example: Apply fillets (round edges) to the result of the difference\n const roundingOptions = new FilletDto();\n roundingOptions.shape = diff; // The shape to fillet\n roundingOptions.radius = 1; // The radius of the fillet\n // Note: Some operations might have specific methods like 'filletEdges' for common tasks\n const solidRoundedCorners: TopoDSShapePointer = await fillets.filletEdges(roundingOptions);\n\n // Step 5: Visualize the result in the 3D viewer\n // Prepare drawing options to customize appearance\n const occtDrawOptions = new DrawOcctShapeOptions();\n occtDrawOptions.faceColour = \"#0000ff\"; // Blue faces\n occtDrawOptions.edgeColour = \"#ff00ff\"; // Magenta edges\n occtDrawOptions.edgeWidth = 5; // Width of the edges\n occtDrawOptions.precision = 0.001; // Rendering precision for complex shapes (lower is finer)\n // Draw the final shape. 'drawAnyAsync' is a versatile function for drawing various entity types.\n draw.drawAnyAsync({ entity: solidRoundedCorners, options: occtDrawOptions });\n\n // Step 6: (Optional) Adjust scene elements like lighting for better visualization\n const dirLight = new DirectionalLightDto();\n dirLight.shadowGeneratorMapSize = 2000; // Higher values for better shadow quality\n dirLight.intensity = 3; // Light intensity\n scene.drawDirectionalLight(dirLight); // Adds or updates a directional light in the scene\n\n // Step 7: (Optional) Export your model to common CAD file formats\n // Export as STEP file (a common format for solid models)\n const stepExportOptions = new SaveStepDto();\n stepExportOptions.shape = solidRoundedCorners;\n stepExportOptions.adjustYtoZ = true; // Optional: Adjusts coordinate system (Y-up to Z-up) if needed\n stepExportOptions.fileName = \"cube_with_sphere_cutout.step\";\n stepExportOptions.tryDownload = true; // Attempts to trigger a browser download of the file\n await io.saveShapeSTEP(stepExportOptions); // Use the destructured 'io'\n\n // Export as STL file (a common format for 3D printing)\n const stlExportOptions = new SaveStlDto();\n stlExportOptions.shape = solidRoundedCorners;\n stlExportOptions.adjustYtoZ = true;\n stlExportOptions.fileName = \"cube_with_sphere_cutout.stl\";\n stlExportOptions.precision = 0.001; // Affects STL mesh quality (smaller values for finer mesh)\n stlExportOptions.tryDownload = true;\n await io.saveShapeStl(stlExportOptions); // Use the destructured 'io'\n};\n\n// Step 8: Call the start function to execute your script\nstart();","version":"0.20.7","type":"typescript"}} + script={{"script":"// Step 1: (Optional but Recommended) Destructure for convenience\n// This makes your code less verbose and easier to read.\nconst { solid } = bitbybit.occt.shapes;\nconst { booleans, fillets, io } = bitbybit.occt; // Added 'io' for export functions\nconst { draw } = bitbybit;\nconst { scene } = bitbybit.babylon;\n\n// Step 2: Import type definitions for input objects and shapes\n// This enables type checking and autocompletion.\ntype TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer; // Represents an OCCT shape\n\nconst { CubeDto, SphereDto, FilletDto, DifferenceDto, SaveStepDto, SaveStlDto } = Bit.Inputs.OCCT;\nconst DrawOcctShapeOptions = Bit.Inputs.Draw.DrawOcctShapeOptions;\nconst DirectionalLightDto = Bit.Inputs.BabylonScene.DirectionalLightDto;\n\n// Step 3: Define your main logic within an async function\nconst start = async () => {\n // Step 3a: Create input objects (DTOs) and set their properties for a cube\n const cubeOptions = new CubeDto(); // Instantiate the DTO\n cubeOptions.size = 6; // Set the cube's size\n // Call the bitbybit function to create the cube, awaiting its promise\n const cube: TopoDSShapePointer = await solid.createCube(cubeOptions);\n\n // Step 3b: Create input objects (DTOs) for a sphere\n const sphereOptions = new SphereDto();\n sphereOptions.radius = 3;\n sphereOptions.center = [3, 3, -3]; // Define center as [x, y, z] coordinates\n const sphere: TopoDSShapePointer = await solid.createSphere(sphereOptions);\n\n // Step 4: Perform geometric operations\n // Example: Boolean difference (subtract sphere from cube)\n const diffOptions = new DifferenceDto(); // Generic type for the shapes involved\n diffOptions.shape = cube; // The base shape\n diffOptions.shapes = [sphere]; // An array of shapes to subtract\n const diff: TopoDSShapePointer = await booleans.difference(diffOptions);\n\n // Example: Apply fillets (round edges) to the result of the difference\n const roundingOptions = new FilletDto();\n roundingOptions.shape = diff; // The shape to fillet\n roundingOptions.radius = 1; // The radius of the fillet\n // Note: Some operations might have specific methods like 'filletEdges' for common tasks\n const solidRoundedCorners: TopoDSShapePointer = await fillets.filletEdges(roundingOptions);\n\n // Step 5: Visualize the result in the 3D viewer\n // Prepare drawing options to customize appearance\n const occtDrawOptions = new DrawOcctShapeOptions();\n occtDrawOptions.faceColour = \"#0000ff\"; // Blue faces\n occtDrawOptions.edgeColour = \"#ff00ff\"; // Magenta edges\n occtDrawOptions.edgeWidth = 5; // Width of the edges\n occtDrawOptions.precision = 0.001; // Rendering precision for complex shapes (lower is finer)\n // Draw the final shape. 'drawAnyAsync' is a versatile function for drawing various entity types.\n draw.drawAnyAsync({ entity: solidRoundedCorners, options: occtDrawOptions });\n\n // Step 6: (Optional) Adjust scene elements like lighting for better visualization\n const dirLight = new DirectionalLightDto();\n dirLight.shadowGeneratorMapSize = 2000; // Higher values for better shadow quality\n dirLight.intensity = 3; // Light intensity\n scene.drawDirectionalLight(dirLight); // Adds or updates a directional light in the scene\n\n // Step 7: (Optional) Export your model to common CAD file formats\n // Export as STEP file (a common format for solid models)\n const stepExportOptions = new SaveStepDto();\n stepExportOptions.shape = solidRoundedCorners;\n stepExportOptions.adjustYtoZ = true; // Optional: Adjusts coordinate system (Y-up to Z-up) if needed\n stepExportOptions.fileName = \"cube_with_sphere_cutout.step\";\n stepExportOptions.tryDownload = true; // Attempts to trigger a browser download of the file\n await io.saveShapeSTEP(stepExportOptions); // Use the destructured 'io'\n\n // Export as STL file (a common format for 3D printing)\n const stlExportOptions = new SaveStlDto();\n stlExportOptions.shape = solidRoundedCorners;\n stlExportOptions.adjustYtoZ = true;\n stlExportOptions.fileName = \"cube_with_sphere_cutout.stl\";\n stlExportOptions.precision = 0.001; // Affects STL mesh quality (smaller values for finer mesh)\n stlExportOptions.tryDownload = true;\n await io.saveShapeStl(stlExportOptions); // Use the destructured 'io'\n};\n\n// Step 8: Call the start function to execute your script\nstart();","version":"0.20.8","type":"typescript"}} title="Create And Download STEP & STL 3D Models" description="Contains example code that can be executed directly inside the editor by clicking Run button." /> diff --git a/docs/learn/getting-started/typescript/parametric-cube.mdx b/docs/learn/getting-started/typescript/parametric-cube.mdx index 84de087e..73c89396 100644 --- a/docs/learn/getting-started/typescript/parametric-cube.mdx +++ b/docs/learn/getting-started/typescript/parametric-cube.mdx @@ -35,7 +35,7 @@ The script shown in the editor below is fairly straightforward, but let's break {\n const size = 10;\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = size;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n bitbybit.draw.drawAnyAsync({\n entity: cube\n });\n}\n\nstart();\n","version":"0.20.7","type":"typescript"}} + script={{"script":"const start = async () => {\n const size = 10;\n const cubeOptions = new Bit.Inputs.OCCT.CubeDto();\n cubeOptions.size = size;\n const cube = await bitbybit.occt.shapes.solid.createCube(cubeOptions);\n\n bitbybit.draw.drawAnyAsync({\n entity: cube\n });\n}\n\nstart();\n","version":"0.20.8","type":"typescript"}} title="Draw the grid" description="Draws the grid mesh with lines in 3D space." /> diff --git a/docs/learn/runners/intro-blockly.mdx b/docs/learn/runners/intro-blockly.mdx index 46931d93..8b0463c0 100644 --- a/docs/learn/runners/intro-blockly.mdx +++ b/docs/learn/runners/intro-blockly.mdx @@ -48,7 +48,7 @@ The following Bitbybit Blockly script is the visual program we'll be creating. T sizecubeMeshsizesizesizesize1cubeMeshsize0000.40.005TRUE#000099TRUE#ffffff1cubeMeshcubeMesh","version":"0.20.7","type":"blockly"}} + script={{"script":"sizecubeMeshsizesizesizesize1cubeMeshsize0000.40.005TRUE#000099TRUE#ffffff1cubeMeshcubeMesh","version":"0.20.8","type":"blockly"}} title="Bitbybit Blockly Editor - Simple Cube for Runner Tutorial" description="Draws 3D Cube and controls its size via inputs coming from external executing program" /> @@ -68,7 +68,7 @@ Below are the `index.html` and `script.js` files you would use on StackBlitz or - + diff --git a/docs/learn/runners/intro-rete.mdx b/docs/learn/runners/intro-rete.mdx index 39288234..325ed784 100644 --- a/docs/learn/runners/intro-rete.mdx +++ b/docs/learn/runners/intro-rete.mdx @@ -51,7 +51,7 @@ The following Bitbybit Rete script is the visual program we'll be creating. The diff --git a/docs/learn/runners/intro-typescript.mdx b/docs/learn/runners/intro-typescript.mdx index e70d57ee..c182f4ee 100644 --- a/docs/learn/runners/intro-typescript.mdx +++ b/docs/learn/runners/intro-typescript.mdx @@ -46,7 +46,7 @@ The following is the Bitbybit TypeScript script we'll be creating. The JavaScrip {\n const cube = await occt.shapes.solid.createCube({\n size: inputs.size,\n center: [0, 0, 0],\n });\n const filletCube = await occt.fillets.filletEdges({\n shape: cube,\n radius: 0.4\n });\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#0000ff\";\n drawOptions.edgeWidth = 1;\n drawOptions.precision = 0.005;\n const cubeMesh = await bitbybit.draw.drawAnyAsync({\n entity: filletCube,\n options: drawOptions,\n });\n return { cubeMesh };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.20.7","type":"typescript"}} + script={{"script":"type Inputs = {\n size: number;\n}\n\nBit.mockBitbybitRunnerInputs({ size: 1 });\nconst inputs: Inputs = Bit.getBitbybitRunnerInputs();\n\nconst { occt } = bitbybit;\n\nconst start = async () => {\n const cube = await occt.shapes.solid.createCube({\n size: inputs.size,\n center: [0, 0, 0],\n });\n const filletCube = await occt.fillets.filletEdges({\n shape: cube,\n radius: 0.4\n });\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#0000ff\";\n drawOptions.edgeWidth = 1;\n drawOptions.precision = 0.005;\n const cubeMesh = await bitbybit.draw.drawAnyAsync({\n entity: filletCube,\n options: drawOptions,\n });\n return { cubeMesh };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.20.8","type":"typescript"}} title="Bitbybit TypeScript Editor - Simple Cube for Runner Tutorial" description="Draws 3D Cube and controls its size via inputs coming from external executing program" /> diff --git a/docs/learn/runners/live-examples/configurable-cad-part.mdx b/docs/learn/runners/live-examples/configurable-cad-part.mdx index aff97798..f1ded7f2 100644 --- a/docs/learn/runners/live-examples/configurable-cad-part.mdx +++ b/docs/learn/runners/live-examples/configurable-cad-part.mdx @@ -30,7 +30,7 @@ Below is an interactive preview of the Rete visual program. Notice how this scri diff --git a/docs/learn/runners/table-configurator-blockly.mdx b/docs/learn/runners/table-configurator-blockly.mdx index e0ec77a5..fd6a32ea 100644 --- a/docs/learn/runners/table-configurator-blockly.mdx +++ b/docs/learn/runners/table-configurator-blockly.mdx @@ -46,7 +46,7 @@ The following Bitbybit Blockly script is the visual program that defines the log widthlengthlegHeightheighthalfLegheightthicknesshalfThicknesswidthOffsetlengthOffsetlegShapecompoundShapetable'clearSky'10000.10.7-100-100-1003#ffffff#ffffff1024TRUE0legHeightMINUSheightthicknesshalfLegheightDIVIDElegHeight2halfThicknessDIVIDEthickness2widthOffsetMINUSDIVIDEwidth2halfThicknesslengthOffsetMINUSDIVIDElength2halfThicknesslegShapethicknessthicknesslegHeight000compoundShapewidthlengththickness0MINUSheighthalfThickness0legShapewidthOffsethalfLegheightlengthOffsetlegShapeNEGwidthOffsethalfLegheightlengthOffsetlegShapewidthOffsethalfLegheightNEGlengthOffsetlegShapeNEGwidthOffsethalfLegheightNEGlengthOffset2000010tablecompoundShape0.01TRUE#999999TRUE#ffffff1tabletablesetupParamsDescribe this function...widthwidthlengthlengthheightheightthicknessthicknesswidthwidth1lengthlength1heightheight0.5thicknessthickness0.05","version":"0.20.7","type":"blockly"}} + script={{"script":"widthlengthlegHeightheighthalfLegheightthicknesshalfThicknesswidthOffsetlengthOffsetlegShapecompoundShapetable'clearSky'10000.10.7-100-100-1003#ffffff#ffffff1024TRUE0legHeightMINUSheightthicknesshalfLegheightDIVIDElegHeight2halfThicknessDIVIDEthickness2widthOffsetMINUSDIVIDEwidth2halfThicknesslengthOffsetMINUSDIVIDElength2halfThicknesslegShapethicknessthicknesslegHeight000compoundShapewidthlengththickness0MINUSheighthalfThickness0legShapewidthOffsethalfLegheightlengthOffsetlegShapeNEGwidthOffsethalfLegheightlengthOffsetlegShapewidthOffsethalfLegheightNEGlengthOffsetlegShapeNEGwidthOffsethalfLegheightNEGlengthOffset2000010tablecompoundShape0.01TRUE#999999TRUE#ffffff1tabletablesetupParamsDescribe this function...widthwidthlengthlengthheightheightthicknessthicknesswidthwidth1lengthlength1heightheight0.5thicknessthickness0.05","version":"0.20.8","type":"blockly"}} title="Bitbybit Blockly Editor - Simple Cube for Runner Tutorial" description="Draws 3D Table and controls its size via inputs coming from external executing program" /> @@ -66,7 +66,7 @@ Below are the `index.html` and `script.js` files you would use on StackBlitz or - + diff --git a/docs/learn/runners/table-configurator-rete.mdx b/docs/learn/runners/table-configurator-rete.mdx index 1f0dc346..90d68e49 100644 --- a/docs/learn/runners/table-configurator-rete.mdx +++ b/docs/learn/runners/table-configurator-rete.mdx @@ -46,7 +46,7 @@ The following Bitbybit Rete script is the visual program that defines the logic diff --git a/docs/learn/runners/table-configurator-typescript.mdx b/docs/learn/runners/table-configurator-typescript.mdx index 543c618e..1a16b2a3 100644 --- a/docs/learn/runners/table-configurator-typescript.mdx +++ b/docs/learn/runners/table-configurator-typescript.mdx @@ -51,7 +51,7 @@ The following Bitbybit TypeScript script is the program that defines the logic f {\n\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n\n const lightOptions = new Bit.Inputs.BabylonScene.DirectionalLightDto();\n lightOptions.intensity = 3;\n bitbybit.babylon.scene.drawDirectionalLight(lightOptions);\n\n const tableTopShape = await solid.createBox({\n width: inputs.width,\n length: inputs.length,\n height: inputs.thickness,\n center: [0, inputs.height - halfThickness, 0],\n });\n\n const leg1Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, lengthOffset],\n });\n const leg2Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, lengthOffset],\n });\n const leg3Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, -lengthOffset],\n });\n const leg4Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, -lengthOffset],\n });\n\n const groundShape = await face.createCircleFace({\n radius: 2,\n center: [0, 0, 0],\n direction: [0, 1, 0]\n });\n\n const compoundShape = await compound.makeCompound({\n shapes: [tableTopShape, leg1Shape, leg2Shape, leg3Shape, leg4Shape, groundShape],\n });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#555577\";\n drawOptions.edgeWidth = 1;\n const table = await bitbybit.draw.drawAnyAsync({ entity: compoundShape, options: drawOptions });\n return { table };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.20.7","type":"typescript"}} + script={{"script":"type Inputs = {\n width: number;\n length: number;\n height: number;\n thickness: number;\n};\n\nconst defaultValues: Inputs = {\n width: 1,\n length: 1,\n height: 0.5,\n thickness: 0.05,\n};\n\nBit.mockBitbybitRunnerInputs(defaultValues);\nconst inputs: Inputs = Bit.getBitbybitRunnerInputs();\n\nconst { solid, compound, face } = bitbybit.occt.shapes;\n\nconst legHeight = inputs.height - inputs.thickness;\nconst halfLegHeight = legHeight / 2;\nconst halfThickness = inputs.thickness / 2;\nconst widthOffset = inputs.width / 2 - halfThickness;\nconst lengthOffset = inputs.length / 2 - halfThickness;\n\n\nconst start = async () => {\n\n const skyboxOptions = new Bit.Inputs.BabylonScene.SkyboxDto();\n skyboxOptions.skybox = Bit.Inputs.Base.skyboxEnum.clearSky;\n bitbybit.babylon.scene.enableSkybox(skyboxOptions);\n\n const lightOptions = new Bit.Inputs.BabylonScene.DirectionalLightDto();\n lightOptions.intensity = 3;\n bitbybit.babylon.scene.drawDirectionalLight(lightOptions);\n\n const tableTopShape = await solid.createBox({\n width: inputs.width,\n length: inputs.length,\n height: inputs.thickness,\n center: [0, inputs.height - halfThickness, 0],\n });\n\n const leg1Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, lengthOffset],\n });\n const leg2Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, lengthOffset],\n });\n const leg3Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [widthOffset, halfLegHeight, -lengthOffset],\n });\n const leg4Shape = await solid.createBox({\n width: inputs.thickness,\n length: inputs.thickness,\n height: legHeight,\n center: [-widthOffset, halfLegHeight, -lengthOffset],\n });\n\n const groundShape = await face.createCircleFace({\n radius: 2,\n center: [0, 0, 0],\n direction: [0, 1, 0]\n });\n\n const compoundShape = await compound.makeCompound({\n shapes: [tableTopShape, leg1Shape, leg2Shape, leg3Shape, leg4Shape, groundShape],\n });\n\n const drawOptions = new Bit.Inputs.Draw.DrawOcctShapeSimpleOptions();\n drawOptions.faceColour = \"#555577\";\n drawOptions.edgeWidth = 1;\n const table = await bitbybit.draw.drawAnyAsync({ entity: compoundShape, options: drawOptions });\n return { table };\n}\n\nconst runnerOutput = start();\nBit.setBitbybitRunnerResult(runnerOutput);\n","version":"0.20.8","type":"typescript"}} title="Bitbybit TypeScript Editor - 3D Table Configurator" description="Draws 3D Table and controls its size via inputs coming from external executing program" /> diff --git a/examples/angular/babylonjs/laptop-holder/package-lock.json b/examples/angular/babylonjs/laptop-holder/package-lock.json index a43b0780..06fb05b8 100644 --- a/examples/angular/babylonjs/laptop-holder/package-lock.json +++ b/examples/angular/babylonjs/laptop-holder/package-lock.json @@ -17,7 +17,7 @@ "@angular/platform-browser": "13.3.0", "@angular/platform-browser-dynamic": "13.3.0", "@angular/router": "13.3.0", - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "rxjs": "7.5.5", "tslib": "2.3.1", "zone.js": "0.11.5" @@ -2331,15 +2331,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -2354,9 +2354,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -2364,18 +2364,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -2383,49 +2383,49 @@ } }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -2434,50 +2434,50 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -3688,9 +3688,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "license": "Apache-2.0", "peer": true }, @@ -13719,14 +13719,14 @@ } }, "@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==" + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==" }, "@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "requires": {} }, "@babylonjs/havok": { @@ -13738,63 +13738,63 @@ } }, "@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "requires": {} }, "@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "requires": {} }, "@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "requires": {} }, "@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "requires": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==" + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==" }, "@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", - "requires": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", + "requires": { + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "requires": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -13803,45 +13803,45 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "requires": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "requires": { "manifold-3d": "3.0.0" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "requires": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "requires": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "requires": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -14847,9 +14847,9 @@ } }, "babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "peer": true }, "balanced-match": { diff --git a/examples/angular/babylonjs/laptop-holder/package.json b/examples/angular/babylonjs/laptop-holder/package.json index b35797a5..3b307b79 100644 --- a/examples/angular/babylonjs/laptop-holder/package.json +++ b/examples/angular/babylonjs/laptop-holder/package.json @@ -10,7 +10,7 @@ }, "private": true, "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "@angular/animations": "13.3.0", "@angular/common": "13.3.0", "@angular/compiler": "13.3.0", diff --git a/examples/angular/threejs/simple/package-lock.json b/examples/angular/threejs/simple/package-lock.json index bf8fd374..4c471926 100644 --- a/examples/angular/threejs/simple/package-lock.json +++ b/examples/angular/threejs/simple/package-lock.json @@ -17,7 +17,7 @@ "@angular/platform-browser": "13.3.0", "@angular/platform-browser-dynamic": "13.3.0", "@angular/router": "13.3.0", - "@bitbybit-dev/threejs": "0.20.7", + "@bitbybit-dev/threejs": "0.20.8", "rxjs": "7.5.5", "tslib": "2.3.1", "zone.js": "0.11.5" @@ -2331,33 +2331,33 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -2366,60 +2366,60 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/threejs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.7.tgz", - "integrity": "sha512-sa/PHehdMQ/vDsacuvrsD5tkwnAnpviQAEC9Jr+ng2YDswAGGdUc7Gq5ITlxNMx1/9lhuXEwGGDGYIhAHXyj0w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.8.tgz", + "integrity": "sha512-L881NCrwJ28+VpAKEf4i7OoYATZII3g99bULyLzJBMM3aQ2e37h0dsj4/w3pZPC/2Xb+hxJNChulVidCkRkH9Q==", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.7", + "@bitbybit-dev/core": "0.20.8", "three": "0.180.0" } }, @@ -13650,30 +13650,30 @@ } }, "@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==" + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==" }, "@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", - "requires": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", + "requires": { + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "requires": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -13682,54 +13682,54 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "requires": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "requires": { "manifold-3d": "3.0.0" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "requires": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "requires": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "requires": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/threejs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.7.tgz", - "integrity": "sha512-sa/PHehdMQ/vDsacuvrsD5tkwnAnpviQAEC9Jr+ng2YDswAGGdUc7Gq5ITlxNMx1/9lhuXEwGGDGYIhAHXyj0w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.8.tgz", + "integrity": "sha512-L881NCrwJ28+VpAKEf4i7OoYATZII3g99bULyLzJBMM3aQ2e37h0dsj4/w3pZPC/2Xb+hxJNChulVidCkRkH9Q==", "requires": { - "@bitbybit-dev/core": "0.20.7", + "@bitbybit-dev/core": "0.20.8", "three": "0.180.0" } }, diff --git a/examples/angular/threejs/simple/package.json b/examples/angular/threejs/simple/package.json index 6876deea..de3c78ce 100644 --- a/examples/angular/threejs/simple/package.json +++ b/examples/angular/threejs/simple/package.json @@ -10,7 +10,7 @@ }, "private": true, "dependencies": { - "@bitbybit-dev/threejs": "0.20.7", + "@bitbybit-dev/threejs": "0.20.8", "@angular/animations": "13.3.0", "@angular/common": "13.3.0", "@angular/compiler": "13.3.0", diff --git a/examples/angular/threejs/vite-basic-example/package-lock.json b/examples/angular/threejs/vite-basic-example/package-lock.json index f8372cbf..79970b2e 100644 --- a/examples/angular/threejs/vite-basic-example/package-lock.json +++ b/examples/angular/threejs/vite-basic-example/package-lock.json @@ -13,7 +13,7 @@ "@angular/forms": "^20.0.0", "@angular/platform-browser": "^20.0.0", "@angular/router": "^20.0.0", - "@bitbybit-dev/threejs": "0.20.7", + "@bitbybit-dev/threejs": "0.20.8", "rxjs": "7.5.5", "tslib": "^2.5.0", "zone.js": "~0.15.0" @@ -929,33 +929,33 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -964,60 +964,60 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/threejs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.7.tgz", - "integrity": "sha512-sa/PHehdMQ/vDsacuvrsD5tkwnAnpviQAEC9Jr+ng2YDswAGGdUc7Gq5ITlxNMx1/9lhuXEwGGDGYIhAHXyj0w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.8.tgz", + "integrity": "sha512-L881NCrwJ28+VpAKEf4i7OoYATZII3g99bULyLzJBMM3aQ2e37h0dsj4/w3pZPC/2Xb+hxJNChulVidCkRkH9Q==", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.7", + "@bitbybit-dev/core": "0.20.8", "three": "0.180.0" } }, diff --git a/examples/angular/threejs/vite-basic-example/package.json b/examples/angular/threejs/vite-basic-example/package.json index ea60e452..d8012504 100644 --- a/examples/angular/threejs/vite-basic-example/package.json +++ b/examples/angular/threejs/vite-basic-example/package.json @@ -14,7 +14,7 @@ "@angular/forms": "^20.0.0", "@angular/platform-browser": "^20.0.0", "@angular/router": "^20.0.0", - "@bitbybit-dev/threejs": "0.20.7", + "@bitbybit-dev/threejs": "0.20.8", "rxjs": "7.5.5", "tslib": "^2.5.0", "zone.js": "~0.15.0" diff --git a/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts b/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts index 40119847..91786b50 100644 --- a/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts +++ b/examples/angular/threejs/vite-basic-example/src/workers/manifold.worker.ts @@ -7,7 +7,7 @@ import Module from "manifold-3d"; const init = async () => { const wasm = await Module({ locateFile: () => { - return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.7/wasm/manifold.cc2ddd38.wasm"; + return "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.8/wasm/manifold.cc2ddd38.wasm"; }, }); wasm.setup(); diff --git a/examples/nextjs/babylonjs/simple/package-lock.json b/examples/nextjs/babylonjs/simple/package-lock.json index fd8a5ad4..6d3ea3a5 100644 --- a/examples/nextjs/babylonjs/simple/package-lock.json +++ b/examples/nextjs/babylonjs/simple/package-lock.json @@ -8,7 +8,7 @@ "name": "simple", "version": "0.1.0", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "file-loader": "6.2.0", "next": "15.0.1", "react": "19.0.0-rc-69d4b800-20241021", @@ -38,15 +38,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -61,9 +61,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -71,18 +71,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -90,49 +90,49 @@ } }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -141,50 +141,50 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -1773,9 +1773,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "license": "Apache-2.0", "peer": true }, diff --git a/examples/nextjs/babylonjs/simple/package.json b/examples/nextjs/babylonjs/simple/package.json index 4fea21ac..f673acc4 100644 --- a/examples/nextjs/babylonjs/simple/package.json +++ b/examples/nextjs/babylonjs/simple/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "react": "19.0.0-rc-69d4b800-20241021", "react-dom": "19.0.0-rc-69d4b800-20241021", "next": "15.0.1", diff --git a/examples/node/basic/package-lock.json b/examples/node/basic/package-lock.json index 255bf496..dbd25e53 100644 --- a/examples/node/basic/package-lock.json +++ b/examples/node/basic/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "^0.20.7" + "@bitbybit-dev/occt": "^0.20.8" }, "devDependencies": { "concurrently": "^7.6.0", @@ -34,18 +34,18 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/ansi-regex": { diff --git a/examples/node/basic/package.json b/examples/node/basic/package.json index 8ee43a3d..a4aa047f 100644 --- a/examples/node/basic/package.json +++ b/examples/node/basic/package.json @@ -15,7 +15,7 @@ "node": ">=20.19.4" }, "dependencies": { - "@bitbybit-dev/occt": "^0.20.7" + "@bitbybit-dev/occt": "^0.20.8" }, "devDependencies": { "extensionless": "1.9.9", diff --git a/examples/node/express-app/package-lock.json b/examples/node/express-app/package-lock.json index 8f0b801a..97ac7618 100644 --- a/examples/node/express-app/package-lock.json +++ b/examples/node/express-app/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.7", + "@bitbybit-dev/core": "0.20.8", "cors": "^2.8.5", "dotenv": "^16.0.3", "express": "^4.18.2", @@ -41,33 +41,33 @@ } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -76,50 +76,50 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -1853,30 +1853,30 @@ } }, "@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==" + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==" }, "@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", - "requires": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", + "requires": { + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "requires": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -1885,45 +1885,45 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "requires": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "requires": { "manifold-3d": "3.0.0" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "requires": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "requires": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "requires": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, diff --git a/examples/node/express-app/package.json b/examples/node/express-app/package.json index 0e1ca9c6..0b8e1b9f 100644 --- a/examples/node/express-app/package.json +++ b/examples/node/express-app/package.json @@ -11,7 +11,7 @@ "author": "Bit By Bit Developers", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.7", + "@bitbybit-dev/core": "0.20.8", "cors": "^2.8.5", "dotenv": "^16.0.3", "express": "^4.18.2", diff --git a/examples/nuxt/babylonjs/basic/package-lock.json b/examples/nuxt/babylonjs/basic/package-lock.json index 52cd5c7d..49ddddb0 100644 --- a/examples/nuxt/babylonjs/basic/package-lock.json +++ b/examples/nuxt/babylonjs/basic/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "@pinia/nuxt": "^0.5.4", "nuxt": "^3.13.0", "pinia": "^2.2.2", @@ -486,15 +486,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -509,9 +509,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -519,18 +519,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -538,49 +538,49 @@ } }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -589,50 +589,50 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -3028,9 +3028,9 @@ "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==" }, "node_modules/babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "license": "Apache-2.0", "peer": true }, diff --git a/examples/nuxt/babylonjs/basic/package.json b/examples/nuxt/babylonjs/basic/package.json index 87689997..68444fdf 100644 --- a/examples/nuxt/babylonjs/basic/package.json +++ b/examples/nuxt/babylonjs/basic/package.json @@ -11,7 +11,7 @@ "postinstall": "nuxt prepare" }, "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "@pinia/nuxt": "^0.5.4", "nuxt": "^3.13.0", "pinia": "^2.2.2", diff --git a/examples/react/babylonjs/cup/package-lock.json b/examples/react/babylonjs/cup/package-lock.json index 19809344..b958a4ea 100644 --- a/examples/react/babylonjs/cup/package-lock.json +++ b/examples/react/babylonjs/cup/package-lock.json @@ -8,7 +8,7 @@ "name": "cup", "version": "0.1.0", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "@emotion/react": "11.9.0", "@emotion/styled": "11.8.1", "@mui/icons-material": "5.6.2", @@ -1809,15 +1809,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -1832,9 +1832,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1842,18 +1842,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1866,49 +1866,49 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -1917,50 +1917,50 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -5694,9 +5694,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "license": "Apache-2.0", "peer": true }, @@ -19074,14 +19074,14 @@ } }, "@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==" + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==" }, "@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "requires": {} }, "@babylonjs/havok": { @@ -19093,21 +19093,21 @@ } }, "@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "requires": {} }, "@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "requires": {} }, "@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "requires": {} }, "@bcoe/v8-coverage": { @@ -19116,45 +19116,45 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "requires": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==" + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==" }, "@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", - "requires": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", + "requires": { + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "requires": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -19163,45 +19163,45 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "requires": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "requires": { "manifold-3d": "3.0.0" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "requires": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "requires": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "requires": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -21830,9 +21830,9 @@ } }, "babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "peer": true }, "balanced-match": { diff --git a/examples/react/babylonjs/cup/package.json b/examples/react/babylonjs/cup/package.json index e9cbac32..c34f7a74 100644 --- a/examples/react/babylonjs/cup/package.json +++ b/examples/react/babylonjs/cup/package.json @@ -4,7 +4,7 @@ "private": true, "homepage": "https://app-store.bitbybit.dev/cup", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "@emotion/react": "11.9.0", "@emotion/styled": "11.8.1", "web-ifc": "0.0.68", diff --git a/examples/react/babylonjs/laptop-holder/package-lock.json b/examples/react/babylonjs/laptop-holder/package-lock.json index 8d7a7c21..e4017422 100644 --- a/examples/react/babylonjs/laptop-holder/package-lock.json +++ b/examples/react/babylonjs/laptop-holder/package-lock.json @@ -8,7 +8,7 @@ "name": "laptop-holder", "version": "0.1.0", "dependencies": { - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "@emotion/react": "11.9.0", "@emotion/styled": "11.8.1", "@mui/icons-material": "5.6.2", @@ -1847,15 +1847,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==", "license": "Apache-2.0" }, "node_modules/@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0" @@ -1870,9 +1870,9 @@ } }, "node_modules/@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1880,18 +1880,18 @@ } }, "node_modules/@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.6.0" } }, "node_modules/@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^8.0.0", @@ -1904,49 +1904,49 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "node_modules/@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "license": "MIT", "dependencies": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -1955,50 +1955,50 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -5400,9 +5400,9 @@ } }, "node_modules/babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "license": "Apache-2.0", "peer": true }, @@ -18179,14 +18179,14 @@ } }, "@babylonjs/core": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.29.1.tgz", - "integrity": "sha512-hZZjiR1FvfWN/Mg07Bo/pzLKfkGYMCMnPsq1ic5UngAvfeVcNmK70l18/2iQlBrC94uSrMeMtCVY6cPxHWKsgg==" + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-8.33.2.tgz", + "integrity": "sha512-XhAX/50808MZjlyCI7/k43dgk5wqdXdtJO8a83jlKG+61jqvlfSYqbYSm/zzWwPcmQ+suYLeIeFo+eU3mdyz8Q==" }, "@babylonjs/gui": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.29.1.tgz", - "integrity": "sha512-z115xTfoNc8t2MkDkeTOg+Fk8FdNNMj/EtWYzXnjO2HS3cSixM/ZawA4MgEqhWOvEmODKBJKvFokxPLaPSRZiQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/gui/-/gui-8.33.2.tgz", + "integrity": "sha512-b6XJQX4c0u5xV8er4CsbJgSMkqkxFUke558xkowLps5ZhGyFXxUyVUFncvMV+Tt8CeaBEy/VbuwVxrTWrQECwg==", "requires": {} }, "@babylonjs/havok": { @@ -18198,21 +18198,21 @@ } }, "@babylonjs/loaders": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.29.1.tgz", - "integrity": "sha512-tBJv24VAdZW30BYxvwrMERDLHnxBjnC68NrMmb66B9Hs7sEl+e59nluEc2zpSSQVtdY8P8+c9F+LbqqliQLuwA==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-8.33.2.tgz", + "integrity": "sha512-emTAHHJzVQ2Qk215wS6r2XUEX8mkJ+hbGeTVgtkjiSqkIZc/w/n/gBxb0Tvh3JzmGjOZmFtiiBB8KXJ+WM93xA==", "requires": {} }, "@babylonjs/materials": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.29.1.tgz", - "integrity": "sha512-bJZPDOfm1IWMMPEUTD416z8/dGpQ3mb0xF543cyEKNuZfiofpvxm6/3jF3SKf9PAVi5+hTgsRI9isCkoVehiYQ==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/materials/-/materials-8.33.2.tgz", + "integrity": "sha512-H7n/Nn71EI71/IVg3yaOSqdAKVJ90owJzleZI43rTqHvwRS3vSA9P8c9EOUast7LCy+TGNFoOw6J9xEmxJydxQ==", "requires": {} }, "@babylonjs/serializers": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.29.1.tgz", - "integrity": "sha512-t7aNW5rh3LXBGeD8KfeEG0s5mzOsqgWHJ+VXQtb9lPkpnSeNj2nl7yY2QuRUuapNITJhvlee2J61CRIdyWNPfg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/@babylonjs/serializers/-/serializers-8.33.2.tgz", + "integrity": "sha512-gqF7ntfHFrD616gljVlk6pAPTOd7rwCShIru99RfyJ0SIXN3geAB/dPPll7k9KXIBCh/6tw941IBU069zDLHrw==", "requires": {} }, "@bcoe/v8-coverage": { @@ -18221,45 +18221,45 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "@bitbybit-dev/babylonjs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.7.tgz", - "integrity": "sha512-PjjAZj5Ovdj0qHkh6EE89fhWReGBZ7M7ymJrQuVmhVKjLoKWd86Wn1in61JLoCJfwFUDvPw6I3NWn9yETMO62g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/babylonjs/-/babylonjs-0.20.8.tgz", + "integrity": "sha512-2pvNP3nJ48Oa0qV5pl9tVbbq6HJkWJrQcUVRxJvx6w5P2vD4kOdzs/WjihJoF3UtpIMWnE5pesFYOvpNCikMYA==", "requires": { - "@babylonjs/core": "8.29.1", - "@babylonjs/gui": "8.29.1", + "@babylonjs/core": "8.33.2", + "@babylonjs/gui": "8.33.2", "@babylonjs/havok": "1.3.10", - "@babylonjs/loaders": "8.29.1", - "@babylonjs/materials": "8.29.1", - "@babylonjs/serializers": "8.29.1", - "@bitbybit-dev/core": "0.20.7", + "@babylonjs/loaders": "8.33.2", + "@babylonjs/materials": "8.33.2", + "@babylonjs/serializers": "8.33.2", + "@bitbybit-dev/core": "0.20.8", "earcut": "2.2.3" } }, "@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==" + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==" }, "@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", - "requires": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", + "requires": { + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "requires": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -18268,45 +18268,45 @@ } }, "@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "requires": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "requires": { "manifold-3d": "3.0.0" } }, "@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "requires": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "requires": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "requires": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, @@ -20738,9 +20738,9 @@ } }, "babylonjs-gltf2interface": { - "version": "8.29.1", - "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.29.1.tgz", - "integrity": "sha512-H3wfdujcU+sEirffc55ucZyaH15+x4q+woem7QuabdcqN18ShPYedcDTl6kyuMjsDF3O6UA0z7VxyG60mA1pJg==", + "version": "8.33.2", + "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-8.33.2.tgz", + "integrity": "sha512-zbCS3LEx8cRm1ZR5nWsR+Lo43zOR+uT1bW7dgcTY2ap5zl6wXK8wQL/F6V23r3ropA0NAFZpqj7cas7bdoFSkA==", "peer": true }, "balanced-match": { diff --git a/examples/react/babylonjs/laptop-holder/package.json b/examples/react/babylonjs/laptop-holder/package.json index c89410c9..61e296a8 100644 --- a/examples/react/babylonjs/laptop-holder/package.json +++ b/examples/react/babylonjs/laptop-holder/package.json @@ -16,7 +16,7 @@ "react-scripts": "5.0.1", "typescript": "^4.6.2", "web-vitals": "^2.1.4", - "@bitbybit-dev/babylonjs": "0.20.7", + "@bitbybit-dev/babylonjs": "0.20.8", "file-loader": "6.2.0", "@mui/icons-material": "5.6.2", "@mui/material": "5.6.4", diff --git a/examples/react/threejs/vase/package-lock.json b/examples/react/threejs/vase/package-lock.json index b7ed0c9a..e1f86f80 100644 --- a/examples/react/threejs/vase/package-lock.json +++ b/examples/react/threejs/vase/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "dependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11", - "@bitbybit-dev/threejs": "0.20.7", + "@bitbybit-dev/threejs": "0.20.8", "@emotion/react": "11.11.0", "@emotion/styled": "11.11.0", "@mui/icons-material": "5.11.16", @@ -1995,33 +1995,33 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, "node_modules/@bitbybit-dev/base": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.7.tgz", - "integrity": "sha512-GZ8NhT+I/SQOh0816t6tuQvN05aH0Li8TKwtR+cNKBH+dcgNVqMp6VOcg4Ann6/F2SDiasJspVmAtE78TwCg3g==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/base/-/base-0.20.8.tgz", + "integrity": "sha512-EPcaFl+qYIhStQ5q2rW5uW+7qoTUP4HoBBT2MYi2jAV9THUDlMLD3qqZVzGj8xiP8OZBp/gt56Y3iSyZ19CiNA==", "license": "MIT" }, "node_modules/@bitbybit-dev/core": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.7.tgz", - "integrity": "sha512-t6g5Jh9A8bTI6cdyVqjKmyEU/JpToNbqkzPx7iOSLS2gsQ6hsnS3qQFJgL1HX0DejqvVSH9KmAbF7RWUyMyDgA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/core/-/core-0.20.8.tgz", + "integrity": "sha512-+BRkCosNKqaUhNJ3XnlRFeCRCuwx8CfernFgD9duiFrC6fxZqTAHScSf3rTkl90z2o9h8THFkWfZPXvW1R39yg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", - "@bitbybit-dev/jscad-worker": "0.20.7", - "@bitbybit-dev/manifold-worker": "0.20.7", - "@bitbybit-dev/occt-worker": "0.20.7", + "@bitbybit-dev/base": "0.20.8", + "@bitbybit-dev/jscad-worker": "0.20.8", + "@bitbybit-dev/manifold-worker": "0.20.8", + "@bitbybit-dev/occt-worker": "0.20.8", "jsonpath-plus": "10.1.0", "rxjs": "7.5.5", "verb-nurbs-web": "2.1.3" } }, "node_modules/@bitbybit-dev/jscad": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.7.tgz", - "integrity": "sha512-WVp6SaSSux7Cd7e1vU+wLwOi6QhqpKyPgQR1lFrnkwy8iv5BdnXwYTCmd7RmY1jYIHc9Xv7QMFWet6VD8F/77w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad/-/jscad-0.20.8.tgz", + "integrity": "sha512-4TWMcwe94QvhNdWKt1Kkj80KdTQUcKCCG6YgpWGkkFjh1stGBNwUTtNa51RQQ1Ue+KEQhr95/SpZBBabr5N1DA==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7", + "@bitbybit-dev/base": "0.20.8", "@jscad/3mf-serializer": "2.1.12", "@jscad/dxf-serializer": "2.1.18", "@jscad/io-utils": "2.0.28", @@ -2030,60 +2030,60 @@ } }, "node_modules/@bitbybit-dev/jscad-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.7.tgz", - "integrity": "sha512-/iWUVc/QnW5p5V+YcJTW5UXU98Ou1LEexyu21ZTb3yKjB2KZF35RYFjOQ2M5SFUfNnyqWHSJZ6JuXjCAx9sjsw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/jscad-worker/-/jscad-worker-0.20.8.tgz", + "integrity": "sha512-26D4pXGPnha7hsKjKgtKFDFn+WuvFAAbmgnBmU2GmkSzx5adRltalUPmQhpGIwU525u2SwK1CRyQtibc05+CKw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/jscad": "0.20.7", + "@bitbybit-dev/jscad": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/manifold": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.7.tgz", - "integrity": "sha512-PbtZhjkmzxDK6zyezIIgQG4GWXxC+S5R+UyNFrFkGA5zkH29e9LKdst+j7+8ElfZQIdEi/Rc+orWAtZo5Wntfw==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold/-/manifold-0.20.8.tgz", + "integrity": "sha512-hmlIUtCf18yLHqu07Uy8iAIDsCzPV/kK1WtK0B2WVXGJRUtYtmuWFLu6jL3zcPUiQB0//EWR4K5j7ba+mAOcoQ==", "license": "MIT", "dependencies": { "manifold-3d": "3.0.0" } }, "node_modules/@bitbybit-dev/manifold-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.7.tgz", - "integrity": "sha512-LbayLKzNclMP75UD1KRQJ201KJkJvd0p+ir3U4CfPQLsKYMPNMq6BwIta8U73ZBqb75IV8yxH1yveGCcf7PzZQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/manifold-worker/-/manifold-worker-0.20.8.tgz", + "integrity": "sha512-IYvxvtnC2B4pWmgoI41k7UW8YTdVSOOnSWXbUmiJH9mKbf70E6aEKclr5u9xr7XwFoty67S5XrmEDkiHo6wMig==", "license": "MIT", "dependencies": { - "@bitbybit-dev/manifold": "0.20.7", + "@bitbybit-dev/manifold": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/occt": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.7.tgz", - "integrity": "sha512-f2dRg4NWhXqX3iLxvXBFOVg0v2oN5ryuvipFPCNhw8BckPKx31TwZKaTA49b/Q7a8lRUoft/nb9WlKGHFrYjoA==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt/-/occt-0.20.8.tgz", + "integrity": "sha512-Sg1rgG+ulbe+sONs7KBRc9yxspsLib9i/UsxrG8YDq3RIB3WTqmOFQYgiV2li3BSARF1Y9UO4li+38jVItCsEg==", "license": "MIT", "dependencies": { - "@bitbybit-dev/base": "0.20.7" + "@bitbybit-dev/base": "0.20.8" } }, "node_modules/@bitbybit-dev/occt-worker": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.7.tgz", - "integrity": "sha512-phh+AT3Idj5TOAyflnC+7gakdIFDGkIbctu+9pbKePyuuIq9AVsu6aqvl4475nR8KMJrqM0dXUs6GafhsjlxvQ==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/occt-worker/-/occt-worker-0.20.8.tgz", + "integrity": "sha512-2EaN+//BiLpI6FpRy4Oaetu62nRPro2AZd483HhS9yUOLpVNuTIqx9f0F+w4vhcS+iM1D6qWqa0cvO0UXm2yJw==", "license": "MIT", "dependencies": { - "@bitbybit-dev/occt": "0.20.7", + "@bitbybit-dev/occt": "0.20.8", "rxjs": "7.5.5" } }, "node_modules/@bitbybit-dev/threejs": { - "version": "0.20.7", - "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.7.tgz", - "integrity": "sha512-sa/PHehdMQ/vDsacuvrsD5tkwnAnpviQAEC9Jr+ng2YDswAGGdUc7Gq5ITlxNMx1/9lhuXEwGGDGYIhAHXyj0w==", + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/@bitbybit-dev/threejs/-/threejs-0.20.8.tgz", + "integrity": "sha512-L881NCrwJ28+VpAKEf4i7OoYATZII3g99bULyLzJBMM3aQ2e37h0dsj4/w3pZPC/2Xb+hxJNChulVidCkRkH9Q==", "license": "MIT", "dependencies": { - "@bitbybit-dev/core": "0.20.7", + "@bitbybit-dev/core": "0.20.8", "three": "0.180.0" } }, diff --git a/examples/react/threejs/vase/package.json b/examples/react/threejs/vase/package.json index 6ec5e228..f5e7d0a0 100644 --- a/examples/react/threejs/vase/package.json +++ b/examples/react/threejs/vase/package.json @@ -4,7 +4,7 @@ "private": true, "homepage": "https://app-store.bitbybit.dev/bitbybit-threejs", "dependencies": { - "@bitbybit-dev/threejs": "0.20.7", + "@bitbybit-dev/threejs": "0.20.8", "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "14.0.0", "@testing-library/user-event": "14.4.3", diff --git a/examples/runner/babylon/full/inline-include/index.html b/examples/runner/babylon/full/inline-include/index.html index c6b83ddc..3402a7f9 100644 --- a/examples/runner/babylon/full/inline-include/index.html +++ b/examples/runner/babylon/full/inline-include/index.html @@ -34,7 +34,7 @@ // This function simply outputs the script that was exported from the Rete editor by clicking "Export to Runner" and selecting Minify option. function exportedScript() { - return '{\"type\":\"rete\",\"version\":\"0.20.7\",\"script\":\"!async function(e,t,s,n,r){let a={};a={x:[0],y:[0],z:[1],...a};const o=[{result:e.HS.executeBasedOnType(a,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let i={};i={text:[\\"[true,false]\\"],...i};const c=[{result:e.HS.executeBasedOnType(i,!1,(e=>t.json.parse(e))),transformers:[]}];let p={};p={text:[\\"[false,true]\\"],...p};const u=[{result:e.HS.executeBasedOnType(p,!1,(e=>t.json.parse(e))),transformers:[]}],l=[{result:[5],transformers:[]}];let d={};d={x:[1],y:[0],z:[0],...d};const m=[{result:e.HS.executeBasedOnType(d,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}],y=[{result:[12],transformers:[]}],S=[{result:[7],transformers:[]}];let H={};H={x:[0],y:[1],z:[0],...H};const f=[{result:e.HS.executeBasedOnType(H,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let h={};h={x:[0],y:[0],z:[1],...h};const x=[{result:e.HS.executeBasedOnType(h,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let v={};v={number:[.4],...v};const O=[{result:e.HS.executeBasedOnType(v,!1,(e=>t.math.number(e))),transformers:[]}];let I={};I={x:[0],y:[0],z:[-1],...I};const L=[{result:e.HS.executeBasedOnType(I,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let B={};B={x:[0],y:[0],z:[-2],...B};const w=[{result:e.HS.executeBasedOnType(B,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let T={};T={x:[0],y:[0],z:[1],...T};const g=[{result:e.HS.executeBasedOnType(T,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let A={};A={x:[0],y:[1.5],z:[0],...A};const E=[{result:e.HS.executeBasedOnType(A,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let b={};b={...{faceOpacity:[.5],edgeOpacity:[.5],edgeColour:[\\"#000000\\"],faceColour:[\\"#212121\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.02],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]},...b};const z=[{result:e.HS.executeBasedOnType(b,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let W={};W={name:[\\"Custom Material\\"],baseColor:[\\"#9c9cba\\"],emissiveColor:[\\"#000000\\"],metallic:[.9],roughness:[.1],alpha:[1],backFaceCulling:[!1],zOffset:[2],...W};const C=[{result:e.HS.executeBasedOnType(W,!1,(e=>t.babylon.material.pbrMetallicRoughness.create(e))),transformers:[]}];let P={};P={x:[0],y:[0],z:[-1],...P};const X=[{result:e.HS.executeBasedOnType(P,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Y={};Y={x:[0],y:[0],z:[-1.5],...Y};const Z=[{result:e.HS.executeBasedOnType(Y,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let N={};N={x:[0],y:[0],z:[1],...N};const k=[{result:e.HS.executeBasedOnType(N,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let M={};M={skybox:[\\"city\\"],size:[1e3],blur:[.4],environmentIntensity:[.4],...M};e.HS.executeBasedOnType(M,!1,(e=>t.babylon.scene.enableSkybox(e)));let F={number:[{result:[20],transformers:[]}]};e.HS.updateListInputs(F),F={number:[20],...F};const D=[{result:e.HS.executeBasedOnType(F,!1,(e=>t.math.number(e))),transformers:[]}];let R={};R.y=y,e.HS.updateListInputs(R),R={x:[0],y:[0],z:[0],...R};const j=[{result:e.HS.executeBasedOnType(R,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let q={};q.item=y,e.HS.updateListInputs(q),q={...q};const V=[{result:q.item}];let G={};G.first=S,e.HS.updateListInputs(G),G={first:[1],second:[-2],operation:[\\"divide\\"],...G};const J=[{result:e.HS.executeBasedOnType(G,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let K={};K.first=S,e.HS.updateListInputs(K),K={first:[1],second:[-4],operation:[\\"divide\\"],...K};const Q=[{result:e.HS.executeBasedOnType(K,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let U={};U.first=y,U.second=O,e.HS.updateListInputs(U),U={first:[1],second:[.4],operation:[\\"add\\"],...U};const $=[{result:e.HS.executeBasedOnType(U,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let _={};_.item=S,e.HS.updateListInputs(_),_={..._};const ee=[{result:_.item}],te={faceOpacity:[1],edgeOpacity:[1],edgeColour:[\\"#1c1c1c\\"],faceColour:[\\"#bdbdbd\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.01],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]};let se={};se.faceMaterial=C,e.HS.updateListInputs(se),se={...te,...se};const ne=[{result:e.HS.executeBasedOnType(se,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let re={};re.center=Z,re.direction=X,e.HS.updateListInputs(re),re={radius:[3],height:[1.9],center:[[0,0,0]],direction:[[0,1,0]],...re};const ae=[{result:await e.HS.executeBasedOnTypeAsync(re,!1,(e=>t.occt.shapes.solid.createCylinder(e))),transformers:[]}];let oe={};oe.y=$,e.HS.updateListInputs(oe),oe={x:[0],y:[12],z:[0],...oe};const ie=[{result:e.HS.executeBasedOnType(oe,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ce={};ce.first=D,e.HS.updateListInputs(ce),ce={first:[1],second:[3],operation:[\\"multiply\\"],...ce};const pe=[{result:e.HS.executeBasedOnType(ce,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ue={};ue.first=V,ue.second=O,e.HS.updateListInputs(ue),ue={first:[1],second:[.4],operation:[\\"add\\"],...ue};const le=[{result:e.HS.executeBasedOnType(ue,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let de={};de.first=V,de.second=O,e.HS.updateListInputs(de),de={first:[1],second:[.4],operation:[\\"subtract\\"],...de};const me=[{result:e.HS.executeBasedOnType(de,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ye={};ye.first=ee,e.HS.updateListInputs(ye),ye={first:[1],second:[-.2],operation:[\\"multiply\\"],...ye};const Se=[{result:e.HS.executeBasedOnType(ye,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let He={};He.second=D,e.HS.updateListInputs(He),He={first:[360],second:[1],operation:[\\"divide\\"],...He};const fe=[{result:e.HS.executeBasedOnType(He,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}],he={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let xe={};xe.shape=ae,e.HS.updateListInputs(xe),xe={...he,...xe};const ve=[{result:await e.HS.executeBasedOnTypeAsync(xe,!1,(e=>t.occt.fillets.filletEdges(e))),transformers:[]}];let Oe={};Oe.start=L,Oe.end=ie,e.HS.updateListInputs(Oe),Oe={start:[[0,0,0]],end:[[0,1,0]],...Oe};const Ie=[{result:await e.HS.executeBasedOnTypeAsync(Oe,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let Le={};Le.second=pe,e.HS.updateListInputs(Le),Le={first:[360],second:[1],operation:[\\"divide\\"],...Le};const Be=[{result:e.HS.executeBasedOnType(Le,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let we={};we.start=w,we.end=ie,e.HS.updateListInputs(we),we={start:[[0,0,0]],end:[[0,1,0]],...we};const Te=[{result:await e.HS.executeBasedOnTypeAsync(we,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let ge={};ge.y=le,e.HS.updateListInputs(ge),ge={x:[0],y:[0],z:[.05],...ge};const Ae=[{result:e.HS.executeBasedOnType(ge,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ee={};Ee.y=me,Ee.z=Q,e.HS.updateListInputs(Ee),Ee={x:[0],y:[0],z:[-1],...Ee};const be=[{result:e.HS.executeBasedOnType(Ee,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ze={};ze.y=me,ze.z=J,e.HS.updateListInputs(ze),ze={x:[0],y:[0],z:[0],...ze};const We=[{result:e.HS.executeBasedOnType(ze,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ce={};Ce.z=Se,e.HS.updateListInputs(Ce),Ce={x:[0],y:[0],z:[0],...Ce};const Pe=[{result:e.HS.executeBasedOnType(Ce,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Xe={};Xe.step=fe,e.HS.updateListInputs(Xe),Xe={step:[.1],min:[0],max:[360],...Xe};const Ye=e.HS.executeBasedOnType(Xe,!1,(e=>t.vector.span(e))),Ze=[];for(let e=0;e<1;e++)Ze.push({type:\\"flat\\"});const Ne=[{result:Ye,transformers:Ze}];let ke={};ke.first=Se,e.HS.updateListInputs(ke),ke={first:[2],second:[-2],operation:[\\"multiply\\"],...ke};e.HS.executeBasedOnType(ke,!1,(e=>t.math.twoNrOperation(e)));let Me={};Me.listElements=ve,e.HS.updateListInputs(Me),Me={...Me};const Fe=[{result:[Me.listElements?Me.listElements:[]]}],De={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Re={};Re.shape=Ie,Re.axis=o,Re.angle=Be,e.HS.updateListInputs(Re),Re={...De,...Re};const je=[{result:await e.HS.executeBasedOnTypeAsync(Re,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let qe={};qe.first=Be,e.HS.updateListInputs(qe),qe={first:[1],second:[.4],operation:[\\"multiply\\"],...qe};const Ve=[{result:e.HS.executeBasedOnType(qe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ge={};Ge.first=Be,e.HS.updateListInputs(Ge),Ge={first:[1],second:[.6],operation:[\\"multiply\\"],...Ge};const Je=[{result:e.HS.executeBasedOnType(Ge,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ke={};Ke.listElements=[Ae[0],j[0],be[0],We[0]],e.HS.updateListInputs(Ke),Ke={...Ke};const Qe=[{result:[Ke.listElements?Ke.listElements:[]]}];let Ue={};Ue.item=Ne,e.HS.updateListInputs(Ue),Ue={...Ue};const $e=[{result:Ue.item}],_e={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let et={};et.shape=je,et.nrOfDivisions=l,e.HS.updateListInputs(et),et={..._e,...et};const tt=[{result:await e.HS.executeBasedOnTypeAsync(et,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],st={shape:[void 0],axis:[[0,0,1]],angle:[0]};let nt={};nt.shape=Te,nt.axis=o,nt.angle=[Ve[0],Je[0]],e.HS.updateListInputs(nt),nt={...st,...nt};const rt=[{result:await e.HS.executeBasedOnTypeAsync(nt,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let at={};at.number=Ve,e.HS.updateListInputs(at),at={number:[1],operation:[\\"negate\\"],...at};const ot=[{result:e.HS.executeBasedOnType(at,!1,(e=>t.math.oneNrOperation(e))),transformers:[]}],it={points:[void 0]};let ct={};ct.points=Qe,e.HS.updateListInputs(ct),ct={...it,...ct};const pt=[{result:await e.HS.executeBasedOnTypeAsync(ct,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(pt,t);const ut={list:[void 0],pattern:[[!0,!0,!1]]};let lt={};lt.list=tt,lt.pattern=u,e.HS.updateListInputs(lt),lt={...ut,...lt};const dt=[{result:e.HS.executeBasedOnType(lt,!0,(e=>t.lists.getByPattern(e))),transformers:[]}];let mt={};mt.listElements=rt,e.HS.updateListInputs(mt),mt={...mt};const yt=[{result:[mt.listElements?mt.listElements:[]]}],St={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let Ht={};Ht.shape=pt,Ht.origin=We,Ht.direction=f,e.HS.updateListInputs(Ht),Ht={...St,...Ht};const ft=[{result:await e.HS.executeBasedOnTypeAsync(Ht,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ht={shape:[void 0]};let xt={};xt.shape=pt,e.HS.updateListInputs(xt),xt={...ht,...xt};const vt=await e.HS.executeBasedOnTypeAsync(xt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),Ot=[];for(let e=0;e<1;e++)Ot.push({type:\\"flat\\"});const It=[{result:vt,transformers:Ot}],Lt={list:[void 0],index:[0],clone:[!0]};let Bt={};Bt.list=yt,e.HS.updateListInputs(Bt),Bt={...Lt,...Bt};const wt=[{result:e.HS.executeBasedOnType(Bt,!1,(e=>t.lists.getItem(e))),transformers:[]}],Tt={shape:[void 0]};let gt={};gt.shape=ft,e.HS.updateListInputs(gt),gt={...Tt,...gt};const At=[{result:await e.HS.executeBasedOnTypeAsync(gt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),transformers:[]}],Et={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let bt={};bt.shape=wt,bt.nrOfDivisions=l,e.HS.updateListInputs(bt),bt={...Et,...bt};const zt=[{result:await e.HS.executeBasedOnTypeAsync(bt,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],Wt={list:[void 0],index:[3],clone:[!0]};let Ct={};Ct.list=At,e.HS.updateListInputs(Ct),Ct={...Wt,...Ct};const Pt=[{result:e.HS.executeBasedOnType(Ct,!1,(e=>t.lists.removeItemAtIndex(e))),transformers:[]}],Xt={list:[void 0],pattern:[[!0,!0,!1]]};let Yt={};Yt.list=zt,Yt.pattern=c,e.HS.updateListInputs(Yt),Yt={...Xt,...Yt};const Zt=[{result:e.HS.executeBasedOnType(Yt,!1,(e=>t.lists.getByPattern(e))),transformers:[]}],Nt={list:[void 0],clone:[!0]};let kt={};kt.list=Pt,e.HS.updateListInputs(kt),kt={...Nt,...kt};const Mt=e.HS.executeBasedOnType(kt,!1,(e=>t.lists.reverse(e))),Ft=[];for(let e=0;e<1;e++)Ft.push({type:\\"flat\\"});const Dt=[{result:Mt,transformers:Ft}];let Rt={};Rt.listElements=[Zt[0],dt[0]],e.HS.updateListInputs(Rt),Rt={...Rt};const jt=[{result:[Rt.listElements?Rt.listElements:[]]}];let qt={};qt.listElements=[It[0],Dt[0]],e.HS.updateListInputs(qt),qt={...qt};const Vt=[{result:[qt.listElements?qt.listElements:[]]}],Gt={list:[void 0],clone:[!0]};let Jt={};Jt.list=jt,e.HS.updateListInputs(Jt),Jt={...Gt,...Jt};const Kt=e.HS.executeBasedOnType(Jt,!1,(e=>t.lists.flipLists(e))),Qt=[];for(let e=0;e<2;e++)Qt.push({type:\\"flat\\"});const Ut=[{result:Kt,transformers:Qt}],$t={points:[void 0]};let _t={};_t.points=Vt,e.HS.updateListInputs(_t),_t={...$t,..._t};const es=[{result:await e.HS.executeBasedOnTypeAsync(_t,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let ts={};ts.listElements=Ut,e.HS.updateListInputs(ts),ts={...ts};const ss=[{result:[ts.listElements?ts.listElements:[]]}],ns={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let rs={};rs.shape=es,e.HS.updateListInputs(rs),rs={...ns,...rs};const as=[{result:await e.HS.executeBasedOnTypeAsync(rs,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],os={points:[void 0]};let is={};is.points=ss,e.HS.updateListInputs(is),is={...os,...is};const cs=[{result:await e.HS.executeBasedOnTypeAsync(is,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],ps={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let us={};us.shape=as,us.direction=x,e.HS.updateListInputs(us),us={...ps,...us};const ls=[{result:await e.HS.executeBasedOnTypeAsync(us,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],ds={shape:[void 0]};let ms={};ms.shape=as,e.HS.updateListInputs(ms),ms={...ds,...ms};const ys=[{result:await e.HS.executeBasedOnTypeAsync(ms,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],Ss={shape:[void 0]};let Hs={};Hs.shape=as,e.HS.updateListInputs(Hs),Hs={...Ss,...Hs};const fs=[{result:await e.HS.executeBasedOnTypeAsync(Hs,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],hs={shape:[void 0]};let xs={};xs.shape=as,e.HS.updateListInputs(xs),xs={...hs,...xs};const vs=[{result:await e.HS.executeBasedOnTypeAsync(xs,!1,(e=>t.occt.shapes.wire.closeOpenWire(e))),transformers:[]}],Os={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Is={};Is.shape=vs,Is.direction=x,e.HS.updateListInputs(Is),Is={...Os,...Is};const Ls=[{result:await e.HS.executeBasedOnTypeAsync(Is,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Bs={shape:[void 0],radius:[1],radiusList:[void 0],indexes:[void 0],direction:[[0,1,0]]};let ws={};ws.shape=cs,ws.direction=g,e.HS.updateListInputs(ws),ws={...Bs,...ws};const Ts=[{result:await e.HS.executeBasedOnTypeAsync(ws,!1,(e=>t.occt.fillets.fillet3DWire(e))),transformers:[]}],gs={shape:[void 0],face:[void 0],distance:[-.2],tolerance:[.1]};let As={};As.shape=ls,e.HS.updateListInputs(As),As={...gs,...As};const Es=[{result:await e.HS.executeBasedOnTypeAsync(As,!1,(e=>t.occt.operations.offset(e))),transformers:[]}],bs={shape:[void 0],index:[0]};let zs={};zs.shape=ls,e.HS.updateListInputs(zs),zs={...bs,...zs};const Ws=[{result:await e.HS.executeBasedOnTypeAsync(zs,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}];let Cs={};Cs.item=ys,e.HS.updateListInputs(Cs),Cs={...Cs};const Ps=[{result:Cs.item}];let Xs={};Xs.item=fs,e.HS.updateListInputs(Xs),Xs={...Xs};const Ys=[{result:Xs.item}];let Zs={};Zs.start=fs,Zs.end=ys,e.HS.updateListInputs(Zs),Zs={start:[[0,0,0]],end:[[0,1,0]],...Zs};const Ns=[{result:await e.HS.executeBasedOnTypeAsync(Zs,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(Ns,t);const ks={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Ms={};Ms.shape=Ts,Ms.angle=ot,Ms.direction=o,e.HS.updateListInputs(Ms),Ms={...ks,...Ms};const Fs=[{result:await e.HS.executeBasedOnTypeAsync(Ms,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Ds={shape:[void 0]};let Rs={};Rs.shape=Ls,e.HS.updateListInputs(Rs),Rs={...Ds,...Rs};const js=[{result:await e.HS.executeBasedOnTypeAsync(Rs,!1,(e=>t.occt.shapes.solid.fromClosedShell(e))),transformers:[]}],qs={shape:[void 0],index:[1]};let Vs={};Vs.shape=Ws,e.HS.updateListInputs(Vs),Vs={...qs,...Vs};const Gs=[{result:await e.HS.executeBasedOnTypeAsync(Vs,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}],Js={shape:[void 0],index:[0]};let Ks={};Ks.shape=Es,e.HS.updateListInputs(Ks),Ks={...Js,...Ks};const Qs=[{result:await e.HS.executeBasedOnTypeAsync(Ks,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}],Us={shape:[void 0],translation:[[0,0,0]]};let $s={};$s.shape=Ns,$s.translation=E,e.HS.updateListInputs($s),$s={...Us,...$s};const _s=[{result:await e.HS.executeBasedOnTypeAsync($s,!1,(e=>t.occt.transforms.translate(e))),transformers:[]}],en={shape:[void 0],direction:[[0,1,0]]};let tn={};tn.shape=Fs,tn.direction=Pe,e.HS.updateListInputs(tn),tn={...en,...tn};const sn=[{result:await e.HS.executeBasedOnTypeAsync(tn,!1,(e=>t.occt.operations.extrude(e))),transformers:[]}];let nn={};nn.listElements=js,e.HS.updateListInputs(nn),nn={...nn};const rn=[{result:[nn.listElements?nn.listElements:[]]}],an={shape:[void 0],index:[1]};let on={};on.shape=Qs,e.HS.updateListInputs(on),on={...an,...on};const cn=[{result:await e.HS.executeBasedOnTypeAsync(on,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}];let pn={};pn.listElements=Gs,e.HS.updateListInputs(pn),pn={...pn};const un=[{result:[pn.listElements?pn.listElements:[]]}],ln={shape:[void 0]};let dn={};dn.shape=_s,e.HS.updateListInputs(dn),dn={...ln,...dn};const mn=[{result:await e.HS.executeBasedOnTypeAsync(dn,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],yn={shape:[void 0]};let Sn={};Sn.shape=_s,e.HS.updateListInputs(Sn),Sn={...yn,...Sn};const Hn=[{result:await e.HS.executeBasedOnTypeAsync(Sn,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],fn={shapes:[void 0]};let hn={};hn.shapes=un,e.HS.updateListInputs(hn),hn={...fn,...hn};const xn=[{result:await e.HS.executeBasedOnTypeAsync(hn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let vn={};vn.listElements=cn,e.HS.updateListInputs(vn),vn={...vn};const On=[{result:[vn.listElements?vn.listElements:[]]}],In={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let Ln={};Ln.shape=sn,Ln.shapes=Fe,e.HS.updateListInputs(Ln),Ln={...In,...Ln};const Bn=[{result:await e.HS.executeBasedOnTypeAsync(Ln,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}];let wn={};wn.item=Hn,e.HS.updateListInputs(wn),wn={...wn};const Tn=[{result:wn.item}];let gn={};gn.item=mn,e.HS.updateListInputs(gn),gn={...gn};const An=[{result:gn.item}],En={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let bn={};bn.shape=Bn,bn.shapes=rn,e.HS.updateListInputs(bn),bn={...En,...bn};const zn=[{result:await e.HS.executeBasedOnTypeAsync(bn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}],Wn={shapes:[void 0]};let Cn={};Cn.shapes=On,e.HS.updateListInputs(Cn),Cn={...Wn,...Cn};const Pn=[{result:await e.HS.executeBasedOnTypeAsync(Cn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let Xn={};Xn.listElements=[Ps[0],Tn[0],An[0],Ys[0]],e.HS.updateListInputs(Xn),Xn={...Xn};const Yn=[{result:[Xn.listElements?Xn.listElements:[]]}],Zn={shape:[void 0],origin:[[0,0,0]],normal:[[0,0,1]]};let Nn={};Nn.shape=zn,Nn.normal=m,e.HS.updateListInputs(Nn),Nn={...Zn,...Nn};const kn=[{result:await e.HS.executeBasedOnTypeAsync(Nn,!1,(e=>t.occt.transforms.mirrorAlongNormal(e))),transformers:[]}];let Mn={};Mn.listElements=[xn[0],Pn[0]],e.HS.updateListInputs(Mn),Mn={...Mn};const Fn=[{result:[Mn.listElements?Mn.listElements:[]]}],Dn={points:[void 0]};let Rn={};Rn.points=Yn,e.HS.updateListInputs(Rn),Rn={...Dn,...Rn};const jn=[{result:await e.HS.executeBasedOnTypeAsync(Rn,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let qn={};qn.listElements=[kn[0],zn[0]],e.HS.updateListInputs(qn),qn={...qn};const Vn=[{result:[qn.listElements?qn.listElements:[]]}],Gn={shapes:[void 0],makeSolid:[!1]};let Jn={};Jn.shapes=Fn,e.HS.updateListInputs(Jn),Jn={...Gn,...Jn};const Kn=[{result:await e.HS.executeBasedOnTypeAsync(Jn,!1,(e=>t.occt.operations.loft(e))),transformers:[]}],Qn={shape:[void 0],radius:[.5],radiusList:[void 0],indexes:[void 0]};let Un={};Un.shape=jn,e.HS.updateListInputs(Un),Un={...Qn,...Un};const $n=[{result:await e.HS.executeBasedOnTypeAsync(Un,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],_n={shapes:[void 0]};let er={};er.shapes=Vn,e.HS.updateListInputs(er),er={..._n,...er};const tr=[{result:await e.HS.executeBasedOnTypeAsync(er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],sr={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let nr={};nr.shape=Kn,nr.origin=We,nr.direction=f,e.HS.updateListInputs(nr),nr={...sr,...nr};const rr=[{result:await e.HS.executeBasedOnTypeAsync(nr,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ar={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let or={};or.shape=$n,or.direction=x,e.HS.updateListInputs(or),or={...ar,...or};const ir=[{result:await e.HS.executeBasedOnTypeAsync(or,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}];let cr={};cr.listElements=[ls[0],Es[0],Kn[0],rr[0]],e.HS.updateListInputs(cr),cr={...cr};const pr=[{result:[cr.listElements?cr.listElements:[]]}],ur={shape:[void 0],offset:[-.1]};let lr={};lr.shape=ir,e.HS.updateListInputs(lr),lr={...ur,...lr};const dr=[{result:await e.HS.executeBasedOnTypeAsync(lr,!1,(e=>t.occt.operations.makeThickSolidSimple(e))),transformers:[]}],mr={shape:[void 0],angle:[0],center:[[0,0,0]],axis:[[0,0,1]]};let yr={};yr.shape=tr,yr.angle=$e,yr.axis=k,e.HS.updateListInputs(yr),yr={...mr,...yr};const Sr=[{result:await e.HS.executeBasedOnTypeAsync(yr,!1,(e=>t.occt.transforms.rotateAroundCenter(e))),transformers:[]}],Hr={shapes:[void 0],tolerance:[1e-7]};let fr={};fr.shapes=pr,e.HS.updateListInputs(fr),fr={...Hr,...fr};const hr=[{result:await e.HS.executeBasedOnTypeAsync(fr,!1,(e=>t.occt.shapes.shell.sewFaces(e))),transformers:[]}],xr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let vr={};vr.entity=dr,vr.options=z,e.HS.updateListInputs(vr),vr={...xr,...vr};await e.HS.executeBasedOnTypeAsync(vr,!1,(e=>t.draw.drawAnyAsync(e)));let Or={};Or.listElements=Sr,e.HS.updateListInputs(Or),Or={...Or};const Ir=[{result:[Or.listElements?Or.listElements:[]]}],Lr={shapes:[void 0]};let Br={};Br.shapes=Ir,e.HS.updateListInputs(Br),Br={...Lr,...Br};const wr=[{result:await e.HS.executeBasedOnTypeAsync(Br,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}];let Tr={};Tr.listElements=[hr[0],ve[0],wr[0]],e.HS.updateListInputs(Tr),Tr={...Tr};const gr=[{result:[Tr.listElements?Tr.listElements:[]]}],Ar={shapes:[void 0]};let Er={};Er.shapes=gr,e.HS.updateListInputs(Er),Er={...Ar,...Er};const br=[{result:await e.HS.executeBasedOnTypeAsync(Er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],zr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let Wr={};Wr.entity=br,Wr.options=ne,e.HS.updateListInputs(Wr),Wr={...zr,...Wr};await e.HS.executeBasedOnTypeAsync(Wr,!1,(e=>t.draw.drawAnyAsync(e)))}(BitByBit,bitbybit,bitbybitRunnerResult,bitbybitRunnerInputs,Bit);\"}' + return '{\"type\":\"rete\",\"version\":\"0.20.8\",\"script\":\"!async function(e,t,s,n,r){let a={};a={x:[0],y:[0],z:[1],...a};const o=[{result:e.HS.executeBasedOnType(a,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let i={};i={text:[\\"[true,false]\\"],...i};const c=[{result:e.HS.executeBasedOnType(i,!1,(e=>t.json.parse(e))),transformers:[]}];let p={};p={text:[\\"[false,true]\\"],...p};const u=[{result:e.HS.executeBasedOnType(p,!1,(e=>t.json.parse(e))),transformers:[]}],l=[{result:[5],transformers:[]}];let d={};d={x:[1],y:[0],z:[0],...d};const m=[{result:e.HS.executeBasedOnType(d,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}],y=[{result:[12],transformers:[]}],S=[{result:[7],transformers:[]}];let H={};H={x:[0],y:[1],z:[0],...H};const f=[{result:e.HS.executeBasedOnType(H,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let h={};h={x:[0],y:[0],z:[1],...h};const x=[{result:e.HS.executeBasedOnType(h,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let v={};v={number:[.4],...v};const O=[{result:e.HS.executeBasedOnType(v,!1,(e=>t.math.number(e))),transformers:[]}];let I={};I={x:[0],y:[0],z:[-1],...I};const L=[{result:e.HS.executeBasedOnType(I,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let B={};B={x:[0],y:[0],z:[-2],...B};const w=[{result:e.HS.executeBasedOnType(B,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let T={};T={x:[0],y:[0],z:[1],...T};const g=[{result:e.HS.executeBasedOnType(T,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let A={};A={x:[0],y:[1.5],z:[0],...A};const E=[{result:e.HS.executeBasedOnType(A,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let b={};b={...{faceOpacity:[.5],edgeOpacity:[.5],edgeColour:[\\"#000000\\"],faceColour:[\\"#212121\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.02],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]},...b};const z=[{result:e.HS.executeBasedOnType(b,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let W={};W={name:[\\"Custom Material\\"],baseColor:[\\"#9c9cba\\"],emissiveColor:[\\"#000000\\"],metallic:[.9],roughness:[.1],alpha:[1],backFaceCulling:[!1],zOffset:[2],...W};const C=[{result:e.HS.executeBasedOnType(W,!1,(e=>t.babylon.material.pbrMetallicRoughness.create(e))),transformers:[]}];let P={};P={x:[0],y:[0],z:[-1],...P};const X=[{result:e.HS.executeBasedOnType(P,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Y={};Y={x:[0],y:[0],z:[-1.5],...Y};const Z=[{result:e.HS.executeBasedOnType(Y,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let N={};N={x:[0],y:[0],z:[1],...N};const k=[{result:e.HS.executeBasedOnType(N,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let M={};M={skybox:[\\"city\\"],size:[1e3],blur:[.4],environmentIntensity:[.4],...M};e.HS.executeBasedOnType(M,!1,(e=>t.babylon.scene.enableSkybox(e)));let F={number:[{result:[20],transformers:[]}]};e.HS.updateListInputs(F),F={number:[20],...F};const D=[{result:e.HS.executeBasedOnType(F,!1,(e=>t.math.number(e))),transformers:[]}];let R={};R.y=y,e.HS.updateListInputs(R),R={x:[0],y:[0],z:[0],...R};const j=[{result:e.HS.executeBasedOnType(R,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let q={};q.item=y,e.HS.updateListInputs(q),q={...q};const V=[{result:q.item}];let G={};G.first=S,e.HS.updateListInputs(G),G={first:[1],second:[-2],operation:[\\"divide\\"],...G};const J=[{result:e.HS.executeBasedOnType(G,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let K={};K.first=S,e.HS.updateListInputs(K),K={first:[1],second:[-4],operation:[\\"divide\\"],...K};const Q=[{result:e.HS.executeBasedOnType(K,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let U={};U.first=y,U.second=O,e.HS.updateListInputs(U),U={first:[1],second:[.4],operation:[\\"add\\"],...U};const $=[{result:e.HS.executeBasedOnType(U,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let _={};_.item=S,e.HS.updateListInputs(_),_={..._};const ee=[{result:_.item}],te={faceOpacity:[1],edgeOpacity:[1],edgeColour:[\\"#1c1c1c\\"],faceColour:[\\"#bdbdbd\\"],vertexColour:[\\"#ff00ff\\"],faceMaterial:[void 0],edgeWidth:[2],vertexSize:[.03],drawEdges:[!0],drawFaces:[!0],drawVertices:[!1],precision:[.01],drawEdgeIndexes:[!1],edgeIndexHeight:[.06],edgeIndexColour:[\\"ff00ff\\"],drawFaceIndexes:[!1],faceIndexHeight:[.06],faceIndexColour:[\\"#0000ff\\"]};let se={};se.faceMaterial=C,e.HS.updateListInputs(se),se={...te,...se};const ne=[{result:e.HS.executeBasedOnType(se,!1,(e=>t.draw.optionsOcctShape(e))),transformers:[]}];let re={};re.center=Z,re.direction=X,e.HS.updateListInputs(re),re={radius:[3],height:[1.9],center:[[0,0,0]],direction:[[0,1,0]],...re};const ae=[{result:await e.HS.executeBasedOnTypeAsync(re,!1,(e=>t.occt.shapes.solid.createCylinder(e))),transformers:[]}];let oe={};oe.y=$,e.HS.updateListInputs(oe),oe={x:[0],y:[12],z:[0],...oe};const ie=[{result:e.HS.executeBasedOnType(oe,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ce={};ce.first=D,e.HS.updateListInputs(ce),ce={first:[1],second:[3],operation:[\\"multiply\\"],...ce};const pe=[{result:e.HS.executeBasedOnType(ce,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ue={};ue.first=V,ue.second=O,e.HS.updateListInputs(ue),ue={first:[1],second:[.4],operation:[\\"add\\"],...ue};const le=[{result:e.HS.executeBasedOnType(ue,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let de={};de.first=V,de.second=O,e.HS.updateListInputs(de),de={first:[1],second:[.4],operation:[\\"subtract\\"],...de};const me=[{result:e.HS.executeBasedOnType(de,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let ye={};ye.first=ee,e.HS.updateListInputs(ye),ye={first:[1],second:[-.2],operation:[\\"multiply\\"],...ye};const Se=[{result:e.HS.executeBasedOnType(ye,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let He={};He.second=D,e.HS.updateListInputs(He),He={first:[360],second:[1],operation:[\\"divide\\"],...He};const fe=[{result:e.HS.executeBasedOnType(He,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}],he={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let xe={};xe.shape=ae,e.HS.updateListInputs(xe),xe={...he,...xe};const ve=[{result:await e.HS.executeBasedOnTypeAsync(xe,!1,(e=>t.occt.fillets.filletEdges(e))),transformers:[]}];let Oe={};Oe.start=L,Oe.end=ie,e.HS.updateListInputs(Oe),Oe={start:[[0,0,0]],end:[[0,1,0]],...Oe};const Ie=[{result:await e.HS.executeBasedOnTypeAsync(Oe,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let Le={};Le.second=pe,e.HS.updateListInputs(Le),Le={first:[360],second:[1],operation:[\\"divide\\"],...Le};const Be=[{result:e.HS.executeBasedOnType(Le,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let we={};we.start=w,we.end=ie,e.HS.updateListInputs(we),we={start:[[0,0,0]],end:[[0,1,0]],...we};const Te=[{result:await e.HS.executeBasedOnTypeAsync(we,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];let ge={};ge.y=le,e.HS.updateListInputs(ge),ge={x:[0],y:[0],z:[.05],...ge};const Ae=[{result:e.HS.executeBasedOnType(ge,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ee={};Ee.y=me,Ee.z=Q,e.HS.updateListInputs(Ee),Ee={x:[0],y:[0],z:[-1],...Ee};const be=[{result:e.HS.executeBasedOnType(Ee,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let ze={};ze.y=me,ze.z=J,e.HS.updateListInputs(ze),ze={x:[0],y:[0],z:[0],...ze};const We=[{result:e.HS.executeBasedOnType(ze,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Ce={};Ce.z=Se,e.HS.updateListInputs(Ce),Ce={x:[0],y:[0],z:[0],...Ce};const Pe=[{result:e.HS.executeBasedOnType(Ce,!1,(e=>t.vector.vectorXYZ(e))),transformers:[]}];let Xe={};Xe.step=fe,e.HS.updateListInputs(Xe),Xe={step:[.1],min:[0],max:[360],...Xe};const Ye=e.HS.executeBasedOnType(Xe,!1,(e=>t.vector.span(e))),Ze=[];for(let e=0;e<1;e++)Ze.push({type:\\"flat\\"});const Ne=[{result:Ye,transformers:Ze}];let ke={};ke.first=Se,e.HS.updateListInputs(ke),ke={first:[2],second:[-2],operation:[\\"multiply\\"],...ke};e.HS.executeBasedOnType(ke,!1,(e=>t.math.twoNrOperation(e)));let Me={};Me.listElements=ve,e.HS.updateListInputs(Me),Me={...Me};const Fe=[{result:[Me.listElements?Me.listElements:[]]}],De={shape:[void 0],axis:[[0,0,1]],angle:[0]};let Re={};Re.shape=Ie,Re.axis=o,Re.angle=Be,e.HS.updateListInputs(Re),Re={...De,...Re};const je=[{result:await e.HS.executeBasedOnTypeAsync(Re,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let qe={};qe.first=Be,e.HS.updateListInputs(qe),qe={first:[1],second:[.4],operation:[\\"multiply\\"],...qe};const Ve=[{result:e.HS.executeBasedOnType(qe,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ge={};Ge.first=Be,e.HS.updateListInputs(Ge),Ge={first:[1],second:[.6],operation:[\\"multiply\\"],...Ge};const Je=[{result:e.HS.executeBasedOnType(Ge,!1,(e=>t.math.twoNrOperation(e))),transformers:[]}];let Ke={};Ke.listElements=[Ae[0],j[0],be[0],We[0]],e.HS.updateListInputs(Ke),Ke={...Ke};const Qe=[{result:[Ke.listElements?Ke.listElements:[]]}];let Ue={};Ue.item=Ne,e.HS.updateListInputs(Ue),Ue={...Ue};const $e=[{result:Ue.item}],_e={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let et={};et.shape=je,et.nrOfDivisions=l,e.HS.updateListInputs(et),et={..._e,...et};const tt=[{result:await e.HS.executeBasedOnTypeAsync(et,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],st={shape:[void 0],axis:[[0,0,1]],angle:[0]};let nt={};nt.shape=Te,nt.axis=o,nt.angle=[Ve[0],Je[0]],e.HS.updateListInputs(nt),nt={...st,...nt};const rt=[{result:await e.HS.executeBasedOnTypeAsync(nt,!1,(e=>t.occt.transforms.rotate(e))),transformers:[]}];let at={};at.number=Ve,e.HS.updateListInputs(at),at={number:[1],operation:[\\"negate\\"],...at};const ot=[{result:e.HS.executeBasedOnType(at,!1,(e=>t.math.oneNrOperation(e))),transformers:[]}],it={points:[void 0]};let ct={};ct.points=Qe,e.HS.updateListInputs(ct),ct={...it,...ct};const pt=[{result:await e.HS.executeBasedOnTypeAsync(ct,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(pt,t);const ut={list:[void 0],pattern:[[!0,!0,!1]]};let lt={};lt.list=tt,lt.pattern=u,e.HS.updateListInputs(lt),lt={...ut,...lt};const dt=[{result:e.HS.executeBasedOnType(lt,!0,(e=>t.lists.getByPattern(e))),transformers:[]}];let mt={};mt.listElements=rt,e.HS.updateListInputs(mt),mt={...mt};const yt=[{result:[mt.listElements?mt.listElements:[]]}],St={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let Ht={};Ht.shape=pt,Ht.origin=We,Ht.direction=f,e.HS.updateListInputs(Ht),Ht={...St,...Ht};const ft=[{result:await e.HS.executeBasedOnTypeAsync(Ht,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ht={shape:[void 0]};let xt={};xt.shape=pt,e.HS.updateListInputs(xt),xt={...ht,...xt};const vt=await e.HS.executeBasedOnTypeAsync(xt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),Ot=[];for(let e=0;e<1;e++)Ot.push({type:\\"flat\\"});const It=[{result:vt,transformers:Ot}],Lt={list:[void 0],index:[0],clone:[!0]};let Bt={};Bt.list=yt,e.HS.updateListInputs(Bt),Bt={...Lt,...Bt};const wt=[{result:e.HS.executeBasedOnType(Bt,!1,(e=>t.lists.getItem(e))),transformers:[]}],Tt={shape:[void 0]};let gt={};gt.shape=ft,e.HS.updateListInputs(gt),gt={...Tt,...gt};const At=[{result:await e.HS.executeBasedOnTypeAsync(gt,!1,(e=>t.occt.shapes.edge.getCornerPointsOfEdgesForShape(e))),transformers:[]}],Et={shape:[void 0],nrOfDivisions:[11],removeStartPoint:[!1],removeEndPoint:[!1]};let bt={};bt.shape=wt,bt.nrOfDivisions=l,e.HS.updateListInputs(bt),bt={...Et,...bt};const zt=[{result:await e.HS.executeBasedOnTypeAsync(bt,!1,(e=>t.occt.shapes.wire.divideWireByEqualDistanceToPoints(e))),transformers:[]}],Wt={list:[void 0],index:[3],clone:[!0]};let Ct={};Ct.list=At,e.HS.updateListInputs(Ct),Ct={...Wt,...Ct};const Pt=[{result:e.HS.executeBasedOnType(Ct,!1,(e=>t.lists.removeItemAtIndex(e))),transformers:[]}],Xt={list:[void 0],pattern:[[!0,!0,!1]]};let Yt={};Yt.list=zt,Yt.pattern=c,e.HS.updateListInputs(Yt),Yt={...Xt,...Yt};const Zt=[{result:e.HS.executeBasedOnType(Yt,!1,(e=>t.lists.getByPattern(e))),transformers:[]}],Nt={list:[void 0],clone:[!0]};let kt={};kt.list=Pt,e.HS.updateListInputs(kt),kt={...Nt,...kt};const Mt=e.HS.executeBasedOnType(kt,!1,(e=>t.lists.reverse(e))),Ft=[];for(let e=0;e<1;e++)Ft.push({type:\\"flat\\"});const Dt=[{result:Mt,transformers:Ft}];let Rt={};Rt.listElements=[Zt[0],dt[0]],e.HS.updateListInputs(Rt),Rt={...Rt};const jt=[{result:[Rt.listElements?Rt.listElements:[]]}];let qt={};qt.listElements=[It[0],Dt[0]],e.HS.updateListInputs(qt),qt={...qt};const Vt=[{result:[qt.listElements?qt.listElements:[]]}],Gt={list:[void 0],clone:[!0]};let Jt={};Jt.list=jt,e.HS.updateListInputs(Jt),Jt={...Gt,...Jt};const Kt=e.HS.executeBasedOnType(Jt,!1,(e=>t.lists.flipLists(e))),Qt=[];for(let e=0;e<2;e++)Qt.push({type:\\"flat\\"});const Ut=[{result:Kt,transformers:Qt}],$t={points:[void 0]};let _t={};_t.points=Vt,e.HS.updateListInputs(_t),_t={...$t,..._t};const es=[{result:await e.HS.executeBasedOnTypeAsync(_t,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let ts={};ts.listElements=Ut,e.HS.updateListInputs(ts),ts={...ts};const ss=[{result:[ts.listElements?ts.listElements:[]]}],ns={shape:[void 0],radius:[.3],radiusList:[void 0],indexes:[void 0]};let rs={};rs.shape=es,e.HS.updateListInputs(rs),rs={...ns,...rs};const as=[{result:await e.HS.executeBasedOnTypeAsync(rs,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],os={points:[void 0]};let is={};is.points=ss,e.HS.updateListInputs(is),is={...os,...is};const cs=[{result:await e.HS.executeBasedOnTypeAsync(is,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}],ps={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let us={};us.shape=as,us.direction=x,e.HS.updateListInputs(us),us={...ps,...us};const ls=[{result:await e.HS.executeBasedOnTypeAsync(us,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],ds={shape:[void 0]};let ms={};ms.shape=as,e.HS.updateListInputs(ms),ms={...ds,...ms};const ys=[{result:await e.HS.executeBasedOnTypeAsync(ms,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],Ss={shape:[void 0]};let Hs={};Hs.shape=as,e.HS.updateListInputs(Hs),Hs={...Ss,...Hs};const fs=[{result:await e.HS.executeBasedOnTypeAsync(Hs,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],hs={shape:[void 0]};let xs={};xs.shape=as,e.HS.updateListInputs(xs),xs={...hs,...xs};const vs=[{result:await e.HS.executeBasedOnTypeAsync(xs,!1,(e=>t.occt.shapes.wire.closeOpenWire(e))),transformers:[]}],Os={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Is={};Is.shape=vs,Is.direction=x,e.HS.updateListInputs(Is),Is={...Os,...Is};const Ls=[{result:await e.HS.executeBasedOnTypeAsync(Is,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Bs={shape:[void 0],radius:[1],radiusList:[void 0],indexes:[void 0],direction:[[0,1,0]]};let ws={};ws.shape=cs,ws.direction=g,e.HS.updateListInputs(ws),ws={...Bs,...ws};const Ts=[{result:await e.HS.executeBasedOnTypeAsync(ws,!1,(e=>t.occt.fillets.fillet3DWire(e))),transformers:[]}],gs={shape:[void 0],face:[void 0],distance:[-.2],tolerance:[.1]};let As={};As.shape=ls,e.HS.updateListInputs(As),As={...gs,...As};const Es=[{result:await e.HS.executeBasedOnTypeAsync(As,!1,(e=>t.occt.operations.offset(e))),transformers:[]}],bs={shape:[void 0],index:[0]};let zs={};zs.shape=ls,e.HS.updateListInputs(zs),zs={...bs,...zs};const Ws=[{result:await e.HS.executeBasedOnTypeAsync(zs,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}];let Cs={};Cs.item=ys,e.HS.updateListInputs(Cs),Cs={...Cs};const Ps=[{result:Cs.item}];let Xs={};Xs.item=fs,e.HS.updateListInputs(Xs),Xs={...Xs};const Ys=[{result:Xs.item}];let Zs={};Zs.start=fs,Zs.end=ys,e.HS.updateListInputs(Zs),Zs={start:[[0,0,0]],end:[[0,1,0]],...Zs};const Ns=[{result:await e.HS.executeBasedOnTypeAsync(Zs,!1,(e=>t.occt.shapes.wire.createLineWire(e))),transformers:[]}];e.HS.drawNodeMeshes(Ns,t);const ks={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let Ms={};Ms.shape=Ts,Ms.angle=ot,Ms.direction=o,e.HS.updateListInputs(Ms),Ms={...ks,...Ms};const Fs=[{result:await e.HS.executeBasedOnTypeAsync(Ms,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}],Ds={shape:[void 0]};let Rs={};Rs.shape=Ls,e.HS.updateListInputs(Rs),Rs={...Ds,...Rs};const js=[{result:await e.HS.executeBasedOnTypeAsync(Rs,!1,(e=>t.occt.shapes.solid.fromClosedShell(e))),transformers:[]}],qs={shape:[void 0],index:[1]};let Vs={};Vs.shape=Ws,e.HS.updateListInputs(Vs),Vs={...qs,...Vs};const Gs=[{result:await e.HS.executeBasedOnTypeAsync(Vs,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}],Js={shape:[void 0],index:[0]};let Ks={};Ks.shape=Es,e.HS.updateListInputs(Ks),Ks={...Js,...Ks};const Qs=[{result:await e.HS.executeBasedOnTypeAsync(Ks,!1,(e=>t.occt.shapes.wire.getWire(e))),transformers:[]}],Us={shape:[void 0],translation:[[0,0,0]]};let $s={};$s.shape=Ns,$s.translation=E,e.HS.updateListInputs($s),$s={...Us,...$s};const _s=[{result:await e.HS.executeBasedOnTypeAsync($s,!1,(e=>t.occt.transforms.translate(e))),transformers:[]}],en={shape:[void 0],direction:[[0,1,0]]};let tn={};tn.shape=Fs,tn.direction=Pe,e.HS.updateListInputs(tn),tn={...en,...tn};const sn=[{result:await e.HS.executeBasedOnTypeAsync(tn,!1,(e=>t.occt.operations.extrude(e))),transformers:[]}];let nn={};nn.listElements=js,e.HS.updateListInputs(nn),nn={...nn};const rn=[{result:[nn.listElements?nn.listElements:[]]}],an={shape:[void 0],index:[1]};let on={};on.shape=Qs,e.HS.updateListInputs(on),on={...an,...on};const cn=[{result:await e.HS.executeBasedOnTypeAsync(on,!1,(e=>t.occt.shapes.edge.getEdge(e))),transformers:[]}];let pn={};pn.listElements=Gs,e.HS.updateListInputs(pn),pn={...pn};const un=[{result:[pn.listElements?pn.listElements:[]]}],ln={shape:[void 0]};let dn={};dn.shape=_s,e.HS.updateListInputs(dn),dn={...ln,...dn};const mn=[{result:await e.HS.executeBasedOnTypeAsync(dn,!1,(e=>t.occt.shapes.wire.startPointOnWire(e))),transformers:[]}],yn={shape:[void 0]};let Sn={};Sn.shape=_s,e.HS.updateListInputs(Sn),Sn={...yn,...Sn};const Hn=[{result:await e.HS.executeBasedOnTypeAsync(Sn,!1,(e=>t.occt.shapes.wire.endPointOnWire(e))),transformers:[]}],fn={shapes:[void 0]};let hn={};hn.shapes=un,e.HS.updateListInputs(hn),hn={...fn,...hn};const xn=[{result:await e.HS.executeBasedOnTypeAsync(hn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let vn={};vn.listElements=cn,e.HS.updateListInputs(vn),vn={...vn};const On=[{result:[vn.listElements?vn.listElements:[]]}],In={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let Ln={};Ln.shape=sn,Ln.shapes=Fe,e.HS.updateListInputs(Ln),Ln={...In,...Ln};const Bn=[{result:await e.HS.executeBasedOnTypeAsync(Ln,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}];let wn={};wn.item=Hn,e.HS.updateListInputs(wn),wn={...wn};const Tn=[{result:wn.item}];let gn={};gn.item=mn,e.HS.updateListInputs(gn),gn={...gn};const An=[{result:gn.item}],En={shape:[void 0],shapes:[void 0],keepEdges:[!1]};let bn={};bn.shape=Bn,bn.shapes=rn,e.HS.updateListInputs(bn),bn={...En,...bn};const zn=[{result:await e.HS.executeBasedOnTypeAsync(bn,!1,(e=>t.occt.booleans.difference(e))),transformers:[]}],Wn={shapes:[void 0]};let Cn={};Cn.shapes=On,e.HS.updateListInputs(Cn),Cn={...Wn,...Cn};const Pn=[{result:await e.HS.executeBasedOnTypeAsync(Cn,!1,(e=>t.occt.shapes.wire.combineEdgesAndWiresIntoAWire(e))),transformers:[]}];let Xn={};Xn.listElements=[Ps[0],Tn[0],An[0],Ys[0]],e.HS.updateListInputs(Xn),Xn={...Xn};const Yn=[{result:[Xn.listElements?Xn.listElements:[]]}],Zn={shape:[void 0],origin:[[0,0,0]],normal:[[0,0,1]]};let Nn={};Nn.shape=zn,Nn.normal=m,e.HS.updateListInputs(Nn),Nn={...Zn,...Nn};const kn=[{result:await e.HS.executeBasedOnTypeAsync(Nn,!1,(e=>t.occt.transforms.mirrorAlongNormal(e))),transformers:[]}];let Mn={};Mn.listElements=[xn[0],Pn[0]],e.HS.updateListInputs(Mn),Mn={...Mn};const Fn=[{result:[Mn.listElements?Mn.listElements:[]]}],Dn={points:[void 0]};let Rn={};Rn.points=Yn,e.HS.updateListInputs(Rn),Rn={...Dn,...Rn};const jn=[{result:await e.HS.executeBasedOnTypeAsync(Rn,!1,(e=>t.occt.shapes.wire.createPolylineWire(e))),transformers:[]}];let qn={};qn.listElements=[kn[0],zn[0]],e.HS.updateListInputs(qn),qn={...qn};const Vn=[{result:[qn.listElements?qn.listElements:[]]}],Gn={shapes:[void 0],makeSolid:[!1]};let Jn={};Jn.shapes=Fn,e.HS.updateListInputs(Jn),Jn={...Gn,...Jn};const Kn=[{result:await e.HS.executeBasedOnTypeAsync(Jn,!1,(e=>t.occt.operations.loft(e))),transformers:[]}],Qn={shape:[void 0],radius:[.5],radiusList:[void 0],indexes:[void 0]};let Un={};Un.shape=jn,e.HS.updateListInputs(Un),Un={...Qn,...Un};const $n=[{result:await e.HS.executeBasedOnTypeAsync(Un,!1,(e=>t.occt.fillets.fillet2d(e))),transformers:[]}],_n={shapes:[void 0]};let er={};er.shapes=Vn,e.HS.updateListInputs(er),er={..._n,...er};const tr=[{result:await e.HS.executeBasedOnTypeAsync(er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],sr={shape:[void 0],origin:[[0,0,0]],direction:[[0,0,1]]};let nr={};nr.shape=Kn,nr.origin=We,nr.direction=f,e.HS.updateListInputs(nr),nr={...sr,...nr};const rr=[{result:await e.HS.executeBasedOnTypeAsync(nr,!1,(e=>t.occt.transforms.mirror(e))),transformers:[]}],ar={shape:[void 0],angle:[360],direction:[[0,1,0]],copy:[!1]};let or={};or.shape=$n,or.direction=x,e.HS.updateListInputs(or),or={...ar,...or};const ir=[{result:await e.HS.executeBasedOnTypeAsync(or,!1,(e=>t.occt.operations.revolve(e))),transformers:[]}];let cr={};cr.listElements=[ls[0],Es[0],Kn[0],rr[0]],e.HS.updateListInputs(cr),cr={...cr};const pr=[{result:[cr.listElements?cr.listElements:[]]}],ur={shape:[void 0],offset:[-.1]};let lr={};lr.shape=ir,e.HS.updateListInputs(lr),lr={...ur,...lr};const dr=[{result:await e.HS.executeBasedOnTypeAsync(lr,!1,(e=>t.occt.operations.makeThickSolidSimple(e))),transformers:[]}],mr={shape:[void 0],angle:[0],center:[[0,0,0]],axis:[[0,0,1]]};let yr={};yr.shape=tr,yr.angle=$e,yr.axis=k,e.HS.updateListInputs(yr),yr={...mr,...yr};const Sr=[{result:await e.HS.executeBasedOnTypeAsync(yr,!1,(e=>t.occt.transforms.rotateAroundCenter(e))),transformers:[]}],Hr={shapes:[void 0],tolerance:[1e-7]};let fr={};fr.shapes=pr,e.HS.updateListInputs(fr),fr={...Hr,...fr};const hr=[{result:await e.HS.executeBasedOnTypeAsync(fr,!1,(e=>t.occt.shapes.shell.sewFaces(e))),transformers:[]}],xr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let vr={};vr.entity=dr,vr.options=z,e.HS.updateListInputs(vr),vr={...xr,...vr};await e.HS.executeBasedOnTypeAsync(vr,!1,(e=>t.draw.drawAnyAsync(e)));let Or={};Or.listElements=Sr,e.HS.updateListInputs(Or),Or={...Or};const Ir=[{result:[Or.listElements?Or.listElements:[]]}],Lr={shapes:[void 0]};let Br={};Br.shapes=Ir,e.HS.updateListInputs(Br),Br={...Lr,...Br};const wr=[{result:await e.HS.executeBasedOnTypeAsync(Br,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}];let Tr={};Tr.listElements=[hr[0],ve[0],wr[0]],e.HS.updateListInputs(Tr),Tr={...Tr};const gr=[{result:[Tr.listElements?Tr.listElements:[]]}],Ar={shapes:[void 0]};let Er={};Er.shapes=gr,e.HS.updateListInputs(Er),Er={...Ar,...Er};const br=[{result:await e.HS.executeBasedOnTypeAsync(Er,!1,(e=>t.occt.shapes.compound.makeCompound(e))),transformers:[]}],zr={entity:[void 0],options:[void 0],babylonMesh:[void 0]};let Wr={};Wr.entity=br,Wr.options=ne,e.HS.updateListInputs(Wr),Wr={...zr,...Wr};await e.HS.executeBasedOnTypeAsync(Wr,!1,(e=>t.draw.drawAnyAsync(e)))}(BitByBit,bitbybit,bitbybitRunnerResult,bitbybitRunnerInputs,Bit);\"}' };