Creating Wires Via Points
Imagine you're sketching a path through a landscape, connecting landmarks along the way. In 3D modeling, creating wires from points follows the same principle - you define key locations in space and let OCCT connect them in different ways to create the exact path you need.
When Would You Use Point-Based Wires?
Think of real-world scenarios where you need to connect specific locations:
- Tracing a coastline from GPS coordinates collected during a survey
- Designing a race track that must pass through mandatory checkpoints
- Creating a roller coaster path with smooth curves through scenic viewpoints
- Plotting a robot's movement through precise manufacturing positions
- Sketching a building outline from surveyed property corners
The Different Ways to Connect Your Points
OCCT offers several methods to connect points, each creating a different type of path. Most of these methods create open-ended wires - paths with distinct start and end points. To create closed shapes, you'll typically combine these wires with additional segments or use specialized closing operations.
Straight-Line Connections
These create angular, precise paths perfect for architectural or mechanical designs:
- Line Wire: The simplest connection - imagine drawing a ruler-straight line between two distant points
- Polyline Wire: Like connecting dots with straight lines, creating sharp turns at each point
- Polygon Wire: Similar to polyline, but automatically closes the shape by connecting back to the start
Smooth Curved Connections
These create flowing, organic paths ideal for natural forms or aesthetic designs:
- Interpolated Wire: Like threading a flexible cable through each point - the curve passes exactly through every location
- Bezier Wire: Points act like magnets pulling on a rubber band - the curve flows toward them but may not touch each one
- BSpline Wire: The most sophisticated option, offering mathematical precision for complex industrial curves
A Story of Six Paths
Picture yourself as a landscape architect designing a garden path system. You have five scenic viewpoints that visitors should experience. Here's how each wire method would create a different journey:
Polylines and Polygons
You want visitors to walk directly between viewpoints with clear sight lines. Polylines create this direct, no-nonsense path with sharp turns at each viewpoint. Polygons add a final segment back to the starting point, creating a complete loop tour.
Perfect for: Property boundaries, building floor plans, mechanical part outlines
Interpolated Curves
You want a gentle, flowing path that guides visitors smoothly through each viewpoint without jarring direction changes. The path bends gracefully, ensuring visitors experience every scenic spot while maintaining a natural walking rhythm.
Perfect for: Natural landscape features, aerodynamic surfaces, smooth motion paths
Bezier and BSpline Curves
You want artistic control over the path's character. The viewpoints influence the route's direction and feel, but the path may curve away from some points to create a more aesthetically pleasing or functionally optimal journey.
Perfect for: Automotive body panels, artistic sculptures, complex industrial surfaces
Example: Comprehensive Point-Based Wire Creation
This example demonstrates all major methods for creating wires from points, showing how the same set of points can produce dramatically different geometric results depending on the chosen method.
- Rete
- Blockly
- TypeScript
{
"id": "rete-v2-json",
"nodes": {
"a1b2c3d4e5f6": {
"id": "a1b2c3d4e5f6",
"name": "bitbybit.vector.vectorXYZ",
"customName": "point 1",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": -4,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
-493.02397782786227,
470.80511748455797
]
},
"b2c3d4e5f6a1": {
"id": "b2c3d4e5f6a1",
"name": "bitbybit.vector.vectorXYZ",
"customName": "point 2",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": -2,
"y": 0,
"z": 1
},
"inputs": {},
"position": [
-495.9775535174124,
824.4887151951773
]
},
"c3d4e5f6a1b2": {
"id": "c3d4e5f6a1b2",
"name": "bitbybit.vector.vectorXYZ",
"customName": "point 3",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 0,
"z": -1
},
"inputs": {},
"position": [
-498.99641218710724,
1176.422611805823
]
},
"d4e5f6a1b2c3": {
"id": "d4e5f6a1b2c3",
"name": "bitbybit.vector.vectorXYZ",
"customName": "point 4",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 2,
"y": 0,
"z": 2
},
"inputs": {},
"position": [
-494.97355151391963,
1517.6141247865087
]
},
"e5f6a1b2c3d4": {
"id": "e5f6a1b2c3d4",
"name": "bitbybit.vector.vectorXYZ",
"customName": "point 5",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 4,
"y": 0,
"z": 0
},
"inputs": {},
"position": [
-495.0539579019686,
1869.4137045825596
]
},
"7f6450ede1fffa90": {
"id": "7f6450ede1fffa90",
"name": "bitbybit.lists.createList",
"customName": "points list",
"data": {},
"inputs": {
"listElements": {
"connections": [
{
"node": "a1b2c3d4e5f6",
"output": "result",
"data": {}
},
{
"node": "b2c3d4e5f6a1",
"output": "result",
"data": {}
},
{
"node": "c3d4e5f6a1b2",
"output": "result",
"data": {}
},
{
"node": "d4e5f6a1b2c3",
"output": "result",
"data": {}
},
{
"node": "e5f6a1b2c3d4",
"output": "result",
"data": {}
}
]
}
},
"position": [
40.11505123394138,
1197.376085706432
]
},
"g7h8i9j0k1l2": {
"id": "g7h8i9j0k1l2",
"name": "bitbybit.occt.shapes.wire.createLineWire",
"customName": "line wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"start": [
0,
0,
0
],
"end": [
0,
1,
0
]
},
"inputs": {
"start": {
"connections": [
{
"node": "a1b2c3d4e5f6",
"output": "result",
"data": {}
}
]
},
"end": {
"connections": [
{
"node": "e5f6a1b2c3d4",
"output": "result",
"data": {}
}
]
}
},
"position": [
40.34197448254858,
1404.5659712296927
]
},
"h8i9j0k1l2m3": {
"id": "h8i9j0k1l2m3",
"name": "bitbybit.occt.shapes.wire.createPolylineWire",
"customName": "polyline wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"points": {
"connections": [
{
"node": "7f6450ede1fffa90",
"output": "list",
"data": {}
}
]
}
},
"position": [
700,
487.8255618667852
]
},
"i9j0k1l2m3n4": {
"id": "i9j0k1l2m3n4",
"name": "bitbybit.occt.shapes.wire.createPolygonWire",
"customName": "polygon wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
}
},
"inputs": {
"points": {
"connections": [
{
"node": "7f6450ede1fffa90",
"output": "list",
"data": {}
}
]
}
},
"position": [
699.1789247688082,
787.174190182404
]
},
"j0k1l2m3n4o5": {
"id": "j0k1l2m3n4o5",
"name": "bitbybit.occt.shapes.wire.interpolatePoints",
"customName": "interpolated wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"periodic": false,
"tolerance": 1e-7
},
"inputs": {
"points": {
"connections": [
{
"node": "7f6450ede1fffa90",
"output": "list",
"data": {}
}
]
}
},
"position": [
695.6631417444979,
1082.0937782727924
]
},
"z9a8b7c6d5e4": {
"id": "z9a8b7c6d5e4",
"name": "bitbybit.occt.shapes.wire.interpolatePoints",
"customName": "interpolated periodic wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"periodic": true,
"tolerance": 1e-7
},
"inputs": {
"points": {
"connections": [
{
"node": "7f6450ede1fffa90",
"output": "list",
"data": {}
}
]
}
},
"position": [
695.6631417444979,
1282.0937782727924
]
},
"k1l2m3n4o5p6": {
"id": "k1l2m3n4o5p6",
"name": "bitbybit.occt.shapes.wire.createBezier",
"customName": "bezier wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"closed": false
},
"inputs": {
"points": {
"connections": [
{
"node": "7f6450ede1fffa90",
"output": "list",
"data": {}
}
]
}
},
"position": [
703.115902028841,
1558.639999951643
]
},
"l2m3n4o5p6q7": {
"id": "l2m3n4o5p6q7",
"name": "bitbybit.occt.shapes.wire.createBSpline",
"customName": "bspline wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"closed": false
},
"inputs": {
"points": {
"connections": [
{
"node": "7f6450ede1fffa90",
"output": "list",
"data": {}
}
]
}
},
"position": [
703.2502480679341,
1909.062052995027
]
},
"m3n4o5p6q7r8": {
"id": "m3n4o5p6q7r8",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate polyline",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "h8i9j0k1l2m3",
"output": "result",
"data": {}
}
]
},
"translation": {
"connections": [
{
"node": "n4o5p6q7r8s9",
"output": "result",
"data": {}
}
]
}
},
"position": [
2130.9911604585623,
696.2845715130113
]
},
"n4o5p6q7r8s9": {
"id": "n4o5p6q7r8s9",
"name": "bitbybit.vector.vectorXYZ",
"customName": "translate vector 1",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 1,
"z": 0
},
"inputs": {},
"position": [
1563.8510440039506,
751.8708579320071
]
},
"o5p6q7r8s9t0": {
"id": "o5p6q7r8s9t0",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate polygon",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "i9j0k1l2m3n4",
"output": "result",
"data": {}
}
]
},
"translation": {
"connections": [
{
"node": "p6q7r8s9t0u1",
"output": "result",
"data": {}
}
]
}
},
"position": [
2128.221783011097,
1034.8714527347215
]
},
"p6q7r8s9t0u1": {
"id": "p6q7r8s9t0u1",
"name": "bitbybit.vector.vectorXYZ",
"customName": "translate vector 2",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 2,
"z": 0
},
"inputs": {},
"position": [
1583.6289311585433,
1126.022776389753
]
},
"q7r8s9t0u1v2": {
"id": "q7r8s9t0u1v2",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate interpolated",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "j0k1l2m3n4o5",
"output": "result",
"data": {}
}
]
},
"translation": {
"connections": [
{
"node": "r8s9t0u1v2w3",
"output": "result",
"data": {}
}
]
}
},
"position": [
2120.580884589621,
1392.6205311000572
]
},
"r8s9t0u1v2w3": {
"id": "r8s9t0u1v2w3",
"name": "bitbybit.vector.vectorXYZ",
"customName": "translate vector 3",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 3,
"z": 0
},
"inputs": {},
"position": [
1595.1616223823362,
1510.5004742140454
]
},
"x8y9z0a1b2c3": {
"id": "x8y9z0a1b2c3",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate interpolated periodic",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "z9a8b7c6d5e4",
"output": "result",
"data": {}
}
]
},
"translation": {
"connections": [
{
"node": "y7z8a9b0c1d2",
"output": "result",
"data": {}
}
]
}
},
"position": [
2120.445985591514,
1820.0396707912366
]
},
"y7z8a9b0c1d2": {
"id": "y7z8a9b0c1d2",
"name": "bitbybit.vector.vectorXYZ",
"customName": "translate vector 4",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 4,
"z": 0
},
"inputs": {},
"position": [
1595.1616223823362,
1926.7229970623423
]
},
"s9t0u1v2w3x4": {
"id": "s9t0u1v2w3x4",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate bezier",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "k1l2m3n4o5p6",
"output": "result",
"data": {}
}
]
},
"translation": {
"connections": [
{
"node": "t0u1v2w3x4y5",
"output": "result",
"data": {}
}
]
}
},
"position": [
2150.4698332469884,
2297.3727581079825
]
},
"t0u1v2w3x4y5": {
"id": "t0u1v2w3x4y5",
"name": "bitbybit.vector.vectorXYZ",
"customName": "translate vector 5",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 5,
"z": 0
},
"inputs": {},
"position": [
1618.2924967222198,
2400.1867524589516
]
},
"u1v2w3x4y5z6": {
"id": "u1v2w3x4y5z6",
"name": "bitbybit.occt.transforms.translate",
"customName": "translate bspline",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"translation": [
0,
0,
0
]
},
"inputs": {
"shape": {
"connections": [
{
"node": "l2m3n4o5p6q7",
"output": "result",
"data": {}
}
]
},
"translation": {
"connections": [
{
"node": "v2w3x4y5z6a7",
"output": "result",
"data": {}
}
]
}
},
"position": [
2147.1321542489886,
2634.941303378405
]
},
"v2w3x4y5z6a7": {
"id": "v2w3x4y5z6a7",
"name": "bitbybit.vector.vectorXYZ",
"customName": "translate vector 6",
"async": false,
"drawable": true,
"data": {
"genericNodeData": {
"hide": true,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"x": 0,
"y": 6,
"z": 0
},
"inputs": {},
"position": [
1620.6403379243168,
2810.8480642892005
]
}
}
}
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="point1">point1</variable><variable id="point2">point2</variable><variable id="point3">point3</variable><variable id="point4">point4</variable><variable id="point5">point5</variable><variable id="pointsList">pointsList</variable><variable id="lineWire">lineWire</variable><variable id="polylineWire">polylineWire</variable><variable id="polygonWire">polygonWire</variable><variable id="interpolatedWire">interpolatedWire</variable><variable id="interpolatedPeriodicWire">interpolatedPeriodicWire</variable><variable id="bezierWire">bezierWire</variable><variable id="bsplineWire">bsplineWire</variable></variables><block type="variables_set" id="create_point1" x="50" y="50"><field name="VAR" id="point1">point1</field><value name="VALUE"><block type="bitbybit.point.pointXYZ" id="point1_coords"><value name="X"><block type="math_number" id="p1_x"><field name="NUM">-4</field></block></value><value name="Y"><block type="math_number" id="p1_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="p1_z"><field name="NUM">0</field></block></value></block></value><next><block type="variables_set" id="create_point2" x="50" y="150"><field name="VAR" id="point2">point2</field><value name="VALUE"><block type="bitbybit.point.pointXYZ" id="point2_coords"><value name="X"><block type="math_number" id="p2_x"><field name="NUM">-2</field></block></value><value name="Y"><block type="math_number" id="p2_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="p2_z"><field name="NUM">1</field></block></value></block></value><next><block type="variables_set" id="create_point3" x="50" y="250"><field name="VAR" id="point3">point3</field><value name="VALUE"><block type="bitbybit.point.pointXYZ" id="point3_coords"><value name="X"><block type="math_number" id="p3_x"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="p3_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="p3_z"><field name="NUM">-1</field></block></value></block></value><next><block type="variables_set" id="create_point4" x="50" y="350"><field name="VAR" id="point4">point4</field><value name="VALUE"><block type="bitbybit.point.pointXYZ" id="point4_coords"><value name="X"><block type="math_number" id="p4_x"><field name="NUM">2</field></block></value><value name="Y"><block type="math_number" id="p4_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="p4_z"><field name="NUM">2</field></block></value></block></value><next><block type="variables_set" id="create_point5" x="50" y="450"><field name="VAR" id="point5">point5</field><value name="VALUE"><block type="bitbybit.point.pointXYZ" id="point5_coords"><value name="X"><block type="math_number" id="p5_x"><field name="NUM">4</field></block></value><value name="Y"><block type="math_number" id="p5_y"><field name="NUM">0</field></block></value><value name="Z"><block type="math_number" id="p5_z"><field name="NUM">0</field></block></value></block></value><next><block type="variables_set" id="create_points_list" x="50" y="550"><field name="VAR" id="pointsList">pointsList</field><value name="VALUE"><block type="lists_create_with" id="points_list"><mutation items="5"></mutation><value name="ADD0"><block type="variables_get" id="get_point1"><field name="VAR" id="point1">point1</field></block></value><value name="ADD1"><block type="variables_get" id="get_point2"><field name="VAR" id="point2">point2</field></block></value><value name="ADD2"><block type="variables_get" id="get_point3"><field name="VAR" id="point3">point3</field></block></value><value name="ADD3"><block type="variables_get" id="get_point4"><field name="VAR" id="point4">point4</field></block></value><value name="ADD4"><block type="variables_get" id="get_point5"><field name="VAR" id="point5">point5</field></block></value></block></value><next><block type="variables_set" id="create_line_wire" x="50" y="650"><field name="VAR" id="lineWire">lineWire</field><value name="VALUE"><block type="bitbybit.occt.shapes.wire.createLineWire" id="line_wire"><value name="Start"><block type="variables_get" id="get_point1_for_line"><field name="VAR" id="point1">point1</field></block></value><value name="End"><block type="variables_get" id="get_point5_for_line"><field name="VAR" id="point5">point5</field></block></value></block></value><next><block type="variables_set" id="create_polyline_wire" x="50" y="750"><field name="VAR" id="polylineWire">polylineWire</field><value name="VALUE"><block type="bitbybit.occt.transforms.translate" id="translate_polyline"><value name="Shape"><block type="bitbybit.occt.shapes.wire.createPolylineWire" id="polyline_wire"><value name="Points"><block type="variables_get" id="get_points_for_polyline"><field name="VAR" id="pointsList">pointsList</field></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ" id="translate_vec1"><value name="X"><block type="math_number" id="translate_x1"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="translate_y1"><field name="NUM">1</field></block></value><value name="Z"><block type="math_number" id="translate_z1"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="variables_set" id="create_polygon_wire" x="50" y="850"><field name="VAR" id="polygonWire">polygonWire</field><value name="VALUE"><block type="bitbybit.occt.transforms.translate" id="translate_polygon"><value name="Shape"><block type="bitbybit.occt.shapes.wire.createPolygonWire" id="polygon_wire"><value name="Points"><block type="variables_get" id="get_points_for_polygon"><field name="VAR" id="pointsList">pointsList</field></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ" id="translate_vec2"><value name="X"><block type="math_number" id="translate_x2"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="translate_y2"><field name="NUM">2</field></block></value><value name="Z"><block type="math_number" id="translate_z2"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="variables_set" id="create_interpolated_wire" x="50" y="950"><field name="VAR" id="interpolatedWire">interpolatedWire</field><value name="VALUE"><block type="bitbybit.occt.transforms.translate" id="translate_interpolated"><value name="Shape"><block type="bitbybit.occt.shapes.wire.interpolatePoints" id="interpolated_wire"><value name="Points"><block type="variables_get" id="get_points_for_interpolated"><field name="VAR" id="pointsList">pointsList</field></block></value><value name="Periodic"><block type="logic_boolean" id="periodic_false"><field name="BOOL">FALSE</field></block></value><value name="Tolerance"><block type="math_number" id="tolerance_value"><field name="NUM">1e-7</field></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ" id="translate_vec3"><value name="X"><block type="math_number" id="translate_x3"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="translate_y3"><field name="NUM">3</field></block></value><value name="Z"><block type="math_number" id="translate_z3"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="variables_set" id="create_interpolated_periodic_wire" x="50" y="1050"><field name="VAR" id="interpolatedPeriodicWire">interpolatedPeriodicWire</field><value name="VALUE"><block type="bitbybit.occt.transforms.translate" id="translate_interpolated_periodic"><value name="Shape"><block type="bitbybit.occt.shapes.wire.interpolatePoints" id="interpolated_periodic_wire"><value name="Points"><block type="variables_get" id="get_points_for_interpolated_periodic"><field name="VAR" id="pointsList">pointsList</field></block></value><value name="Periodic"><block type="logic_boolean" id="periodic_true"><field name="BOOL">TRUE</field></block></value><value name="Tolerance"><block type="math_number" id="tolerance_value_periodic"><field name="NUM">1e-7</field></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ" id="translate_vec4"><value name="X"><block type="math_number" id="translate_x4"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="translate_y4"><field name="NUM">4</field></block></value><value name="Z"><block type="math_number" id="translate_z4"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="variables_set" id="create_bezier_wire" x="50" y="1150"><field name="VAR" id="bezierWire">bezierWire</field><value name="VALUE"><block type="bitbybit.occt.transforms.translate" id="translate_bezier"><value name="Shape"><block type="bitbybit.occt.shapes.wire.createBezier" id="bezier_wire"><value name="Points"><block type="variables_get" id="get_points_for_bezier"><field name="VAR" id="pointsList">pointsList</field></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ" id="translate_vec5"><value name="X"><block type="math_number" id="translate_x5"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="translate_y5"><field name="NUM">5</field></block></value><value name="Z"><block type="math_number" id="translate_z5"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="variables_set" id="create_bspline_wire" x="50" y="1250"><field name="VAR" id="bsplineWire">bsplineWire</field><value name="VALUE"><block type="bitbybit.occt.transforms.translate" id="translate_bspline"><value name="Shape"><block type="bitbybit.occt.shapes.wire.createBSpline" id="bspline_wire"><value name="Points"><block type="variables_get" id="get_points_for_bspline"><field name="VAR" id="pointsList">pointsList</field></block></value><value name="Periodic"><block type="logic_boolean" id="periodic_false_bspline"><field name="BOOL">FALSE</field></block></value><value name="Degree"><block type="math_number" id="degree_value"><field name="NUM">3</field></block></value></block></value><value name="Translation"><block type="bitbybit.vector.vectorXYZ" id="translate_vec6"><value name="X"><block type="math_number" id="translate_x6"><field name="NUM">0</field></block></value><value name="Y"><block type="math_number" id="translate_y6"><field name="NUM">6</field></block></value><value name="Z"><block type="math_number" id="translate_z6"><field name="NUM">0</field></block></value></block></value></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_line_wire" x="50" y="1350"><value name="Entity"><block type="variables_get" id="get_line_wire"><field name="VAR" id="lineWire">lineWire</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_polyline_wire" x="50" y="1450"><value name="Entity"><block type="variables_get" id="get_polyline_wire"><field name="VAR" id="polylineWire">polylineWire</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_polygon_wire" x="50" y="1550"><value name="Entity"><block type="variables_get" id="get_polygon_wire"><field name="VAR" id="polygonWire">polygonWire</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_interpolated_wire" x="50" y="1650"><value name="Entity"><block type="variables_get" id="get_interpolated_wire"><field name="VAR" id="interpolatedWire">interpolatedWire</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_interpolated_periodic_wire" x="50" y="1750"><value name="Entity"><block type="variables_get" id="get_interpolated_periodic_wire"><field name="VAR" id="interpolatedPeriodicWire">interpolatedPeriodicWire</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_bezier_wire" x="50" y="1850"><value name="Entity"><block type="variables_get" id="get_bezier_wire"><field name="VAR" id="bezierWire">bezierWire</field></block></value><next><block type="bitbybit.draw.drawAnyAsyncNoReturn" id="draw_bspline_wire" x="50" y="1950"><value name="Entity"><block type="variables_get" id="get_bspline_wire"><field name="VAR" id="bsplineWire">bsplineWire</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>
// Import required DTOs and types for wire creation
const { LineDto, PolylineDto, PolygonDto, InterpolationDto, BezierDto, BSplineDto, TranslateDto } = Bit.Inputs.OCCT;
type Point3 = Bit.Inputs.Base.Point3;
type Vector3 = Bit.Inputs.Base.Vector3;
type TopoDSShapePointer = Bit.Inputs.OCCT.TopoDSShapePointer;
// Get access to OCCT wire creation and transform functions
const { wire } = bitbybit.occt.shapes;
const { transforms } = bitbybit.occt;
// Define the main function to demonstrate various wire creation methods
const start = async () => {
// Define a set of control points for wire creation
const points: Point3[] = [
[-4, 0, 0], // Start point
[-2, 0, 1], // First control point
[0, 0, -1], // Second control point
[2, 0, 2], // Third control point
[4, 0, 0] // End point
];
// 1. Create a simple line wire between first and last points
const lineOptions = new LineDto();
lineOptions.start = points[0];
lineOptions.end = points[4];
const lineWire = await wire.createLineWire(lineOptions);
// 2. Create a polyline wire connecting all points with straight segments
const polylineOptions = new PolylineDto();
polylineOptions.points = points;
const polylineWire = await wire.createPolylineWire(polylineOptions);
// 3. Create a polygon wire (closed shape) from the points
const polygonOptions = new PolygonDto();
polygonOptions.points = points;
const polygonWire = await wire.createPolygonWire(polygonOptions);
// 4. Create an interpolated wire that passes smoothly through all points
const interpolationOptions = new InterpolationDto();
interpolationOptions.points = points;
interpolationOptions.periodic = false;
interpolationOptions.tolerance = 1e-7;
const interpolatedWire = await wire.interpolatePoints(interpolationOptions);
// 5. Create an interpolated periodic wire that creates a closed smooth curve
const interpolationPeriodicOptions = new InterpolationDto();
interpolationPeriodicOptions.points = points;
interpolationPeriodicOptions.periodic = true;
interpolationPeriodicOptions.tolerance = 1e-7;
const interpolatedPeriodicWire = await wire.interpolatePoints(interpolationPeriodicOptions);
// 6. Create a Bezier curve using points as control points
const bezierOptions = new BezierDto();
bezierOptions.points = points;
bezierOptions.closed = false;
const bezierWire = await wire.createBezier(bezierOptions);
// 7. Create a BSpline curve with specified degree
const bsplineOptions = new BSplineDto();
bsplineOptions.points = points;
bsplineOptions.closed = false;
const bsplineWire = await wire.createBSpline(bsplineOptions);
// Translate wires to different Y positions for better visualization
const translateOptions = new TranslateDto<TopoDSShapePointer>();
// Translate polyline
translateOptions.shape = polylineWire;
translateOptions.translation = [0, 1, 0] as Vector3;
const translatedPolyline = await transforms.translate(translateOptions);
// Translate polygon
translateOptions.shape = polygonWire;
translateOptions.translation = [0, 2, 0] as Vector3;
const translatedPolygon = await transforms.translate(translateOptions);
// Translate interpolated wire
translateOptions.shape = interpolatedWire;
translateOptions.translation = [0, 3, 0] as Vector3;
const translatedInterpolated = await transforms.translate(translateOptions);
// Translate interpolated periodic wire
translateOptions.shape = interpolatedPeriodicWire;
translateOptions.translation = [0, 4, 0] as Vector3;
const translatedInterpolatedPeriodic = await transforms.translate(translateOptions);
// Translate Bezier wire
translateOptions.shape = bezierWire;
translateOptions.translation = [0, 5, 0] as Vector3;
const translatedBezier = await transforms.translate(translateOptions);
// Translate BSpline wire
translateOptions.shape = bsplineWire;
translateOptions.translation = [0, 6, 0] as Vector3;
const translatedBSpline = await transforms.translate(translateOptions);
// Draw all the created wires
bitbybit.draw.drawAnyAsync({ entity: lineWire });
bitbybit.draw.drawAnyAsync({ entity: translatedPolyline });
bitbybit.draw.drawAnyAsync({ entity: translatedPolygon });
bitbybit.draw.drawAnyAsync({ entity: translatedInterpolated });
bitbybit.draw.drawAnyAsync({ entity: translatedInterpolatedPeriodic });
bitbybit.draw.drawAnyAsync({ entity: translatedBezier });
bitbybit.draw.drawAnyAsync({ entity: translatedBSpline });
}
// Execute the function
start();
Understanding the Results
When you run this example, you'll see six different paths connecting the same five points. Each represents a different approach to the journey:
Line Wire (Bottom)
The most direct route - ignores the scenic stops and goes straight from start to finish.
Polyline Wire (Second from bottom)
The methodical tourist route - visits every viewpoint with efficient straight-line segments between them.
Polygon Wire (Third from bottom)
The complete circuit tour - same as polyline but returns to the starting point to complete the loop.
Interpolated Wire (Fourth from bottom)
The scenic route - flows smoothly through every viewpoint like a gentle river following its course.
Interpolated Periodic Wire (Fifth from bottom)
The endless garden path - creates a smooth, closed loop that flows through all points and seamlessly connects back to itself.
Bezier Wire (Sixth from bottom)
The artistic interpretation - the viewpoints inspire the path's direction, creating an elegant curve that captures the essence of the journey.
BSpline Wire (Top)
The engineer's precision path - mathematically optimized for specific curve properties while responding to the viewpoint influences.
Choosing Your Path
When You Need Precise Control
Line and Polyline wires are your friends when every point must be exactly where you specify - think building corners, property boundaries, or mechanical part edges where precision trumps aesthetics.
When You Need Natural Flow
Interpolated wires create organic, flowing shapes perfect for landscapes, water features, or any design where you want smooth transitions through specific locations.
When You Need Artistic Freedom
Bezier and BSpline wires give you creative control over the overall shape while using your points as guides rather than absolute requirements - ideal for automotive styling, product design, or architectural features.
Important Note: Open vs. Closed Wires
Most point-based wire methods create open-ended paths with distinct start and end points. While polygon wires and periodic interpolated wires automatically close themselves, other methods produce open wires that you can later:
- Combine with additional wire segments to create complex closed shapes
- Use as building blocks for more sophisticated geometries
- Connect to other wires using OCCT's wire joining operations
- Transform into faces when combined with other wires to form closed boundaries
Understanding point-based wire creation opens the door to more advanced OCCT operations like face creation, surface modeling, and complex 3D shape development. These wires become the foundation elements that you'll combine and transform to build sophisticated geometries.



