VIOLENT VOLUMES

Archive for May, 2012

Voxelizer Rhinoscript

  I made a voxelizer rhinoscript for a project I have in my mind. took me few days to find the fastest algorithm but I think I ended up with common one.I tried few other ways to make voxels but they always missed some voxels that should be made.. below is just the gist of [...]

Vuzzle Chair

Vuzzle Chair, 2010 1000mm x 1000mm x 800mm, 59 cells. (46 cells for seating) Vuzzle Chair consists of 59 cushions dividing the complete cube into voronoi cells. Each cushion has neodymium magnet underneath its surface to secure its cohesive status with adjacent cushions. Polysurface-shaped cushions with magent in each surface will provide enough bonding constraint [...]

IsLineParallelTo() and get2DLineLineInt()

Rhino.LineLineIntersection and Rhino.IsVectorParallelTo methods are problematic.. I spent quite an amount of time trying to find out where my offset script fails, and then I realized Rhino.LineLineIntersection is not working as expected in many cases. for example, it doesn’t make intersection where there is obviously one. or it determines two lines are parallel with very [...]

Rhinoscript Bug (SR6) – LineLineIntersection

Dim arrLineA, arrLineB, arrPoint arrLineA = Array(Array(0,0,0), Array(3,0,0)) arrLineB = Array(Array(0,1,0), Array(3,0.99,0)) arrPoint = Rhino.LineLineIntersection(arrLineA, arrLineB) If IsArray(arrPoint) Then Rhino.AddPoint arrPoint Else Rhino.Print “no intersection” End If ‘this should add point at (300,0,0), but arrPoint is NULL (no intersection) sometimes my script doesn’t work with certain input, then I try to debug my script looking [...]

Determining if the point lies inside a closed polyline

Option Explicit Dim arrTestPt Dim strPolyline arrTestPt = Rhino.GetPoint (“pick a point”) strPolyline = Rhino.GetObject (“pick a closed polyline”, 4) If Rhino.IsCurveClosed (strPolyline) Then If Rhino.IsPointOnCurve (strPolyline, arrTestPt) Then Rhino.Print “the point you just picked lies on the polyline” Else arrPolylineVertices = Rhino.PolylineVertices (strPolyline) If (IsPointInPolyLine(arrTestPt, arrPolylineVertices) = 1) Then Rhino.Print “the point you just [...]

Polyline OffsetStructure

‘————————————————————— ‘take closed polyline and returns polyline of each offset step ‘————————————————————— Function OffsetCurveStructure(strCurve) Dim arrPolylineVertices arrPolylineVertices = Rhino.PolylineVertices(strCurve) Dim ActualVertNum ActualVertNum = UBound(arrPolylineVertices) Dim arrCenterPt ‘set of offset polylines at each step Dim arrOffsetStepPolylines Redim arrOffsetStepPolylines(UBound(arrPolylineVertices)-3) ‘distance between offset steps Dim arrOffsetStepDistance Redim arrOffsetStepDistance(UBound(arrPolylineVertices)-4) Dim arrCurrentPolylineVertices Redim arrCurrentPolylineVertices(UBound(arrPolylineVertices)) Dim arrCurrentLine1 Dim arrCurrentLine2 Dim currentVectorSet [...]