############################## import rhinoscriptsyntax as rs import random, time, sys ### sys.path.append("P:/www/argetlam/DM2") ### import DM_lib as dm ### reload( dm ) ############################## rs.UnitSystem(3) rs.ShowGrid(view=None, show=0) rs.ShowGridAxes(view=None, show=0) rs.ViewDisplayMode(view=None, mode="Wireframe") rs.EnableRedraw(0) dm.PointRadius(displayModeX=0, rad=3, styl=1) ##Kreise dm.newEmptyLayer("PROJ::crv", [0,0,200]) rs.ViewDisplayMode("Perspective", "Shaded") rs.ViewDisplayMode("Front", "Shaded") rs.ViewDisplayMode("Top", "Shaded") rs.ZoomExtents() rs.EnableRedraw(1) ### 4 the MACs dm.printDisplay(1) ################KoordinatenSuche def generateZwiebel(ID,hohe,krum1,v,jung): haus = rs.ObjectsByName(ID)[0] #print haus coords = dm.getSurfacePoints( haus ) #dm.textDots(coords) #print rs.CurveEditPoints( crv ) #####################Variablen leng = rs.Distance(coords[1], coords[2]) bre = rs.Distance(coords[2], coords[3]) hoeh = hohe center = dm.pntInbetween(coords [1],coords [3]) spitze = rs.VectorAdd(center,[0,0,hoeh]) rs.AddPoint(spitze) rs.DeleteObject(rs.AllObjects()[0]) distVec1 = rs.VectorSubtract(coords[1],center) distVec2 = rs.VectorSubtract(coords[2],center) distVec3 = rs.VectorSubtract(coords[3],center) distVec4 = rs.VectorSubtract(coords[4],center) num = 27 ### max 32 / min ~16 anz = 22 ### sinnvoll ab ~12 step = (hoeh*1)/ num krum=0.03 ###### if 1: center_index = num // 2 allCoords = [] sprung = 20 #11 #sprung2 = 20 for i in range(num): distance = abs(i - center_index) if i==0: rs.AddCurve([coords [1],coords [2],coords [3],coords [4],coords [1]],1) pnts_0 = rs.DivideCurve(rs.AllObjects()[0], anz, create_points=0) rs.DeleteObject(rs.AllObjects()[0]) elif i