See attached. Trying, after the thread in the Comment section, to build a simple example for view analysis.
I get this error:
Solution exception:global name ‘viewPoints’ is not defined
And don’t know how to move forward. It is strange. Before this error i get another one related to (unfortunately didn’t copied the error and now can’t reproduce) “JoinMesh”. After this one i input a new ViewAnalysis component and then the error shifted to ViewPoints.
Now it is fixed and running. I will update the source code and the download link shortly:
Whenever you get an error that says “lb_preparation has no method called joinMesh” it means there is an older version of ladybug flying on your system. You just need to let the new Ladybug fly to overwrite the old version!
I meant that for each of the viewing points i want to know the % average they see the Geometry. The ViewResult shows the % for each patch on the geometry. The AverageView is giving only one value (even when i disconnected the viewPtsWeights.
I see your point now. You are changing the test point and the target points in your question. Pretty interesting indeed! I’ve never thought of it this way! [I feel stupid now! Hahaha. Of course you should be able to so this.] I’ll modify the component later today so you can either input a point or a surface for test.
Even though the component is not designed for what you are looking for, it is still possible to get what you want out of it by creating some fake test surfaces. Checked the attached file!
Well. This is not what i meant at all but the results is the same. When i said “point” i always intended them to be the ViewPoints, as in the component. Now, you check if you see from each of those point a Geometry (say, a surface). So according to the grid size you have more or less of those. The thing a was asking is if it is possible to average those values, so i can know that viewPoint1 sees 80% of the geometry. What you did above gives the value but “backwards”. I think it should be simpler to average the values (less work for you, i suppose …, right?).
I think, but not sure, that you are doing something like this in the averageView output, but for all ViewPoints. I’m asking for this but for each VP.
Thanks for the comment. It reminded me that I actually considered this! I added an output to viewAnalysis component (“ptIsVisible”) at the last minute to let the users do stuff like this.
It is similar to intersectionMtx: A list of 0s and 1s that shows if the test point is visible. You need to flip the matrix and count the number of 1s and divide it by the length of the list. Here is how you can set it up:
The result is 1% different from the last example. I think it happens because the test points are not exactly the same.
In your “spare” time please explain the logic of the viewPtsWeights. I don’t get it. When all are 0 you get the average (~78 in this case), when all 1 i thought you should get the same … but i’m not. I get 100 (probably because one of the VP sees 100%).
Weights define the importance of the view point. Just an input to give some freedom to user to use the component as they wish.
Let’s say you are testing for 4 viewPoints. In that case normally each viewPoint has the importance of 1/4 (25%), however in some cases you want to consider 100% view if you can see any of the points. You can use the weights input in cases similar to this. If you put 1 as the weight you are telling the component that if a testPoint sees this point it has 100% view. There is no true or false method in assigning the weights. It is all about your definition of view.
Hope it explains the idea to some extents. I owe you a video on this anyways!