fix non tangent arcs

fix non tangent arcs

Anonymous
Not applicable
1,329 Views
11 Replies
Message 1 of 12

fix non tangent arcs

Anonymous
Not applicable

Hi all! I need a big help
I need lisp to detect non tangent arcs in polyline, and then fillet segments before and after it with same radius as that arc. Is it possible?
I found program to detect non tangent arcs so i can edit it manually, but it would be cool if it can be done automatically
Thanx in advance!

(I have polylines that are made using fillet command, but now its  slightly changed/moved, so i need to do fillet again.)
(sorry for bad english, its not my native language)

0 Likes
1,330 Views
11 Replies
Replies (11)
Message 2 of 12

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

....

I need lisp to detect non tangent arcs in polyline, and then fillet segments before and after it with same radius as that arc. Is it possible?
....

(I have polylines that are made using fillet command, but now its  slightly changed/moved, so i need to do fillet again.)
....


Welcome to these Forums!

Can you provide a sample drawing or image showing the kinds of changes you may need to re-Fillet for?

 

Many such changes I can imagine would result in an arc segment with a different radius from the original, so if you re-Fillet the corner matching the current arc-segment radius, it will be different from what you started with.  Is that what you want?  For example, this one I altered by dragging the arc segment's midpoint grip outboard slightly:

ReFillet.png

But at a right-angle corner like that, with adjacent line segments not altered, it should be possible to calculate what the original corner radius was, and restore that.

 

Or are you talking about arc segments that are not changed, and all changes happening to adjacent line segments?

Kent Cooper, AIA
0 Likes
Message 3 of 12

john.uhden
Mentor
Mentor
I am guessing that he would want to refillet the tangents with an arc of the same radius, so the tangent points would shift along their straight segments. I am rather sure that could be done programmatically, maybe even by the fillet command itself.

John F. Uhden

0 Likes
Message 4 of 12

dbroad
Mentor
Mentor

I hate to disappoint but as soon as the filleted polyline was stretched in error, it became useless and should be redrawn.  You can't fix drafting errors automatically even if you can spot them automatically.  I don't program such foolishness when I make my own mistakes.  Draw it correctly and take responsibility for it.  If you are satisfied with the straight line locations and just need to refillet the corners, use the fillet command with the polyline option and make your own choice for a suitable radius.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 5 of 12

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:
I am guessing that he would want to refillet the tangents with an arc of the same radius, so the tangent points would shift along their straight segments. ....

But....  The "same radius" as what?  Here's another possible kind of change -- the left one is the original, the right one has had its right edge Stretched farther to the right.

PLStretch.png

Re-Filleting that right one with the same radius as its arc segment currently has would not be the same as doing so with the original radius, just as in my previous Reply.  [It might not even be possible, depending on the lengths of adjacent line segments.]  But I can't imagine a way to calculate what that original radius was, unless you can be sure of certain things about the nature of the change that has been made.  For example, in this case, if you know that a right-angle corner like this may have been stretched thus in a direction parallel to one of the line segments, and will have had only one edge altered in that way, the original radius could be calculated.  But being able to count on such limited possibilities doesn't seem likely.

 

And what would they want to do with something like this?

PLStretch2.png

 

That's why I asked what kinds of changes might occur.  Some kinds could probably be handled, but some kinds would be very difficult, if not impossible, to know what to do with.

Kent Cooper, AIA
0 Likes
Message 6 of 12

john.uhden
Mentor
Mentor
I guess I disagree a little. When the polyline was originally filleted,
the drafter applied a chosen radius. It ain't that hard to apply the same
desired radius programmatically. Based on the radius and chord just set
the bulge. If the tangent point got shifted, then use the delta and
radius, reset the vertex, and apply the bulge

John F. Uhden

0 Likes
Message 7 of 12

marko_ribar
Advisor
Advisor

kiloleba, jesi li pogledao poslednju poruku sa sajta :

