Skip to content

Generate skirt vertices and triangles - #12

Open
TimGurnett wants to merge 3 commits into
mapbox:mainfrom
TimGurnett:master
Open

Generate skirt vertices and triangles#12
TimGurnett wants to merge 3 commits into
mapbox:mainfrom
TimGurnett:master

Conversation

@TimGurnett

Copy link
Copy Markdown

Added a getMeshWithSkirts function to generate skirts while populating vertices and triangles arrays.

Could modify getMesh with a skirts flag but I didn't want to affect any non-skirts retrieval performance or bloat the function

@TimGurnett
TimGurnett marked this pull request as draft May 15, 2020 04:47
@TimGurnett
TimGurnett marked this pull request as ready for review May 16, 2020 12:24
Comment thread index.js
}

getMeshWithSkirts(maxError = 0) {
const {gridSize: size, indices} = this.martini;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree in principle with reducing function bloat, and performance is very important to my use case too. I also believe it's beneficial to remove duplicate complex code and adding skits as an option to getMesh, if possible. Would you be open to combining the functions into one, together?

If you'd prefer to keep it this way, that is also fine. Are you looking for a 3rd party review? I can pull this down and test it out.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem lies in getMesh being so concise and elegant :)

When I started adding if (skirt) blocks to handle the custom code I felt like I was making a mess. Once I started changing the vertices and triangle arrays as well as the return object (and more than doubling the length of the original function) I figured it might be neater to separate - though harder to maintain because of the code duplication of the core logic. I also thought a new user would have less trouble understanding getMesh by itself than getMesh with the skirt flag. @mourner any preference?

I'm guessing that the performance loss of the if (skirt) statement inside the recursive countElements function would be negligible but would have to bench at scale to be sure.

p.s. I also don't know if the way I'm generating the skirts is sound or if there's shortcuts etc that might make all of this moot

@farfromrefug

Copy link
Copy Markdown

@chrisgervang any news on this ? would love to have skirts in deck.gl

@morandd

morandd commented Oct 5, 2021

Copy link
Copy Markdown

Maybe a repo owner can pull this in, since it seems all is ok? This is a pretty useful addition to the library.

@warflash

Copy link
Copy Markdown

Agreed, seems like a very nice addition so considering a merge would be much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants