logo

[D]elamjam

Gallery details

[delamjammer] [30.July.2012]
“””More Stuff on Stuff… Quick Fun _ Geom from CMTA – [001.HRR] 

[GHop Version]
[DelamJam] Python Version

CODE

"""
Script written by <Luis Quinones>
Script copyrighted by <[n]igma + complicitMatter + computationalMatter>
www.complicitMatter.com
www.computationalmatter.com
Script version Thursday, 16 Feb 2012 20:18:46
"""

import rhinoscriptsyntax as rs
import math

from System.Drawing import Color 

baseCrv = rs.GetObject("BaseAction")
strTransferPt = rs.GetObject("PointA",rs.filter.point)
coordTransferPt = rs.PointCoordinates(strTransferPt)

strTransferPt2 = rs.GetObject("PointB",rs.filter.point)
coordTransferPt2 = rs.PointCoordinates(strTransferPt2)

strTransferPt3 = rs.GetObject("PointC",rs.filter.point)
coordTransferPt3 = rs.PointCoordinates(strTransferPt3)

intDiv = 16
arrCrvPtsA = rs.DivideCurve(baseCrv, intDiv, False)

arrSplitA = arrCrvPtsA[0:8]
arrSplitB = arrCrvPtsA[8:16]


for m in range(len(arrSplitA)):
    #print m
    pointA = rs.AddPoint(arrSplitA[m])
    rs.ObjectColor(pointA, Color.White)
    pointB = rs.AddPoint(arrSplitB[m])
    rs.ObjectColor(pointB, Color.Red)


for i in range(len(arrSplitA)):
    for j in range(0,8):

        strMainCrv = rs.AddLine(arrSplitA[i],arrSplitB[j])
        intDiv2 = rs.DivideCurve(strMainCrv, 7, True)

        intDiv2.remove(intDiv2[3])

        intDiv2.insert(3,coordTransferPt)
        
        intDiv2.remove(intDiv2[4])
        intDiv2.insert(4,coordTransferPt2)
        
        arrFinalCrvs = rs.AddCurve(intDiv2,3)
        rs.ObjectColor(arrFinalCrvs, Color.Red)

        intDiv3 = rs.DivideCurve(arrFinalCrvs, 7, True)

        intDiv3.remove(intDiv3[3])
        intDiv3.insert(3,coordTransferPt3)
        
        arrFinalCrvs2 = rs.AddCurve(intDiv3,3)
        rs.ObjectColor(arrFinalCrvs2, Color.Green)
        
        rs.DeleteObject(strMainCrv)
Update

 

  • Share

Leave a reply

Your email address will not be published. Required fields are marked *