WIP / POC: Parameterized voxelizer - #199
Draft
pyrollo wants to merge 5 commits into
Draft
Conversation
[Maven Build Status]📑 Commit: 📦 Download artifact: Generator.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A POC for parameterized voxelizers
Idea
The (already discussed) idea is to merge multiple variants of a same task only differing by the way they voxelize models.
For example,
renderSurfaces,renderLines,renderLines2d,renderPointsandrenderPoints2dall does the same work: place something at a position resulting from a voxelizer. They all could be replaces by aplacetask with a voxelizer parameter (along with model selection and placeable parameters).Status
This is a working example, with a lot of work still to be done. But the example works.
All existing voxelizers are usable:
Two more have been added:
Reason
Because that's soo coool!
TODOS
1 - Have (sort of) scoped values
This is a bit out of scope but I already simplified some methods by adding a temporary
Generation.current()that avoids to pass generation from class to class.Code would be much simplified if usage of a scoped/global/static sort of variable (like
current()method) could be generalized, not only in that PR but also:create()methods;create()methods;voxelize()method, by intrinsically filter out voxels outside current tile;2 - Improve parameters syntax
Temporary POC syntax is:
This places 2d buildings surfaces on ground heightmaps.
We may have something more concise like;
3 - Model values
Voxelizers could use model values as parameter (for example, for line thickness).
4 - World Model
If we had a built-in "world" model that covers the entire world, we could also get rid of
renderHeightmaptask and replace it by aplacetask on that world model.This would work only if
voxelize()method gives results limited to current tile (or it would return way too many results).Self-checks
/docsfolder has been updatedexamples/work the same (or have been adapted if subject to changes in this PR)