How do I calculate a value between two object attributes within a range

1491
6
10-02-2014 04:17 AM
KennethLindhardt
Occasional Contributor

I will try to explain this, and hopefully it will make sense ;) 

I got a building building height left and a building height right. Since they are delivered from Lidar, those are not completely equal, but can vary with 0.3 m for a gable roof. What I would like to do is to get the color “red” if left and right minus each other has a range from -0.3 to 0.3

In Ecxel it could look like this:

=IF(AND(Left-Right>=-0.3; Left-Right <=0.3);"Yes"; "Shape") So this brings a Yes if my calculation is between -0.3 and 0.3.   

0 Kudos
6 Replies
MatthiasBuehler
Regular Contributor

Hey !

How does your data look that you are evaluating ?

Is it geometry ?

Let me know ..

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

----------------------------------

Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
KennethLindhardt
Occasional Contributor

This is attribute values on a building footprint. I got left, right, front, back, center height. If left, right front, back height is between a small range, but the center height is 2 m above, I would know that this is a roofHip. If let’s say left, right and center is between a small height range, but front and back is 2 m below, then we have a roofGable.

In that way I need to set up a rule that take all these different combinations and equal a roof type, which would be straight forward if my Lidar height left, right and so on had the exact same height, but they of course got a little variation  

0 Kudos
KennethLindhardt
Occasional Contributor

The rint function will round up and down, and will then be able to calculate the roof form. So I’m ready to move forward again. This seems a lot easier to do it like that, instead of writing it in a rule.

I started out by filed calculation in ArcMAP, whit gave me the idea, and a little searching in the help file got me going, then I can maintain my original attributes, and don’t have to get 5 more object attributes inside CityEngine

0 Kudos
KennethLindhardt
Occasional Contributor

Of course that didn’t work, since I could have a value with 2.499 that would go to 2 and 2.501 would go to 3 :(

0 Kudos
MatthiasBuehler
Regular Contributor

Hey ..

sorry for the late reply ..

well, you can encode such heuristics in CGA, but that's a bit complicated..

before going on with this, did you find a solution yet ?

Cheers!

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-----------------------------------

Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
KennethLindhardt
Occasional Contributor

Hi Matt. That’s perfectly fine, I’ve been busy anyway. Yes this is kinda still an issue to me, but at this point I have no idea if it would ever work, since I do not have the right data to test it on. I think I’ve solved my own question, but it seems to be a long way around. I sat up to two allowed differences. 0.3 and -0.3, then I could take the left_H – Right_H < Dif_1(0.3) && left_H – Right_H >Dif_2 (-0.3) Then all the other calculations…. If front and back are above 1 m from right and left, create a gable roof. Well because I had  5 pionts to calculate on, and the Lidar data was not giving me some prober information, I had to many wrong heights on my points, that meaning I had to many calculations. If Right_H was 0 I had to go another way, if center was hitting a chimney, take that one out of the calculation, and so on. So probably I need to read up on my math skills, and get some better Lidar data before I continue.

This is still interesting to me, and I will get back to the threat at some point, but I don’t want to load any work on you on this one by now.

0 Kudos