aegis1980 / cad-to-shapely

convert a dxg CAD file (using ezdxf) to shapely geometry
MIT License
16 stars 6 forks source link

AutoCAD circle shapes not recognized #6

Open EngDM opened 2 years ago

EngDM commented 2 years ago

Hey @aegis1980, I thought I'd move the discussion over here from sectionproperties.

It would be very useful to be able to use the circle drawing tool and have cad to shapely recognize that as a line. Possible structural engineering applications are round bar reinforcing and drawing other concrete beams with different internal sections.

I'm not sure how easy this would be to implement but it sure would be beneficial.

aegis1980 commented 2 years ago

@EngDM I added CIRCLE to dev branch. Seems to work ok with your weird 2 circles and top hat file,

I haven't merged onto master (yet) - will do at some point, This automagically kicks it up to pypi. Until I do that, you can pip from git dev branch:

pip install git+https://github.com/aegis1980/cad-to-shapely.git@dev

Something like that anyway, from memory!
Tell me if it works okay (the CIRCLE) .... Google the pip'ing from git repo branch if above doesn't wk.

And if your next request is for an ellipse, you'll have to do it!!! ;)

EngDM commented 2 years ago

@EngDM I added CIRCLE to dev branch. Seems to work ok with your weird 2 circles and top hat file,

I haven't merged onto master (yet) - will do at some point, This automagically kicks it up to pypi. Until I do that, you can pip from git dev branch:

pip install git+https://github.com/aegis1980/cad-to-shapely.git@dev

Something like that anyway, from memory! Tell me if it works okay (the CIRCLE) .... Google the pip'ing from git repo branch if above doesn't wk.

And if your next request is for an ellipse, you'll have to do it!!! ;)

Hey! Just got around to checking it. It's returning an error "A LinearRing must have at least 3 coordinate tuples" when I draw it as two arcs, and then the following as a circle:

WARNING:root:Importing of DXF type <class 'ezdxf.entities.circle.Circle'> is not implemented yet.
WARNING:root:Raise issue at https://github.com/aegis1980/cad-to-shapely/issues
ERROR:root:Unable to from any closed polygons.
aegis1980 commented 2 years ago

You sure you are using dev-branch version? Is it the same file as b4? image

EngDM commented 2 years ago

I believe I am, I did the update as you described and received no errors, it appeared to update. But it still gave the error.

aegis1980 commented 2 years ago

Hum. Is it the same file?