Perspective Equivalent Vision Level Indicator?

It should be possible with SVG. If you import a rect, you should be able to bind the position and size to custom properties with formulas.

If you want to use a custom shape, you’ll probably have to calculate the path dynamically, which would require you to know how paths work (see the tutorial on MDN as example: Paths - SVG: Scalable Vector Graphics | MDN)

EDIT: to write it out completely

  • Create an SVG (just a text file with the *.svg suffix) with the following contents. This SVG has a 100x100 viewbox, and defines a 60x100 rect in it.
<?xml version="1.0" encoding="UTF-8"?>
<svg
   xmlns="http://www.w3.org/2000/svg"
   version="1.1"
   viewBox="0 0 100 100">
<rect
   y="40"
   x="0"
   height="60"
   width="100"
   id="fillRect" />
</svg>
  • Import the SVG (drag the file into the designer) as “Embedded image”
  • Drill down into the SVG properties, and bind the y attribute to “100 - fill percentage”, and the height to “fill percentage”
    afbeelding
  • You can alter the “PreserveAspectRatio”, or alter the width directly to get it to match your drawing

When creating such an SVG, it’s probably good to start with a drawing program (like inkscape or illustrator), and clean up the resulting SVG (a drawing program will ofen introduce unneccesary features like layers, namespaces, …).

Ultimately, you can also bundle the outline and the fill in one SVG object.

3 Likes