Questions

  • What are meshes and topology?
  • Relationship of meshes to raster/vector data?

What is a mesh?

Key ideas!

  • Topology: the shape of things and their relationships.
  • Geometry: the where of things.
  • Indexing: the link between topology and geometry.









(indexing of data-structures, not database-indexing)

Topology is not geometry

Topology emerges as an index into geometry.

## this is pure 3-space geometry, no connections
(geometry <- cbind(x = c(0, 0.5, 1), y = c(0, 0.5, 1), z = c(0, 0, 0.8)))
##        x   y   z
## [1,] 0.0 0.0 0.0
## [2,] 0.5 0.5 0.0
## [3,] 1.0 1.0 0.8
# line of 2-segments has 1-dimensional topology (2-index) 
(topology1 <- cbind(.v0 = c(1, 2), .v1 = c(2, 3)))
##      .v0 .v1
## [1,]   1   2
## [2,]   2   3

Topology is not geometry

## this is pure 3-space geometry, no connections
geometry
##        x   y   z
## [1,] 0.0 0.0 0.0
## [2,] 0.5 0.5 0.0
## [3,] 1.0 1.0 0.8
# triangle has 2-dimensional topology (3-index)
(topology2 <- cbind(.v0 = 1, .v1 = 2, .v2 = 3))
##      .v0 .v1 .v2
## [1,]   1   2   3

Shared geometry

What is wrong with spatial?

Traditional spatial data tends to confuse topology and geometry.

Polygons are topologically equivalent to lines.

How to triangulate a polygon?

What is wrong with spatial?

Traditional spatial data tends to confuse topology and geometry.

Polygons are topologically equivalent to lines.

How to triangulate a polygon? (YIKES)

Raster and vector aren’t so different.

Motivations

  • Lossless raster reprojection
  • Topology fixes and neighbour classification
  • Tracks and point clouds
  • 3D and 4D visualization, immersive experiences

I want to jump the chasm from geospatial to computer graphics and VR.

What is a raster?

What is a raster?

A layer of neighbouring rectangles? A regular grid of points?

What is a polygon?

A series of grouped paths?

What’s the fill?

In 3D, need to fill our polygons properly as data.

The fill we see in traditional 2D graphics is a trick!!.

Triangles

To fill our polygon we need triangles.

A raster and vector mesh use the same concepts.

When things go wrong

st_is_valid(x[2, ]) == FALSE

R package silicate, topology in tables

## # A tibble: 6 x 2
##    .vx0  .vx1
##   <int> <int>
## 1     9    11
## 2    11    13
## 3    13    15
## 4    15    14
## 5    14    15
## 6    15     9

Live code

Thanks!