Skip to main content

Rectangle Holes On Face

OCCT category icon with a stylized logo representation

Creating regular patterns of holes manually can be time-consuming and error-prone. The subdivideToRectangleHoles function automates this process by intelligently subdividing rectangular faces into grids with customizable hole patterns. This powerful helper function is essential for creating perforated panels, ventilation grilles, and decorative screens with precise, parametric control.

Bitbybit Platform

Rectangle holes on face

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"5426441c41e8f5cf": {
"id": "5426441c41e8f5cf",
"name": "bitbybit.occt.shapes.face.createRectangleFace",
"customName": "rectangle face",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 20,
"length": 14,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
345.2983055114746,
314.52503173302796
]
},
"f22217faf02b0785": {
"id": "f22217faf02b0785",
"name": "bitbybit.occt.shapes.face.subdivideToRectangleHoles",
"customName": "subdivide to rectangle holes",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"nrRectanglesU": 10,
"nrRectanglesV": 10,
"holesToFaces": false,
"offsetFromBorderU": 0.05,
"offsetFromBorderV": 0.05
},
"inputs": {
"shape": {
"connections": [
{
"node": "5426441c41e8f5cf",
"output": "result",
"data": {}
}
]
},
"scalePatternU": {
"connections": [
{
"node": "550f3b6b8b2aa505",
"output": "result",
"data": {}
}
]
},
"scalePatternV": {
"connections": [
{
"node": "99dd6ff34f6653e7",
"output": "result",
"data": {}
}
]
}
},
"position": [
786.5151933544087,
313.81030977782325
]
},
"6cabc11ad209ab15": {
"id": "6cabc11ad209ab15",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
1,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "1371efdcc602ecab",
"output": "result",
"data": {}
}
]
}
},
"position": [
1617.2367813648507,
314.2527322269106
]
},
"1371efdcc602ecab": {
"id": "1371efdcc602ecab",
"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": "f22217faf02b0785",
"output": "result",
"data": {}
}
]
}
},
"position": [
1224.9600069760618,
315.2106752901691
]
},
"550f3b6b8b2aa505": {
"id": "550f3b6b8b2aa505",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[0.8,0.5,0.5]"
},
"inputs": {},
"position": [
350.8630642517603,
710.2281472271986
]
},
"99dd6ff34f6653e7": {
"id": "99dd6ff34f6653e7",
"name": "bitbybit.json.parse",
"customName": "parse",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"text": "[0.8,0.5,0.5]"
},
"inputs": {},
"position": [
349.19129322805645,
984.5341384541671
]
}
}
}

Understanding Rectangle Hole Subdivision

The subdivideToRectangleHoles function is a powerful helper that automates the creation of regular grid patterns with holes. Instead of manually creating and positioning individual holes, this function intelligently subdivides a rectangular face into a grid and creates holes or wires at each grid position.

This approach is particularly valuable for applications requiring precise, regular patterns such as:

  • Perforated metal sheets
  • Ventilation grilles
  • Acoustic panels
  • Decorative architectural screens
  • Industrial filtration elements

Key Parameters and Their Effects

Grid Division Controls

nrRectanglesU and nrRectanglesV: These parameters control how many divisions are created in each direction. Higher values create more, smaller holes, while lower values create fewer, larger holes.

offsetFromBorderU and offsetFromBorderV: These control the spacing between the holes and the edge of the face. Values between 0.05 and 0.2 typically provide good results, with smaller values creating holes closer to the edge.

Scale Pattern Arrays

The scale pattern arrays are where this function becomes truly powerful. These arrays allow you to create non-uniform hole sizes across the grid:

  • Single value: [1.0] creates uniform holes across the entire grid
  • Multiple values: [0.8, 0.5, 0.5] creates varying hole sizes that repeat in a pattern
  • Gradient effect: [1.0, 0.8, 0.6, 0.4, 0.2] creates a gradual size transition

The pattern repeats across the grid, so if you have 10 divisions and a 3-element pattern, the pattern will cycle: 1st uses pattern[0], 2nd uses pattern[1], 3rd uses pattern[2], 4th uses pattern[0] again, and so on.

Output Type Control

holesToFaces: This boolean parameter determines the output format:

  • false: Returns wire boundaries (useful for creating faces with holes)
  • true: Returns individual face elements (useful for separate processing of each hole)

Pattern Creation and Applications

You can create sophisticated visual effects using carefully designed scale patterns. Try fade effects with [0.2, 0.4, 0.6, 0.8, 1.0, 0.8, 0.6, 0.4, 0.2], alternating patterns like [1.0, 0.3, 1.0, 0.3], or exponential growth with [0.1, 0.2, 0.4, 0.8, 1.0]. The patterns repeat across the grid, so a 3-element pattern on 10 divisions will cycle through the values continuously.

This function excels in architectural applications for facade panels and decorative screens, manufacturing contexts like sheet metal fabrication, and engineering applications including filtration systems and acoustic panels. The holesToFaces parameter controls whether you get wire boundaries for creating faces with holes or individual face elements for separate processing.

Start with simple uniform patterns before experimenting with complex scale arrays. The parametric nature transforms hundreds of individual operations into a single call, making it invaluable for creating sophisticated perforated designs that remain flexible and easily adjustable for different requirements.