Skip to content

LPE Perspective / Envelope produces incorrect output

Summary:

LPE Perspective / Envelope is mathematically flawed and produces incorrect output.

For instance: For bezier curves, only the control points are transformed. However, a perspective transformation is not linear and thus, this is not enough for a correct transformation. In some cases, there is a huge difference between the correct output and the current one. A check is required if the bezier segments need to be splitted into several subsegments for correct output.

Steps to reproduce:

Sample File: InkscapePerspectiveBug.svg

  • Open the attached file. It contains one cubic bezier curve with a perspective transformation
  • Split the bezier curve into two subsegments and observe how the transformed bezier curve changes

What happened?

  • The transformed bezier curve changes a lot

Animation:

Bildschirmaufzeichnung_vom_2024-06-10_23-47-05

With one bezier segment:

grafik

After splitting with two bezier segments:

grafik

What should have happened?

  • The transformed bezier curve should stay the same. Actually, it should already have been similar to how it was after the splitting.

Version info

Inkscape 1.4-dev (1:1.4.0-dev+202403210151+2fe0648968)

                      Compile  (Run)
    GLib version:     2.79.2
    GTK version:      3.24.40 (3.24.41)
    glibmm version:   2.66.6
    gtkmm version:    3.24.8
    libxml2 version:  2.9.14
    libxslt version:  1.1.35
    Cairo version:    1.18.0 (1.18.0)
    Pango version:    1.51.0 (1.52.1)
    HarfBuzz version: 8.3.0 (8.3.0)

    OS version:       Ubuntu 24.04 LTS

Edited by Hendrik Roehm
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information