Display full version of the post: 2D Problem with circles in an equilateral tringle

sadiq3210
08.03.2014, 21:29
Hi, its my first post here, i use AutoCAD2010.Below is the link of pic of the drawing i m talking about.I can create this drawing by.1. making 1 circle of bottom row 10 radius. 2. copy that to the right 3 times3. make another circle with ttr of above row 4. copy that to right 2 times5. repeating same steps 2nd row 6. and top circle .7. then making boundary line with xline (horizontal) and using line command + tan + bject snap tracking.8.  Trim and scale the whole figure with reference of given dimension.I have 2 questions here.1) Is there any simpler way to make this drawing?2) How can i build this drawing if i first make the triangle and then circle?

sadiq3210
08.03.2014, 21:32
http://s38.photobucket.com/user/sadiq3210/media/triangle_zpsc641fbe7.png.html

John Connor
09.03.2014, 00:25
An easier way to create the drawing would take another program.  Have you ever heard of "nesting" software?

sadiq3210
09.03.2014, 08:45
i mean, another way via the same software

John Connor
09.03.2014, 11:53
The nesting program would be an AutoCAD add-on.Another option would be a custom lisp routine.

sadiq3210
09.03.2014, 15:36
i have no idea what custom lisp routine is. i searched on autocad help. but i found nothing. would you please explain a bit

John Connor
10.03.2014, 13:38
Lisp is a programming language that is support in AutoCAD as well as .NET and VBA.Some AutoCAD users create their own lisp programs to do repetitive tasks or to help them do a complex task more easily.

John Connor
10.03.2014, 14:03
I tried your little exercise and despite doing it differently it still took me eight steps.However, if the triangle was drawn first then it could be done in seven steps.

John Connor2014-03-10 14:14:16

John Connor
10.03.2014, 14:06
.I used the Circle, Array, Copy, Polyline, Offset and Erase commands.
John Connor2014-03-10 14:07:37

John Connor
10.03.2014, 14:15
The seven step plan.


sadiq3210
10.03.2014, 15:26
firstly, the object you made is a bit different.i would like to ask some questions here.About 1st picture that you attached.Q1 : why the circles are in different colors?Ans : Q2 : how you made the 6th circle; did you used circle with ttr;  yes or no?Ans : About 1st picture that you attached.Q1 : how you made the 1st circle; did you used circle with ttr;  yes or no?

John Connor
10.03.2014, 15:44
The circles are different colors so I could keep track of the ones I copied.The 6th circle was made using the TTR option.The first circle in the 2nd image I attached was made using the TTR option.

Robert_D
10.03.2014, 16:10
[QUOTE=John Connor]The first circle in the 2nd image I attached was made using the TTR option.[/QUOTE]Interesting exercise. How do you determine the "R" such that 5 circles fit precisely in the bottom row's fixed geometry?

John Connor
10.03.2014, 16:17
There would be no easy way to determine what R to use.  In this case I basically backed into it since the triangle was derived from the first exercise.  In other words...I cheated the system.  Your question is quite valid.
John Connor2014-03-10 16:31:10

sadiq3210
10.03.2014, 16:38
[QUOTE=Robert_D][QUOTE=John Connor]The first circle in the 2nd image I attached was made using the TTR option.[/QUOTE]Interesting exercise. How do you determine the "R" such that 5 circles fit precisely in the bottom row's fixed geometry?[/QUOTE]
The only dimension given is the length of side(s) of equilateral triangle.So, once you make the circles and the sides of triangle. You can scale the whole diagram by using command scale with reference option and entering the given dimension.

John Connor
10.03.2014, 16:40
Now that I think of it Robert you might very well be able to come very close to determining the size of that first circle (second image) with a little math.

sadiq3210
10.03.2014, 16:42
I know the technique of making the circles first and make triangle and then scale.But the question is that if i want to make the triangle first and then make the circles, how can i do it ??  

sadiq3210
10.03.2014, 16:44
I thing more, You can make all the circles in just three steps. Guess how  !!! 

John Connor
10.03.2014, 16:53
[QUOTE=sadiq3210]I know the technique of making the circles first and make triangle and then scale.But the question is that if i want to make the triangle first and then make the circles, how can i do it ??  [/QUOTE]Well I figured it out but this damn website won't post the image file correctly (comes up blank) and I've used the exact same method as before.  Crap! 

John Connor
10.03.2014, 16:59
[QUOTE=sadiq3210]I thing more, You can make all the circles in just three steps. Guess how  !!! [/QUOTE]Path array and copy?

Robert_D
10.03.2014, 21:06
[QUOTE=sadiq3210]...if i want to make the triangle first and then make the circles, how can i do it ??[/QUOTE] Measure side length of triangle. Divide by 11.464101615137753. Result will be radius of circle(s).Robert_D2014-03-10 22:16:43

