# Whats the best way to draw paths for "unknown" amount of objects?

**URL:** <https://forum.inductiveautomation.com/t/whats-the-best-way-to-draw-paths-for-unknown-amount-of-objects/34365>\
**Category:** General Discussion\
**Created:** [May 2, 2020, 12:33am UTC](https://forum.inductiveautomation.com/t/whats-the-best-way-to-draw-paths-for-unknown-amount-of-objects/34365 "2020-05-02T00:33:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.berglund](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@michael.berglund](https://forum.inductiveautomation.com/u/michael.berglund)\
**Post date:** [May 2, 2020, 12:33am UTC](https://forum.inductiveautomation.com/t/whats-the-best-way-to-draw-paths-for-unknown-amount-of-objects/34365/1 "2020-05-02T00:33:25Z")

</div>

Hi all experts,

I am currently working on a project where i need to visualize the position and size of a bunch of (almost) rectangular-shaped objects that are automatically detected by a thermal camera.

The amount are somewhere between 0-25 objects and i’m recieving following tagvalues for each one:

Object#  
x1 = int ◄─ top left X pos  
y1 = int ◄─ top left Y pos  
x2 = int ◄─ top right X pos  
y2 = int ◄─ top right Y pos  
x3 = int ◄─ btm right X pos  
y3 = int ◄─ btm right Y pos  
x4 = int ◄─ btm left X pos  
y4 = int ◄─ btm left Y pos  
tempMax = int ◄─ maximum temperature  
tempMin = int ◄─ minimum temperature  
tempAvg = int ◄─ average temperature  
isSame = int ◄─ This automagically checks if the object has been moved or if it is a new one

Object mockup

x1-y1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x2-y2  
┌───────────────────────────────────┐  
│ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .│  
│. . . . .tempMin . . . . . . . .tempAvg. . . . . . . . tempMax . . .│  
│ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .│  
└───────────────────────────────────┘  
x4-y4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x3-y3

What’s the best way to achieve a page that dynamically shows these objects in Ignition?  
I would really appreciate if someone had the time to point me in the right direction or even better,  
maybe create something that i can try to continue to work with?  
(Vision or Perspective does not matter at this moment)

Best regards

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 2, 2020, 12:49am UTC](https://forum.inductiveautomation.com/t/whats-the-best-way-to-draw-paths-for-unknown-amount-of-objects/34365/2 "2020-05-02T00:49:54Z")

</div>

When all else fails, get out the Paintable Canvas (Vision). I’d supply the twenty-five-ish entries as a dataset on a custom property. Though a generated SVG for Perspective could be delivered by the WebDev module. (I’m not comfortable enough with SVGs to do the latter just yet, unless I had to.)

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 2, 2020, 4:12am UTC](https://forum.inductiveautomation.com/t/whats-the-best-way-to-draw-paths-for-unknown-amount-of-objects/34365/3 "2020-05-02T04:12:22Z")

</div>

This would be quite easy to do with the paintable canvass as @pturmel notes. Here's my first experiment with it--not perfect, but gives a quick example of how to draw from coordinates like this, as well as scaling after drawing from coordinates to make everything fit into whatever space you give it.

> [@Animate Fill Level On Irregular Shaped Component](http://forum.inductiveautomation.com/t/animate-fill-level-on-irregular-shaped-component/15740/4):
>
> Thanks for pointing out the paintable canvas for this, @pturmel. Using it to draw a shape and then fill to a certain level is easy using the clip method. Definitely beats my previous method of creating shapes to fill the area and dynamically calculating their size and position to make it all work! Below is a basic example, in case it’s helpful to others. It expects the paintable canvas to have a custom property fillPercent used to set the fill level 0-100%: from java.awt import Color from java…
