LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot Rotated Rectangle/ROI in a XY graph?

Solved!
Go to solution

Well, thank you for your help, but I don't manage to make it work.

 

I'm so surpised that no one had that problem before me. If anyone has a solution, I'm listening 🙂

 

Thanks,

Sébastien

0 Kudos
Message 11 of 28
(2,143 Views)

Hello Sébastien,

 

Where are you stuck at this moment?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 12 of 28
(2,135 Views)

Hi,

 

I'm still blocked at the same place.

I've got 4 points while drawing a ROI (Top, Left, Bottom, Right) and 1 other point which is the rotation of my rectangle and I'm not able to draw that rectangle in a XY graph.

 

Thanks,

Sébastien

0 Kudos
Message 13 of 28
(2,133 Views)

Here's the simplest way I can think of to show how to rotate one point around another. Feed the center of your rectangle and the four corners into the code and you will get where the new corners should be.


___________________
Try to take over the world!
Message 14 of 28
(2,124 Views)

Other things you have to keep in mind:


1) To show a rectangle (with Point 1= left top, Point 2= right top, Point 3= right bottom, Point 4= left bottom)

You have to Plot the whole rectangle around for an XY graph.

With this I mean (that when you're plotting point by point) you have to plot Point 1, Point 2, Point 3, Point 4 and again Point 1.

The last one is needed to close the rectangle.

 

2) To rotate the rectangle you have to define a "center point" of the non-rotated rectangle and you'll have to rotate around this.

When you have the "center point",  then you can just use tst's code to rotate your 4 individual Points around that "center point".

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 15 of 28
(2,113 Views)

Hi,

 

Thank you both of your for your answers.

 

I'm currently trying what you said.

 

Just to be sure, in tst's example, point 2 is the center like for my rectangle?

 

Thank you,

Sébastien

 

PS : I'll post later to confirm if yes or not I succeed to do it.

0 Kudos
Message 16 of 28
(2,103 Views)

@Zepiii wrote:

 

Just to be sure, in tst's example, point 2 is the center like for my rectangle?


P2 rotates around P1, so P1 is the center and P2 would be the corner.


___________________
Try to take over the world!
Message 17 of 28
(2,100 Views)
Solution
Accepted by topic author Zepiii

Youhouw !

 

I've finally managed to do it.

 

However, I have a stupid question, but I'm blocked on this.

 

I was able to extract the diagonal with the tst's method, plot on a XY Graph which is PINK.

 

But I wanted the countour, so I extracted the XY and little bit earlier in the step of tst's method. I managed to do it and plot them in a XY graph which is BROWN.

 

However, the movement of flies is recorded and I'm ploting it a XY graph which is a PINK and I'm not able to melt my BROWN one (which are the countours and which is the part that interest me).

 

So how to melt a PINK XY Graph with a BROWN XY Graph?

 

Btw, I attached my VI. This might be useful for anyone else !

 

Can just check on the right side, the both XY graph are there and I really don't understand how to make them shown on the same one.

 

Maybe this make it more clear :

 

RectangleInfos.png

 

Thank you,

Regards,

 

Sébastien

 

@ThiCop : Thank you too, you also gave me precious help

0 Kudos
Message 18 of 28
(2,095 Views)

I didn't look at the actual code, but generally brown clusters are made up of numeric values and pink ones are made of elements with variable sized (probably arrays in your case). You can see the exact data type of each wire if you hover over it with the context help window open.

 

It's important to understand which data types you have and what each one represents. Once you understand that, you will be able to merge them together meaningfully.


___________________
Try to take over the world!
Message 19 of 28
(2,089 Views)

Hi,

 

Thank you for your answer.

 

To be honest, I'm quite lost in those cluster and array differences. I managed to change that "brown" to "pink" color with the For Loop that you used, but now the points XY graph aren't joined 😄 ?

I also screenshoted the help content from the brown wire.

 

RectangleNotRelied.png

I changed some settings, but it doesn't work. Any quick idea?

 

Thank you,

Sébastien

0 Kudos
Message 20 of 28
(2,087 Views)