Gallery details
“”” The input is a Text File containing XYZ info as well as deformation values. The code rebuilds the geometry from scratch based on XYZ coordinates, these coordinates are used to re-create the mesh in 3D and paint the vertices based on the value range. This is very useful in recreating and making the structural color maps as drivers in actual geometry instead of simple Textures THIS IS ONLY A SETUP PROCESS, ONCE YOU HAVE THE MESH VERTEX INFORMATION YOU CAN DO WHATEVER YOU WANT WITH IT”””
. Process
. Create Geometry
. Export STL, Bring into ALGOR
. Assign Analysis Type
. Establish Fixed Support Points (If Any)
. Assign Nodal Forces + Other Stuff 🙂
. Run Analysis
. Use Information to Rebuild Geometry and Paint
. Use the Mesh Vertex Information as a DRIVER FOR ANYTHING YOU WANT [Input Data Text File – Shortened List.]
CODE
Part# 1, Element# 1, Element Node# 1, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 574.277 Part# 1, Element# 1, Element Node# 2, Node# 4454, X = 4.87186, Y = 0.655312, Z = -7.71344, Val 574.277 Part# 1, Element# 1, Element Node# 3, Node# 4455, X = 4.96378, Y = 0.660614, Z = -7.70957, Val 574.277 Part# 1, Element# 2, Element Node# 1, Node# 4453, X = 4.97955, Y = 0.578781, Z = -7.71002, Val 482.997 Part# 1, Element# 2, Element Node# 2, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 482.997 Part# 1, Element# 2, Element Node# 3, Node# 4455, X = 4.96378, Y = 0.660614, Z = -7.70957, Val 482.997 Part# 1, Element# 3, Element Node# 1, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 558.239 Part# 1, Element# 3, Element Node# 2, Node# 4454, X = 4.87186, Y = 0.655312, Z = -7.71344, Val 558.239 Part# 1, Element# 3, Element Node# 3, Node# 4471, X = 4.7784, Y = 0.661259, Z = -7.7059, Val 558.239 Part# 1, Element# 4, Element Node# 1, Node# 4379, X = 4.88078, Y = 0.493439, Z = -7.71126, Val 533.003 Part# 1, Element# 4, Element Node# 2, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 533.003 Part# 1, Element# 4, Element Node# 3, Node# 4407, X = 4.98532, Y = 0.493795, Z = -7.70596, Val 533.003 Part# 1, Element# 5, Element Node# 1, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 491.162 Part# 1, Element# 5, Element Node# 2, Node# 4453, X = 4.97955, Y = 0.578781, Z = -7.71002, Val 491.162 Part# 1, Element# 5, Element Node# 3, Node# 4407, X = 4.98532, Y = 0.493795, Z = -7.70596, Val 491.162 Part# 1, Element# 6, Element Node# 1, Node# 4379, X = 4.88078, Y = 0.493439, Z = -7.71126, Val 524.449 Part# 1, Element# 6, Element Node# 2, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 524.449 Part# 1, Element# 6, Element Node# 3, Node# 4378, X = 4.7766, Y = 0.493905, Z = -7.70432, Val 524.449 Part# 1, Element# 7, Element Node# 1, Node# 4455, X = 4.96378, Y = 0.660614, Z = -7.70957, Val 558.002 Part# 1, Element# 7, Element Node# 2, Node# 4454, X = 4.87186, Y = 0.655312, Z = -7.71344, Val 558.002 Part# 1, Element# 7, Element Node# 3, Node# 4456, X = 4.86309, Y = 0.726358, Z = -7.70627, Val 558.002 Part# 1, Element# 8, Element Node# 1, Node# 4472, X = 4.77661, Y = 0.579158, Z = -7.70766, Val 479.377 Part# 1, Element# 8, Element Node# 2, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 479.377 Part# 1, Element# 8, Element Node# 3, Node# 4471, X = 4.7784, Y = 0.661259, Z = -7.7059, Val 479.377 Part# 1, Element# 9, Element Node# 1, Node# 4452, X = 4.87821, Y = 0.5763, Z = -7.71481, Val 489.208 Part# 1, Element# 9, Element Node# 2, Node# 4472, X = 4.77661, Y = 0.579158, Z = -7.70766, Val 489.208 Part# 1, Element# 9, Element Node# 3, Node# 4378, X = 4.7766, Y = 0.493905, Z = -7.70432, Val 489.208 Part# 1, Element# 10, Element Node# 1, Node# 4454, X = 4.87186, Y = 0.655312, Z = -7.71344, Val 614.989 Part# 1, Element# 10, Element Node# 2, Node# 4456, X = 4.86309, Y = 0.726358, Z = -7.70627, Val 614.989 Part# 1, Element# 10, Element Node# 3, Node# 4471, X = 4.7784, Y = 0.661259, Z = -7.7059, Val 614.989 Part# 1, Element# 11, Element Node# 1, Node# 4379, X = 4.88078, Y = 0.493439, Z = -7.71126, Val 524.033 Part# 1, Element# 11, Element Node# 2, Node# 4407, X = 4.98532, Y = 0.493795, Z = -7.70596, Val 524.033 Part# 1, Element# 11, Element Node# 3, Node# 4380, X = 4.87821, Y = 0.410847, Z = -7.70372, Val 524.033 Part# 1, Element# 12, Element Node# 1, Node# 4379, X = 4.88078, Y = 0.493439, Z = -7.71126, Val 532.065 Part# 1, Element# 12, Element Node# 2, Node# 4378, X = 4.7766, Y = 0.493905, Z = -7.70432, Val 532.065 Part# 1, Element# 12, Element Node# 3, Node# 4380, X = 4.87821, Y = 0.410847, Z = -7.70372, Val 532.065 Part# 1, Element# 13, Element Node# 1, Node# 4455, X = 4.96378, Y = 0.660614, Z = -7.70957, Val 434.344 Part# 1, Element# 13, Element Node# 2, Node# 4456, X = 4.86309, Y = 0.726358, Z = -7.70627, Val 434.344 Part# 1, Element# 13, Element Node# 3, Node# 4457, X = 4.93958, Y = 0.735925, Z = -7.7034, Val 434.344 Part# 1, Element# 14, Element Node# 1, Node# 4453, X = 4.97955, Y = 0.578781, Z = -7.71002, Val 504.962 Part# 1, Element# 14, Element Node# 2, Node# 4455, X = 4.96378, Y = 0.660614, Z = -7.70957, Val 504.962 Part# 1, Element# 14, Element Node# 3, Node# 4448, X = 5.0825, Y = 0.587131, Z = -7.69352, Val 504.962 Part# 1, Element# 15, Element Node# 1, Node# 4471, X = 4.7784, Y = 0.661259, Z = -7.7059, Val 486.579 Part# 1, Element# 15, Element Node# 2, Node# 4456, X = 4.86309, Y = 0.726358, Z = -7.70627, Val 486.579 Part# 1, Element# 15, Element Node# 3, Node# 4470, X = 4.78372, Y = 0.736738, Z = -7.69864, Val 486.579 Part# 1, Element# 16, Element Node# 1, Node# 4407, X = 4.98532, Y = 0.493795, Z = -7.70596, Val 497.506 Part# 1, Element# 16, Element Node# 2, Node# 4453, X = 4.97955, Y = 0.578781, Z = -7.71002, Val 497.506 Part# 1, Element# 16, Element Node# 3, Node# 4448, X = 5.0825, Y = 0.587131, Z = -7.69352, Val 497.506 Part# 1, Element# 17, Element Node# 1, Node# 4380, X = 4.87821, Y = 0.410847, Z = -7.70372, Val 494.199 Part# 1, Element# 17, Element Node# 2, Node# 4407, X = 4.98532, Y = 0.493795, Z = -7.70596, Val 494.199 Update
CODE
import rhinoscriptsyntax as rs from System.Drawing import Color """Script Written By Luis Quinones Script Copywritten by [n]igma + computationalMatter www.luisquinonesdesign.com www.computationalmatter.com Script Version Wednesday, July 30, 2011""" import rhinoscriptsyntax as rs from System.Drawing import Color def makeMeshyMesh(pts,mainValue,faceCount,layer): faceCounter = [] faceVerts = [0] pt1 = rs.AddPoint(pts[0]) coord1 = rs.PointCoordinates(pt1) pt2 = rs.AddPoint(pts[1]) coord2 = rs.PointCoordinates(pt2) pt3 = rs.AddPoint(pts[2]) coord3 = rs.PointCoordinates(pt3) if len(pts) == 4: pts4 = rs.AddPoint(pts[3]) coord4 = rs.PointCoordinates(pts4) testVerts = [coord1,coord2,coord3,coord4] for i in range (faceCount): faceCounter.append(i) faceVerts[0] = faceCounter testVerts = [coord1,coord2,coord3] newMesh = rs.AddMesh(testVerts,faceVerts) vertexcount = rs.MeshVertexCount(newMesh) if not vertexcount: print "did not make mesh" else: colors = [] for n in range(rs.MeshVertexCount(newMesh)): mainColor = mainValue[n] #print mainColor r = mainColor if r > 255: r = 255 #print r g = mainColor if g > 255: g = 255 #print g b = mainColor if b > 255: b = 255 #print b intMainValue = float(r),float(g),float(b) #print intMainValue colors.append(intMainValue) print colors rs.MeshVertexColors( newMesh, colors ) return newMesh def Main(): strLayer = rs.AddLayer("MeshLayer") strLayer2 = rs.AddLayer("DOTACTION") f = open('C:UserskingLuiDesktopzingbanger2.txt','r') #C:UserskingLuiDesktop mainValue = [] tempLOC = [] ElementList = [] count = 1 counter = [] for line in f: trim = line.split(",") TestNodes = trim[1:] #print TestNodes TestNodesSplit = TestNodes[0] TestNodesSplit2 = TestNodesSplit.split(" ") NodeList = TestNodesSplit2[2] ElementList.append(NodeList) XYZValue = trim[4:7] #print 'this'+ ' = ' + str(XYZValue) xValue = XYZValue[0] temp = xValue.split(" ") newXValue = len(temp)-1 FinalX = temp[newXValue] yValue = XYZValue[1] temp2 = yValue.split(" ") newYValue = len(temp2)-1 FinalY = temp2[newYValue] zValue = XYZValue[2] temp3 = zValue.split(" ") newZValue = len(temp3)-1 FinalZ = temp3[newZValue] tempLOC.append([FinalX,FinalY,FinalZ]) lastItem = len(trim)-1 value = trim[lastItem] test = value.split(" ") lastItem2 = len(test)-1 printest = test[lastItem2] mainValue.append(test[lastItem2]) count += 1 counter.append(count) indexPass = [] count4 = 0 lastValueTrans = len(ElementList)-1 lastValue = int(ElementList[lastValueTrans]) #len = 44 items which means there are 43 and 0 #index numbers in ElementList go from 1 - 13 count5 = 1 for z in range(lastValue): #print "Element List - " + ElementList[count5] + " XYZ = " + str(tempLOC[count5]) #print ElementList[count4] transferB = ElementList.index(str(count5)) indexPass.append(transferB) count5 += 1 for m in range(len(indexPass)): if m != len(indexPass)-1: tempArray = indexPass[m],indexPass[m+1] tempValueArray = indexPass[m],indexPass[m+1] listTrans = tempLOC[tempArray[0]:tempArray[1]] print listTrans listColorTrans = mainValue[tempValueArray[0]:tempArray[1]] print listColorTrans newcount2 = len(listTrans) ColorTrans = mainValue[0:newcount2] faceCount = len(listTrans) mesh = makeMeshyMesh(listTrans,listColorTrans,faceCount,strLayer2) Main() Update
CODE
import rhinoscriptsyntax as rs #from System.Drawing import Color class AlgoNode(): def __init__ (self, LINE): #print "made an AlgoNode" self.line = LINE lineTokens = self.line.split(",") self.part = int( lineTokens[0].split(" ")[1] )#propably object count self.element = int( lineTokens[1].split(" ")[2] )#face count self.elementNode = int( lineTokens[2].split(" ")[3] )#count of vertex in face self.node = int( lineTokens[3].split(" ")[2] )#vertex index self.x = float( lineTokens[4].split(" ")[3] ) self.y = float( lineTokens[5].split(" ")[3] ) self.z = float( lineTokens[6].split(" ")[3] ) self.val = float( lineTokens[7].split(" ")[2] ) class AlgoMesh(): def __init__(self,path): data = open(path,'r') self.algoNodeList = [] for line in data: self.algoNodeList.append(AlgoNode(line)) def vertices(self): #here return the vertices result = [] #for myAlgoNode in self.algoNodeList: # result.append([myAlgoNode.x, myAlgoNode.y, myAlgoNode.z]) temp4count = self.nodes() temp4count.sort() allNodes = self.nodes() for i in range(temp4count[-1]): index = allNodes.index(i+1) result.append([self.algoNodeList[index].x, self.algoNodeList[index].y, self.algoNodeList[index].z]) return result def faceVertices(self): #here return the face vartices result = [] oldElement = self.algoNodeList[0].element oneFace = [] for myAlgoNode in self.algoNodeList: if myAlgoNode.element == oldElement: oneFace.append(myAlgoNode.node-1) else: oldElement = myAlgoNode.element result.append(oneFace) oneFace = [] oneFace.append(myAlgoNode.node-1) return result def vertexColors(self): #here return the vertex colors result = [] temp4count = self.nodes() temp4count.sort() allNodes = self.nodes() for i in range(temp4count[-1]): index = allNodes.index(i+1) color = 255*50*self.algoNodeList[index].val / self.maxVal() if color>255 : color = 255 result.append((color,color,color)) return result def nodes(self): #here return the vertices result = [] for myAlgoNode in self.algoNodeList: result.append(myAlgoNode.node) return result def maxVal(self): listOfVals = [] for myAlgoNode in self.algoNodeList: listOfVals.append(myAlgoNode.val) listOfVals.sort() return listOfVals[-1] def Main(): #myAlgoNode = AlgoNode("Part# 1, Element# 1, Element Node# 1, Node# 368, X = 615.779, Y = -158.81, Z = -358.427, Val 0") #print myAlgoNode.val myAlgoMesh = AlgoMesh('C:zingbanger2.txt') myMesh = rs.AddMesh(myAlgoMesh.vertices(), myAlgoMesh.faceVertices()) rs.MeshVertexColors(myMesh, myAlgoMesh.vertexColors()) #rs.AddPointCloud(myAlgoMesh.vertices()) Main() Update
Recently in Portfolio
- Nike A.I.R Prototypes
- HE.6 2020 Prototype
- [A]nisochromatic Meshing
- PYTORCH-CLASSIFIER
- CULEBRA.NET
- Nike Zoom Superfly Elite
- Nike Footscape Flyknit DM
- Jordan Hyperdunk React
- KA-HELMET
- PARAPRAXIS
- [001.HRR] CONCEPT BIKE
- [C]ucarachas
- [S]eeker
- BENGBU CITY OPERA
- [O]h Baby
- [E]l Papa
- [S]hatter.Brain
- [S]tigmergy
- [F]orces
- CULEBRA.JAVA
- [C]ulebra.MultiBehaviors
- 2040:LUNAR.OUTPOST[a]
- [S]ticky Stuff
- [S]entinels
- [G]allopingTopiary
- [P]erlin
- [E]ternal Wanderers
- [W]heelie
- [M]esh Crawlers
- [E]l Nino
- [L]a Silla
- [3]D BabyMaking Trackstars
- [3]D Trackers
- [2]D BabyMaking Trackers
- [T]rackers
- CULEBRA GRASSHOPPER
- culebra.[M]eshCrawlers.3D
- culebra.[H]ybrid.3D
- culebra.[F]lorgy
- culebra.[F]ockers.3D
- culebra.[F]ockers.2D
- culebra.[N]oisey.3D
- culebra.[S]elfOrg
- [D]rippin
- [S]labacube
- culebra.[N]oisey.2D
- [C]reepyCrawlers
- [J]eepresesCreepers
- [C]reepers
- [T]2000
- RELUXOED
- [SRC] . Semi Rigid Car
- PUFFER PLEATNESS
- EMERGEN[CY]
- [L]iquified
- [S]uckedComp
- [X]plosion
- MR. EW
- [H]airGoo
- [B]alled
- [n]injaStars
- [b]loomer
- [t]rip city
- TAPE GUNNED
- [B]oom
- [M]iller Time
- [D]elamjam
- [B]rain Zapper
- [B]ig Bird
- IIIIIIII 00137
- [E]gg Tube Pavillion
- [A]llice’s Easter Tree
- [S]weet Honey
- [U]M.Urgent
- [t]oo.urgent
- [B]onnie..+..Clyde
- [B]io Mess
- [EL]Mojado.Virus
- [W]HAT the …!
- [H]ot Lava
- [P]leat Diddy
- [t]erminator easter egg
- Mr. BB
- [B]less You
- [J]acky Jack
- [F]antastic + Interactive
- [S]oo_Minimally_Pathed
- [P]uffer Fish.Fab
- [M]an Eater
- [F]ace Sukka
- [W]eave Machine
- Sportbike Racing
- Grappling
- Kart Racing
Leave a reply