sbrl / Minetest-WorldEditAdditions

Extra tools and commands to extend WorldEdit for Minetest
https://worldeditadditions.mooncarrot.space/
Mozilla Public License 2.0
16 stars 3 forks source link

//scale <factor_x> <factor_y> <factor_z> #26

Closed sbrl closed 3 years ago

sbrl commented 3 years ago

WorldEdit has //stretch, but it doesn't support decimal numbers. We should fix that, and implement a more intelligent version here instead.

VorTechnix commented 3 years ago

Not only that but //stretch doesn't support down scaling (shrinking).

VorTechnix commented 3 years ago

Also the syntax is awkward if you only want to scale on one axis. E.g. //stretch 1 2 1 instead of //stretch y 1. It would be really good if the //scale command could support both syntaxis.

sbrl commented 3 years ago

Oh, good idea. Let's support both syntaxes @VorTechnix. Eventually I want to implement a better //rotate too, but the logic breaks my brain lol :P

sbrl commented 3 years ago

Looks like the syntax is going to look like this:

//scale <axis> <scale_factor> | <factor_x> [<factor_y> <factor_z> [<anchor_x> <anchor_y> <anchor_z>]]

My initial quick description:

Combined scale up / down. Takes either an axis name + a scale factor (e.g. y 3 or -z 2; negative values swap the anchor point for the scale operation), or 3 scale factor values for x, y, and z respectively. In the latter mode, a set of anchors can also be specified, which indicate which size the scale operation should be anchored to.

I haven't finished it or tested anything yet, so I haven't written the full docs yet. The scaling is breaking my brain a bit - especially since I'm allowing for changing the anchor point from which the scaling is being done.

Status:

sbrl commented 3 years ago

Done and tested! It seems to be working as intended now, but it's still marked as experimental until we've tested it more thoroughly.