Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deforming region support #5

Open
rjksmith opened this issue Dec 17, 2020 · 2 comments
Open

Deforming region support #5

rjksmith opened this issue Dec 17, 2020 · 2 comments
Assignees
Labels
use case Use case or example

Comments

@rjksmith
Copy link
Member

A deforming region is one whose boundary includes vertices that change location over time relative to each other. An oil slick is a real world example of this.

Such features can be represented using WebVMT with the interpolation enhancement proposed at TPAC 2020. As a simple example:

WEBVMT

NOTE Start with isosceles triangle at t = 1
     Deform to right-angled triangle at t = 5
     First two points remain static, third point changes

00:00:01.000 —> 00:00:05.000
{"polygon": {"points": [
  {"lat": 50.0, "lng": 0.1},
  {"lat": 50.0, "lng": 0.5},
  {"lat": 50.4, "lng": 0.3}
]}}
{"interp": {"to": {"points": [
  {"lat": 50.0, "lng": 0.1},
  {"lat": 50.0, "lng": 0.5},
  {"lat": 50.4, "lng": 0.1}
]}}}

cc @mahmsakr

@rjksmith rjksmith added the use case Use case or example label Dec 17, 2020
@rjksmith rjksmith self-assigned this Dec 17, 2020
@mahmsakr
Copy link

This solves a special case of deforming regions, where it is guaranteed that the number and the ordering of the region vertices remains the same across snapshots.
A "general" deforming region would change location, shape, number of vertices, and even number of faces and holes. For example an oil spill may be decomposed into multiple smaller spills.

@rjksmith
Copy link
Member Author

I agree - the number and order of vertices must be the same. However, this special case can be generalised as follows.

Generalised Deforming Region Without Holes

Consider two consecutive observations of a deforming region at times A and B. For simplicity, assume there are no holes, though this method can be extended to include them too.

  1. To deform the region smoothly, a one-to-one mapping must be created between the vertices at time A and those at time B.
  2. By definition, vertices are ordered consecutively around each region's perimeter.
  3. In the special case where both observations have an equal number of vertices, the same start vertex can be chosen at times A and B without loss of generalisation. Hence, the vertices are in the same order and can be successfully deformed by interpolation.
  4. If the observations have different numbers of vertices, the best one-to-one mapping can be chosen from a subset and then extra 'redundant' vertices, i.e. concurrent with the face between two vertices, can be inserted so both observations have an equal number of vertices and proceed as above.
WEBVMT

NOTE Start with isosceles triangle at t = 1
     Deform to square at t = 5
     Include redundant second point at t = 1 for deforming region
     First & third points change, second & fourth remain static

00:00:01.000 —> 00:00:05.000
{"polygon": {"points": [
  {"lat": 50.0, "lng": 0.1},
  {"lat": 50.0, "lng": 0.3},
  {"lat": 50.0, "lng": 0.5},
  {"lat": 50.4, "lng": 0.3}
]}}
{"interp": {"to": {"points": [
  {"lat": 50.2, "lng": 0.1},
  {"lat": 50.0, "lng": 0.3},
  {"lat": 50.2, "lng": 0.5},
  {"lat": 50.4, "lng": 0.3}
]}}}

Generalised Deforming Region With Holes

WebVMT does not currently support holes in regions, but this feature would be simple to add and could support deforming regions using a similar method to that above. In this case, both regions must have the same number of holes though 'redundant' holes, i.e. a hole where all vertices are concurrent, could be inserted to support events when existing holes close or new holes open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
use case Use case or example
Projects
None yet
Development

No branches or pull requests

2 participants