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

Introduction to OCCT Wire Shape Primitives

Wire shape primitives are specialized geometric entities that create more complex and decorative wire patterns beyond basic geometric shapes. While basic wire primitives like circles and rectangles are useful for fundamental geometry, wire shape primitives offer creative and practical solutions for specialized design needs.

In this tutorial, we'll explore four fascinating wire shape primitives that demonstrate the versatility and power of OCCT's wire creation capabilities:

What You'll Learn

  • Star Wire: Perfect for creating decorative elements, logos, or technical drawings requiring star patterns
  • Christmas Tree Wire: Ideal for seasonal designs, architectural elements, or creating tree-like structures
  • Heart Wire: Great for decorative applications, artistic designs, or romantic themed projects
  • L-Polygon Wire: Essential for architectural drawings, floor plans, or any L-shaped structural elements

Each primitive comes with customizable parameters that allow you to fine-tune the shape according to your specific requirements. Whether you're working on architectural drawings, decorative patterns, or technical illustrations, these wire shapes provide the building blocks for more complex designs.

Understanding Wire Shape Parameters

Before diving into the examples, it's helpful to understand some common parameters you'll encounter:

  • Center/Origin: The position where the shape will be placed in 3D space
  • Direction: Controls the orientation plane of the wire (typically [0,1,0] for XZ plane)
  • Rotation: Allows you to rotate the shape around its center point
  • Size Parameters: Various dimensions that control the overall scale and proportions

Now let's explore each wire shape primitive with interactive examples in three different programming approaches.

Star Wire

The star wire creates beautiful star-shaped patterns with customizable rays, radii, and proportions. It's particularly useful for decorative elements, logos, or technical drawings requiring star patterns.

Bitbybit Platform

Creating basic wire star primitive

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"71846e8e38925893": {
"id": "71846e8e38925893",
"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": 2,
"innerRadius": 1,
"offsetOuterEdges": 0,
"half": false
},
"inputs": {
"outerRadius": {
"connections": [
{
"node": "628ba46a0d5e9465",
"output": "result",
"data": {}
}
]
},
"numRays": {
"connections": [
{
"node": "192508f899900074",
"output": "result",
"data": {}
}
]
},
"innerRadius": {
"connections": [
{
"node": "4acf459aea74e8ab",
"output": "result",
"data": {}
}
]
},
"offsetOuterEdges": {
"connections": [
{
"node": "17021b462c8ed355",
"output": "result",
"data": {}
}
]
}
},
"position": [
792.20474867041,
402.71109608823497
]
},
"628ba46a0d5e9465": {
"id": "628ba46a0d5e9465",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 6,
"max": 10,
"step": 0.1,
"width": 350,
"updateOnDrag": false
},
"number": 7.8
},
"inputs": {},
"position": [
-76.40423018516849,
519.9747461190168
]
},
"192508f899900074": {
"id": "192508f899900074",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 2,
"max": 10,
"step": 1,
"width": 350,
"updateOnDrag": false
},
"number": 10
},
"inputs": {},
"position": [
-80.25629062222836,
352.8820155706951
]
},
"4acf459aea74e8ab": {
"id": "4acf459aea74e8ab",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 2,
"max": 5,
"step": 0.1,
"width": 350,
"updateOnDrag": false
},
"number": 3.7
},
"inputs": {},
"position": [
-75.93438578553521,
690.5567908444164
]
},
"17021b462c8ed355": {
"id": "17021b462c8ed355",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 0,
"max": 5,
"step": 0.1,
"width": 350,
"updateOnDrag": false
},
"number": 0
},
"inputs": {},
"position": [
-72.96558565595751,
864.4192589752912
]
}
}
}

The star wire example above demonstrates several key concepts:

  • NumRays: Controls how many points the star has (10 in our example)
  • OuterRadius: Sets the distance from center to the star's points (7.8 units)
  • InnerRadius: Sets the distance from center to the star's inner vertices (3.7 units)
  • OffsetOuterEdges: Allows fine-tuning of the star's outer edge positioning (0 = no offset)

The interactive Rete example includes sliders that let you experiment with these parameters in real-time, while the Blockly and TypeScript versions show you how to implement the same functionality programmatically.

Christmas Tree Wire

The Christmas tree wire creates detailed tree-like structures perfect for seasonal designs, architectural elements, or any application requiring organic tree shapes.

Bitbybit Platform

Creating basic wire primitive of christmass tree

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"192508f899900074": {
"id": "192508f899900074",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 2,
"max": 10,
"step": 1,
"width": 350,
"updateOnDrag": false
},
"number": 6
},
"inputs": {},
"position": [
-80.25629062222836,
352.8820155706951
]
},
"83cc04dce7869251": {
"id": "83cc04dce7869251",
"name": "bitbybit.occt.shapes.wire.createChristmasTreeWire",
"customName": "christmas tree wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"height": 6,
"innerDist": 1.5,
"outerDist": 3,
"nrSkirts": 5,
"trunkHeight": 1,
"trunkWidth": 1,
"half": false,
"rotation": 0,
"origin": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {
"height": {
"connections": [
{
"node": "192508f899900074",
"output": "result",
"data": {}
}
]
}
},
"position": [
428.2270680467593,
310.2091216520016
]
}
}
}

The Christmas tree wire showcases more complex geometric construction:

  • Height: Controls the overall tree height (6 units in our example)
  • InnerDist & OuterDist: Define the inner and outer distances of each tree layer (1.5 and 3 units)
  • NrSkirts: Determines how many layered sections the tree has (5 layers)
  • TrunkHeight & TrunkWidth: Control the tree's base trunk dimensions (1x1 units)

