import rhinoscriptsyntax as rs allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) initial1 = "L" initial2 = "C" hgt= 60 size = 40 # draw a closed curve mytext = rs.AddText(initial1,(0,0,0),height=size, font="Elephant") crv = rs.ExplodeText(mytext,True)[0] rs.SelectObject(crv) # extrude the curve rs.Command("-_ExtrudeCrv Solid=No DeleteInput=Yes {} _Enter".format(hgt)) srf = rs.FirstObject(select=True) # rebuild shape so the NURBS surface can be edited smoothly rs.Command("-_Rebuild UPointCount=10 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") # enable handles and use them to change NURBS shape rs.EnableObjectGrips(srf, True) rs.SelectObjectGrip(srf,23) rs.SelectObjectGrip(srf,35) rs.Command("-_Move 0,0,0 0,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,20) rs.Command("-_Move 0,0,0 5,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,11) rs.Command("-_Move 0,0,0 0,15,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf, False) # create contourlines in z-direction and extrude them rs.SelectObject(srf) rs.Command("Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=Yes 0.3 _Enter") # create contourlines in x-direction and use the pipe command rs.SelectObject(srf) rs.Command("Contour 0,0,0 1,0,0 2.0 _Enter") rs.Command("Pipe 0.2 _Enter") rs.DeleteObject(srf) #initial 2 mytext = rs.AddText(initial2,(50,0,0),height=size, font="Elephant") crv = rs.ExplodeText(mytext,True)[0] rs.SelectObject(crv) rs.Command("-_ExtrudeCrv Solid=No DeleteInput=Yes {} _Enter".format(hgt)) srf = rs.FirstObject(select=True) rs.Command("-_Rebuild UPointCount=10 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") rs.EnableObjectGrips(srf, True) rs.SelectObjectGrip(srf,23) rs.SelectObjectGrip(srf,35) rs.Command("-_Move 0,0,0 0,4,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,20) rs.Command("-_Move 0,0,0 2,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,11) rs.Command("-_Move 0,0,0 0,4,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf, False) rs.SelectObject(srf) rs.Command("Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=Yes 0.3 _Enter") rs.SelectObject(srf) rs.Command("Contour 0,0,0 1,0,0 2.0 _Enter") rs.Command("Pipe 0.2 _Enter") rs.DeleteObject(srf)