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

Polygon clipping: d3.geoPolyhedral() now uses d3-geo-polygon if the plugin is available #132

Closed
wants to merge 7 commits into from

Conversation

Fil
Copy link
Member

@Fil Fil commented Feb 20, 2018

(clean-up of PR #130)

Note that d3-geo-polygon is still unstable. When we stream points that belong to the clipping polygon itself, it sometimes bleeds out -- for example on the Waterman projection with a default aspect -- rotate [0,0]).

I have been as conservative as possible: d3-geo-projection works as usual without d3-geo-polygon, and checks that it has projection.preclip (d3-geo > 1.8.1).

Examples and issues at [d3-geo-polygon](https://github.com/d3/d3-geo-polygon)

Solves #129
Solves #124
Solves d3/d3-geo#108
Solves #86
… would not interesect the polygon and its visibility would be inverted)
…images that are slightly (but not visibly) different
@mbostock
Copy link
Member

I am on vacation this week but I am excited you made a breakthrough here!

@Fil
Copy link
Member Author

Fil commented Feb 22, 2018

A new issue comes up with this approach: now we're not cutting, but clipping, which means a small (epsilon-wide) band is removed from the sphere.

We are no longer in a full-world projection: by way of consequence, if we path() a point that is exactly on that band, e.g. [0,0] on the polyhedralWaterman, it is not drawn any more. (It doesn't change much anything else.)

A solution for this could be to add an option in d3-geo-polygon to remove the test on pointVisible for stream.point, and use that option from d3.geoPolyhedral().

See d3/d3-geo-polygon#4

@Fil Fil mentioned this pull request Feb 22, 2018
Fil added a commit to d3/d3-geo-polygon that referenced this pull request Mar 4, 2018
…alButterfly, geoPolyhedralCollignon and geoPolyhedralWaterman, with minimal code duplication.

With this version, d3/d3-geo-projection#132 is not needed anymore.

(If you need to use both d3-geo-projection and d3-geo-polygon, they should be included in that order.)
Fil added a commit to d3/d3-geo-polygon that referenced this pull request Mar 4, 2018
…alButterfly, geoPolyhedralCollignon and geoPolyhedralWaterman, with minimal code duplication.

With this version, d3/d3-geo-projection#132 is not needed anymore.

(If you need to use both d3-geo-projection and d3-geo-polygon, they should be included in that order.)
@Fil
Copy link
Member Author

Fil commented Mar 4, 2018

This is not necessary anymore to use d3-geo-polygon: beginning with v1.2.0, d3-geo-polygon includes its own versions of d3-geo-projection's four polyhedral symbols.

@Fil Fil closed this Mar 4, 2018
@Fil Fil deleted the polygon-clipping-2 branch March 4, 2018 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants