Skip to content

Instantly share code, notes, and snippets.

@mdsumner
Last active August 9, 2025 00:43
Show Gist options
  • Save mdsumner/9f533957df71ec187bd555837439348e to your computer and use it in GitHub Desktop.
Save mdsumner/9f533957df71ec187bd555837439348e to your computer and use it in GitHub Desktop.

In this thread it's actually not well defined, essentially if a vertex is used twice it shouldn't be in the output. (But should we normalize on edge or vertex, or full shared boundaries?). Should islands stay in the set? (I don't think so)

With silicate, simplest case is

library(silicate)
sc <- SC(polygon)
library(dplyr)
sc$object_link_edge <- sc$object_link_edge |> 
  group_by(edge_) |> 
  filter(n() > 1)
plot(sc)

But, we lost the integrity of the mesh and need to chase down the relations that need to be dropped. This is something I'm long term interested in. sf polygons are awful, as is the SF standard - we can analyse them to get the topology and be explicit about it, but we're really not closer to having good tools for this.

We can use the wk/geos tools to identify topology of points, but it's not that exciting without being able to trace the actual edge elements of a shape. rgeos always mixed up precision with this too, again that needs to be separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment