Skip to content

Commit dcc919d

Browse files
update to docs
1 parent c45d529 commit dcc919d

File tree

6 files changed

+304
-1
lines changed

6 files changed

+304
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Booleans",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}

docs/learn/code/common/occt/booleans/operations.mdx

Lines changed: 178 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Fillets",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: "Introduction to OCCT Fillets"
3+
sidebar_label: Fillets Intro
4+
description: Learn about OCCT fillets, which create roundings on the edges of shapes (solids, shells, or wires) to produce smooth transitions, with examples in Bitbybit.
5+
tags: [occt]
6+
---
7+
8+
import BitByBitRenderCanvas from '@site/src/components/BitByBitRenderCanvas';
9+
10+
# OCCT Fillets: Creating Rounded Edges
11+
12+
<img
13+
class="category-icon-small"
14+
src="https://s.bitbybit.dev/assets/icons/white/occt-icon.svg"
15+
width="100"
16+
alt="OCCT category icon with a stylized logo representation"
17+
title="OCCT category icon" />
18+
19+
## Introduction to Fillets
20+
21+
**Fillets** are geometric operations that create smooth, rounded transitions along the edges of shapes. They are widely used in various industries to:
22+
* Soften sharp corners and edges, giving shapes a more organic or aesthetically pleasing look.
23+
* Improve structural integrity by reducing stress concentrations at sharp intersections.
24+
* Create smooth transitions between two or more surfaces on **shells** and **solids**.
25+
* Apply roundings between two or more connected **edges** within a **wire**.
26+
27+
![A 3D solid box with several of its edges rounded by fillet operations of varying radii.](https://ik.imagekit.io/bitbybit/app/assets/start/general/editor-categories/variable-fillet.jpeg "Fillets on a 3D solid")
28+
*Fillets on a 3D solid with variable radii.*
29+
30+
## How Can Fillets Be Applied to a Solid?
31+
32+
In Bitbybit, leveraging OCCT's capabilities, there are a few primary ways to create fillets on solid shapes:
33+
34+
1. **Fillet All Edges:** You can apply a fillet of a uniform radius to all eligible edges of a solid simultaneously.
35+
2. **Fillet Specific Edges by Index:** For more precise control, you can apply fillets to specific edges by providing their [edge indexes](/learn/code/common/occt/shapes/edge/edge-indexes). This allows for different radii on different edges or filleting only a subset of edges.
36+
37+
### Filleting All Edges of a Solid
38+
39+
Let's first look at the simplest case: applying a fillet with a given radius to all applicable edges of a solid. In Bitbybit, you'll typically use a "Fillet Edges" command or function for this.
40+
41+
The following examples in TypeScript, Rete, and Blockly demonstrate creating a simple box solid and then filleting all its edges:
42+
43+
**TypeScript Example: Fillet All Edges of a Solid**
44+
<BitByBitRenderCanvas
45+
requireManualStart={true}
46+
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.3","type":"typescript"}}
47+
title="Fillet Solid"
48+
/>
49+
50+
**Blockly Example: Fillet All Edges of a Solid**
51+
<BitByBitRenderCanvas
52+
requireManualStart={true}
53+
script={{"script":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"bitbybit.draw.drawAnyAsyncNoReturn\" id=\"UO^K1-FNciNjT{DsaF2S\" x=\"126\" y=\"-931\"><value name=\"Entity\"><block type=\"bitbybit.occt.fillets.filletEdges\" id=\"]d!qIi^FvTrfo6~}o~r!\"><value name=\"Shape\"><block type=\"bitbybit.occt.shapes.solid.createBox\" id=\"}ti`95.Px,*VWdbe:+2(\"><value name=\"Width\"><block type=\"math_number\" id=\"qKPm%W;J:H.3i8v#2Ibp\"><field name=\"NUM\">5</field></block></value><value name=\"Length\"><block type=\"math_number\" id=\"KA!u62qD46=^mm()r/Kr\"><field name=\"NUM\">8</field></block></value><value name=\"Height\"><block type=\"math_number\" id=\"1P/r/2V@?!Yd|dy3n78U\"><field name=\"NUM\">10</field></block></value><value name=\"Center\"><block type=\"bitbybit.point.pointXYZ\" id=\"lyxO-q4()OdN=awoG:Y0\"><value name=\"X\"><block type=\"math_number\" id=\"4bQJbGsRZ2NRQ)=dgggy\"><field name=\"NUM\">0</field></block></value><value name=\"Y\"><block type=\"math_number\" id=\"(.66wVQ[,1%aY!?{k4(:\"><field name=\"NUM\">0</field></block></value><value name=\"Z\"><block type=\"math_number\" id=\"C5,9wZ=aD7(*AhsLhq3%\"><field name=\"NUM\">0</field></block></value></block></value></block></value><value name=\"Radius\"><block type=\"math_number\" id=\"Tl]m971f5#L-B6U8oI2$\"><field name=\"NUM\">1</field></block></value></block></value></block></xml>","version":"0.20.3","type":"blockly"}}
54+
title="Fillet Solid"
55+
/>
56+
57+
**Rete Example: Fillet All Edges of a Solid**
58+
<BitByBitRenderCanvas
59+
requireManualStart={true}
60+
script={{"script":"{\"id\":\"rete-v2-json\",\"nodes\":{\"24d5eba8a6441cd3\":{\"id\":\"24d5eba8a6441cd3\",\"name\":\"bitbybit.occt.shapes.solid.createBox\",\"customName\":\"box\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"width\":5,\"length\":8,\"height\":10,\"center\":[0,0,0],\"originOnCenter\":true},\"inputs\":{},\"position\":[-708.9265376490123,859.1667600728709]},\"fabbb1728807a7f9\":{\"id\":\"fabbb1728807a7f9\",\"name\":\"bitbybit.occt.fillets.filletEdges\",\"customName\":\"fillet edges\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"radius\":1},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"24d5eba8a6441cd3\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-269.9433663221892,1146.51629885998]}}}","version":"0.20.3","type":"rete"}}
61+
title="Fillet Solid"
62+
/>
63+
64+
Filleting operations are a powerful tool in CAD modeling for refining designs and achieving desired aesthetics and functional properties. In subsequent sections or advanced tutorials, we might explore how to fillet specific edges using their indexes and apply other types of fillets.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: "OCCT Fillets: Variable Radius on Specific Edges"
3+
sidebar_label: Variable Edge Radius Fillets
4+
description: Learn how to apply fillets with different radii to specific edges of an OCCT solid using edge indexes in Bitbybit's Rete, Blockly, and TypeScript editors.
5+
tags: [occt]
6+
---
7+
8+
import BitByBitRenderCanvas from '@site/src/components/BitByBitRenderCanvas';
9+
10+
# OCCT Fillets: Applying Variable Radius on Specific Edges
11+
12+
In addition to filleting all edges of a solid with a uniform radius, OpenCascade Technology (OCCT) allows for more precise control by applying fillets with **different radii to specific, individual edges**. This is achieved by identifying the target edges using their [edge indexes](/editors/categories/occt/edge-indexing).
13+
14+
This capability is essential for creating more detailed and nuanced designs where varying degrees of rounding are required on different parts of a model.
15+
16+
### How It Works
17+
18+
The general process involves:
19+
1. **Identifying Target Edges:** Determine the indexes of the edges you wish to fillet. You can visualize these indexes using the "Draw Edge Indexes" option in the drawing settings.
20+
2. **Providing Edge Index and Radius Pairs:** The fillet operation will typically require you to provide a list of edge indexes along with their corresponding desired fillet radii. This allows you to specify, for example, that edge index 1 should have a radius of 0.5, while edge index 5 should have a radius of 1.2.
21+
22+
The examples below demonstrate creating a solid box and then applying fillets with different radii to a selection of its edges.
23+
24+
**TypeScript Example: Fillet Specific Edges with Variable Radii**
25+
<BitByBitRenderCanvas
26+
requireManualStart={true}
27+
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.3","type":"typescript"}}
28+
title="Variable Fillet Radius On Spec Edges"
29+
/>
30+
31+
32+
**Blockly Example: Fillet Specific Edges with Variable Radii**
33+
<BitByBitRenderCanvas
34+
requireManualStart={true}
35+
script={{"script":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"bitbybit.draw.drawAnyAsyncNoReturn\" id=\"UO^K1-FNciNjT{DsaF2S\" x=\"514\" y=\"-1267\"><value name=\"Entity\"><block type=\"bitbybit.occt.fillets.filletEdges\" id=\"HUGQP_OZ2HA+0$!Rq(K-\"><value name=\"Shape\"><block type=\"bitbybit.occt.shapes.solid.createBox\" id=\"|)@8Fjiij5v/gub8f#u$\"><value name=\"Width\"><block type=\"math_number\" id=\"Ki-@9)~]mkRl6?@Rfx5n\"><field name=\"NUM\">5</field></block></value><value name=\"Length\"><block type=\"math_number\" id=\",~D8g;%9aYqX/!8ING/F\"><field name=\"NUM\">8</field></block></value><value name=\"Height\"><block type=\"math_number\" id=\":@Ftc#0G%xkQ9Sk+z;+F\"><field name=\"NUM\">10</field></block></value><value name=\"Center\"><block type=\"bitbybit.point.pointXYZ\" id=\"/^:hH^b?Zgyl62v-o`o|\"><value name=\"X\"><block type=\"math_number\" id=\"8Ggh~I~ZP}grGof7=][T\"><field name=\"NUM\">0</field></block></value><value name=\"Y\"><block type=\"math_number\" id=\"j,g@GX_5A}p3E?A`)e)G\"><field name=\"NUM\">0</field></block></value><value name=\"Z\"><block type=\"math_number\" id=\"cFoeLSsG2P4P.Pi]FKnl\"><field name=\"NUM\">0</field></block></value></block></value></block></value><value name=\"RadiusList\"><block type=\"lists_create_with\" id=\"XcA2UEHs0*ObsR*1D4Fl\"><mutation items=\"3\"></mutation><value name=\"ADD0\"><block type=\"math_number\" id=\"ag|?;ikAU*4r7DE21mf1\"><field name=\"NUM\">1</field></block></value><value name=\"ADD1\"><block type=\"math_number\" id=\"}j0o2Tl|AA=NjfiKl9hy\"><field name=\"NUM\">2</field></block></value><value name=\"ADD2\"><block type=\"math_number\" id=\"24bK|Y*n)Z;)zwh)U;%]\"><field name=\"NUM\">0.3</field></block></value></block></value><value name=\"Indexes\"><block type=\"lists_create_with\" id=\"owishX5L@:.mf9k$%FoG\"><mutation items=\"3\"></mutation><value name=\"ADD0\"><block type=\"math_number\" id=\"]^a2nABtULU6lQJmJ)rL\"><field name=\"NUM\">1</field></block></value><value name=\"ADD1\"><block type=\"math_number\" id=\"ClsScm/]O07-eM=oQuq6\"><field name=\"NUM\">2</field></block></value><value name=\"ADD2\"><block type=\"math_number\" id=\"C@1SHC`O~@!^bTGi(1~f\"><field name=\"NUM\">3</field></block></value></block></value></block></value></block></xml>","version":"0.20.3","type":"blockly"}}
36+
title="Variable Fillet Radius On Spec Edges"
37+
/>
38+
39+
40+
**Rete Example: Fillet Specific Edges with Variable Radii**
41+
<BitByBitRenderCanvas
42+
requireManualStart={true}
43+
script={{"script":"{\"id\":\"rete-v2-json\",\"nodes\":{\"627a8cc50042ca11\":{\"id\":\"627a8cc50042ca11\",\"name\":\"bitbybit.occt.shapes.solid.createBox\",\"customName\":\"box\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":true,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"width\":5,\"length\":8,\"height\":10,\"center\":[0,0,0],\"originOnCenter\":true},\"inputs\":{},\"position\":[-708.9265376490123,859.1667600728709]},\"7dbf39d355a4a6a7\":{\"id\":\"7dbf39d355a4a6a7\",\"name\":\"bitbybit.occt.fillets.filletEdges\",\"customName\":\"fillet edges\",\"async\":true,\"drawable\":true,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"radius\":1},\"inputs\":{\"shape\":{\"connections\":[{\"node\":\"627a8cc50042ca11\",\"output\":\"result\",\"data\":{}}]},\"radiusList\":{\"connections\":[{\"node\":\"220c5ac8eeed60d1\",\"output\":\"list\",\"data\":{}}]},\"indexes\":{\"connections\":[{\"node\":\"741fba4c0482a1c4\",\"output\":\"list\",\"data\":{}}]}},\"position\":[4.849368722060774,1232.1525405252057]},\"220c5ac8eeed60d1\":{\"id\":\"220c5ac8eeed60d1\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"3deaf348607653c5\",\"output\":\"result\",\"data\":{}},{\"node\":\"a4e55f01d7171b93\",\"output\":\"result\",\"data\":{}},{\"node\":\"2eedc26244dacad8\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-640.3973867518604,1430.4370266380179]},\"3deaf348607653c5\":{\"id\":\"3deaf348607653c5\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":1},\"inputs\":{},\"position\":[-1078.9839555481535,1161.320096810749]},\"a4e55f01d7171b93\":{\"id\":\"a4e55f01d7171b93\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":2},\"inputs\":{},\"position\":[-1078.0127214540544,1378.5970750222207]},\"2eedc26244dacad8\":{\"id\":\"2eedc26244dacad8\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":0.3},\"inputs\":{},\"position\":[-1081.201301310153,1599.818546417745]},\"741fba4c0482a1c4\":{\"id\":\"741fba4c0482a1c4\",\"name\":\"bitbybit.lists.createList\",\"customName\":\"create list\",\"data\":{},\"inputs\":{\"listElements\":{\"connections\":[{\"node\":\"cddcea779bef9f05\",\"output\":\"result\",\"data\":{}},{\"node\":\"74455d74bd3781b8\",\"output\":\"result\",\"data\":{}},{\"node\":\"ea9c1145ead573eb\",\"output\":\"result\",\"data\":{}}]}},\"position\":[-682.5098753600391,2136.7678491912484]},\"cddcea779bef9f05\":{\"id\":\"cddcea779bef9f05\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":1},\"inputs\":{},\"position\":[-1073.1517770359849,1845.4768091041688]},\"74455d74bd3781b8\":{\"id\":\"74455d74bd3781b8\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":2},\"inputs\":{},\"position\":[-1074.0510678638543,2060.2715749532063]},\"ea9c1145ead573eb\":{\"id\":\"ea9c1145ead573eb\",\"name\":\"bitbybit.math.number\",\"customName\":\"number\",\"async\":false,\"drawable\":false,\"data\":{\"genericNodeData\":{\"hide\":false,\"oneOnOne\":false,\"flatten\":0,\"forceExecution\":false},\"number\":3},\"inputs\":{},\"position\":[-1071.0703995224253,2303.5495396019314]}}}","version":"0.20.3","type":"rete"}}
44+
title="Variable Fillet Radius On Spec Edges"
45+
/>
46+
47+
By utilizing edge indexing, you gain fine-grained control over filleting operations, enabling the creation of more sophisticated and precisely detailed 3D models. Remember that after a fillet operation, the topology of the shape changes, and edge indexes will be different on the resulting shape.

docs/learn/code/common/occt/shapes/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Shapes",
3-
"position": 1,
3+
"position": 2,
44
"link": {
55
"type": "generated-index"
66
}

0 commit comments

Comments
 (0)