Skip to main content

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:

  1. Identify Target Edges: Determine the indexes of the edges you wish to chamfer. Visualizing edge indexes can be helpful here.
  2. 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.

Chamfer specific edges with different distances
Bitbybit Platform

Chamfer specific edges with different distances in Rete

rete logoRete
Script Source (rete)
{
"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": {}
}

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:

  • chamferEdgeTwoDistances takes distance1 along that face and distance2 along the other.
  • chamferEdgeDistAngle takes a distance along that face and an angle measured from it; 45 gives an even chamfer.
An uneven chamfer and an angled one
Bitbybit Platform

An uneven chamfer and an angled one in Rete

rete logoRete
Script Source (rete)
{
"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": {}
}

chamferEdgesTwoDistances and chamferEdgesDistAngle do the same for several edges.