Extract polygon holes in a polygon #397
Unanswered
RasmusGrift96
asked this question in
Q&A
Replies: 1 comment
-
it's not very intuitive, but i think HATCH is the entity you are looking for. HATCH entities can have solid color in addition to patterns and support holes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm currently working on a project where I want to make a standalone program to convert images to .dxf files. I want to use these .dxf files in solid works as sketches.

The problem I'm having is if there are holes in my polygon. How can I get the .dxf to detect it is a hole instead of a new polygon.
Take for example the next image:
If I run my code, I detect the contours with their respective hierarchy (child, parent etc.) with the cv2.findContours() function. So I have that information. The next step is that i'm connecting the dots with the layout.add_line() function which results in 2 polygons (circle and a star). If I convert it to .dxf. It doesn't know the circle is actually the parent of the star and it uploads as 2 seperate polygons as below.

This is my code:
I've read something about surface, region, polyface etc in the documentation but I'm not really sure which one I should use.
Thanks in advance
R
Beta Was this translation helpful? Give feedback.
All reactions