Fix "linear_sweep(..., texture=..., scale=..., twist=...)".

The commit 'Fix "linear_sweep(..., texture=..., scale=...)" was not
enough.  This one fixes linear_sweep(..., texture=...) when scale
and/or twist parameters are specified.

Code to reproduce the fixed issue:

  linear_sweep(ellipse(d = [5, 10]), 5, twist = 45, texture = "bricks", scale = 0.5);
This commit is contained in:
Cedric Vincent 2023-02-24 20:54:11 +01:00
parent d700884482
commit d9f118e44f

View file

@ -3489,8 +3489,8 @@ function _textured_linear_sweep(
if (i != counts.y || ti == 0)
let(
v = (i + (ti/texcnt.y)) / counts.y,
sc = lerp(scale, [1,1,1], v),
mat = down((v-0.5)*h) *
sc = lerp([1, 1, 1], scale, v),
mat = up((v-0.5)*h) *
scale(sc) *
zrot(twist*v)
) apply(mat, tile_rows[ti])