mapbox / mapbox/martini

Simplifying non-square meshes

Open
#14 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
658
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Great library @mourner. I've been adapting this to simplify non-square meshes, by buffering the east and southern edges with filler values. This forms a bigger square, whatever the next larger `2^n +1` integer may be (a 225x500 mesh becomes 513x513).

To keep the algorithm from simplifying away vertices on the real edge, I fill the placeholder values with a constant, extremely low/high elevation, and then trim them away:

Screen Shot 2020-08-24 at 7 59 47 PM

Two questions:

- is this worth adding into core functionality? I'm curious if we can further optimize by skipping simplification on values that are known to be placeholders.

- this strategy forms an interesting bandana pattern, where the eastern and southern edges keep a really fine detail (probably finer than necessary) where they were trimmed away. The savings might be minimal, but can we simplify those edges further?

Screen Shot 2020-08-24 at 7 51 00 PM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test entry point is named. Start by reviewing the mesh simplification algorithm and how square mesh dimensions are handled, then assess placeholder-aware simplification and treatment of the trimmed eastern and southern edges. Done means a decided core approach with coverage for non-square meshes and acceptable edge detail.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.