Jayme McColgan Posted March 4 Share Posted March 4 I'm trying to figure out how to draw the 2d path object and have a triangle inserted evenly spaced along the path. I'm struggling to figure out where the points on the line would be. some direction would be appreciated. thank you Quote Link to comment
Marionette Maven Marissa Farrell Posted March 5 Marionette Maven Share Posted March 5 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 Quote Link to comment
Jesse Cogswell Posted March 7 Share Posted March 7 @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. 1 Quote Link to comment
Jayme McColgan Posted May 5 Author Share Posted May 5 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]) Quote Link to comment
Recommended Posts
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.