Exercise2

The pictures above show how rectangles are extruded.

 


import rhinoscriptsyntax as rs
import random

rs.DeleteObjects (rs.AllObjects ())

plane = rs.WorldXYPlane ()

 

def myRectangle (origin, width, height):
#origin = rs.CurveStartPoint (platformUnit)
midPoint = [origin[0] + 5, origin[1] + 5,0]
Object = rs.AddPoint (midPoint)

#movePlane
newPlane = rs.MovePlane (plane, origin)
newRectangle = rs.AddRectangle (newPlane, width, height)
#platform = rs.OffsetCurve(platform, midPoint, height)
#newRectangle =
newHeight = random.uniform(2,8)
newMidpoint =rs.MoveObject (Object, [0,0,newHeight])
facade = rs.ExtrudeCurveStraight (newRectangle, midPoint, newMidpoint)
rs.CapPlanarHoles (facade)

points = rs.GetPoints ("Please select points locations:")
for point in points:
myRectangle (point,10,10)

 

Leave a Reply

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