Difference between revisions of "Honeycomb Panels 03-madeincalifornia"
From scripting
(Created page with "'Direct: http://madeincalifornia.blogspot.com/2009/01/honeycomb-panels-03.html Option Explicit ' Author: Milutin Cerovic 2009 ' www.4ofseven.com ' adapted:http://www.ma...") |
(No difference)
|
Latest revision as of 06:07, 22 April 2017
'Direct: http://madeincalifornia.blogspot.com/2009/01/honeycomb-panels-03.html
Option Explicit ' Author: Milutin Cerovic 2009 ' www.4ofseven.com ' adapted:http://www.madeincalifornia.blogspot.com/ Call Main() Sub Main() '--------------------- 'declare variables '--------------------- Dim arrPoints Dim i,j Dim strObject, arrStartPoint, arrEndPoint, arrContours, divnumber Dim arrIsoCurves Const rhObjectCurve = 4 '--------------------- 'select surface or Polysurface '--------------------- strObject = Rhino.GetObject("Select object", rhObjectSurface + rhObjectPolysurface) 'define plane of section '--------------------- arrStartPoint = Rhino.GetPoint("select contour base plane startpoint") arrEndPoint = Rhino.GetPoint("select contour plane endpoint", arrStartPoint) '--------------------- 'define distance of sections '--------------------- divnumber= rhino.GetReal("enter equal distance of sections contour") arrContours = Rhino.SurfaceContourPoints(strObject, arrStartPoint, arrEndPoint,divnumber) '--------------------- 'draw curve through section arraypoints '--------------------- If IsArray(arrContours) Then For Each arrPoints In arrContours Rhino.Addcurve arrPoints Next End If '--------------------- 'select isocurves '--------------------- arrIsoCurves=Rhino.GetObjects ("Select Section curves, from left to right or viceversa",rhObjectcurve ) ReDim arrPoints(UBound(arrIsoCurves)) '--------------------- 'divide curve into equal distances and array points '------------------------------- DivNumber = Rhino.GetReal ("enter divide number curves") For i=0 To UBound(arrIsoCurves) arrPoints(i)=Rhino.DivideCurve(arrIsoCurves(i),DivNumber,True) Next '--------------------- 'draw lines with honeycomb pattern '------------------------------- '>>>>>>>>>>>>>ACTIVE NEXT LINE FOR FAST CALCULATION<<<<<<<<<<<<<<<<<< ' Call rhino.EnableRedraw (False) For i=0 To (UBound(arrIsoCurves)-1)Step 4 For j=0 To (DivNumber-2) If j Mod 2 <> 0 Then Rhino.addLine arrPoints(i)(j),arrPoints(i+1)(j) Rhino.addLine arrPoints(i+1)(j),arrPoints(i+2)(j+1) Rhino.addLine arrPoints(i+2)(j+1),arrPoints(i+1)(j+2) Rhino.addLine arrPoints(i+2)(j+1),arrPoints(i+3)(j+1) Rhino.addLine arrPoints(i+3)(j+1),arrPoints(i+4)(j+2) Rhino.addLine arrPoints(i+3)(j+1),arrPoints(i+4)(j) End If Next Next '>>>>>>>>>>>>>ACTIVE NEXT LINE FOR FAST CALCULATION<<<<<<<<<<<<<<<<<< 'Call rhino.EnableRedraw (True) End Sub