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

Trying to make a chain

$
0
0

@rhinorudi wrote:

Looking for some tips on doing this correct.

I have a chain link as a closed polysurface and a curve.

I want to array along curve the link and rotate every 2nd link 90ª .

So I can get the object and copy and rotate it. What I am wondering is the array part. I don't see any commands on the Rhinoscript syntax page.

Here is my script for rotating the object

import rhinoscriptsyntax as rs

def createLinks():
    obj = rs.GetObject("Select object to rotate")

    if obj:
        bb=rs.BoundingBox(obj)
        # find object's bounding box center point
        center=rs.AddPoint.Origin=(bb[0]+bb[6])/2
        # rotate and copy original object
        cplane = rs.WorldXYPlane()
        xform = rs.XformRotation2 (90.0, cplane[1], center)
        link2 = rs.TransformObjects( obj, xform, True )


    rs.MoveObject(link2, (2.75,0,0))


createLinks()

Would it be better to Array along curve first then rotate every second one with …

Slice notation a[low:high:increment]

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6023

Trending Articles