I’m working with some .dwg files that were prepared by a client and was sent curves that consist of many line segments. These are used to represent all the radius corners and curves as well.
Is there any way to approximate these curves into arc segments instead using a Rhino command similar to Convert?
If anyone is aware of a way please let me know as it could be a great time saver!!
Hi Sean - the best way I know of to get the arcs is to use Arc > 3Point snapping to the polyline vertices, but there is no ‘convert’. Circle > FitPoints can also help, but you need to turn on control points on the polyline and select the ones you want.
@seanprokopec - in case it helps, I had a few Python scripts that attempt to reverse engineer arcs from points and polylines - I bundled them into a plugin fo convenience, you may be able to save a bit of time. If you download and unblock:
the plug-in and then drag it onto Rhino, you’ll get these commands:
Arc3Pt -the same as the Rhino command Arc > Start, End, PointOnArc only it reads out the radius and copies the radius to the clipboard - this is handy for checking the radius on an arc like polyline and then adding a fillet between two lines that has that same radius - this way the arc is sure to be tangent to the lines.
Arc3PointFromPoints - you give the tool points or control points (e.g. selected control points in an arc-like area of a polyline) and it makes a 3 point arc there. (the start and end of the arc should be the first and last points selected)
ArcFitToPoints - as above for the input, but makes a best-fit arc, that is the start and and points may not actually be - probably won’t - the ends of the point sequence, but it may be a better approximation of the arc, I’d use the 3point version if you are pretty sure that the points selected fall on an arc.
Arc3PointFromPolyline as above for points but asks for a polyline as input - if you already have the arc-like polyline as its own joined polyline.
ArcFitToPolyline - as above for points only uses a polyline as input.
Thanks,
great plug in.
Is it possible to delete the input because now I have to explode the contour and delete the little line segments and after, join the contour again.
For me, that wil makes the plug in “almost” perfect.
thanks already
Hi Edward - - You don’t… I have to type it… hold on a bit.
@E.O.Stam -I updated the plug-in again - This version of ArcFitToPolyline and Arc3PtFromPolyline have been goosed to optionally delete inputs. See how it works. They work with multiple input polylines.
In your example, I would use `Arc3PtFromPolyline’:
ExtractSubCrv to separate all the straights from the arc shapes,
Arc3PtFromPolyline DeleteInout=Yes, and select everything as input, even the lines, they will be ignored, Enter, then select everything again, and Join. Done.
Deleteinput=Yes I did see it once and default was no, I did’t change it an now I don’t see the option anymore.
Do I have to remove the privious plug-in (Arc3Pt.rhp)?
OK - thanks, let me check that.
Hmm - I do not get a crash - there is a check in the code for the arc being valid, and on the polylines you sent earlier, if I feed it the whole polyline, the arc it makes is not valid and the command ignores it and moves on, as it should - if you have a specific file that crashes, please send it to me.
ok, I delete the previous end new rhp and download it again an drag it into rhino but still get a crash with my example, sorry.
next week I will check it on my desktop.
hope its oke.