Select to view content in your preferred language

Buffers revisited

177
0
03-25-2025 07:39 PM
Labels (1)
DanPatterson
MVP Esteemed Contributor
3 0 177

It began as a simple coding exercise, but it soon morphed into one of those "things".

Offset Buffer
     I began with the seemingly simple exercise of the offset buffer, which is created by 'offsetting' the segments of a geometry object, polygons in this case, by a finite distance. I will spare you the sheer excitement when I managed to implement an offset buffer for an axis aligned square. 

Here is a concave polygon with an offset buffer.
offset_simple.png

 

For the most part the buffer is equally spaced except for those outward pointing corners.

On to the rounded corners.  That involved arcs and angles and intersections and the math stuff that I had forgotten or long not used.  The effort was breathtaking.  I left the arc nodes to show I worked really hard. rounded_simple.png

On to the next shapes! What could go wrong. Here is another example of a more convoluted concave polygon as an offset and conventional buffer.

d1_with_np_wn_algo.pngd1_with_np_wn_rounded.png

 

 

 

 

 

 

 

 

I wonder what a really cool geometry would look like with the new buffering code?maple0.png

The journey continue smoothly there.  Producing rounded corners when the pointy bits are close together proved to a challenge, but that involves another blog and the code links.  But in the interim, something to look forward to and share with your neighbours.

maple_leaf.png

 

Tags (3)
Contributors
About the Author
Retired Geomatics Instructor (also DanPatterson_Retired). Currently working on geometry projects (various) as they relate to GIS and spatial analysis. I use NumPy, python and kin and interface with ArcGIS Pro.
Labels