philippe JOSEPH
11.03.2014, 07:45
uploads/175428/TRIANGLE+CIRCLES_01_A.dwg
 
No Robert_D, your method is aproximate.
John'n first drawing with the colored circles is OK.
The good method is align with "scale to fit".
Or maybe you can do it with "parametric constrains"?
Find here mine.philippe JOSEPH2014-03-11 08:14:07

sadiq3210
11.03.2014, 10:18
[QUOTE=John Connor][QUOTE=sadiq3210]I know the technique of making the circles first and make triangle and then scale.But the question is that if i want to make the triangle first and then make the circles, how can i do it ??  [/QUOTE]Well I figured it out but this damn website won't post the image file correctly (comes up blank) and I've used the exact same method as before.  Crap!  [/QUOTE]
upload the image somewhere and post link here

John Connor
11.03.2014, 10:32
I'm beginning to lose interest as I no longer see where this is all going.  Is there a practical reason for this discussion or are we having it because someone got bored at work?

sadiq3210
11.03.2014, 10:32
[QUOTE=philippe JOSEPH]uploads/175428/TRIANGLE+CIRCLES_01_A.dwg
 
No Robert_D, your method is aproximate.
John'n first drawing with the colored circles is OK.
The good method is align with "scale to fit".
Or maybe you can do it with "parametric constrains"?
Find here mine.[/QUOTE]
the link is not working. can't see the  image 

sadiq3210
11.03.2014, 10:36
[QUOTE=John Connor]I'm beginning to lose interest as I no longer see where this is all going.  Is there a practical reason for this discussion or are we having it because someone got bored at work?[/QUOTE]
the only question remaining is that, how to find the radius of circle ?

John Connor
11.03.2014, 11:02
Robert_D answered that question yesterday.  Did you try his method or not?Doesn't matter.  It works.Time to move on.
John Connor2014-03-11 11:13:55

sadiq3210
11.03.2014, 12:14
that method ill not give the exact radius.

John Connor
11.03.2014, 12:34
I tested the method only once so what can I say.  If it doesn't work for you then find another way.

sadiq3210
11.03.2014, 15:32
the length of side of triangle is 109.6966after dividing by 11.464101615137753it give. r=9.66870442 hich is wrong.the correct radius of circle is 11.5908

Robert_D
11.03.2014, 15:32
[QUOTE=sadiq3210]that method will not give the exact radius.[/QUOTE]Drawing triangle w/ arbitrary sides of 10 units in length, radius = 0.87228815093505.(@ max LUPREC in AutoCAD, radius properties = 0.87228815)Zooming in max on intersections of circumferential circles and triangle, there is no gap or overage.AutoCAD recognizes them as intersections.How much more precision is required?PS: formula= 8+(2xsqrt3) Courtesy Erdős/Groemer (1961)

Robert_D
11.03.2014, 15:48
[QUOTE=sadiq3210]the length of side of triangle is 109.6966after dividing by 11.464101615137753it give. r=9.66870442 which is wrong.the correct radius of circle is 11.5908[/QUOTE]??? That would = 5 circles w/ d 23.18 X 5 = 115.9 units in length?? How could that fit inside your 109.69 triangle?Check your math. r=9.56870444. If you say r= 11.59, something has changed with your geometry.PS: I just drew it up quickly (@109.6966) and it is quite precise.

Robert_D
11.03.2014, 16:15
[QUOTE=Robert_D][QUOTE=sadiq3210]the length of side of triangle is 109.6966after dividing by 11.464101615137753it give. r=9.66870442 which is wrong.the correct radius of circle is 11.5908[/QUOTE] something has changed with your geometry.[/QUOTE]Apparently now you are stacking 10 circles in triangle NOT 15 (you should have told us).Whereby formula now is 6+(2xsqrt3) & r = 11.5908096152033

John Connor
11.03.2014, 16:24
Maybe if the OP wouldn't change the rules in the middle of the game we'd all have a better idea of what is going on.  Go figure.

Kent Cooper
11.03.2014, 21:26
 


 
That's for FIVE Circles in the bottom row.  Change the 8 to 6 for FOUR Circles, etc.
 
Copy/pasteable:
(setq rad (/ edge (+ 8 (/ 2 (/ (sin (/ pi 6)) (cos (/ pi 6)))))))Kent Cooper2014-03-11 21:28:54

Kent Cooper
11.03.2014, 22:24
Or, yes, the square root of 3 works too -- a little less code:
(setq rad (/ edge (+ 8 (* 2 (sqrt 3)))))
[Again, substitute 6 for 8 to get the radius for four Circles.]
 

