Extruding a polygon upwards while getting smaller without skewing to the side

Hi, I’m trying to extrude a polygon into a solid that gets smaller as the distance along its central axis increases. Imagine a christmas tree that starts with a shape at the bottom and the same shape is scaled down in size as you go up the trunk.

If I try a custom extrusion with a scaling function, the shape itself decreases in size, but it seems all vertex offsets are decreased by the same scale, resulting in a shape that skews off to the side.

If it modify the x and z values in the path, it rotates the face rather than keep the upper face parallel to the base.

Here’s a PG that illustrates what I’m seeing: Babylon.js Playground
In this example, I’m effectively trying to create a star-based pyramid.
Any advice please?

Hi, for the scaling to work properly your shape origin should be at the center of geometry. Babylon.js Playground

1 Like

Of course! Makes sense… and works!
Thanks!