How to center circles across a rectangle

How to center circles across a rectangle

sdone
Explorer Explorer
1,369 Views
19 Replies
Message 1 of 20

How to center circles across a rectangle

sdone
Explorer
Explorer

Hello,

I am coming from Tinkercad so sorry for the silly questions.  One question I have is, I have a rectangle 76.2 mm wide, the center is 38.1.  I place a point on that and make my circle 17.01 mm in diameter.  I want to space out another 17.01 mm circle on either side of the center circle and evenly spaced from the edge of the rectangle.  It should be somewhere around where I have the red dotted circle but i'm not sure how to get that dimension.  Is there a good spacing calculator online?  I basically want 3 circles to be spaced evening across the top of the rectangle.  76.2mm divided by 4 spaces between the circles give me 19.05mm which is in the drawing below but you can see the circle is not evenly spaced.  I'm missing something simple.

Thanks,
Shawn

center 3 circles.png

 

0 Likes
Accepted solutions (1)
1,370 Views
19 Replies
Replies (19)
Message 2 of 20

TrippyLighting
Consultant
Consultant

You'll use sketch dimensions and constraints.

I deleted the screencast as it did not address the problem.

The math you are using will space the the center points of your circles evenly, but it does not create even spacing between the outside of the rectangle and between the circles 😉

 


EESignature

0 Likes
Message 3 of 20

sdone
Explorer
Explorer

Hello, I really appreciate you taking the time to walk through that.  I can take it as far as you have but what I am really wondering is how do I center 3 circles evenly across the rectangle.  You can see at the ending of your video, the circles are not spaced evenly across.  Is there an easy way to determine how to space a certain number of object equally across a rectangle.  

 

spacing2.png

 

0 Likes
Message 4 of 20

TrippyLighting
Consultant
Consultant

Attached is a design file that does what you describe:

 

I created three user parameters, which I use in formulas. :

TrippyLighting_0-1737576529622.png

 

This is the formula which positions the first circle in the sketch:

 

TrippyLighting_1-1737576605274.png

 

I could have patterned the circels in the sketch, but usually we discourage users from patterning in a sketch and favor patterning features:

 

So another formula is in the pattern UI in the timelinne:

 

TrippyLighting_2-1737576704979.png

 

This conveys the design intent you described and works for any rectangle size with any number of circles.

 

 


EESignature

Message 5 of 20

etfrench
Mentor
Mentor

You can use construction lines with equal constraints (as well as a few horizontal/vertical and coincident constraints).

etfrench_0-1737577580281.png

Or you can use a formula in a rectangular pattern: (Width of rectangle - (circle count * diameter))/4 + diameter

etfrench_1-1737578123657.png

 

ETFrench

EESignature

0 Likes
Message 6 of 20

sdone
Explorer
Explorer

 

Thank you TrippyLighting,

Hello, just to be clear, if someone is trying to spread something across evenly starting at an edge of a rectangle, they have to create these 3 user parameters and insert these complex formulas.   Seems like there would be something built in already to do this.  I have used the rectangle pattern before but it always seems like you are guessing on where to stop the last circle so that it ends evenly across to the edge compared to the starting circle.  See image below.

 

rect pattern question1.png

0 Likes
Message 7 of 20

TheCADWhisperer
Consultant
Consultant

@sdone 

Can you File>Export your *.f3d file to your local drive and then Attach it here to a Reply?

Message 8 of 20

TrippyLighting
Consultant
Consultant

Did you look at the design I had posted before you asked these questions?

 

The reason these formulas a bit more complicated is that they can be used as a generic case. The design requirement - even spacing between the sides of the rectangle and the circumference of the circles - will always be met, regardless of the size of the rectangle, the diameter of the circles and the number of circles. attached.

 

If you only need three circles, you  don't need user parameters and can achieve the same thing with sketch tools e.g. construction lines and constraints. I have an example attached. However, the first, seemingly  more complicated approach does a much better job at capturing design intend.

 

