i want to make the ring sort of wave in and out. so i made 2 profiles. with varying width. then rotate them so every 45 degrees the profile alternates.
rs.Command("_-New _None")
intRingsize = rs.GetString(“Ringsize”)
ringsizeInput = float(intRingsize)
ringsize = ((ringsizeInput/math.pi)/2)
intWidth = rs.GetString(“Width”)
width = float(intWidth)
global width
intTop = rs.GetString(“Height”)
top = float(intTop)
global top
intBottom = rs.GetString(“Bottom”)
bottom = float(intBottom)
global bottom
intThickness = rs.GetString(“Thickness”)
thickness = float(intThickness)
global thickness
#create profile
#Sets the name of the object and returns the GUI id
def setObject(object, objectName) :
rs.ObjectName(object, objectName)
return rs.ObjectsByName(objectName)
def createProfile():
rs.CurrentView(‘Right’)
start = 0,width/-2,0
startBottom = 0,width/-2,thickness * -1
topPoint = 0,0,top
end = 0,width/2,0
endBottom = 0,width/2,thickness * -1
bottomValue = 0,0,bottom*-2
thicknessOne = 0,width/-2,thickness*-1
thicknessTwo = 0,width/2,thickness*-1
startTwo = 0,width/2,0
W = (rs.AddInterpCurve([start, topPoint, end]))
X = (rs.AddInterpCurve([startBottom, bottomValue, endBottom]))
Y = (rs.AddCurve([start, thicknessOne]))
Z = (rs.AddCurve([startTwo, thicknessTwo]))
rs.CurrentView('Front')
joinedCurveOne = rs.JoinCurves([W,X,Y,Z],delete_input=True)
rs.MoveObject(joinedCurveOne,(0,0,ringsize+bottom+thickness))
rs.RotateObject(joinedCurveOne,(0,0,0), 90,None, copy=True)
rs.RotateObject(joinedCurveOne,(0,0,0), 180,None, copy=True)
rs.RotateObject(joinedCurveOne,(0,0,0), 270,None, copy=True)
#rs.HideObject(rs.AllObjects())
def waveProfile():
widthOfWave = width + 4
start = 0,widthOfWave/-2,0
startBottom = 0,widthOfWave/-2,thickness * -1
topPoint = 0,0,top
end = 0,widthOfWave/2,0
endBottom = 0,widthOfWave/2,thickness * -1
bottomValue = 0,0,bottom*-2
thicknessOne = 0,widthOfWave/-2,thickness*-1
thicknessTwo = 0,widthOfWave/2,thickness*-1
startTwo = 0,widthOfWave/2,0
W = (rs.AddInterpCurve([start, topPoint, end]))
X = (rs.AddInterpCurve([startBottom, bottomValue, endBottom]))
Y = (rs.AddCurve([start, thicknessOne]))
Z = (rs.AddCurve([startTwo, thicknessTwo]))
#rs.SelectObjects([W,X,Y,Z])
joinedCurveTwo = rs.JoinCurves([W,X,Y,Z],delete_input=True)
rs.MoveObject(joinedCurveTwo,(0,0,ringsize+bottom+thickness))
rs.CurrentView('Front')
rs.RotateObject(joinedCurveTwo,(0,0,0), 45,None, copy=False)
rs.RotateObject(joinedCurveTwo,(0,0,0), 90,None, copy=True)
rs.RotateObject(joinedCurveTwo,(0,0,0), 180,None, copy=True)
rs.RotateObject(joinedCurveTwo,(0,0,0), 270,None, copy=True)
def createCircle():
rs.UnselectAllObjects()
rs.SelectObjects(rs.AllObjects())
profiles = rs.SelectedObjects()
rs.UnselectAllObjects()
a = profiles[0]
b = profiles[1]
c = profiles[2]
d = profiles[3]
e = profiles[4]
f = profiles[5]
g = profiles[6]
h = profiles[7]
profilesStr = [a,b,c,d,e,f,g,h]
rs.CurrentView("Front")
rs.Command('_Circle 0,0,0 _R ' + str(ringsize) + " _Enter")
rs.SelectObject(rs.LastCreatedObjects())
curve = rs.SelectedObjects()
rs.UnselectAllObjects()
rs.AddSweep1(curve,profilesStr,True)
#rs.Command("_Sweep1 _Enter _C")
#macro = "!_Sweep1 _Enter _ClosedSweep=True"
#Sweep.ClosedSweep=True
#rs.Rhino.RhinoApp.RunScript(macro, True)
createProfile()
waveProfile()
createCircle()
It´s still alot messy, so sorry for that
also at the bottom there is me trying different things out