############################## import rhinoscriptsyntax as rs import random, math, sys sys.path.append("P:/") ### sys.path.append('P:/FINALE/annaS/') import DM_lib as dm ### reload(dm) ################### rs.EnableRedraw(0) ########################### ##### get Coords and export if 0: if 1: dm.newEmptyLayer("CONTI", [200,100,0]) feuerZ = rs.ObjectsByName("feuerzeug_srf")[0] bBox = rs.BoundingBox( feuerZ ) maxZ = bBox[-1][2] - bBox[0][2] imgWidth = 480 imgHeight = 480 deltaZ = maxZ / (imgHeight -1) print maxZ, "dist/deltaZ =", deltaZ #rs.Command("-_contour 0,0,0 0,1,0 1.0 enter", 0) rs.UnselectAllObjects() rs.Command("-_contour -selID "+str(feuerZ)+" enter 0,0,0 0,0,1 "+str(deltaZ)+" enter", 0) rs.UnselectAllObjects() contis = rs.ObjectsByLayer("CONTI") rs.HideObjects(contis ) if 1: allCoords = [] for crv in rs.ObjectsByLayer("CONTI")[0:]: rs.ShowObject( crv ) rs.Redraw() allCoords.append( rs.DivideCurve( crv, imgWidth, 0) ) rs.DeleteObject( crv ) dm.exportCoordLists(list2export=allCoords, exportedListName='fCoords', path='P:/FINALE/annaS/', fileName='feuerzeugCoords' ) ## exportCoordList(list2export=[], exportedListName='GIS_coords', path='P:/', fileName='dachsteinGis') #dm.exportCoordLists(list2export=allCoords, exportedListName='fCoords', path='P:/FINALE/annaS/', fileName='feuerzeugCoords_MM' ) ############################################## ##### import Coords and colors and make points if 1: print "*** importing.." dm.setTime() import feuerzeugCoords #import background_colors #import marilyn_680x680_colors import background2_colors reload( feuerzeugCoords ) #reload( background_colors ) #reload( marilyn_680x680_colors ) reload( background2_colors ) fCoords = feuerzeugCoords.fCoords #fColors = background_colors.allColors #fColors = marilyn_680x680_colors.allColors fColors = background2_colors.allColors #fColors.reverse() anzCoordsX = len(fCoords) anzCoordsY = len(fCoords[0]) print "coords :", anzCoordsX, "x", anzCoordsY anzColorsX = len(fCoords) anzColorsY = len(fCoords[0]) print "colors :", anzColorsX, "x", anzColorsY, " = ", anzColorsX*anzColorsY, "[x,y,z] & [R,G,B]" print "*** .. done in", dm.getTime() dm.newEmptyLayer("POINTS", [20,100,220]) dm.setCameraTarget( [1377.469, -1110.264, 151.845], [767.655, 606.154, 90.776], lens=50.0, rota=0, upVec=[0,0,1] ) if 1: intervall = 6 if 0: for x in range(0, anzCoordsX, intervall): dm.esc() coords = fCoords[x] colors = fColors[x] for y in range(0, anzCoordsY, intervall): pt = rs.AddPoint( coords[y] ) rs.ObjectColor(pt, colors[y] ) rs.Redraw() if 0: for y in range(0, anzCoordsY, intervall): dm.esc() coords = fCoords[y] colors = fColors[y] for x in range(0, anzCoordsX, intervall): pt = rs.AddPoint( coords[x] ) rs.ObjectColor(pt, colors[x] ) rs.Redraw() if 0: dm.newEmptyLayer("POINTS", [20,100,220]) for x in range(0,anzCoordsY-1,intervall*1): dm.esc() for y in range(0,anzCoordsX-1,intervall*1): dm.esc() cor = fCoords[y][x] col = fColors[y][x] rs.ObjectColor( rs.AddPoint( cor ), col ) rs.Redraw() if 1: dm.newEmptyLayer("POINTS", [ 20,100,220 ]) for x in range(0, anzCoordsY-1, intervall): for y in range(0, anzCoordsX-1, intervall): if y < anzCoordsX-1 and x < anzCoordsY-1: cor = fCoords[-y][-x] col = fColors[y][x] pt = rs.AddPoint(cor) rs.ObjectColor(pt, col) rs.Redraw() if 0: dm.newEmptyLayer("POINTS", [ 20,100,220 ]) for x in range(0, anzCoordsY-1, intervall): for y in range(0, anzCoordsX-1, intervall): if y < anzCoordsX-1 and x < anzCoordsY-1: cor = fCoords[y][x] col = fColors[y][x] pt = rs.AddPoint(cor) rs.ObjectColor(pt, col) rs.Redraw()