WorldEdit

WorldEdit

43M Downloads

Allow trimming a cuboid selection based on a given predicate

haykam821 opened this issue ยท 3 comments

commented

Is your feature request related to a problem? Please describe.

Currently, the manipulation of selections based on their contents is quite limited. It is hard to use the wand tool or get the manual coordinates of a built structure to select only that structure, without extraneous air around the selection.

Describe the solution you'd like

Given a cuboid selection, a new command should be added (//trim <mask>) to trim that selection. The selection's bounds would change to the minimum and maximum positions that match that mask.

Describe alternatives you've considered

One alternative that defeats the point is manually changing the selection.

commented

not sure what you mean...you want to contract the selection such that all blocks match the mask? or just the min/max points would match? unless you have a house that's an actual cube, you'd end up cutting off parts of your structure when trying to use this. not sure that the mask works very well there. i think the idea of "contract the selection to some structure" is a lot more complex than you may think, and would begin with defining structure.

commented

I'm pretty sure the request here is to add something like "crop to content", but with a selection and a mask. Not sure if it could be applied in the general well, maybe only with cuboid selections. It would essentially result in the bounding box of all points matching the mask, sort of like clicking with //sel extend on each block that matches.

commented

For example, the following would be a cuboid selection denoted by red wool before any trimming:

Original selection

After //trim !#air:

Non-air trimmed selection

After //trim spruce_stairs:

Spruce stairs trimmed selection