Modeling spirals

Technical discussions
Post Reply
bingset
Posts: 2
Joined: Thu Sep 05, 2013 1:39 am

Modeling spirals

Post by bingset »

Hi
I am developing a program to model pipes made out of Spiral Wound strips. Is it possible to model them in kernel cad? The spirals have to be solid. If yes I would appreciate any relevant information
Thank You

gerard12
Posts: 21
Joined: Fri Jul 26, 2013 8:34 am

Re: Modeling spirals

Post by gerard12 »

Hi
We have an example created for another customer. Look at: http://www.dynoinsight.com/Prod/Example ... Spiral.zip
It is a modification of ObjArray example. If you select “Generic” in the “New Child” group and press the Add button you will get a solid object constructed on four spirals.

Most of the changes are located in the ConstructSpiral() (below), but there are some scattered changes too. So I recommend comparing the file with one from the KernelCAD installation directory using a diff tool
Good luck
Gerard

' The 3D section iSect has been created with default shape: Box with edges as straight
' lines in cylindrical coordinates).
' Modify The edges to construct a solid spiral
Sub ConstructSpiral(ByVal iSect As ISection)

iSect.SetGeomResolution(20) 'Tune in this number when everything is working
' This is surface quality vs performance trade off

Dim iAxiBase As IAxiBase = iSect
' Set z dimention
'Dim length As Double = 1.3
Dim length As Double = 1.0
'Number of patches in axial direction:
Dim stacks As Integer = m_nSpiralKnots - 1 'm_nSpiralKnots can also be obtained as iAxiBase.GetCount()
Dim lengthStack As Double = length / stacks

For i As Integer = 0 To m_nSpiralKnots - 1
iAxiBase.SetKnotValue(i, i * lengthStack)
Next
'iAxiBase.SetKnotValue(1, 0.65) ' Knot 0 is 0.0 by default
'iAxiBase.SetKnotValue(2, 1.3)

' This is easier to understand followitn operations in Modeling Studio after a 3DS section
' (like box) was created. Box is a strip of four patched (sides) and four edges between them
' In this case we have a line so no patches only a standalone edge
' To acces the edge get the strip first. Thi sis what appers in the cros-section view (bottom right) in MS
Dim iStrip As IStrip = iSect

Dim tapes As Integer = 4 ' How many in the pipe
Dim aStart As Double = 0
Dim angleSwept As Double = 2 * Math.PI / tapes
'Dim R As Double = 2.06 '2.05 is ok
Dim R As Double = 5
Dim thickness As Double = 0.2
Debug.Print("Windangle:" & Math.Atan(Math.PI * R / 1.3) * 180 / Math.PI)
' Get the edge (Corresponds to selection of the point in crossection view of MS)
ConstructEdgeOfSolidSpiral(aStart, R, iStrip, 0)
ConstructEdgeOfSolidSpiral(aStart + angleSwept, R, iStrip, 1)
ConstructEdgeOfSolidSpiral(aStart + angleSwept, R - thickness, iStrip, 2)
ConstructEdgeOfSolidSpiral(aStart, R - thickness, iStrip, 3)
End Sub

Post Reply