Demesne Posted February 2, 2012 Posted February 2, 2012 Does anyone have a routine (I've searched but can't find) to draw a straight polyline with a vertex every metre (or other specified distance). Also useful would be the option to 'equal segment lengths'. So, if a polyline was drawn by picking two points, start and end, and the line had a length of, say, 7.2m then there would be the option to add a vertex every metre, leaving the last segment length at 0.2m, or, each segment length would be the same - 7 segments at 1.028571428571429m (I didn't work that out in my head!). I see that if the user picks more than two initial points then the routine would have to treat each initial segment individually. Would also be useful if it worked with arcs. Like I said, I have looked but couldn't find anything. Regards Demesne Quote
ReMark Posted February 2, 2012 Posted February 2, 2012 It kind of sounds like you are laying out stationing (chainage). Is that what this is about? Quote
Demesne Posted February 2, 2012 Author Posted February 2, 2012 Ah, no. I'm fitting polylines to sections of point cloud data. The software I'm using doesn't add vertices to lines to give a better fit, it just fits the line you give it. So, if I draw a line through a section of cloud data (one vertex at either end) the software will fit that line to the data based on tolerances I've specified. If the cloud data is actually depicting a slight arc then it will still try and fit a line. Therefore, if I give it a polyline that has several vertices it will fit that polyline to the data more accurately as the 'shape' I'm fitting has more flexibility than a rigid line. I hope that makes sense. Quote
Demesne Posted February 2, 2012 Author Posted February 2, 2012 I'm just trying to find a way to speed things up. I'm currently fitting a polyline and then adding vertices where I think they're required, then re-fitting the polyline. ...and maybe adding more vertices ...and then re-fitting. If I could just pick two points for the start and end of a polyline that has multiple vertices and fit that It would save a lot of time. I could then 'weed' the polylines to remove unnecessary vertices (I'd use CadTools for that). Quote
Demesne Posted February 2, 2012 Author Posted February 2, 2012 Polyline with two vertices doesn't fit well: Polyline with multiple vertices fits better: Quote
ReMark Posted February 2, 2012 Posted February 2, 2012 What if you could interactively add or delete a polyline vertex by picking a point on the line with your mouse? Would that be a practical solution? Quote
Demesne Posted February 2, 2012 Author Posted February 2, 2012 I'm sort of doing that already by hovering on the grip and using 'Add Vertex'. I was just hoping to draw a polyline that had the vertices to start with. I'm a demanding CAD user. I expect too much from my software! Quote
ReMark Posted February 2, 2012 Posted February 2, 2012 I think someone over at The Swamp may have already anticipated your thread and wrote a lisp routine that will add vertices. Lee mac might know. He's a member of that forum as well as this one. Quote
Demesne Posted February 2, 2012 Author Posted February 2, 2012 Thanks. I'll have another look over there. Quote
Lee Mac Posted February 2, 2012 Posted February 2, 2012 Cross-reference: http://www.theswamp.org/index.php?topic=40839.0 Quote
Demesne Posted February 2, 2012 Author Posted February 2, 2012 Anybody interested in the solution should follow the link Lee Mac has posted above. Excellent solution. Thanks Lee (&CAB). Quote
ReMark Posted February 2, 2012 Posted February 2, 2012 Ah, I see Lee Mac came to your rescue. Good. Quote
Demesne Posted February 2, 2012 Author Posted February 2, 2012 Yes. Thanks for the push in the right direction. Quote
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.