Gallery details
“”” Creates a custom mill pattern based from an ice cream paint job. Input is a flat surface and a painted mesh. Process will create variation in x,y,z as well as take into account bit depth and diameter. The output will be ONE closed curve w. stepover and a surface created based on the NEW paths.”””
[GHop Version] [PDT]Paint Drive Toolpaths Python Version
CODE
"""
Script written by Luis Quinones
Script copyrighted by complicitMatter.com
www.complicitMatter.com
www.computationalmatter.com
Script version Sat, 1 Sep 2012 20:18:46
"""
import rhinoscriptsyntax as rs
import math
from System.Drawing import Color
def lineHanzSolo(arrCrvs,strNewLayer):
arrFirstSet = []
arrSecondSet = []
for i in range(len(arrCrvs)):
rs.ObjectLayer(arrCrvs[i],strNewLayer)
arrFirstSet.append(rs.CurveStartPoint(arrCrvs[i]))
arrSecondSet.append(rs.CurveEndPoint(arrCrvs[i]))
for j in range(len(arrCrvs)-1):
if math.fmod(j,2) == 0:
dot = rs.AddTextDot(j,arrFirstSet[j])
rs.ObjectLayer(dot,strNewLayer)
newLine = rs.AddLine(arrFirstSet[j],arrFirstSet[j+1])
rs.ObjectLayer(newLine,strNewLayer)
else:
newLine2 = rs.AddLine(arrSecondSet[j],arrSecondSet[j+1])
rs.ObjectLayer(newLine2,strNewLayer)
rs.ObjectsByLayer(strNewLayer,True)
rs.Command("_Join")
rs.UnselectAllObjects
#rs.LayerVisible("BASE", False)
def Main():
strNewLayer = rs.AddLayer("FTHATNOISE", Color.Red)
strNewLayer2 = rs.AddLayer("TEMP", Color.Red)
baseSrf = rs.GetObject("BASE SURFACE",rs.filter.surface)
paintMesh = rs.GetObject("PAINTEDMESH",rs.filter.mesh)
color = rs.MeshVertexColors(paintMesh)
arrVerts = rs.MeshVertices(paintMesh)
# intDiv = rs.RealBox("NUMBER OF ISOCURVES",20,"ISOACTION")
intDiv2 = rs.RealBox("NUMBER OF ISOCURVE DIVISION",60,"ISOACTION")
intHeight = rs.RealBox("Max Z Height in Inches for the mill Pattern",1,"HEIGHT")
# intWidth = rs.RealBox("Shift in Inches for the mill Pattern",1,"WIDTH")
intBitDia = rs.RealBox("Bit Diameter",1,"BIT SIZE")
intStepOver = rs.RealBox("StepOver",0.25,"STEPOVER")
intDivLen = intBitDia-intStepOver
arrSrfPts = rs.SurfacePoints(baseSrf,True)
arrSrfPts = rs.SurfacePoints(baseSrf,True)
rs.AddPoint(arrSrfPts[1])
tempLine = rs.AddLine(arrSrfPts[0],arrSrfPts[1])
tempLine2 = rs.AddLine(arrSrfPts[2],arrSrfPts[3])
tempDiv = rs.DivideCurveLength(tempLine,intDivLen,False)
rs.ObjectLayer(tempLine,strNewLayer2)
tempDiv2 = rs.DivideCurveLength(tempLine2,intDivLen,False)
rs.ObjectLayer(tempLine2,strNewLayer2)
rs.EnableRedraw(False)
newCalcLine = []
for i in range(len(tempDiv)):
newLine = rs.AddLine(tempDiv[i],tempDiv2[i])
rs.ObjectLayer(newLine,strNewLayer2)
newLineDiv = rs.DivideCurve(newLine,intDiv2,False)
arrbuildPts = []
for j in range(len(newLineDiv)):
closestPt = rs.PointArrayClosestPoint(arrVerts,newLineDiv[j])
#meshClosest = rs.MeshClosestPoint(paintMesh,newLineDiv[j])
arrHLS = rs.ColorRGBToHLS(color[closestPt])
value = arrHLS[2]
valueZ = value * intHeight
valueY = value * intDivLen
arrNewPoint = [newLineDiv[j][0],newLineDiv[j][1]+valueY,newLineDiv[j][2]+valueZ]
arrbuildPts.append(arrNewPoint)
newCalcLine.append(rs.AddCurve(arrbuildPts,3))
lineHanzSolo(newCalcLine,strNewLayer)
rs.LayerVisible(strNewLayer2,False)
#rs.LayerVisible("PAINTMESH",False)
rs.LayerVisible("BASE_SURFACE",False)
rs.EnableRedraw(True)
Main()
Recently in Portfolio
- [K]ernels

- Nike A.I.R Prototypes

- [A]nisochromatic Meshing

- Nike After Dark Tour

- PARAPRAXIS

- [001.HRR] CONCEPT BIKE

- 2040:LUNAR.OUTPOST[a]

- HE.6 2020 Prototype

- CULEBRA.NET

- PYTORCH-CLASSIFIER

- Nike Zoom Superfly Elite

- BENGBU CITY OPERA

- Nike Footscape Flyknit DM

- Jordan Hyperdunk React

- KA-HELMET

- [C]ucarachas

- [S]eeker

- [O]h Baby

- [E]l Papa

- [S]hatter.Brain

- [S]tigmergy

- [F]orces

- CULEBRA.JAVA

- [C]ulebra.MultiBehaviors

- [S]ticky Stuff

- [S]entinels

- [G]allopingTopiary

- RELUXOED

- [SRC] . Semi Rigid Car

- [P]erlin

- [E]ternal Wanderers

- [W]heelie

- [S]labacube

- [M]esh Crawlers

- [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

- [E]l Nino

- culebra.[S]elfOrg

- [D]rippin

- culebra.[N]oisey.2D

- [C]reepyCrawlers

- [J]eepresesCreepers

- [T]2000

- 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

- [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

- [F]antastic + Interactive

- [S]oo_Minimally_Pathed

- [P]uffer Fish.Fab

- [M]an Eater

- [AHH] Alien House Hunters

- [W]eave Machine

- Sportbike Racing

- Grappling

- Kart Racing




Leave a reply