Jump to content

draw an polygon spaced across a 2D path object


Recommended Posts

  • Marionette Maven

The easiest way I've done with with Marionette was to convert a copy of the poly to a NURBS curve and divide the curve into segments to get the points along it.
I'm attaching a file to demonstrate. If you just want the 2D points instead of the 3D points, you'll need to remove the Z value from the resulting list.

Div Curve.vwx

Link to comment

@Jayme McColgan What you are looking for is using vs.GetCustomObjectPath to get a handle to the path object's underlying path, then using vs.PointAlongPoly or vs.PointAlongPolyN as @Pat Stanford suggested to get the X,Y point and vector (if you want to match rotation of the triangles to be tangent to the path).  To space them evenly, I would use vs.CalcPolySegLen to determine the distance between the first and last point (use vs.GetVertNum to get the index of the final point), and divide that by the number of triangles you wish to insert.

  • Like 1
Link to comment
  • 1 month later...

sorry y'all been awhile. sometimes I gotta do my day job. lol 

 

for those in the future looking for an example here's what I ended up going with. 

 

hPath = vs.GetCustomObjectPath(objectHand)
arrows = int(vs.GetRField(PIO_handle, recname, "arrows"))

amount = arrows + 1
testing = vs.HPerim(hPath) / amount

starting = 0
for i in range(amount - 1):

  starting += testing

  vs.RegularPolygon(0, 0, 30, 3, 1)
  last = vs.LNewObj()

  cur_loc = vs.PointAlongPoly(pathHandle, starting)
  vs.HRotate(last,  0, 0, vs.Vec2Ang(cur_loc[2])-90)
  vs.HMove(last,cur_loc[1][0], cur_loc[1][1])

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...