Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rectangle Bounded by a Circle

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
dougfunke7850
1182 Views, 15 Replies

Rectangle Bounded by a Circle

I am trying to create a dynamic block of a rectangle that is contained within a circle.  The rectangle can be resized to any dimensions within the circle but cannot extend outside the circle.  The rectangle must also always contain the center point of the circle just to make it a little harder.  I have tried various combinations of constraints, stretch parameters with dimension limits, polar parameters with dimension limits but nothing quite behaves correctly.

15 REPLIES 15
Message 2 of 16

Something like this perhaps as a start?

With this DynBLk you need to invoke NEArest ofter selecting the DynGrip to move along the circle at any point.

I am not savvy enough to add a Constraint to this to keep the Rectangle from extending beyond the circle

Message 3 of 16

Yes, I went down that path.  But the problem is that it needs to be "idiot proof" with some sort of constraint or length limitation to prevent the rectangle extending beyond the circle.  I tried a polar stretch (See Attached) that had a limit of the radius of the circle but for some reason it allowed the other corners of the rectangle to extend beyond the circle when I applied a vertical constraint to keep it from rotating.  The vertical constraint makes the box get smaller every time it is resized.  Is there a way to limit the length of from the center of the circle to each of the rectangle corners all at the same time?

Message 4 of 16
Libbya
in reply to: dougfunke7850

Are you wanting all four corners of the rectangle to always be coincident with the circle?  Are you wanting the rectangle to be able to be able to be small and moved around inside the circle without it touching the circle?  Do you want the centroid of the rectangle to be coincident with the center of the circle?  Do you want the sides of the rectangle to always be horizontal/vertical?  

 

Message 5 of 16
dougfunke7850
in reply to: Libbya

Sadly I am trying to accomplish the second option.  The rectangle can be any size as long as all 4 corners are inside the circle.  I'm thinking this might be possible with chaining parameters but my results with chaining are not good.

Message 6 of 16
Libbya
in reply to: dougfunke7850

Just before you posted I edited with a couple other pertinent questions.  

Message 7 of 16

The centroid of the rectangle does not need to be the center of the circle.  But the center of the circle should always be contained within the rectangle.  It would be desirable for the rectangle to rotate but  I can accomplish that by rotating the entire block after the sizing is done.

Message 8 of 16
Libbya
in reply to: dougfunke7850

I do not know of any way to do what you desire with stock autocad and I do not actually believe there is a way.  I'd be happy to be wrong, though.

Message 9 of 16
dougfunke7850
in reply to: Libbya

Was there a solution if the centroid of the rectangle was required to be the center of the circle?

Message 10 of 16
Libbya
in reply to: dougfunke7850

Yes. but once the centroid of the rectangle is no longer the center of the circle, I know of no way to limit the rectangle to the limits of the circle.

 

Message 11 of 16
dougfunke7850
in reply to: Libbya

What does the solution with the centroids matching look like?

Message 12 of 16
Libbya
in reply to: dougfunke7850

See the attached file.  The one on the left does not have centroids matching and in playing with it I am sure you will see how it fails.  The one on the right does have centroids matching and it does not fail.  

Message 13 of 16
dougfunke7850
in reply to: Libbya

Thanks.  I will proceed with this as the best possible solution.  And I will have to digest the solution a little while to determine how the chained actions are working to provide the desired result. 

Message 14 of 16
Anonymous
in reply to: dougfunke7850

Here is my try look if its what you wanted 🙂

Message 15 of 16
dougfunke7850
in reply to: Anonymous

Kudos for out of the box thinking.  It is perfectly acceptable for this application for the circle to move as long as it still contains the rectangle and does not grow beyond a certain diameter.  I still have not figured out the constraint you used to keep the corners of the rectangle coincident with the perimeter of the circle.  A clue to that trick would be appreciated.  I modified your drawing a bit to change the controls to be 2 polar stretches with distance limits.  They also have angle limits that keep the center of the circle within the rectangle.  The grip in the top right seems to work correctly but the one in the bottom left does not stay on the corner of the rectangle.  Maybe the constraints are preventing that?  I case the "real world" application of this will help with the solution, the circle represents the coverage area of a smoke detector (15 foot radius).  The rectangle represents the walls of a room served by the smoke detector.  As long as the room resides inside the circle, it has smoke protection.  So if someone can figure out what I did wrong with the lower left grip and can find a way to keep it on the lower left corner of the rectangle I will be all set. 

Message 16 of 16

Libbya has the answer:

Open his block in the BE.

Make Distance1 Parameter Dist Type Increment from 0 to 15' in the Properties window (or however you change these variables)

Add a Scale Action to the Circle using Distance 1 Parameter as the parameter.

Voila.

 

Cool stuff. Love the chained XY

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report