Skip to main content
OCCT category icon with a stylized logo representation

Creating Face From Wire

Creating a face from a wire is one of the most fundamental operations in 3D modeling. Any closed wire can be converted into a face that fills the area bounded by that wire. This process transforms a 1D boundary into a 2D surface, which can then be used for visualization, analysis, or further 3D operations like extrusion.

Understanding Wire Orientation and Face Normal

The orientation of a wire determines the direction of the face's normal vector, which affects how the face appears and behaves in 3D operations. When you create a face from a wire, the face's "up" direction depends on whether the wire follows a clockwise or counter-clockwise path.

Wire reversal is often necessary to ensure faces have the correct orientation for:

  • Proper lighting and material rendering
  • Consistent normal directions in complex models
  • Correct behavior in boolean operations
  • Proper face orientation for manufacturing applications

This example demonstrates creating a star-shaped face from a reversed wire to control the face orientation.

Bitbybit Platform

Creating face from wire

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"2698ec9c8609bd3e": {
"id": "2698ec9c8609bd3e",
"name": "bitbybit.occt.shapes.face.createFaceFromWire",
"customName": "face from wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"planar": true
},
"inputs": {
"shape": {
"connections": [
{
"node": "26f0d7f44f84203e",
"output": "result",
"data": {}
}
]
}
},
"position": [
1028.8892372087307,
300.06237146267887
]
},
"b609f7662c9a1971": {
"id": "b609f7662c9a1971",
"name": "bitbybit.occt.shapes.wire.createStarWire",
"customName": "star wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
],
"numRays": 7,
"outerRadius": 7,
"innerRadius": 3,
"offsetOuterEdges": 0,
"half": false
},
"inputs": {},
"position": [
291.0980954041938,
302.64895734996213
]
},
"26f0d7f44f84203e": {
"id": "26f0d7f44f84203e",
"name": "bitbybit.occt.shapes.wire.reversedWire",
"customName": "reversed wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "b609f7662c9a1971",
"output": "result",
"data": {}
}
]
}
},
"position": [
660.3086304587323,
301.04867120852754
]
}
}
}

Key Concepts

Wire Reversal: The reversedWire operation changes the direction of the wire's traversal. This is crucial because the face's normal vector (which direction is "up") depends on the wire's orientation. A clockwise wire produces a face with the normal pointing in one direction, while a counter-clockwise wire produces the opposite.

Planar Faces: Setting planar: true ensures that the face lies entirely in a single plane. This is essential for most 2D shapes and guarantees predictable behavior in subsequent 3D operations.

Face Orientation: The orientation of the created face affects lighting, material rendering, and boolean operations. Wire reversal gives you control over which side of the face is considered the "front" or "outside" surface.