Skip to main content

Picking faces and edges

A fillet rounds edges, a shell removes faces, a draft tilts them. Each needs to know which ones. OpenCascade numbers the faces and edges of every shape, and many functions take a list of those numbers, indexes. There are three ways to come by them.

By index​

Draw the shape with its indexes shown (drawEdgeIndexes or drawFaceIndexes in the drawing options), read the numbers off the screen and type them in. Edge indexes shows how.

It is quick, and it is fragile: the numbers belong to this shape as it is now. Change a size, add a hole, and the edge you meant may get another number while your list now points at a different one.

By rule​

bitbybit.occt.select chooses faces and edges by what they are and where they lie: faces facing a direction, edges along an axis, circular edges of a radius, edges inside a box or on a plane, the edges where two sets of faces meet. Each function returns the indexes for you, so a rule keeps choosing the right ones however the model changes.

Here the faces that face up are chosen first, then the edges around them, and only those edges are filleted. Change the box's sizes and the top edges are still the ones rounded:

Bitbybit Platform

Round the top edges, whatever their numbers 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": 6,
"length": 4,
"height": 3,
"center": [
0,
0,
0
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
40
]
},
"up": {
"id": "up",
"name": "bitbybit.occt.select.faces.facing",
"customName": "faces facing",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
],
"angle": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "box",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"around": {
"id": "around",
"name": "bitbybit.occt.select.edges.ofFaces",
"customName": "edges of faces",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "box",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "up",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"fillet": {
"id": "fillet",
"name": "bitbybit.occt.fillets.filletEdges",
"customName": "fillet edges",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 0.8
},
"inputs": {
"shape": {
"connections": [
{
"node": "box",
"output": "result",
"data": {}
}
]
},
"indexes": {
"connections": [
{
"node": "around",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
}
},
"modules": {}
}

Rules combine: pass the indexes one rule found to the next, as above, to narrow a choice step by step.

Mind an empty choice. A rule that matches nothing returns an empty list, and filletEdges given no indexes rounds every edge. If more is rounded than you meant, check what the rule found: a direction slightly off, such as [0, 1, 1] instead of [0, 1, 0], with an angle of 0 finds no face at all.

By history​

Some operations can report what became of each face, edge and vertex: the *WithHistory booleans and features, such as bitbybit.occt.booleans.differenceWithHistory, return beside the new shape which of its faces came from which of the old ones, so a drill's side is known to be the wall of its hole. A step built on such a face keeps finding it even after the steps before it change.

Corners by a point​

bitbybit.occt.corners rounds or bevels a single corner chosen by a point near it, without any index at all.