I find it much easier to understand the meaning behind a formula then trying to decipher a sketch littered with constraints.

 

Moving the pattern instances with the mouse/arrow isn't precise until you put a precise numeric value, or a formula into the respective field.

 

 


EESignature

0 Likes
Message 9 of 20

sdone
Explorer
Explorer

Okay, thank you all.  I will have to dig in a bit more tonight when I get home and look this all over.  Just to be clear the equation to find this example where to place 3 circles with a diameter of 20 mm equally along a rectangle that is 100mm would be this?

 

(rectangle_length-(num_circles*circle_diameter))/(num_circles + 1) + (circle_diameter/2)

(100-(3*20))/(3+1) + (20/2) = 20

OR THIS

(Width of rectangle - (circle count * diameter))/4 + diameter

(100-(3+20))/4+20 = 30

 

I saw both listed from folks.

Thanks.
Shawn

 

 

 

0 Likes
Message 10 of 20

etfrench
Mentor
Mentor

In this formula, (Width of rectangle - (circle count * diameter))/4 + diameter, 4 refers to the number of spaces between the circles and the rectangle.  It is always be equal to the number of circles plus one.

ETFrench

EESignature

0 Likes
Message 11 of 20

sdone
Explorer
Explorer

But the last part of the equation varies between both.

 

equa.png

0 Likes
Message 12 of 20

etfrench
Mentor
Mentor

See my previous post with the image showing the formula in use.

p.s. Open @TrippyLighting's file and look at the formula.

ETFrench

EESignature

0 Likes
Message 13 of 20

sdone
Explorer
Explorer

ETFrench,

I tried to put in the "Distance" just like you did but it is turning red.  Does the system know what "rWidth" and "cCount" is etc?  I'm sorry, I'm pretty new to this.

image1.png

 

 

0 Likes
Message 14 of 20

Warmingup1953
Advisor
Advisor

I think it's possible using the Equal (Line Length) Constraint but it takes a lot of effort!

 

Capture.PNG

Message 15 of 20

etfrench
Mentor
Mentor

You need to create those user parameters.  Open the parameters dialog clicking on the Modify/Change Parameters menu item.

Add the parameters and set their values in the dialog:

etfrench_0-1737609745965.png

 

ETFrench

EESignature

0 Likes
Message 16 of 20

etfrench
Mentor
Mentor

I think using construction lines with the equals constraint to be more obvious than using a formula.  The nice thing about the formula method is that it can be used in a sketch or on the solid model.

ETFrench

EESignature

Message 17 of 20

sdone
Explorer
Explorer

ETFrench,

I think I am just going to use the equation outside of Fusion on paper for now, determine the number and then implement it into Fusion.  I will need to take time to learn how to place in parameters, etc and use equals constraints better.

With that being said, I know this is more of a math question, but I have used your equation like such:

 

(Width of rectangle - (circle count * diameter))/(num_circles + 1) + diameter
(100-(3*20))/4+20 = 30

 

Now with my answer being 30, the first step is to place the back edge of the first circle 30mm from the 1st edge (or 20 mm from the 1st edge to center of 1st circle) then after that point I can go from center to center on the circles with 30?  Just making sure I understand the process.

Thanks.

 

measurement.png

0 Likes
Message 18 of 20

TheCADWhisperer
Consultant
Consultant

@sdone 

I seldom repeat any dimensions.

TheCADWhisperer_0-1737731582636.png

 

Message 19 of 20

etfrench
Mentor
Mentor
Accepted solution

Unfortunately, doing that way is not parametric.  Observe what happens when you change one of the dimensions in that sketch.  Equal constraints on construction lines between each circle and the rectangle will always be correct no matter which dimension is changed.

ETFrench

EESignature

0 Likes
Message 20 of 20

sdone
Explorer
Explorer

Thanks for all the help.

0 Likes