This primitive demonstrates how OCCT can create complex, organic-looking shapes that would be difficult to construct manually using basic geometric operations.

Heart Wire

The heart wire creates elegant heart-shaped curves, perfect for decorative applications, artistic designs, or romantic-themed projects.

Bitbybit Platform

Creating basic wire primitive of heart

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"192508f899900074": {
"id": "192508f899900074",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 2,
"max": 10,
"step": 1,
"width": 350,
"updateOnDrag": false
},
"number": 8
},
"inputs": {},
"position": [
-80.25629062222836,
352.8820155706951
]
},
"9f69c5b78eaadbf7": {
"id": "9f69c5b78eaadbf7",
"name": "bitbybit.occt.shapes.wire.createHeartWire",
"customName": "heart wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
],
"rotation": 0,
"sizeApprox": 2
},
"inputs": {
"sizeApprox": {
"connections": [
{
"node": "192508f899900074",
"output": "result",
"data": {}
}
]
}
},
"position": [
423.63737129471093,
192.68558548802676
]
}
}
}

The heart wire is elegantly simple yet mathematically sophisticated:

  • SizeApprox: Controls the approximate overall size of the heart shape (8 units)
  • Rotation: Allows you to rotate the heart around its center (0 = upright position)

Despite its simplicity in parameters, the heart wire uses complex mathematical curves to create the characteristic heart shape with smooth transitions and proper proportions.

L-Polygon Wire

The L-polygon wire creates precise L-shaped structures essential for architectural drawings, floor plans, or any application requiring L-shaped structural elements.

Bitbybit Platform

Creating basic wire primitive of L polygon

rete logoRete
Script Source (rete)
{
"id": "rete-v2-json",
"nodes": {
"192508f899900074": {
"id": "192508f899900074",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"options": {
"min": 2,
"max": 10,
"step": 1,
"width": 350,
"updateOnDrag": false
},
"number": 3
},
"inputs": {},
"position": [
-58.62727358624325,
383.0022559657982
]
},
"1a01d49b6d3cc689": {
"id": "1a01d49b6d3cc689",
"name": "bitbybit.occt.shapes.wire.createLPolygonWire",
"customName": "L polygon wire",
"async": true,
"drawable": true,
"data": {
"genericNodeData": {
"hide": false,
"oneOnOne": false,
"flatten": 0,
"forceExecution": false
},
"widthFirst": 1,
"lengthFirst": 2,
"widthSecond": 0.5,
"lengthSecond": 2,
"align": "outside",
"rotation": 0,
"center": [
0,
0,
0
],
"direction": [
0,
1,
0
]
},
"inputs": {
"widthFirst": {
"connections": [
{
"node": "192508f899900074",
"output": "result",
"data": {}
}
]
},
"lengthFirst": {
"connections": [
{
"node": "3026d7d0438f254b",
"output": "result",
"data": {}
}
]
},
"widthSecond": {
"connections": [
{
"node": "e7f2685798b9cda9",
"output": "result",
"data": {}
}
]
},
"lengthSecond": {
"connections": [
{
"node": "a2143dba4ba4dc8b",
"output": "result",
"data": {}
}
]
}
},
"position": [
606.5768827276579,
505.1489554478012
]
},
"3026d7d0438f254b": {
"id": "3026d7d0438f254b",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"number": 5
},
"inputs": {},
"position": [
-57.56991142077169,
535.7696833252093
]
},
"e7f2685798b9cda9": {
"id": "e7f2685798b9cda9",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"number": 3
},
"inputs": {},
"position": [
-55.255157296752216,
689.9084210873098
]
},
"a2143dba4ba4dc8b": {
"id": "a2143dba4ba4dc8b",
"name": "bitbybit.math.numberSlider",
"customName": "number slider",
"data": {
"number": 7
},
"inputs": {},
"position": [
-53.8048813713838,
847.5960693491355
]
}
}
}

The L-polygon wire demonstrates precision in architectural and technical applications:

  • WidthFirst & LengthFirst: Define the dimensions of the first segment (3x5 units)
  • WidthSecond & LengthSecond: Define the dimensions of the second segment (3x7 units)
  • Align: Controls how the two segments connect ("outside" alignment in our example)

This primitive is particularly valuable for creating floor plans, structural drawings, or any design requiring precise L-shaped elements.

Key Takeaways

Wire shape primitives offer several advantages over constructing complex shapes manually:

1. Consistency and Precision

Each primitive uses mathematical formulas to ensure perfect proportions and smooth curves every time. This eliminates human error and ensures professional results.

2. Parametric Control

All primitives accept parameters that allow you to customize the shape without rebuilding the geometry from scratch. This makes them perfect for creating families of related shapes or iterating on designs.

3. Performance Benefits

These primitives are optimized at the OCCT level, making them much faster than constructing equivalent shapes using multiple basic operations.

4. Professional Applications

  • Architecture: L-polygons for floor plans, stars for decorative elements
  • Manufacturing: Precise shapes for technical drawings and CAD applications
  • Art & Design: Hearts and stars for decorative and artistic projects
  • Seasonal Design: Christmas trees for themed applications

Next Steps

Now that you understand wire shape primitives, you can:

  1. Experiment with different parameter values to see how they affect the shapes
  2. Combine multiple primitives to create more complex designs
  3. Transform these wires using translation, rotation, and scaling operations
  4. Convert wires to faces or solids for 3D modeling applications
  5. Use these shapes as profiles for extrusion or sweeping operations

Remember that these wire primitives serve as building blocks for more advanced geometric operations.

The beauty of OCCT wire shape primitives lies in their simplicity of use combined with mathematical precision—they provide professional-grade geometric capabilities while remaining accessible to users at any skill level.