Help with defining points for offset arcs

Help with defining points for offset arcs

annoisscary
Advocate Advocate
509 Views
8 Replies
Message 1 of 9

Help with defining points for offset arcs

annoisscary
Advocate
Advocate

I'm starting to work on a lisp to draw various types of radius doors and whatnot and figured I needed to work out how to define the points for the openings. I have a method to find the arcs center points and can find the angle at the bottom part of the triangle and the Height (horizontally). But I cant quite wrap my head around to solve for the other two lines with the information I have. I was assuming some trig would be the best way to do it but if there is another way with lisp I wouldn't mind changing my approach.

 

Need to solve for yellow, cyan, and red lines/points. Everything in green is already in my code.

annoisscary_0-1666287101212.png

 Any help appreciated!

 

**edit**

Attached dwg / lisp I have so far.

0 Likes
Accepted solutions (1)
510 Views
8 Replies
Replies (8)
Message 2 of 9

Kent1Cooper
Consultant
Consultant

Would you settle for code that would simply OFFSET the perimeter, raise the bottom edge of the result, and draw the center vertical [your cyan line] off the midpoint of that raised bottom edge?  No calculations of those non-green locations would be needed.

 

[A question:  the cyan line doesn't look quite vertical.  Does it go to the midpoint of the arc, rather than vertically?  Should it?]

Kent Cooper, AIA
0 Likes
Message 3 of 9

annoisscary
Advocate
Advocate
Don't know exactly what you are suggesting with the offset off description alone. I'm working under the assumption that to draw an opening of any size based off inputs that I would need to figure out how to reliably calculate the three points for the inside arc. In my example its 5" top, 5" side and 9" bottom but it could be anything.

As far as the cyan line, I honestly didn't even notice (woops). It snapped to the arc mid point. I think any 3 points along the arc would be fine honestly, would probably be easier if they are all perfectly vertical if I'm doing any trig to figure out the points though.
0 Likes
Message 4 of 9

Kent1Cooper
Consultant
Consultant

@annoisscary wrote:
... I would need to figure out how to reliably calculate the three points for the inside arc. In my example its 5" top, 5" side and 9" bottom but it could be anything.
....

When the widths at the top and sides are the same as in that example, if you make the perimeter as a Polyline, you can OFFSET it by 5" inward, and it wouldn't be too complex for a routine to then move the bottom-edge vertices up 4" for your 9" bottom width.  The command will do all the necessary arc [segment] calculations for you.

Kent Cooper, AIA
0 Likes
Message 5 of 9

Kent1Cooper
Consultant
Consultant

Another question:  Is that [I assume] doorknob location supposed to be the center of the Arcs?  That would mean that the top/outer Arc hits its highest point directly above the knob, and is going downward again before it reaches the edge of the door.  If this is one of a pair of doors, don't you want the center of an overall both-doors top arc to be on the meeting edge, rather than have two arcs with a "widow's peak"?

Kent1Cooper_0-1666290674653.png

Kent Cooper, AIA
0 Likes
Message 6 of 9

annoisscary
Advocate
Advocate

The center is just that, the center of the arcs. We have a standard lock prep location regardless of anything else other than customer request. As far as the widows peak thing, the drawing I provided is just a random radius. It could be any radius within reason, in the case of a double door yeah they would form a true radius. 

 

Regarding the offset, that would work for cases where I'm simply drawing an opening but I think I need a method to define points on the arcs so I can make the routine draw lite patterns and such inside the opening without trimming anything.

0 Likes
Message 7 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

You need to be figuring angles from at the level of the arc center, not from the bottom of the opening.  Here's the trigonometry of that:

Kent1Cooper_0-1666294764249.png

Do you know how to construct calculations in AutoLisp to figure those B/D/F heights?  It would involve the (sin) function and also an arc-cosine function, which AutoLisp doesn't have.  You can find all those trig functions built in AutoLisp with some searching, for example, >here<.

Kent Cooper, AIA
0 Likes
Message 8 of 9

annoisscary
Advocate
Advocate

wow, I just assumed Autolisp would have all the required trig functions built in.. Kind of surprised they don't. I guess I'll be putting that link to use, so thanks for that!

 

Also, thanks for the tip on solving the problem. I don't know why I didn't think of making them right triangles, Should make them a bit easier to solve. I think I can take it from here. As always, I appreciate your help Kent!

0 Likes
Message 9 of 9

annoisscary
Advocate
Advocate

Boy, what a journey that was. So at first glance I was thinking "oh cool, that picture explains EVERYTHING I needed to know".. Well, I soon realized (perhaps due to my inability to solve it) that its kind of hard to solve for the triangle when I only know one corner is 90 and have no idea what to opposite side is until I get the point where they intersect which is why I need to do the trigonometry in the first place. I kept trying other methods and figured if I could just figure out the Y coordinate difference between a point on the inner/outer radius I would be set. So I tried doing a point using polar to offset it in 5" which was great... for that 1 point. Tried to see if I could maybe do some trig off that point to get an idea of how I could do the other ones to no avail. Then I took a step back and thought maybe trigonometry isn't the best answer. I had the radius and the CenterPoint so maybe just some simple geometry would work and finally got a result! 

 

annoisscary_0-1666390274437.png

 

 

Went with calculating chord length for both circles, that way I could find the difference between the two of them and just come down off the top radius that amount /2. Here is a little excerpt of code :

 

 

(setq clenO (*(sqrt(-(expt rad 2)(expt cendist 2)))2)) ;Outer Chord
(setq clenI (*(sqrt(-(expt (- rad 5)2)(expt cendist 2)))2)) ;Inner Chord
(setq IOdif (- clenO clenI)) ;Difference between 2
(setq Opt1 (mapcar '+ ipt2oc (list 0 (/ clenO 2) 0))) ;Outer Point made with Chord
(setq Ipt1 (mapcar '+ Opt1 (list 0 (- (/ IOdif 2)) 0))) ;Innner point made with difference between 2 chords, derived from first point on outter.

 

 

 

In summary,  Trigonometry sucks.

 

 

 

0 Likes