Dear STKO Team,
I want to model the spiral hoops for circular columns in STKO in 3D. Could you tell me which tool I should use to model it?
Thank you.
Spiral hoops in circular column

 Posts: 348
 Joined: Sat Mar 28, 2020 2:25 pm
Re: Spiral hoops in circular column
Hi, I wrote a piece of Python script that uses PyMpc library of STKO. You can try and modify according to your requirement.
Code: Select all
import math
from PyMpc import *
doc = App.caeDocument()
def create_helicalSpiral(start_x, start_y, start_z, radius, pitch, num_turns, num_points):
"""
Create a helical spiral line in 3D space.
Parameters:
start_x (float): X coordinate of the starting point
start_y (float): Y coordinate of the starting point
start_z (float): Z coordinate of the starting point
radius (float): Radius of the helix
pitch (float): Vertical distance between each turn of the helix
num_turns (int): Number of turns in the helix
num_points (int): Number of points to use in the spiral
Returns:
Wire: A PyMPC Wire object representing the helical spiral
"""
vertex = list(range(num_points))
for i in range(num_points):
t = i / (num_points  1) * num_turns * 2 * math.pi
x = start_x + radius * math.cos(t)
y = start_y + radius * math.sin(t)
z = start_z + pitch * t / (2 * math.pi)
vertex[i] = FxOccBuilder.makeVertex(x, y, z)
edge = list(range(num_points1))
for i in range(num_points1):
edge[i] = FxOccBuilder.makeEdge(vertex[i], vertex[i+1])
w1 = FxOccBuilder.makeWire(edge)
next_id = doc.geometries.getlastkey(0)+1
geom = MpcGeometry(next_id,"Wire1",w1)
doc.addGeometry(geom)
App.runCommand('Regenerate',str(2))
create_helicalSpiral(0, 0, 0, 100, 50, 10, 500)
:: With best wishes ::
Prabakaran Kesavan
Prabakaran Kesavan

 Posts: 19
 Joined: Thu Dec 21, 2023 3:17 pm
Re: Spiral hoops in circular column
Thanks for sharing. It works very nicely.

 Posts: 348
 Joined: Sat Mar 28, 2020 2:25 pm