This is another fabrication tool that i wrote almost two years ago for my thesis. So… let´s show the code!!!!
This tool was developed for the automated process of unrolling planar surfaces for fabrication via laser cut or cnc cut. It allows the user to select the surfaces of the model (or polysrf) and make an array of contours with an ID, in the model and the array (for further assembly help). I wrote it for the ribber tool, and added to the MAB FPS and exatect structure scripts.
It´s a very simple, but powerfull tool ,i hope you use it , and again , do whatever the f#$#cK u want. but remember to name the real author of the script.
Video showing the script running, (in spanish).
stay tuned for more SHOW ME THE CODE!!! in escripto…
Option Explicit 'script name <unroll automatic> 'Script written by <Diego Pinochet Puentes> 'Script copyrighted by <escripto.wordpress.com> 'Script version lunes, 14 de abril de 2007 09:44:02 a.m. 'este codigo esta generado y protegido por creative commons. cualquier alteracion 'del mismo o adjudicacion de autoria por parte de cualquier persona es un delito intelectual. 'si lo ocupas debes indicar la version y autor de la herramienta. 'generated under creative commons license, u must name the author of the code in ur work if u use it or modify it. Call unroll-escripto() Sub unroll-escripto() Dim arrobjects,arrpanel, arrEdge,i,grilla(),pt,arredge2 Dim texto1,texto Dim textdim:textdim= rhino.getreal("enter the size of the text (it depends of your model scale)",1) Dim punto,newarrPoint,newarrpoint2 Dim n:n= 0 Dim newDomainU, newDomainV Dim newarrParameterU, newarrParameterV Dim strpoligon,strpoligonoff,crvamidpt(),crvbmidpt(),aux(),auxmidpt() Dim espaciado:espaciado=rhino.getreal ("enter distance of unfolded patterns") Dim trgroup2 Dim letra:letra= rhino.getstring ("enter a prefix for the id") arrObjects = Rhino.GetObjects("select the surfaces, or polysurfaces to to unroll",8+16) For i =0 To (ubound(arrobjects)) ReDim Preserve grilla(i) grilla(i)= array(i*espaciado+50,0,0) Next '------------------------------------------------------------------ If IsNull(arrObjects) Then Exit Sub ReDim arrpanel(UBOUND(arrObjects)) For i = 0 To UBOUND(arrObjects) Call Rhino.EnableRedraw(True) Call Rhino.UnselectAllObjects Call Rhino.SelectObject(arrObjects(i)) newarrpoint= Rhino.SurfaceAreaCentroid (arrObjects(i)) texto1= rhino.addtext ("<"&letra & i + 1 &""&">" ,newarrpoint(0),textdim) rhino.ObjectColor texto1,RGB(255,0,255) '------------------------------------------------ Rhino.Command "_unrollsrf explode=no enter enter" Call Rhino.UnselectAllObjects arrpanel(i) = Rhino.FirstObject Call Rhino.MoveObject(arrpanel(i),array(0,0,0), grilla(i)) newarrPoint2 = Rhino.SurfaceAreaCentroid (arrpanel(i)) texto= rhino.addtext ("<"&letra & i + 1 &""&">" ,newarrpoint2(0),textdim) rhino.ObjectColor texto,RGB(255,0,255) '------------------------------------------------ arrEdge = Rhino.Duplicatesurfaceborder(arrpanel(i)) arrEdge2 = Rhino.Duplicateedgecurves(arrpanel(i)) strpoligon= Rhino.JoinCurves(arrEdge,True) rhino.ObjectColor strpoligon,RGB(178,248,58) Call Rhino.DeleteObject(arrpanel(i)) trgroup2= rhino.addgroup rhino.addobjectstogroup array(strpoligon(0),texto),trgroup2 Next End Sub
Tags: algorithm, algorythms, arquitectura digital, cam, cnc, digital architecture, digital fabrication, digital project, diseño paramétrico, generative components, grasshopper, hexagon mesh, laser cutter, laser cutting, marq, maxscript, paracloud, puc, rhinoceros, rhinoscript, rhinosript, scripting, surface
