# Convert shape to square

## Recommended Posts

Hi. I need to convert this shape to perfect square with same orientation. Any ideas?..

http://i.imgur.com/ZRSZ366.png

to_square.hipnc

Edited by Alexey Vanzhula
##### Share on other sites

Box SOP or Bound SOP, check 'Oriented Bounding Box' - could be a starting point.

##### Share on other sites

I need square, but not rectangle . For example with same perimeter

##### Share on other sites

Also source shape can be not so flat. In this situation bound SOP with orientation give me oriented not flat box, that not so good...

##### Share on other sites

Maybe get the primitive normal to orient it correctly and then pick one point to get circle radius and make a new square inside of this circle.

Edited by fântastîque Mântragorîè
##### Share on other sites

Maybe get the primitive normal to orient it correctly and then pick one point to get circle radius and make a new square inside of this circle.

It is very funny

I need this square to get perfect circle in next stage, and you offered me to get circle first

So another question: How to get perfect circle from any 4-corner polygon? Unfortunatelly Convert SOP can create non-proportional circle...

Edited by Alexey Vanzhula
##### Share on other sites

So another question: How to get perfect circle from any 4-corner polygon? Unfortunatelly Convert SOP can create non-proportional circle...

This is my solution for circle:

circle.hip

##### Share on other sites

This is my solution for circle:

I thought about something similar, only I would find the farthest point of your 4-corner figure from center of the circle to set this circle radius. This way I would get your figure perfectly included in a circle and only thing that's left would be to correct positions of its 3 points by using 90 degrees angles, starting from the point that was picked as a circle radius.

##### Share on other sites

I thought about something similar, only I would find the farthest point of your 4-corner figure from center of the circle to set this circle radius. This way I would get your figure perfectly included in a circle and only thing that's left would be to correct positions of its 3 points by using 90 degrees angles, starting from the point that was picked as a circle radius.

I don`t need square any more. But any way thanx!!!

SOLVED

Edited by Alexey Vanzhula
##### Share on other sites

I thought about something similar, only I would find the farthest point of your 4-corner figure from center of the circle to set this circle radius. This way I would get your figure perfectly included in a circle and only thing that's left would be to correct positions of its 3 points by using 90 degrees angles, starting from the point that was picked as a circle radius.

I still would like to see your solution in the form of a scene. It is very interesting

##### Share on other sites

I still would like to see your solution in the form of a scene. It is very interesting

It's all in the picture.

You have circle in a middle of your shape, oriented correctly. If you get the farthest point, to get radius, then you have one point exactly on the circle. To correct position of next point you need to move PI/2 from first point position to get next correct position on the circle. Once you have second point you need to move from it again PI/2 and so on, till you fix all points.

Or you could set third point position by negating first point position thru center of a circle. So now you would get two opposite points and all you would need to do to get last two correct positions is rotate those two you have by PI/2 and correct last two points.

Are you doing Perfect Circle tool?

##### Share on other sites

Are you doing Perfect Circle tool?

Yes . It almost finished.

##### Share on other sites

Are you doing Perfect Circle tool?

##### Share on other sites

When selecting polygon island I think that it would make more sense to convert inside of the island to circle with user defined divisions rather than deforming in some way all other polygons. At least that's how I understand purpose of this tool.

##### Share on other sites

When selecting polygon island I think that it would make more sense to convert inside of the island to circle with user defined divisions rather than deforming in some way all other polygons. At least that's how I understand purpose of this tool.

Override divisions already in my TODO list

At least I dont want to correct rotation manually like in Mode. Just "Fix Rotation" checkbox in some cases. I think this tool more accurate. Also it will be controled via Qt events in the viewport to speedup some things...

Edited by Alexey Vanzhula
##### Share on other sites

Fix Rotation? Not always you will have regular geometry around, so I think that i would add possibility to select look at point, so the circle would always start pointing at some direction and on top of it add user defined rotation offset.

...  Also it will be controled via Qt events in the viewport to speedup some things...

QT Events to speedup things? What for example?

Edited by fântastîque Mântragorîè
##### Share on other sites

This is very subjective

'Fix Rotation' will need for some irregular selections. What is faster? Select destination point or toggle checkbox to automatically rotate shape a bit...  I have to think!

## 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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×
×