Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5877

Odd Behavior...Python Discontinuity/Scale

$
0
0

@brobes05 wrote:

Hi, not sure how to title this.

I am getting an error when I extend two rectangles (one initial and a scaled version). For some reason, after I scale, the larger rectangle loses its dimensions. I think it may have to do with how I am calculating the discontinuities of the rectangle before? Thank you.

import rhinoscriptsyntax as rs

a = []

def squares(p0, depth):
    if depth > 1:
        depth -= 1

        vect = rg.Vector3d(0,0,1)
        rect = rs.AddRectangle(rs.WorldXYPlane(),size,size)
        lines = rs.ExplodeCurves(rect)

        for line in lines:
            points = []
            endPts = rs.CurveEndPoint(line)
            pts = rs.AddPoint(endPts)
            points.append(pts)
            print points

        scale = rs.ScaleObject(rect, points[0], (.33, .33, 0))
        a.extend([rect,scale])


def main():
    size = 5
    p0 = rs.AddPoint(0,0,0)
    plane = rg.Plane.WorldXY
    squares(p0, 2)

main()

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5877

Trending Articles