OCCT Fillets: Applying Variable Radius on Specific Corners of 2D Wires
While filleting all corners of a 2D wire with a uniform radius is common, OpenCascade Technology (OCCT) also provides the capability to apply fillets with different radii to specific, individual corners (vertices) of a wire. This allows for more nuanced and precise control over the shape of 2D profiles.
Fillets with variable radii on a 2D wire.
To achieve this, you typically need to:
- Identify Target Corners: Determine which vertices (corners) of the wire you want to fillet. This might involve knowing the order of vertices in the wire or selecting them based on their position.
- Provide Vertex and Radius Pairs: The fillet operation will usually require a list of target vertices (or their indexes within the wire) and the corresponding fillet radius to be applied at each of those specific corners.
The examples below demonstrate creating a 2D wire and then applying fillets with different radii to selected corners.
TypeScript Example: Fillet Specific Corners of a Wire with Variable Radii
const start = async () => {
const squareOpt = new Bit.Inputs.OCCT.SquareDto();
const square = await bitbybit.occt.shapes.wire.createSquareWire(squareOpt);
const squareFillet = await bitbybit.occt.fillets.fillet2d({
shape: square,
radiusList: [0.1, 0.3],
indexes: [1, 3]
});
bitbybit.draw.drawAnyAsync({
entity: squareFillet
});
}
start();
Blockly Example: Fillet Specific Corners of a Wire with Variable Radii
<xml xmlns="https://developers.google.com/blockly/xml"><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="UO^K1-FNciNjT{DsaF2S" x="-386" y="-1094"><value name="Entity"><block type="bitbybit.occt.fillets.fillet2d" id="Ox7,%Hh~Fw+kv!s(Q7(E"><value name="Shape"><block type="bitbybit.occt.shapes.wire.createSquareWire" id=",($Iew6lo`C7aI%n5CC+"><value name="Size"><block type="math_number" id="q9G;9WNvj*j:)Zh|8?I}"><field name="NUM">1</field></block></value><value name="Center"><block type="bitbybit.point.pointXYZ" id="Q/^[^mqVSld+!6MnJF7("><value name="X"><block type="math_number" id="6p5j#W09R[]Yxt];FqX]"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="PE{_^g]~xSa?$OYiLWEw"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="ts@X1}R0SiC@`04![b2,"><field name="NUM">0</field></block></value></block></value><value name="Direction"><block type="bitbybit.vector.vectorXYZ" id="MSTpJ`{T;q4p[9yMb6$R"><value name="X"><block type="math_number" id="x_(L9{On`m!mzn)O!y5:"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="qLfDzEy[xPrrGi7dTB~a"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number" id="lgc(z|+OX:qW]j1mIa:s"><field name="NUM">0</field></block></value></block></value></block></value><value name="RadiusList"><block type="lists_create_with" id="/Hd5KW,VCB6,2Q$eygd{"><mutation items="2"></mutation><value name="ADD0"><block type="math_number" id="C0dr`B1U7Dv)=uGdnkW$"><field name="NUM">0.1</field></block></value><value name="ADD1"><block type="math_number" id="?~Vc_oJGQ,,TPmBkZ^5S"><field name="NUM">0.3</field></block></value></block></value><value name="Indexes"><block type="lists_create_with" id="%0Q$(=odS^{~-+Eqh}-J"><mutation items="2"></mutation><value name="ADD0"><block type="math_number" id="RCb7G`7@dxSwZHEc:zMb"><field name="NUM">1</field></block></value><value name="ADD1"><block type="math_number" id="Vk$pJ#[mvN%^BiI0Q1Pl"><field name="NUM">3</field></block></value></block></value></block></value></block></xml>
Rete Example: Fillet Specific Corners of a Wire with Variable Radii
{
"id": "rete-v2-json",
"nodes": {
"fc07e0c542a94302": {
"id": "fc07e0c542a94302",
"name": "bitbybit.occt.shapes.wire.createSquareWire",
"customName": "square wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"size": 1,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
874.4804222774951,
611.1219530666237
]
},
"80bd1bbd7593daa6": {
"id": "80bd1bbd7593daa6",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[1, 3]"
},
"inputs": {},
"position": [
881.1825628672659,
1297.4887643425693
]
},
"ee9394c0ea645cc9": {
"id": "ee9394c0ea645cc9",
"name": "bitbybit.occt.fillets.fillet2d",
"customName": "fillet 2d",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 0.1
},
"inputs": {
"indexes": {
"connections": [
{
"node": "80bd1bbd7593daa6",
"output": "result",
"data": {}
}
]
},
"shape": {
"connections": [
{
"node": "fc07e0c542a94302",
"output": "result",
"data": {}
}
]
},
"radiusList": {
"connections": [
{
"node": "f129862d3eb80edb",
"output": "result",
"data": {}
}
]
}
},
"position": [
1417.0916481447425,
919.1470674425932
]
},
"f129862d3eb80edb": {
"id": "f129862d3eb80edb",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[0.2, 0.3]"
},
"inputs": {},
"position": [
881.0722766958328,
1002.8610291015843
]
}
}
}
Applying variable radius fillets to specific corners of 2D wires is a powerful technique for creating custom profiles with precise rounded features, which can then be used as a basis for more complex 3D modeling operations.



