Jump to content

Radius of Fillet


Steven P

Recommended Posts

Good afternoon,

Does anyone have a simple LISP that will work out the radius needed for a fillet?

 

I have a start line, an end line and a point of the curve (user selects the point so it might not be the mid point), and I want to fillet the lines, just can't work out how to get the radius from these.

 

Thanks for any help

Link to comment
Share on other sites

Not quite, I don't use blend curves really and I don't think they work here. I want the user to draw the start line, a point on the circumference and then the end line and the LISP, or whatever, to draw a single radius curve joining it all together. Blend draws a spline and as far as I can see, won't let you specify the radius or a point on the circumference for the curve to pass through.

 

So if I can work out how to calculate the radius a simple fillet will work for me here

 

Link to comment
Share on other sites

Nearly Alan, but the arc isn't at a tangent to the lines.

 

Noting for Arc that the 2 straight lines  I'm working with arn't necessarily ending exactly where they should - so that would need to be corrected and it works.

 

Like a lot it's frustrating that the commands are nearly what I want but not quite, Fillet works best if I can get the radius, circle Tangent-Tangent-Radius but you have to trim the circle, blend sets off at a tangent but isn't a single radius curve, arc if you the lines are drawn where they need to be

Link to comment
Share on other sites

3 hours ago, Steven P said:

Nearly Alan, but the arc isn't at a tangent to the lines.

 

Noting for Arc that the 2 straight lines  I'm working with arn't necessarily ending exactly where they should - so that would need to be corrected and it works.

 

Like a lot it's frustrating that the commands are nearly what I want but not quite, Fillet works best if I can get the radius, circle Tangent-Tangent-Radius but you have to trim the circle, blend sets off at a tangent but isn't a single radius curve, arc if you the lines are drawn where they need to be

Is it assumed they specified point is on a curve that can even be tangent to the two lines? For instance, the point shown in the attached image cannot exists on a curve that is tangent to the two lines.

 

image.png.d0bccc7ab4a0d7417f55f73674986e37.png

 

 

  • Like 1
Link to comment
Share on other sites

If I understand your goal you want to create a fillet between 2 straight lines such that the fillet arc passes through a specified point "p" that is not on either of the two lines. The radius "r" of the arc is unknown.

 

If so, you can draw the angle bisector to the two lines. There are actually two angle bisectors but we can assume the one to use is implied by the bounds of the lines. The center of the fillet is on this line but where? We know that arc center is a distance r from either line (measured perpendicular to the line) and from the point p.

 

You can guess a point p1 on the angle bisector and then determine r and the distance s (the distance from p1 to p). If s is less than r determine a new point p2 further out from the intersection of the two lines. and recalculate r and s. Repeat until r and s are equal within a given tolerance.  You can modify the guessing process to speed convergence to a solution.

  • Like 1
Link to comment
Share on other sites

I never considered that the chosen point might not be possible Alan, thanks.

 

 

I think that is it BigAl, thanks. I'll play with this today and come back later with what I come up with

Link to comment
Share on other sites

If you are drawing a circle, make sure you pick the three points in an anti-clockwise direction otherwise you might get an unwanted solution.

 

 

Circle-3P.PNG

Link to comment
Share on other sites

Not sure if this is what you are trying to achieve; not mine as you can see from the code.

;;; By Irneb
;;; http://www.theswamp.org/index.php?topic=41775.0;all
;;; Creates a fillet but lets you pick a point that will lie on the arc.
;;; This is usefull when the radius is not known.
(defun c:FP (/ l1 l2 pt ed)
  (if (and (setq l1 (entsel "Pick first line: "))
           (setq l2 (entsel "Pick second line: "))
           (setq pt (getpoint "Pick point passing through circle: ")))
    (progn (command "._circle" "_3P" "_tan" (cadr l1) "_tan" (cadr l2) "_non" pt)
           (setq ed (entget (entlast)))
           (entdel (entlast))
           (command "._fillet" "_radius" (cdr (assoc 40 ed)) "._fillet" l1 l2)))
  (princ)
)

 

Link to comment
Share on other sites

52 minutes ago, Steven P said:

I never considered that the chosen point might not be possible Alan, thanks......

 

 

As the chosen point is by the user, it would seem unlikely that it would be impossible!!!

Link to comment
Share on other sites

14 hours ago, alanjt said:

Is it assumed they specified point is on a curve that can even be tangent to the two lines? For instance, the point shown in the attached image cannot exists on a curve that is tangent to the two lines.

 

image.png.d0bccc7ab4a0d7417f55f73674986e37.png

 

 

 

You could get a GIGO solution

 

 

GIGO solution.PNG

Link to comment
Share on other sites

So this is what I came up with so far:

 

(defun c:3pointfillet(/ line1 line2 line1point line2point circlepoint lst1 lst2 Radius)

  (princ "Draw Line 1")
  (command "line" pause pause "")
  (setq line1 (entlast))

  (foreach pair1 (entget line1)
    (if (= 10 (car pair1))
      (setq lst1 (cons (cdr pair1) lst1))
    )
  )
  (setq line1point (last lst1))

  (princ "Draw Line 2")
  (command "line" pause pause "")
  (setq line2 (entlast))

  (foreach pair2 (entget line2)
    (if (= 10 (car pair2))
      (setq lst2 (cons (cdr pair2) lst2))
    )
  )
  (setq line2point (last lst2))

  (setq circlepoint (getpoint "Select Point on curve"))

  (command "circle" "3p" "tan" line1point circlepoint "tan" line2point)
  (setq Radius (cdr (assoc 40 (entget(entlast)) ))) 
  (entdel (entlast))

  (command "fillet" "Radius" Radius)
  (command "fillet" line1 line2)

  (princ)

)

which is very similar to  Dahzee

 

If you choose a point on the circle outside of the lines it will fillet them but the radius is 'off'. I'll probably accept that happens.

 

Thanks for your help.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...