Carpet

Carpet

2M Downloads

[Scarpet suggestion] Corner-to-corner and corner-to-directional-offest versions of rect()

TheCatSaber opened this issue ยท 3 comments

commented

Currently rect() creates an iterator over corner-to-offest-in-all-directions.
Corner-to-corner would create an iterator over between the two corners (like vanilla fill command, just an iterator).
Corner-to-directional-offest would create an iterator from one corner to corner+directional-offest for each of the dimensions.

These would reduce head hurting when trying to test over an area where you know the corners. (See my problem here on SciCraft Discord)

commented

And just as the good people in the carpet mod chat, I would advise you to look into the volume() function, @TheCatSaber

commented

yes, volume is a loop that does corner to corner and you don't need to worry which corners you specify. scan is a loop center oriented/offset.
rect is like scan but an iterator. There is no iterator for volume, but you can have a function that converts it and return it since iterators can be passed along by value, unlike loops.

I get that - the naming (volume, scan, rect) is kinda random. Didn't come up with better names back in the days.