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

Confusion about rs.MirrorObject()

$
0
0

Hello, I’m really new to Rhino Python scripting, but not new to Python. I am trying to create a box and then mirror that box. If I run my script with the front view selected, everything works as expected. If I run my script from the perspective layer, box draws, but doesn’t mirror as expected. I’m really confused as to why this is happening and how to correctly resolve this so that my mirroring happens correctly no matter which view I have selected. Thanks!

import rhinoscriptsyntax as rs
from System.Drawing import Color

width = rs.GetInteger("Total Width", 24, 0, 48)
height = rs.GetInteger("Total Height", 36, 0, 48)
depth = rs.GetInteger("Total Depth", 48, 0, 48)

left_wall = rs.AddBox([
    (0,0,0),
    (2,0,0),
    (2,0,height),
    (0,0,height),
    (0,depth,0),
    (2,depth,0),
    (2,depth,height),
    (0,depth,height)])

# now mirror it
rs.MirrorObject(left_wall, [width/2, 0, 0], [width/2, 0, height], True)

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4125