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

Drawing Outlines With a Pen

bitbybit.occt.sketch.pen draws a flat outline the way you would describe it in words: start here, go 40 to the right, go up 10, round that corner, curve back smoothly, close. Each command draws on from where the previous one ended. The result is one exact wire, or a face when the outline closes, ready to extrude, revolve or sweep.

Straight pieces come out as true lines and arcs as true circles, so an extruded sketch has planar and cylindrical faces that fillets, selectors and measurements treat exactly.

A first sketch​

A plate drawn with a pen
Bitbybit Platform

A plate drawn with a pen in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"base": {
"id": "base",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 40,
"id": ""
},
"inputs": {},
"position": [
40,
40
]
},
"right": {
"id": "right",
"name": "bitbybit.occt.sketch.commands.vLine",
"customName": "v line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 10,
"id": ""
},
"inputs": {},
"position": [
40,
288
]
},
"corner": {
"id": "corner",
"name": "bitbybit.occt.sketch.commands.filletCorner",
"customName": "fillet corner",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 2,
"id": ""
},
"inputs": {},
"position": [
40,
536
]
},
"back": {
"id": "back",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": -12,
"id": ""
},
"inputs": {},
"position": [
40,
784
]
},
"nose": {
"id": "nose",
"name": "bitbybit.occt.sketch.commands.tangentArc",
"customName": "tangent arc",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"to": [
-10,
10
],
"relative": true,
"id": ""
},
"inputs": {},
"position": [
40,
1032
]
},
"top": {
"id": "top",
"name": "bitbybit.occt.sketch.commands.line",
"customName": "line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"to": [
0,
20
],
"relative": false,
"id": ""
},
"inputs": {},
"position": [
40,
1326
]
},
"left": {
"id": "left",
"name": "bitbybit.occt.sketch.commands.close",
"customName": "close",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"id": ""
},
"inputs": {},
"position": [
40,
1620
]
},
"commands": {
"id": "commands",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "base",
"output": "result",
"data": {}
},
{
"node": "right",
"output": "result",
"data": {}
},
{
"node": "corner",
"output": "result",
"data": {}
},
{
"node": "back",
"output": "result",
"data": {}
},
{
"node": "nose",
"output": "result",
"data": {}
},
{
"node": "top",
"output": "result",
"data": {}
},
{
"node": "left",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"pen": {
"id": "pen",
"name": "bitbybit.occt.sketch.pen",
"customName": "pen",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
0,
0
],
"makeFace": true
},
"inputs": {
"commands": {
"connections": [
{
"node": "commands",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"block": {
"id": "block",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
5,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "pen",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
20,
59,
35
],
"lookAt": [
20,
2,
-10
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
1720,
40
]
}
},
"modules": {}
}

makeFace turns the closed outline into a face whose normal is the frame's normal, whichever way the outline runs, so extruding along that normal always builds the solid on the same side. An outline that crosses itself is refused with a message naming the problem, as is any command that cannot be drawn.

The commands​

Every command is a small object with a type, and an optional id that names it in the segments report described below. Points are in the sketch's own x and y. A point is absolute unless relative is true, in which case it is an offset from where the pen is.

typeFieldsDraws
lineto, relativea straight segment to a point
hLinelengthalong the sketch's x axis; negative goes left
vLinelengthalong the sketch's y axis; negative goes down
polarLinelength, angleat an angle in degrees from the x axis, counterclockwise
tangentLinelengthstraight on, in the direction the previous segment ended in
threePointArcthrough, to, relativea circular arc through a middle point
tangentArcto, relativea circular arc leaving tangent to the previous segment
sagittaArcto, sagitta, relativean arc whose middle stands sagitta off the chord; positive bows to the left of travel
bulgeArcto, bulge, relativethe DXF way: bulge is the tangent of a quarter of the swept angle, positive counterclockwise
quadraticcontrol, to, relativea quadratic Bezier curve
cubiccontrol1, control2, to, relativea cubic Bezier curve
closea straight segment back to the start point
filletCornerradiusrounds the corner between the segments before and after it
chamferCornerdistancebevels that corner, cutting distance off each segment

Corner commands sit between the two segments they join. Placed after close, a corner command rounds or bevels the corner at the start point. Corners work between lines and circular arcs in any combination.

In Rete and Blockly, bitbybit.occt.sketch.commands has one builder per command (line, hLine, tangentArc, filletCorner and the rest): collect their outputs into a list and feed it to the pen, as the Rete and Blockly tabs on this page do.

Sketching on a plane​

A sketch lies in the plane of a frame: the frame's direction is the sketch's x axis, and its normal crossed with the direction is the sketch's y axis. Without a frame, the sketch lies on the ground, facing up, with its y axis running along -Z, which reads naturally when you look down from above.

A wall sketched on an upright plane
Bitbybit Platform

A wall sketched on an upright plane in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"floor": {
"id": "floor",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 30,
"id": ""
},
"inputs": {},
"position": [
40,
40
]
},
"side": {
"id": "side",
"name": "bitbybit.occt.sketch.commands.vLine",
"customName": "v line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 20,
"id": ""
},
"inputs": {},
"position": [
40,
288
]
},
"arch": {
"id": "arch",
"name": "bitbybit.occt.sketch.commands.sagittaArc",
"customName": "sagitta arc",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"to": [
0,
20
],
"sagitta": -4,
"relative": false,
"id": ""
},
"inputs": {},
"position": [
40,
536
]
},
"back": {
"id": "back",
"name": "bitbybit.occt.sketch.commands.close",
"customName": "close",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"id": ""
},
"inputs": {},
"position": [
40,
876
]
},
"commands": {
"id": "commands",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "floor",
"output": "result",
"data": {}
},
{
"node": "side",
"output": "result",
"data": {}
},
{
"node": "arch",
"output": "result",
"data": {}
},
{
"node": "back",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"upright": {
"id": "upright",
"name": "bitbybit.frame.create",
"customName": "frame",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
0,
0
],
"normal": [
0,
0,
1
],
"direction": [
1,
0,
0
]
},
"inputs": {},
"position": [
40,
1116
]
},
"pen": {
"id": "pen",
"name": "bitbybit.occt.sketch.pen",
"customName": "pen",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
0,
0
],
"makeFace": true
},
"inputs": {
"commands": {
"connections": [
{
"node": "commands",
"output": "list",
"data": {}
}
]
},
"frame": {
"connections": [
{
"node": "upright",
"output": "result",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"wall": {
"id": "wall",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
0,
3
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "pen",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
-21,
28,
-46
],
"lookAt": [
15,
12,
1
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
1720,
40
]
}
},
"modules": {}
}

Finding the edges a command drew​

bitbybit.occt.sketch.penWithSegments draws the same outline and also reports which edges each command drew, numbered as bitbybit.occt.shapes.edge.getEdges numbers them. Give commands an id to find their edges by name rather than by position, which shifts when a command is added.

An edge found by the name of its command
Bitbybit Platform

An edge found by the name of its command in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"base": {
"id": "base",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 40,
"id": "base"
},
"inputs": {},
"position": [
40,
40
]
},
"side": {
"id": "side",
"name": "bitbybit.occt.sketch.commands.vLine",
"customName": "v line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 10,
"id": "side"
},
"inputs": {},
"position": [
40,
288
]
},
"slope": {
"id": "slope",
"name": "bitbybit.occt.sketch.commands.close",
"customName": "close",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"id": "slope"
},
"inputs": {},
"position": [
40,
536
]
},
"commands": {
"id": "commands",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "base",
"output": "result",
"data": {}
},
{
"node": "side",
"output": "result",
"data": {}
},
{
"node": "slope",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"drawn": {
"id": "drawn",
"name": "bitbybit.occt.sketch.penWithSegments",
"customName": "pen with segments",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
0,
0
],
"makeFace": true
},
"inputs": {
"commands": {
"connections": [
{
"node": "commands",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"shape": {
"id": "shape",
"name": "bitbybit.json.getValueOnProp",
"customName": "get value on prop",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"property": "shape"
},
"inputs": {
"json": {
"connections": [
{
"node": "drawn",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"drawFace": {
"id": "drawFace",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "shape",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"edges": {
"id": "edges",
"name": "bitbybit.occt.shapes.edge.getEdges",
"customName": "get edges",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"shape": {
"connections": [
{
"node": "shape",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"found": {
"id": "found",
"name": "bitbybit.json.query",
"customName": "query",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"query": "$.segments[?(@.id=='slope')].edges[0]"
},
"inputs": {
"json": {
"connections": [
{
"node": "drawn",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
288
]
},
"number": {
"id": "number",
"name": "bitbybit.lists.getFirstItem",
"customName": "get first item",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"clone": true
},
"inputs": {
"list": {
"connections": [
{
"node": "found",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
280
]
},
"edge": {
"id": "edge",
"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": "edges",
"output": "result",
"data": {}
}
]
},
"index": {
"connections": [
{
"node": "number",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"bright": {
"id": "bright",
"name": "bitbybit.draw.optionsOcctShape",
"customName": "options occt shape",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"faceOpacity": 1,
"edgeOpacity": 1,
"edgeColour": "#ff6a00",
"faceColour": "#ff0000",
"vertexColour": "#ff00ff",
"edgeWidth": 8,
"edgeWidthBySize": false,
"vertexSize": 0.03,
"drawEdges": true,
"drawFaces": true,
"drawVertices": false,
"precision": 0.01,
"angularDeflection": 0.5,
"relativeDeflection": false,
"precisionShare": 0,
"drawEdgeIndexes": false,
"edgeIndexHeight": 0.06,
"edgeIndexColour": "#ff00ff",
"drawFaceIndexes": false,
"faceIndexHeight": 0.06,
"faceIndexColour": "#0000ff",
"drawTwoSided": true,
"backFaceColour": "#0000ff",
"backFaceOpacity": 1,
"edgeArrowSize": 0,
"edgeArrowAngle": 15,
"keepMeshData": false,
"allowQualityDecrease": true,
"forceFaceDeflection": false,
"drawIsoCurves": false,
"isoCurvesU": 5,
"isoCurvesV": 5,
"isoCurvesColour": "#808080",
"surfaceAnalysis": "none",
"draftDirection": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
776
]
},
"drawEdge": {
"id": "drawEdge",
"name": "bitbybit.draw.drawAnyAsync",
"customName": "draw any async",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"entity": {
"connections": [
{
"node": "edge",
"output": "result",
"data": {}
}
]
},
"options": {
"connections": [
{
"node": "bright",
"output": "result",
"data": {}
}
]
}
},
"position": [
2560,
334
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
20,
58,
27
],
"lookAt": [
20,
0,
-5
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2560,
628
]
}
},
"modules": {}
}

Outlining a wire with a width​

bitbybit.occt.sketch.stroke outlines a wire as if it were drawn with a pen of a given width: a slot from a path, a trace from a centre line. cap finishes the two ends with a flat cut, a half circle or a square end, and join sets how the outline goes around corners. A closed wire gives a ring.

A curved slot from a centre line
Bitbybit Platform

A curved slot from a centre line in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"straight": {
"id": "straight",
"name": "bitbybit.occt.sketch.commands.hLine",
"customName": "h line",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"length": 30,
"id": ""
},
"inputs": {},
"position": [
40,
40
]
},
"bend": {
"id": "bend",
"name": "bitbybit.occt.sketch.commands.tangentArc",
"customName": "tangent arc",
"async": true,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"to": [
10,
10
],
"relative": true,
"id": ""
},
"inputs": {},
"position": [
40,
288
]
},
"commands": {
"id": "commands",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "straight",
"output": "result",
"data": {}
},
{
"node": "bend",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"path": {
"id": "path",
"name": "bitbybit.occt.sketch.pen",
"customName": "pen",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
0,
0
],
"makeFace": false
},
"inputs": {
"commands": {
"connections": [
{
"node": "commands",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"outline": {
"id": "outline",
"name": "bitbybit.occt.sketch.stroke",
"customName": "stroke",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 4,
"cap": "round",
"join": "arc",
"makeFace": true
},
"inputs": {
"shape": {
"connections": [
{
"node": "path",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"cutter": {
"id": "cutter",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
3,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "outline",
"output": "result",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"tools": {
"id": "tools",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "cutter",
"output": "result",
"data": {}
}
]
}
},
"position": [
2140,
40
]
},
"plate": {
"id": "plate",
"name": "bitbybit.occt.shapes.solid.createBox",
"customName": "box",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"width": 56,
"length": 26,
"height": 3,
"center": [
20,
1.5,
-5
],
"originOnCenter": true
},
"inputs": {},
"position": [
40,
582
]
},
"slotted": {
"id": "slotted",
"name": "bitbybit.occt.booleans.difference",
"customName": "difference",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"keepEdges": false,
"strategy": "oneAfterAnother"
},
"inputs": {
"shape": {
"connections": [
{
"node": "plate",
"output": "result",
"data": {}
}
]
},
"shapes": {
"connections": [
{
"node": "tools",
"output": "list",
"data": {}
}
]
}
},
"position": [
2560,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
20,
79,
57
],
"lookAt": [
20,
1,
-5
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2980,
40
]
}
},
"modules": {}
}

Wrapping shapes in a hull​

bitbybit.occt.sketch.hull wraps vertices, lines, circles and circular arcs in the tightest convex outline around them. It is exact: straight where it spans between shapes, following a circle where a circle bulges out. The hull of a few circles is the classic way to draw a lever, a link or a rounded plate.

A lever wrapped around two circles
Bitbybit Platform

A lever wrapped around two circles in Rete

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"pivot": {
"id": "pivot",
"name": "bitbybit.occt.shapes.wire.createCircleWire",
"customName": "circle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 8,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
40
]
},
"tip": {
"id": "tip",
"name": "bitbybit.occt.shapes.wire.createCircleWire",
"customName": "circle wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"radius": 4,
"center": [
40,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {},
"position": [
40,
334
]
},
"circles": {
"id": "circles",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "pivot",
"output": "result",
"data": {}
},
{
"node": "tip",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
40
]
},
"outline": {
"id": "outline",
"name": "bitbybit.occt.sketch.hull",
"customName": "hull",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"makeFace": true
},
"inputs": {
"shapes": {
"connections": [
{
"node": "circles",
"output": "list",
"data": {}
}
]
}
},
"position": [
880,
40
]
},
"body": {
"id": "body",
"name": "bitbybit.occt.operations.extrude",
"customName": "extrude",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"direction": [
0,
5,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "outline",
"output": "result",
"data": {}
}
]
}
},
"position": [
1300,
40
]
},
"atPivot": {
"id": "atPivot",
"name": "bitbybit.frame.zx",
"customName": "zx",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
0,
5,
0
]
},
"inputs": {},
"position": [
40,
628
]
},
"atTip": {
"id": "atTip",
"name": "bitbybit.frame.zx",
"customName": "zx",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"origin": [
40,
5,
0
]
},
"inputs": {},
"position": [
40,
868
]
},
"frames": {
"id": "frames",
"name": "bitbybit.lists.createList",
"customName": "create list",
"async": false,
"drawable": false,
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "atPivot",
"output": "result",
"data": {}
},
{
"node": "atTip",
"output": "result",
"data": {}
}
]
}
},
"position": [
460,
280
]
},
"lever": {
"id": "lever",
"name": "bitbybit.occt.features.holes",
"customName": "holes",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"diameter": 5,
"depth": 0,
"tipAngle": 0
},
"inputs": {
"shape": {
"connections": [
{
"node": "body",
"output": "result",
"data": {}
}
]
},
"frames": {
"connections": [
{
"node": "frames",
"output": "list",
"data": {}
}
]
}
},
"position": [
1720,
40
]
},
"view": {
"id": "view",
"name": "bitbybit.babylon.scene.adjustActiveArcRotateCamera",
"customName": "adjust active arc rotate camera",
"async": false,
"drawable": false,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"position": [
21,
63,
63
],
"lookAt": [
18,
2,
0
],
"lowerBetaLimit": 1,
"upperBetaLimit": 179,
"angularSensibilityX": 1000,
"angularSensibilityY": 1000,
"maxZ": 1000,
"panningSensibility": 1000,
"wheelPrecision": 3
},
"inputs": {},
"position": [
2140,
40
]
}
},
"modules": {}
}