Robert_D
11.03.2014, 23:24
[QUOTE=Kent Cooper][Again, substitute 6 for 8 to get the radius for four Circles.][/QUOTE]Yup, and substitute 4 for 8 to fit 3 circles, 2 for 8 to fit 2 circles. 4 + 2√3,     2 + 2√3

sadiq3210
12.03.2014, 16:16
[QUOTE=sadiq3210]I thing more, You can make all the circles in just three steps. Guess how  !!! [/QUOTE]
Sorry again, that wasn't three. That were 5 steps. I just didn't count the copy of circle.1) once you make a circle (central).2) Copy to adjacent location.3) polar array to make 6  circles in 360 degrees4) then again copy a circle to make the cornered circle. 5) polar array to make 3  circles in 360 degrees

sadiq3210
12.03.2014, 17:57
Kent Cooper, Did autoCAD generated all these equations automatically? or you manually did all these ?If AutoCAD automatically created this, then how?

rs_higgins
12.03.2014, 21:24
This is a tangent exercise.Start by building you triangle 95 highthen draw a line from endpoint top to midpoint bottom.repeat all three sides so you have a 3 way cross it the middle of the triangle.using the circle command CIRCLE then type 3p  enter then pick your points as tangent the color X's will create the circle of the same color.You will need to complete the red or green first to use it to make the blue.Then you can work you way around from there.A quick note the center circle is created for 3 circle.Okay did this yesterday did not see the part about 3 time to get all the circles.

rs_higgins2014-03-12 22:34:33

Kent Cooper
13.03.2014, 14:00
>>Kent Cooper, Did autoCAD generated all these equations automatically? or you manually did all these ?



 
I came up with the formulas myself.  It's only a little trigonometry and algebra, and finally a conversion into AutoLISP syntax.Kent Cooper2014-03-13 14:01:22

Kent Cooper
13.03.2014, 14:07
>>... Start by building you triangle 95 high>> then draw a line from endpoint top to midpoint ....









 
[That works when you want four Circles along each triangle edge, but not for other quantities such as the five in the original image.]

rs_higgins
13.03.2014, 15:52
[QUOTE=Kent Cooper]>>... Start by building you triangle 95 high>> then draw a line from endpoint top to midpoint ....









 
[That works when you want four Circles along each triangle edge, but not for other quantities such as the five in the original image.][/QUOTE]Ok got in late I guess for the original image from the link "http://s38.photobucket.com/user/sadiq3210/media/triangle_zpsc641fbe7.png.html" shows 4 must have changed.If you would for those that came in late. What are the list of thing you would like for this. I enjoy this type of thing but need all the rules in one place. Thanks
rs_higgins2014-03-13 15:53:47

sadiq3210
13.03.2014, 17:21
rs_higgins Okay did this yesterday did not see the part about 3 time to get all the circles.what you mean to say? i don't understand.And thanks for the technique. i thought there is no way without finding R trignomatrically.
sadiq32102014-03-13 17:23:08

sadiq3210
13.03.2014, 17:23
[QUOTE=Kent Cooper]>>Kent Cooper, Did autoCAD generated all these equations automatically? or you manually did all these ?



 
I came up with the formulas myself.  It's only a little trigonometry and algebra, and finally a conversion into AutoLISP syntax.[/QUOTE]
What is autoLISP ?

rs_higgins
13.03.2014, 17:45
AutoLISP is a dialect of Lisp programming language built specifically for use with the full version of AutoCAD and its derivatives, which include AutoCAD Map 3D, AutoCAD Architecture and AutoCAD Mechanical.Lisp is a family of computer programming languages with a long history and a distinctive, fully parenthesized Polish prefix notation.Originally specified in 1958, Lisp is the second-oldest high-level programming language in widespread use today; only Fortran is older (by one year). Like Fortran, Lisp has changed a great deal since its early days, and a number of dialects have existed over its history. Today, the most widely known general-purpose Lisp dialects are Common Lisp and Scheme.Disclamer: The above statment is to be creited to Wikipedia Encyclopedia.Just wanted to know what you wanted in one post. It seem that this has evolved as we go along.Please indicate all that you would like to see in this problem.The puzzle I showed was given to us in class (Not to give away my age) using AutoCAD Version 2.6 took me some time to find it. A little tougher then "no m-button for on snap to tangent." type it all.Sorry rambling on.As I read the thread it gets confusing we started with 4 or 5 circles not sure but how to simplify the drawing.now if I'm reading this right once we find the right circle then we need to fill the triangle in three commands.If you would be so kind as to put all the limitations set for this problem and you requirements in one reply.

rs_higgins2014-03-13 18:06:47

sadiq3210
13.03.2014, 18:14
I got the solution to my question. I want to discuss AutoLisp now, which was mentioned earlier in this thread multiple times. what is autoLisp?