http://www.cadtutor.net/forum/showthread.php?98330-fix-non-tangent-arcs

 

Ako nesto nije u redu, mozes da uradis reply...

 

Translation :

kiloleba, have you looked at last message from this site :

http://www.cadtutor.net/forum/showthread.php?98330-fix-non-tangent-arcs

 

If something's wrong, you can post reply message...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 8 of 12

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:
.... When the polyline was originally filleted, the drafter applied a chosen radius. It ain't that hard to apply the same desired radius programmatically. ....

Applying it isn't very hard.  It's determining what it was, from information contained in a Polyline where it has been altered, that could be utterly impossible, again depending on the exact nature of the change(s) that may have been made.  Applying the same radius to all corners of a Polyline is easy enough with the Polyline option in Fillet as @dbroad suggested, but that would not be appropriate if a Polyline they want to fix may have originally had different radii on different corners, or some corners Filleted and some not, etc., etc.

Kent Cooper, AIA
0 Likes
Message 9 of 12

dbroad
Mentor
Mentor

@john.uhden.  Once the polyline has been changed, there is no reliable, programmatic way to determine what the original radius was unless extra information had been attached the polyline.  In some, cases, where a vertex is added, the radius remains the original radius but how would that be determined programmatically?

 

This is best fixed by a drafter, hopefully the same one who made the mistake, not by a program that might make false assumptions.  It's easy to stretch a polyline without messing up its tangents. It's also easy to remove a fillet, stretch it and add the fillet back in.  Who's to say that every corner of the polyline might have had an intentionally different radius.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 10 of 12

john.uhden
Mentor
Mentor
My apologies. I was presuming that the drafter or his designer colleague would know what radius to apply. It had been drawn by somebody, right? In that regard I agree that user input is required to repair the damage. Yes, assumptions are a bad bet.

John F. Uhden

0 Likes
Message 11 of 12

Anonymous
Not applicable

I found this program that do what i want just manually (you need to click on arc to get radius and then on segments to fillet), so i was hoping that there is way to do this by clicking on polyline.

 

(defun c:fsr ( / pt rad) ;; Fillet with radius from picked curve
(setq pt (cadr (entsel "Select curve: ")))
(if (osnap pt "cen")
(prompt (strcat "\nRadius is " (rtos (setq rad (distance (osnap pt "nea") (osnap pt "cen")))) "."))
(prompt "\nNo radius for that object.")
); end if

(setvar "cmdecho" 0)
(command "filletrad" rad)
(setvar "cmdecho" 1)
(terpri)
(command "_.fillet" pause pause)
(princ)
)

 

Sorry i wasn't clear enough about my request.

0 Likes
Message 12 of 12

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

I found this program that do what i want just manually (you need to click on arc to get radius and then on segments to fillet), so i was hoping that there is way to do this by clicking on polyline.

.....


Does that not work with picking on an un-altered arc segment of the Polyline for the radius, and then choosing the Polyline option and picking the Polyline, if you want to re-Fillet all its corners?  It takes two User inputs to the Fillet command, which can be two segments, but can instead be a P and the selection of the Polyline.

 

Or if it does work that way, is that not what you want to do?  If your idea is to simply pick a Polyline once, if it's been altered, it probably has arc segments of different radii, so how is a routine to know which one to use?  And if it would use the Polyline option in Fillet, would your Polylines ever have non-radiused corners that you would want to keep that way?  Fillet's Polyline option won't leave those alone.

 

Here is my somewhat more sophisticated routine to do the same kind of thing, with extras like *error* handling, etc., and this difference:  instead of doing a Fillet command and allowing two-and-only-two pauses for User input, and then ending, it puts you in a whatever-you-need Fillet command, in which you can choose the Polyline option to re-Fillet an entire Polyline or pick segments [and only those you want rounded corners between, in case there are some where you don't], and even keep going and do as many of them as you want at the same radius.

Kent Cooper, AIA
0 Likes