Skip to main content

Sections, slices and drawings

Many uses of a 3D model are flat: the layers a 3D printer or a laser cutter makes, a cross-section through a part, a technical drawing with hidden edges dashed. bitbybit.occt.operations cuts shapes for all of them.

Slices​

slice cuts a solid into parallel layers along a direction, every step model units, like a loaf of bread. Each layer is the flat section where a cutting plane meets the solid, and all of them come back in one compound. sliceInStepPattern uses a repeating pattern of gaps, and sliceByFrames cuts with the plane of each frame you give it, at any angle.

Here a sphere is sliced every half unit along Y:

Bitbybit Platform

A sphere cut into layers in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"sphere": {
"id": "sphere",
"name": "bitbybit.occt.shapes.solid.createSphere",
"customName": "sphere",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 4,
"center": [
0,
0,
0
]
},
"inputs": {},
"position": [
40,
40
]
},
"slice": {
"id": "slice",
"name": "bitbybit.occt.operations.slice",
"customName": "slice",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"step": 0.5,
"direction": [
0,
1,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "sphere",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
}
},
"modules": {}
}

Each slice is a face: extrude it by the thickness of your sheet and you have the parts of a stacked model to cut.

Splitting​

  • splitByFrame cuts a shape in two with the plane of a frame and gives both halves.
  • splitShapeWithShapes cuts a shape into pieces with other shapes, without removing material, as a knife would.
  • splitFaceByWires scores a face along wires that lie on it, so each region can be coloured or extruded on its own.

Where two shapes meet​

sectionWires finds the curves where two shapes meet and joins them into wires: the outline a plane cuts through a part, or the seam where a pipe meets a wall.

Drawings​

hiddenLines draws a shape as a technical drawing does, seen from a view frame and flattened: the edges the eye sees, and those hidden behind faces, which a drawing dashes. Together with sections, the result goes to DXF or SVG for a drawing or a cutter.