Kent Cooper
13.03.2014, 19:41
I couldn't resist working this out....  uploads/353260/CirclesFillPolygon.lsp
 
To demonstrate the power of AutoLISP, since you apparently are not familiar with it, the attached is an AutoLISP routine that automates the process in AutoCAD, and will do it in any regular triangle, square or hexagon.  Save the file into some known location; open it with Notepad and read the commentary at the top.  In AutoCAD, type APPLOAD, navigate to that location and Load the file.  Type CFP, and follow the prompts -- select a regular triangle/square/hexagon and tell it how many Circles you want along each edge.  [If you're not in the World Coordinate System, and/or your polygon isn't in a plane parallel to it, it will draw Circles, but they won't be where you expect them -- it could be modified to account for that if necessary.]

rs_higgins
13.03.2014, 20:55
This is a step by step to get you started. www.g-wlearning.com/CAD/9781605255637/.../pdf/ch27_695_716.pdfyou can do a search for----pdf on autolisp programming---and find a lot of downloads on how.

rs_higgins
13.03.2014, 21:01
[QUOTE=Kent Cooper]I couldn't resist working this out....  uploads/353260/CirclesFillPolygon.lsp
 OK that is slick and not as long as the one I was trying. I will have to break that down later to see it all.
rs_higgins2014-03-13 21:02:49

sadiq3210
14.03.2014, 16:51
thanks guyz for the idea about AutoLisp.The fact is that i don't know the Lisp language, although i learned C language. So i have rough idea how the sript is made.Now the question is that, when i typed cfp and hit enter. it said :Select Polyline triangle/square/hexagon to fill with Circles:but it was not recognizing the triangle made by lines, not a triangle made by poly line as it said (Nothing selected, or not a closed planar Triangle/Square/Hexagon.) It recognize the triangle made by polygon command. Is it a bug in script or something else.

rs_higgins
14.03.2014, 17:13
NO not a bug that is how it determines the area you want to add the circles to.COOL is it not.

rs_higgins2014-03-14 17:21:30

rs_higgins
14.03.2014, 17:17
[QUOTE=sadiq3210]I got the solution to my question. I want to discuss AutoLisp now, which was mentioned earlier in this thread multiple times. what is autoLisp?[/QUOTE]By the By what was the answer you came up with that worked for you. Good info is always needed

sadiq3210
14.03.2014, 17:33
[QUOTE=rs_higgins][QUOTE=sadiq3210]I got the solution to my question. I want to discuss AutoLisp now, which was mentioned earlier in this thread multiple times. what is autoLisp?[/QUOTE]By the By what was the answer you came up with that worked for you. Good info is always needed[/QUOTE]
when i tried that script, it worked.
sadiq32102014-03-14 17:36:37

sadiq3210
14.03.2014, 17:39
Now I am trying to make the object (circles in triangle - 5 row) using constraint.

John Connor
14.03.2014, 17:49
Select Polyline triangle/square/hexagon to fill with Circles:The program is expecting to see polylines not lines.  That is how it was written.  The code would have to be altered to be able to use lines.

rs_higgins
14.03.2014, 18:02
[QUOTE=sadiq3210]Now I am trying to make the object (circles in triangle - 5 row) using constraint.[/QUOTE]When it ask the number of just hit 5 of any number you want.I have tried up to 9 it did them all.

sadiq3210
14.03.2014, 18:07
no, no want to make it with constraints.
see this half worked diagramhttp://i38.photobucket.com/albums/e109/sadiq3210/Untitled_zps1e5de5c4.pngsadiq32102014-03-14 18:10:20

Kent Cooper
14.03.2014, 19:42
It doesn't use constraints, but assuming Circle 3 in your diagram is supposed to remain tangent to the crossing Lines in the middle, the criteria in the diagram will be met by using CFP and 5 Circles along each edge.
And yes, the CFP command is built to require closed Polylines, because it would be hugely more complicated otherwise, since separate Lines have no inherent relationship to each other.  Just determining whether a collection of six Lines form a regular hexagon would be a difficult task, considering that the Lines might not all have been drawn in the same direction around the shape, and other complications.

sadiq3210
15.03.2014, 07:46
thank you guyz, time to close discussion here.I would like if some one make a summary of whole thread and post in a single post to make thread clean.and then i will delete my later posts to clear the thread

John Connor
15.03.2014, 17:16
Since it is YOUR thread perhaps YOU should do the summary.  Seems only fair.

Kent Cooper
18.03.2014, 17:44
Here's a better version of the same thing.  It uses a different way to make the Circles that's faster [try both with 100 Circles per edge, and you'll really see what I mean]:  uploads/353260/CirclesFillPolygonII.lsp Kent Cooper2014-03-18 18:04:09