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.

A 3D solid box with chamfers of varying distances applied to different edges, creating a mix of larger and smaller beveled surfaces. Variable distance chamfer on a 3D solid.

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.

TypeScript Example: Chamfer Specific Edges with Variable Distances

Bitbybit Platform

Chamfer Specific Edges of Solid

typescript logoTypescript
Script Source (typescript)
const start = async () => {

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,
});
}

start();

Blockly Example: Chamfer Specific Edges with Variable Distances

Bitbybit Platform

Chamfer Specific Edges of Solid

blockly logoBlockly
Script Source (blockly)
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="UO^K1-FNciNjT{DsaF2S" x="-747" y="-1380"><value name="Entity"><block type="bitbybit.occt.fillets.chamferEdges" id="6uogo|4}Z3+s,ia1mM3:"><value name="Shape"><block type="bitbybit.occt.shapes.solid.createBox" id="j7c72:HK3,I{b(x9zZIz"><value name="Width"><block type="math_number" id=",fo6YOQk@dm@e[X0rK6b"><field name="NUM">5</field></block></value><value name="Length"><block type="math_number" id="QL66K!iJ{Vi*UpRT0JGV"><field name="NUM">8</field></block></value><value name="Height"><block type="math_number" id="?De5KjGTsjp|fd1GHymT"><field name="NUM">10</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ" id="1k=}S]vqH]b@=6$YCjW0"><value name="X"><block type="math_number" id="h+|NXXS#HA3SlB^@`xJy"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="#2w/3ef,AW{I~tD7+G:T"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="`K531F,JJdTbcK?3Vruu"><field name="NUM">0</field></block></value></block></value></block></value><value name="Distance"><block type="math_number" id="0E8m=`=w6SkB[!#mUu4X"><field name="NUM">0.1</field></block></value><value name="DistanceList"><block type="lists_create_with" id="lb$(16{W[^wR08hN%b`^"><mutation items="3"></mutation><value name="ADD0"><block type="math_number" id="z.uO-0Q+g!?3smND!,Xe"><field name="NUM">0.3</field></block></value><value name="ADD1"><block type="math_number" id="vJcGreC13u%u@i.8T,;;"><field name="NUM">1.2</field></block></value><value name="ADD2"><block type="math_number" id="RXn4#/mqc(3[w*fT5xz6"><field name="NUM">2</field></block></value></block></value><value name="Indexes"><block type="lists_create_with" id="e}XG?UqqNHzCPq^1@xMV"><mutation items="3"></mutation><value name="ADD0"><block type="math_number" id="eSePQ}Dv:?J{8}|w4@nR"><field name="NUM">1</field></block></value><value name="ADD1"><block type="math_number" id="vjW#^4U_+/!y.dHsa~.e"><field name="NUM">2</field></block></value><value name="ADD2"><block type="math_number" id="m3I;qkK]U5`XR|WV:vd/"><field name="NUM">3</field></block></value></block></value></block></value></block></xml>

Rete Example: Chamfer Specific Edges with Variable Distances

Bitbybit Platform

Chamfer Specific Edges of Solid

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"b1ca16cad3950774": {
"id": "b1ca16cad3950774",
"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.4622256926414,
677.2113811794219
]
},
"465a6cff04eeb4c7": {
"id": "465a6cff04eeb4c7",
"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": "b1ca16cad3950774",
"output": "result",
"data": {}
}
]
},
"distanceList": {
"connections": [
{
"node": "64dbb6c45ed711be",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "427b59e709128fbe",
"output": "result",
"data": {}
}
]
}
},
"position": [
-298.7726704360432,
945.4913875785387
]
},
"64dbb6c45ed711be": {
"id": "64dbb6c45ed711be",
"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.1381188727944,
1110.7937135142204
]
},
"427b59e709128fbe": {
"id": "427b59e709128fbe",
"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.1502918573998,
1400.9478714101845
]
}
}
}

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.