SamIWas Posted February 12 Share Posted February 12 I have been writing a PIO to draw curtain tracks that we use in film/tv a lot. It's a 2D Path Object which takes the path, and makes a thicker outline of it, and a 3D track. Works a lot like the lighting pipe tool and the soft goods tool, but much simpler and faster and has multiple track styles. I don't know exactly how the lighting pipe tool draws its 2D variant, but I'm using the OffsetPolyN to offset the main polyline 1" in each direction, then subtracting the shapes from each other. This seems to work fairly well, but it can fail if the poly line is open, and I draw in a certain direction because it puts the bigger poly on top. Two questions then... First, does anyone know how the lighting pipe tool draws its 2D portion? Because it closes the ends which is nice, and is probably more efficient than my clip surface idea. And second, if not, is there a command that determines the direction a poly line is drawn in so that I can make sure the correct poly ends up on top. Attached are images showing the end results of drawing the same shape in opposite directions, both open and closed. Quote Link to comment
VIRTUALENVIRONS Posted February 13 Share Posted February 13 Have you considered writing this with NURBS curves instead of Polyline. That should give you curve direction. If I was doing this manually, it would be NURBS curve>duplicate and move down>Loft surface>Shell thickness. Quote Link to comment
C. Andrew Dunning Posted February 13 Share Posted February 13 @SamIWas, for the 2D portions of tracks for Soft Goods/SoftGoods 2 I use a combination of OffSetPoly ("left" side), OffSetPolyN ("right" side"), and then GetPolyLineVertex to find the endpoints of each. I then place lines to "cap" the end points. The 3D portion then uses those 2 polylines to create new ones within BeginPoly/EndPoly and BeginXtrd/EndExtrd calls. SetPolyClosed is used to make the resulting polyline closed. I'm sorry, but it has been so long (12 years?) since I coded those parts of that tool that I don't remember why I had to use a combination of OffSetPoly and OffSetPolyN. 1 Quote Link to comment
SamIWas Posted February 14 Author Share Posted February 14 18 hours ago, VIRTUALENVIRONS said: Have you considered writing this with NURBS curves instead of Polyline. That should give you curve direction. If I was doing this manually, it would be NURBS curve>duplicate and move down>Loft surface>Shell thickness. That's for 3D, right? The 3D portion is working perfectly. That was easy with an ExtrudeAlongPath. It was the 2D I was having trouble with. But, I got it working! Quote Link to comment
SamIWas Posted February 14 Author Share Posted February 14 (edited) 17 hours ago, C. Andrew Dunning said: @SamIWas, for the 2D portions of tracks for Soft Goods/SoftGoods 2 I use a combination of OffSetPoly ("left" side), OffSetPolyN ("right" side"), and then GetPolyLineVertex to find the endpoints of each. I then place lines to "cap" the end points. The 3D portion then uses those 2 polylines to create new ones within BeginPoly/EndPoly and BeginXtrd/EndExtrd calls. SetPolyClosed is used to make the resulting polyline closed. I'm sorry, but it has been so long (12 years?) since I coded those parts of that tool that I don't remember why I had to use a combination of OffSetPoly and OffSetPolyN. I couldn't get your method to work, but it did lead me in the right direction, and I got it working! What I ended up doing was creating an array that stored all the vertex points of the two offset polylines, then created a new polyline using all of the points into a single object. Took a LOT of experimenting, but it appears to work now. Next thing is to work this into a separate procedure/function that can be called multiple times to create 1, 2, and 3-track versions from a single poly. Edited February 14 by SamIWas 2 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.