OCCT Chamfers: Applying Variable Distance on Specific Edges
Beyond applying a uniform chamfer to all edges, OpenCascade Technology (OCCT) also allows for applying chamfers with different distances (or sets of distances) to specific, individual edges of a solid or shell. This is achieved by identifying the target edges using their edge indexes.
This feature provides enhanced control for creating precise beveled features, where the size or angle of the chamfer needs to vary across different parts of the model.
How It Works
The process is similar to applying variable radius fillets:
- Identify Target Edges: Determine the indexes of the edges you wish to chamfer. Visualizing edge indexes can be helpful here.
- Provide Edge Index and Distance(s) Pairs: The chamfer operation will typically require you to provide a list of edge indexes along with their corresponding desired chamfer distances. For each edge, you might specify one distance (for a symmetric chamfer) or two distances (for an asymmetric chamfer along the two adjacent faces).
The examples below demonstrate creating a solid box and then applying chamfers with different distance parameters 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": [
-798,
677
]
},
"chamferEdges": {
"id": "chamferEdges",
"name": "bitbybit.occt.fillets.chamferEdges",
"customName": "chamfer edges",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"distance": 1
},
"inputs": {
"shape": {
"connections": [
{
"node": "box",
"output": "result",
"data": {}
}
]
},
"distanceList": {
"connections": [
{
"node": "parse",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "parse2",
"output": "result",
"data": {}
}
]
}
},
"position": [
-299,
945
]
},
"parse": {
"id": "parse",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[2,1.2, 0.3]"
},
"inputs": {},
"position": [
-798,
1111
]
},
"parse2": {
"id": "parse2",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[1,2,3]"
},
"inputs": {},
"position": [
-801,
1401
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" x="-747" y="-1380"><value name="Entity"><block type="bitbybit.occt.fillets.chamferEdges"><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="Distance"><block type="math_number"><field name="NUM">0.1</field></block></value><value name="DistanceList"><block type="lists_create_with"><mutation items="3"></mutation><value name="ADD0"><block type="math_number"><field name="NUM">0.3</field></block></value><value name="ADD1"><block type="math_number"><field name="NUM">1.2</field></block></value><value name="ADD2"><block type="math_number"><field name="NUM">2</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 chamfered = await bitbybit.occt.fillets.chamferEdges({
shape: box,
distanceList: [0.2, 1.2, 2],
indexes: [1, 2, 3]
})
bitbybit.draw.drawAnyAsync({
entity: chamfered,
});
Using edge indexing to apply variable distance chamfers offers a high degree of precision in detailing 3D models, allowing for the creation of complex mechanical parts and aesthetically refined designs. As with fillets, remember that chamfering operations alter the shape's topology, so edge indexes will change on the resulting model.
Uneven and angled chamfers
A chamfer does not have to cut both faces equally. Two functions set the slope of the bevel on one edge, and both need to know which face you are measuring from, so they take the face as well as the edge:
chamferEdgeTwoDistancestakesdistance1along that face anddistance2along the other.chamferEdgeDistAngletakes adistancealong that face and ananglemeasured from it; 45 gives an even chamfer.

- 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
]
},
"topIndexes": {
"id": "topIndexes",
"name": "bitbybit.occt.select.faces.extreme",
"customName": "extreme faces",
"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
]
},
"topIndex": {
"id": "topIndex",
"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": "topIndexes",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"top": {
"id": "top",
"name": "bitbybit.occt.shapes.face.getFace",
"customName": "get face",
"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": "topIndex",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
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,
380
]
},
"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,
334
]
},
"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,
288
]
},
"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
]
},
"uneven": {
"id": "uneven",
"name": "bitbybit.occt.fillets.chamferEdgeTwoDistances",
"customName": "chamfer edge two distances",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"distance1": 2,
"distance2": 0.6
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"edge": {
"connections": [
{
"node": "edge",
"output": "result",
"data": {}
}
]
},
"face": {
"connections": [
{
"node": "top",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"angled": {
"id": "angled",
"name": "bitbybit.occt.fillets.chamferEdgeDistAngle",
"customName": "chamfer edge dist angle",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"distance": 1.5,
"angle": 30
},
"inputs": {
"shape": {
"connections": [
{
"node": "block",
"output": "result",
"data": {}
}
]
},
"edge": {
"connections": [
{
"node": "edge",
"output": "result",
"data": {}
}
]
},
"face": {
"connections": [
{
"node": "top",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
426
]
},
"moved": {
"id": "moved",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
10
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "angled",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"drawUneven": {
"id": "drawUneven",
"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": "uneven",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
40
]
},
"drawMoved": {
"id": "drawMoved",
"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": "moved",
"output": "result",
"data": {}
}
]
}
},
"position": [
2980,
334
]
},
"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": [
14,
16,
-18
],
"lookAt": [
0,
2,
5
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2980,
628
]
}
},
"modules": {}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="block">block</variable><variable id="topIndexes">topIndexes</variable><variable id="top">top</variable><variable id="longEdges">longEdges</variable><variable id="edge">edge</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="topIndexes">topIndexes</field><value name="VALUE"><block type="base_time_await_return"><value name="Promise"><block type="bitbybit.occt.select.faces.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><next><block type="variables_set"><field name="VAR" id="top">top</field><value name="VALUE"><block type="bitbybit.occt.shapes.face.getFace"><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="topIndexes">topIndexes</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><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="variables_set"><field name="VAR" id="edge">edge</field><value name="VALUE"><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><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.fillets.chamferEdgeTwoDistances"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Edge"><block type="variables_get"><field name="VAR" id="edge">edge</field></block></value><value name="Face"><block type="variables_get"><field name="VAR" id="top">top</field></block></value><value name="Distance1"><block type="math_number"><field name="NUM">2</field></block></value><value name="Distance2"><block type="math_number"><field name="NUM">0.6</field></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn"><value name="Entity"><block type="bitbybit.occt.transforms.translate"><value name="Shape"><block type="bitbybit.occt.fillets.chamferEdgeDistAngle"><value name="Shape"><block type="variables_get"><field name="VAR" id="block">block</field></block></value><value name="Edge"><block type="variables_get"><field name="VAR" id="edge">edge</field></block></value><value name="Face"><block type="variables_get"><field name="VAR" id="top">top</field></block></value><value name="Distance"><block type="math_number"><field name="NUM">1.5</field></block></value><value name="Angle"><block type="math_number"><field name="NUM">30</field></block></value></block></value><value name="Translation"><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">0</field></block></value><value name="Z"><block type="math_number"><field name="NUM">10</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">14</field></block></value><value name="Y"><block type="math_number"><field name="NUM">16</field></block></value><value name="Z"><block type="math_number"><field name="NUM">-18</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">5</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></next></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 topIndexes = await bitbybit.occt.select.faces.extreme({ shape: block, direction: [0, 1, 0] });
const top = await bitbybit.occt.shapes.face.getFace({ shape: block, index: topIndexes[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 uneven = await bitbybit.occt.fillets.chamferEdgeTwoDistances({ shape: block, edge, face: top, distance1: 2, distance2: 0.6 });
const angled = await bitbybit.occt.fillets.chamferEdgeDistAngle({ shape: block, edge, face: top, distance: 1.5, angle: 30 });
const moved = await bitbybit.occt.transforms.translate({ shape: angled, translation: [0, 0, 10] });
await bitbybit.draw.drawAnyAsync({ entity: uneven });
await bitbybit.draw.drawAnyAsync({ entity: moved });
bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [14, 16, -18], lookAt: [0, 2, 5] });
chamferEdgesTwoDistances and chamferEdgesDistAngle do the same for several edges.



