lwpolyline is_simple #1091
toporivskiy
started this conversation in
Ideas
Replies: 1 comment
-
import shapely
import ezdxf.path
doc = ezdxf.new()
msp = doc.modelspace()
polyline = msp.add_lwpolyline([(0, 0), (10, 0), (10, 5), (5, 5), (5, -5)])
path = ezdxf.path.make_path(polyline) # convert to a Path
vertices = path.flattening(0.01) # because a polyline could contain bulges (cirular arcs)
is_simple = shapely.is_simple(shapely.LineString(vertices))
print(f"Is this polyline simple: {is_simple}") # answer: no, it's not |
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
-
Good day!
How do you like the idea of adding a property to a polyline if it doesn't have its own intersection or self-touch?
Analogue: https://shapely.readthedocs.io/en/stable/reference/shapely.is_simple.html
Beta Was this translation helpful? Give feedback.
All reactions