Archive for julio, 2009

090731- SHOW ME THE CODE!!!-(RVB) – automatic unroll

julio 31, 2009

unroll

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 Main()
Sub Main()
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

Lee el resto de esta entrada »

Anuncios

090730 -SHOW ME THE CODE!!!! (RVB) – attractor function

julio 30, 2009

4

OK, lets show the code!!!..

Function esfera (attr,k,mval,pa,pb,pc,pd,scale,i)

	Dim face
	Dim center
	Dim dist
	Dim esf
	Dim color
	face= rhino.addsrfpt (array(pa,pb,pc,pd))
	center= rhino.SurfaceAreaCentroid(face)

	ReDim dist (ubound(attr))
	Dim ptatr():ReDim ptatr (ubound(attr))

	For k=0 To ubound(attr)
		ptatr(k)= rhino.pointcoordinates(attr(k))
		dist(k)=rhino.Distance(ptatr(k),center(0))
	Next

	mval= rhino.min (dist)
	rhino.Print mval
	esf= rhino.AddSphere (center(0),(mval/scale))
	rhino.ObjectColor esf,rgb(255,i+(mval*5),133)
	rhino.ObjectColor face,rgb(255,i+(mval*5),133)

End Function
According to the recently attactor “fashion/porn” in the digital age (mainly grasshopper), i´m showing one of my first scripts in rhinoscript (2006). it’s an attractor function. Use, do wathever the f#$K!! you want with this function.
this was the core of my MAB-FPS code (https://escripto.wordpress.com/2008/07/01/080630_mab-fps-multi-attractor-based-flat-panel-skin/), a nice script for my thesis. Lee el resto de esta entrada »

090717-playing with the power of python (MAYA)

julio 17, 2009

python

Yesterday i started to play some hours with mel , but i remembered the recomendations of rodrigo culagovski (www.culagovski.net – http://www.parametrica.org) about the benefits and advantages of python. So, i stopped with mel and put my hands into python.

Lee el resto de esta entrada »

090711-parametric bridge – Thesis Final project-

julio 11, 2009

01

Some images from my final project for my master degree thesis. its a parametric bridge with a parametric skin – (hexatect). All the project it´s defined by scripting (rhinoscript) and some specific grasshopper definitions (vb.net) .

Lee el resto de esta entrada »