robbievanleeuwen / section-properties

Analysis of an arbitrary cross-section in python using the finite element method.
https://sectionproperties.rtfd.io
MIT License
426 stars 93 forks source link

Proposed fix for non-recognized holes #297

Closed connorferster closed 1 year ago

connorferster commented 1 year ago

When the geometries resulting from an operation result in a MultiPolygon that only touch at points, a hole is not recognized in shapely but it is "recognized" by humans. To fix this problem, the hole needs to be recognized by shapely as part of a Polygon. One solution to fix this would be to buffer the geometry by a very small amount to force this switch from MultiPolygon to Polygon.

connorferster commented 1 year ago

Hmm...maybe I should put the scale constant outside of the function then? As per PEP8, constants should be all caps. I will try moving it to the module level (which I prefer not to do because then it will be visible during the module imports) to see if that makes flake8 happy.

robbievanleeuwen commented 1 year ago

Thanks @connorferster that should probably work - note N806 is "variable in function should be lowercase"

PEP8 says "Constants are usually defined on a module level", I guess that's what is making the linter upset.