OCCT Fillets: Applying Variable Radius on Specific Edges
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.
This capability is essential for creating more detailed and nuanced designs where varying degrees of rounding are required on different parts of a model.
How It Works
The general process involves:
- 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.
- 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.
The examples below demonstrate creating a solid box and then applying fillets with different radii to a selection of its edges.

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"box": {
"id": "box",
"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": [
-709,
859
]
},
"filletEdges": {
"id": "filletEdges",
"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": "box",
"output": "result",
"data": {}
}
]
},
"radiusList": {
"connections": [
{
"node": "createList",
"output": "list",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "createList2",
"output": "list",
"data": {}
}
]
}
},
"position": [
5,
1232
]
},
"createList": {
"id": "createList",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "number",
"output": "result",
"data": {}
},
{
"node": "number2",
"output": "result",
"data": {}
},
{
"node": "number3",
"output": "result",
"data": {}
}
]
}
},
"position": [
-640,
1430
]
},
"number": {
"id": "number",
"name": "bitbybit.math.number",
"customName": "number",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"number": 1
},
"inputs": {},
"position": [
-1079,
1161
]
},
"number2": {
"id": "number2",
"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,
1379
]
},
"number3": {
"id": "number3",
"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,
1600
]
},
"createList2": {
"id": "createList2",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "number4",
"output": "result",
"data": {}
},
{
"node": "number5",
"output": "result",
"data": {}
},
{
"node": "number6",
"output": "result",
"data": {}
}
]
}
},
"position": [
-683,
2137
]
},
"number4": {
"id": "number4",
"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,
1845
]
},
"number5": {
"id": "number5",
"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,
2060
]
},
"number6": {
"id": "number6",
"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,
2304
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" x="514" y="-1267"><value name="Entity"><block type="bitbybit.occt.fillets.filletEdges"><value name="Shape"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">5</field></block></value><value name="Length"><block type="math_number"><field name="NUM">8</field></block></value><value name="Height"><block type="math_number"><field name="NUM">10</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value></block></value><value name="RadiusList"><block type="lists_create_with"><mutation items="3"></mutation><value name="ADD0"><block type="math_number"><field name="NUM">1</field></block></value><value name="ADD1"><block type="math_number"><field name="NUM">2</field></block></value><value name="ADD2"><block type="math_number"><field name="NUM">0.3</field></block></value></block></value><value name="Indexes"><block type="lists_create_with"><mutation items="3"></mutation><value name="ADD0"><block type="math_number"><field name="NUM">1</field></block></value><value name="ADD1"><block type="math_number"><field name="NUM">2</field></block></value><value name="ADD2"><block type="math_number"><field name="NUM">3</field></block></value></block></value></block></value></block></xml>
const boxOpt = new Bit.Inputs.OCCT.BoxDto();
boxOpt.width = 5;
boxOpt.length = 8;
boxOpt.height = 10;
const box = await bitbybit.occt.shapes.solid.createBox(boxOpt);
const filleted = await bitbybit.occt.fillets.filletEdges({
shape: box,
radiusList: [1, 2, 0.3],
indexes: [1, 2, 3]
})
bitbybit.draw.drawAnyAsync({
entity: filleted,
});
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.
A radius that changes along an edge
The fillets above keep one radius along each edge. bitbybit.occt.fillets.filletEdgeVariableRadius lets the radius change along a single edge: radiusList holds the radii and paramsU where each one applies, as fractions from 0 at the start of the edge's curve to 1 at its end, whichever way the edge is turned. They are fractions of the curve's parameter, which match its length on lines and arcs, the edges of boxes and of extruded lines and circles; on a spline edge a position halfway can sit nearer one end.
Give at least three positions, the first at 0 and the last at 1. The first and last you give are always taken as the two ends of the edge, and with only two, the positions are not used at all. Between positions the radius follows a smooth curve that can overshoot the radii you gave, so neighbouring radii that jump far apart can round more, or less, than either of them.

- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"block": {
"id": "block",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 12,
"length": 6,
"height": 4,
"center": [
0,
2,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"topEdges": {
"id": "topEdges",
"name": "bitbybit.occt.select.edges.extreme",
"customName": "extreme edges",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
],
"tolerance": 1e-7
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"longEdges": {
"id": "longEdges",
"name": "bitbybit.occt.select.edges.along",
"customName": "edges along",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
1,
0,
0
],
"angle": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "topEdges",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"firstLong": {
"id": "firstLong",
"name": "bitbybit.lists.getItem",
"customName": "get item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 0,
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "longEdges",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"edge": {
"id": "edge",
"name": "bitbybit.occt.shapes.edge.getEdge",
"customName": "get edge",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"index": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"index": {
"connections": [
{
"node": "firstLong",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"radii": {
"id": "radii",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[0.4, 1.8, 0.4]"
},
"inputs": {},
"position": [
40,
426
]
},
"positions": {
"id": "positions",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[0, 0.5, 1]"
},
"inputs": {},
"position": [
40,
666
]
},
"swelling": {
"id": "swelling",
"name": "bitbybit.occt.fillets.filletEdgeVariableRadius",
"customName": "fillet edge variable radius",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"edge": {
"connections": [
{
"node": "edge",
"output": "result",
"data": {}
}
]
},
"radiusList": {
"connections": [
{
"node": "radii",
"output": "result",
"data": {}
}
]
},
"paramsU": {
"connections": [
{
"node": "positions",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"drawSwelling": {
"id": "drawSwelling",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "swelling",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
12,
12,
-16
],
"lookAt": [
0,
2,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2560,
334
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="block">block</variable><variable id="longEdges">longEdges</variable></variables><block type="variables_set" x="40" y="200"><field name="VAR" id="block">block</field><value name="VALUE"><block type="bitbybit.occt.shapes.solid.createBox"><value name="Width"><block type="math_number"><field name="NUM">12</field></block></value><value name="Length"><block type="math_number"><field name="NUM">6</field></block></value><value name="Height"><block type="math_number"><field name="NUM">4</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="OriginOnCenter"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value><next><block type="variables_set"><field name="VAR" id="longEdges">longEdges</field><value name="VALUE"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.select.edges.along"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">1</field></block></value><value name="Y"><block type="math_number"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Angle"><block type="math_number"><field name="NUM">0</field></block></value><value name="Indexes"><block type="bitbybit.occt.select.edges.extreme"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="Tolerance"><block type="math_number"><field name="NUM">1e-7</field></block></value></block></value></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.fillets.filletEdgeVariableRadius"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Edge"><block type="bitbybit.occt.shapes.edge.getEdge"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Index"><block type="bitbybit.lists.getItem"><value name="List"><block type="variables_get"><field name="VAR" id="longEdges">longEdges</field></block></value><value name="Index"><block type="math_number"><field name="NUM">0</field></block></value><value name="Clone"><block type="logic_boolean"><field name="BOOL">TRUE</field></block></value></block></value></block></value><value name="RadiusList"><block type="bitbybit.json.parse"><value name="Text"><block type="text"><field name="TEXT">[0.4, 1.8, 0.4]</field></block></value></block></value><value name="ParamsU"><block type="bitbybit.json.parse"><value name="Text"><block type="text"><field name="TEXT">[0, 0.5, 1]</field></block></value></block></value></block></value><next><block type="bitbybit.babylon.scene.adjustActiveArcRotateCamera"><value name="Position"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">12</field></block></value><value name="Y"><block type="math_number"><field name="NUM">12</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-16</field></block></value></block></value><value name="LookAt"><block type="bitbybit.point.pointXYZ"><value name="X"><block type="math_number"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number"><field name="NUM">0</field></block></value></block></value><value name="LowerBetaLimit"><block type="math_number"><field name="NUM">1</field></block></value><value name="UpperBetaLimit"><block type="math_number"><field name="NUM">179</field></block></value><value name="AngularSensibilityX"><block type="math_number"><field name="NUM">1000</field></block></value><value name="AngularSensibilityY"><block type="math_number"><field name="NUM">1000</field></block></value><value name="MaxZ"><block type="math_number"><field name="NUM">1000</field></block></value><value name="PanningSensibility"><block type="math_number"><field name="NUM">1000</field></block></value><value name="WheelPrecision"><block type="math_number"><field name="NUM">3</field></block></value></block></next></block></next></block></next></block></xml>
const block = await bitbybit.occt.shapes.solid.createBox({ width: 12, length: 6, height: 4, center: [0, 2, 0] });
const topEdges = await bitbybit.occt.select.edges.extreme({ shape: block, direction: [0, 1, 0] });
const longEdges = await bitbybit.occt.select.edges.along({ shape: block, direction: [1, 0, 0], indexes: topEdges });
const edge = await bitbybit.occt.shapes.edge.getEdge({ shape: block, index: longEdges[0] });
const radii = bitbybit.json.parse({ text: "[0.4, 1.8, 0.4]" });
const positions = bitbybit.json.parse({ text: "[0, 0.5, 1]" });
const swelling = await bitbybit.occt.fillets.filletEdgeVariableRadius({ shape: block, edge, radiusList: radii, paramsU: positions });
await bitbybit.draw.drawAnyAsync({ entity: swelling });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [12, 12, -16], lookAt: [0, 2, 0] });
filletEdgesSameVariableRadius applies one such profile to several edges, and filletEdgesVariableRadius gives each edge its own.



