Polygons to circles

Polygons to circles

janis-krums
Explorer Explorer
3,140 Views
5 Replies
Message 1 of 6

Polygons to circles

janis-krums
Explorer
Explorer

Hi, 

 

I got dxf files from client. Files created in Sketchup. All circles are polygons. Is there any way how to convert polygons to circles in Fusion 360?

 

I know that in Autocad have a script for it. Maybe some of you have experience. 

 

Thank you in advance!

 

Janis

0 Likes
Accepted solutions (2)
3,141 Views
5 Replies
Replies (5)
Message 2 of 6

BrianEkins
Mentor
Mentor

There isn't any built-in functionality to Fusion to help with this but it should be possible to write a script to do it. If the polygons are full circles, it should be fairly easy.  The main thing needed is to know how the polygon represents the circle.  For example, does the polygon fit within the original circle, or is it outside the circle, or something else.  It's still possible but gets trickier if the polygons represent connected arcs and lines.  Determining where an arc or line ends and the next one starts takes some more logic.

It will probably be best if you can post an example file here and how the polygon represents the circle so we can all see what data you have and see how you might best create the desired geometry.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 6

janis-krums
Explorer
Explorer

Hi,

 

Thank you for reply. File example in attachment.

0 Likes
Message 4 of 6

kandennti
Mentor
Mentor
Accepted solution

Hi @janis-krums .

 

It looked like fun, so I gave it a try.
Let me tell you beforehand that the processing speed is very slow.

 

I decided to make it a circumscribed circle for the polygon.
Find a polygon in the specified sketch that can be determined to be a hole, change the polygon to construction, and add a circle.

1.png

The script I created is too long, so I have attached it.

 

Here is the result of trying the DXF file I attached.

type4.png

Due to the low performance of my PC, it could be processed in less time.

・・・However, needing about 20 minutes to draw 128 circles is too slow.

 

As an excuse, the progress dialog appears twice.
The first time it is looking for a polygon that can be converted, and the second time it is drawing a circle.
I feel that the cause of the slow processing speed is probably the access to the sketch entity.

Message 5 of 6

kandennti
Mentor
Mentor
Accepted solution

Improved the processing speed and published it here.

Fusion360 Polygons To Circles 

 

Here are the main changes.

・Changed to add-in
・Improvement of processing speed
・Circle fitting by least-squares method
・Support for Japanese

0 Likes
Message 6 of 6

janis-krums
Explorer
Explorer

Thank you for help. It really helped solve the problem.  

0 Likes