public override Task Rebuild()
        {
            this.DebugDepth("Rebuild");

            var rebuildLocks = this.RebuilLockAll();

            return(ApplicationController.Instance.Tasks.Execute(
                       "Pinch".Localize(),
                       null,
                       (reporter, cancellationToken) =>
            {
                SourceContainer.Visible = true;
                RemoveAllButSource();

                // remember the current matrix then clear it so the parts will rotate at the original wrapped position
                var currentMatrix = Matrix;
                Matrix = Matrix4X4.Identity;

                var aabb = SourceContainer.GetAxisAlignedBoundingBox();

                bool valuesChanged = false;

                PinchPercent = agg_basics.Clamp(PinchPercent, 0, 3, ref valuesChanged);

                foreach (var sourceItem in SourceContainer.VisibleMeshes())
                {
                    var originalMesh = sourceItem.Mesh;
                    var transformedMesh = originalMesh.Copy(CancellationToken.None);
                    var itemMatrix = sourceItem.WorldMatrix(SourceContainer);
                    var invItemMatrix = itemMatrix.Inverted;

                    for (int i = 0; i < originalMesh.Vertices.Count; i++)
                    {
                        var pos = originalMesh.Vertices[i];
                        pos = pos.Transform(itemMatrix);

                        var ratioToApply = PinchPercent / 100.0;

                        var distFromCenter = pos.X - aabb.Center.X;
                        var distanceToPinch = distFromCenter * (1 - ratioToApply);
                        var delta = (aabb.Center.X + distFromCenter * ratioToApply) - pos.X;

                        // find out how much to pinch based on y position
                        var amountOfRatio = (pos.Y - aabb.MinXYZ.Y) / aabb.YSize;

                        var newPos = new Vector3Float(pos.X + delta * amountOfRatio, pos.Y, pos.Z);

                        transformedMesh.Vertices[i] = newPos.Transform(invItemMatrix);
                    }

                    transformedMesh.CalculateNormals();

                    var newMesh = new Object3D()
                    {
                        Mesh = transformedMesh
                    };
                    newMesh.CopyWorldProperties(sourceItem, this, Object3DPropertyFlags.All, false);
                    this.Children.Add(newMesh);
                }

                // set the matrix back
                Matrix = currentMatrix;
                SourceContainer.Visible = false;
                rebuildLocks.Dispose();

                if (valuesChanged)
                {
                    Invalidate(InvalidateType.DisplayValues);
                }

                Invalidate(InvalidateType.Children);
                return Task.CompletedTask;
            }));
        }