Skip to content

Carpet plots #1179

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

Closed
etpinard opened this issue Nov 21, 2016 · 2 comments
Closed

Carpet plots #1179

etpinard opened this issue Nov 21, 2016 · 2 comments
Labels
feature something new

Comments

@etpinard
Copy link
Contributor

image

References:

@etpinard etpinard added the feature something new label Nov 21, 2016
@rreusser
Copy link
Contributor

rreusser commented Nov 24, 2016

One challenge for this plot: contour lines. We need hash lines along a contour line in order to represent inequalities, which means we need to be able to construct continuous contour lines. simplicial-complex-contour, unless I'm wrong, needs triangle geometry in 2D and returns contour segments in cell order rather than as continuous lines.

Imagine a quad a-b-d-c which we need to split into triangles in order to get contours.

c ------- d
|  \      |
|    \    |
|      \  |
a ------- b

The first choice is a-b-c and b-d-c. When there's high frequency detail, this doesn't do so well:

screen shot 2016-11-24 at 15 44 52

a-d-c and a-b-d obviously gives similar results:

screen shot 2016-11-24 at 15 44 40

A switching function that minimizes the angle between the normals (imagining the data projecting into the third dimension) is better but not great:

screen shot 2016-11-24 at 15 45 39

Okay, so next I tried splitting it into four triangles by taking the centroid of the coordinates and data.

c ------- d
| \     / |
|    O    |
| /     \ |
a ------- b

screen shot 2016-11-24 at 15 43 34

This basically just adds a lot more noise to the contours since it's all based on linear interpolation. It does get the topology pretty good though. So at @alexcjohnson's suggestion, I filtered out the center points after using them to construct the geometry. Yay. This seems to work well:

screen shot 2016-11-24 at 15 43 53

Nothing will get it perfect when there's heavy aliasing, but this is at least way better. The code can hopefully be extracted, cleaned up just a bit (not worth heavy cleanup since 250 x 250 grids take about 300ms to construct pretty complicated contours), and used in the svg version. 😄

Current prototype at: https://rreusser.github.io/demos/carpet/

@etpinard
Copy link
Contributor Author

done in #1595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

2 participants