ladybug-tools / ladybug-legacy

:beetle: Ladybug is an environmental plugin for Grasshopper.
http://ladybug.tools
Other
195 stars 82 forks source link

New Ladybug Sun Shades Calculator #264

Closed chriswmackey closed 6 years ago

chriswmackey commented 8 years ago

This issue was created to give @ayezioro and @AntonelloDN feedback on the new sun shades component that they are creating.

I absolutely agree that we should have the capability to generate shades based on ray-shooting rather than geometric methods as I am convinced that it is faster in cases with atypical geometry and it also seems to have less potential to fail in odd cases like parallel vectors and surfaces, etc. It also appears to be much more resilient in cases where you have very low sun angles, which I know tended to make the older shade component unstable.

Here is my feedback on the current component:

1) I see that the current component is using a lot of rhinoscript inside the component instead of rhinocommon and I would strongly recommend using rhinocommon, for which you can find the full documentation here. I know that it may seem unnecessary when you are just starting to code geometry functions (as it did for me) but please trust me that it really is worthwhile in the end to use rhinocommon as your scripts will be MUCH faster and you will gain a lot more control over the geometry objects. Not having the code in rhinocommon will also make it very difficult to integrate into the new ladybugx and honeybeex libraries, which will be all based in rhinocommon on the GH end (it's of course different for Dynamo). The rhinocommon SDK is also very well documented and working with the documentation will give you some experience that is applicable to how we are documenting the Ladybug API.

2) It is customary in all of the components that subdivide surfaces into a grid of points to ask for a gridSize instead of separate udiv and vdiv. A lot of the time, people do not know what the orientation of U vs V is in their input geometry and it's just much easier to only put in 1 value in rhino model units and use that throughout. If you want to have a default for the that is selected based on the size of the input _window, I would recommend using a bounding box as I do for the shade benefit evaluator.

3) I would suggest hiding outputs that are not critical. I imagine that most people really only want to see the shade surface and are not always interested in all of the points and lines (though they are helpful if people want to dig in). Use code like this to hide these outputs.

4) It's a bit misleading to have the line geometry output when the calculation is actually accounting for intersections that can occur beyond the length of this line. Why not just set the length of the line based on where they intersect the context or the shadeSrf? You can use the 2-point method for line creation instead of point and vector.

5) A number of important descriptions are missing. I am not sure what the rectangularWindow input does or why you would not just have some code that auto-sense whether the input is a rectangle.

6) All of the deluany inputs could use a better description. For example, I am told that the offsetFactor is VERY important but not why it is important or what it is.

7) I would not have tolerance as an input since you almost never want to change it and it can be confusing to users who do not know how rhino common intersections work. I would just always use the Rhino model tolerance, which you get from sc.doc.ModelAbsoluteTolerance.

8) This is more of a personal aesthetic issue but the component seems very large and to have a lot more text in the inputs than is needed. Personally, I don't think that you need to label all of the categories of inputs as people are usually smart enough to figure this out after using the component a couple of times and labeling them might also be confusing to new users who think they are inputs.

-Chris

ayezioro commented 8 years ago

Hi Chris and thanks for this thorough input. We know that there is a lot of work to do, and we are now working on some features that go beyond getting a geometric outcome. We will update when time comes and we are more "cooked". As for the rhinocommon, of course we will make the try 9and beyond that). I'm lack of experience with that, and that's why most of the code uses rhinoscript. If you have good pointers to make this less painful i'll appreciate. Point 2 (grid size). Good idea we will implement. Point 3 (outputs).Of course. This is for control of the results. We will hide the unnecessary items (but you should see how it looks the original component ... :-) ) Point 4 (lines/vectors). This is only for visualizing. It will probably dissapear later on, but just for the exercise we will try to have the exact size for each line. Point 5 (rectangle). I'm curious about this sensing. I have an idea already how to do it and will try it. But i know you use this term (sensing) a lot in other components. Will be glad to your sensing approaches. Specially if you have examples of sensing input items, that according to some inputs other input items appear or dissapear or change name. We are probably going to need that. Point 6 (descriptions). Yes ... yes ... The less likable part of all of this, but important. We know, we know ... Point 7 (tolerance) Good idea. but i can see also the advantages of letting users change it. Point 8 (aesthetics). Agree. Those are remainings of the start of the road. I think is good to have the separation lines, but the titles are unnecessary. Thanks again, -A.

chriswmackey commented 8 years ago

@ayezioro and @AntonelloDN ,

All sounds good. For Rhinocommon, you can find the full documentation here . Almost everything that you need is in the Rhino.Geometry Namespace and, if you ever get stuck, I recommend using the search feature on the online documentation to help you find what you are looking for.

All of the responses to the Points sound good and I will just say that, for Point 5 (rectangle), you can find some example code here . The glazingBasedOnRatio component does some auto-sensing of rectangular/semi-rectangular geometry that mostly happens inside that function.

Looking forward to the next version of the component! -Chris

ayezioro commented 8 years ago

Hi Chris, By now i just can say that "i hate rhinocommon" :-). Rhinoscript is much user friendly. The documentation link i know, the problem is that sometimes (many times) you don't know what to search. Of course i'm saying this now. Maybe in the (near) future i'll say differently. I solved the rectangle sensing already. I saw your definition from the link above. I'm doing this differently and hope it works fine in any case. Maybe later on i'll use it. After giving my response a thought i'm having second thoughts regarding to some of them: Point 2 (grid). I'm getting to the conclusion that the normal grid definitions is not good for our case. The size gives you the size of "sub-windows" and the required shade for them. This i will explain later on (not now). This will be a designer will for his design sake and not only for accuracy in the calculation. Sounds complicated and weird, but as i said, i will explain. In any case the input name should be something more meaningful. Point 7 (tolerance). The use of this is mainly for culling intersection points that are too close. The tolerance of the document is so small that no points are culled at all. Anyway, i put some checking that according to the tolerance value it will be multiplied by a factor. This will be transparent to the user.

As for the next version ... you made our lives difficult and we are struggling with RC (at least i do) :-). We are in the middle of the translation. I'll expect that by the end of the week we can have something. Thanks, -A.

chriswmackey commented 8 years ago

@ayezioro ,

Sorry for responding to this so late. I definitely know what you are going through with the Rhinocommon learning curve and I can't tell you how many times I ran into a problem and wanted to resort back to rhinoscript so badly. Trust me that there is a light at the end of the tunnel and, if you stick with it, there will be a time when you are very thankful that you mastered it. Also, if you get stuck for more than a half-hour, please post the question here and I could probably save you some time. Alternatively, if you build up a list of questions, we can schedule a skype call and knock them all out at once. As for your re-thinking of the points:

Point 2 - I definitely understand that a regular grid might not be the best suited for your situation but I imagine that most people will not know the UV coordinates of their surfaces. So finding some other way of describing the divisions of the surface (ie. horizontal division and vertical division) would be helpful from the user perspective.

Point 7 - makes sense.

Keep me posted and I will try to pay better attention to this in the next few days if you have questions about rc.

-Chris

ayezioro commented 8 years ago

100% Thanks, We are converging to a first version that i hope we get into it before this weekend. Next week i'm traveling for a month and don't want to leave this so open. We are planning advance features to improve the design decision making, and the proper "interface" is not an easy task. So maybe another brain can help how to do this better. But about this i prefer to wait for the first version so we are more focused. About point 2, agree. This is a semantic one that we need to be clear in the explanation. -A.

chriswmackey commented 8 years ago

@ayezioro ,

Sounds good and I'll lay off on the comments until you get out the next version.

The only thing that I want to mention is that the uv division might not simply be semantic matter because u and v coordinates are independent of Rhino 3D space (they are only specific to the surface and they don't have an "awareness" of the larger 3D world). As such, a u coordinate might be either vertical or horizontal depending on how the surface geometry was built and how the surface maps into 3D space. We can add in some code that senses whether the u or the v of a surface is closer to being horizontal in 3D and this will make it easier for the user. All of this said, we can do this after your new version.

Good luck and, again, let me know if you have any questions or get stuck with rc. -Chris

ayezioro commented 8 years ago

Thanks, "Don't worry". I'll ask ... :-) Sometimes i get stuck and MANY times Antonello knows how to deal, so i can say now that i'm well covered now :-) We are sensing already the direction of the surface (forgot to mention). That's why i said it is semantic. The definitions will read something like numOfShades (like in the LB shading calculator) for the horizontal divisions, and somethingSomething (for now is vDiv) for the vertical divisions. -A.

chriswmackey commented 8 years ago

Very nice! It is semantic, then. If you are performing operations like that of the old shadeDesigner, then you and @AntonelloDN are clearly on your ways to becoming a rc masters. Stick with it!

chriswmackey commented 6 years ago

@ayezioro and @AntonelloDN , It would be great to move this component out of WIP for the next stable release. Is there any reason why we would not do so? -Chris

ayezioro commented 6 years ago

Hi @chriswmackey, Me neither. If @AntonelloDN agrees i'm for taking it out from the WIP section. -A.

AntonelloDN commented 6 years ago

Hi @chriswmackey, I am agree with you and @ayezioro.

Antonello

chriswmackey commented 6 years ago

Ok. It will be done before the next release, then!

ayezioro commented 6 years ago

Hi @chriswmackey and @AntonelloDN, Please stop the engines. In the last couple of days i've found some bugs that need to be addressed. Some of them i don't fully understand. Just when i was very happy with the outcomes, i was preparing a class for tomorrow and then all the bugs appeared. I'm getting crazy. So please, leave the component in the WIP unbtil we can find answers for the isuues. I'll ask for your help ... after tomorrows class. Thanks, -A.

ayezioro commented 6 years ago

Hi again @chriswmackey and @AntonelloDN, I'm happy and glad to say that the (plenty of) bugs are solved and the component is pretty neat now (magical, as @chriswmackey wrote a while ago). I'll be sending @AntonelloDN a file for him to make some checkings (and answer some questions i left in the code) and then commit the updated version. -A.

chriswmackey commented 6 years ago

@ayezioro ,

I'm glad to hear that the bugs were fix-able. I hope you don't mind that I have moved the older component out of WIP via https://github.com/mostaphaRoudsari/ladybug/commit/54939bd93adced4d87576443b180586f1ab58bb8 in preparation for the next release, which will happen in a few days. If you can send a pull request in that time to replace the old component with your fixed one, that would be great. Then we can close out this issue. -Chris

ayezioro commented 6 years ago

Hi @chriswmackey, Yes. We've found another minor bug and i sent @AntonelloDN a version solving this "last" one. if he approves i'll pull a request immediately. Thanks, -A.

chriswmackey commented 6 years ago

Sounds good, @ayezioro . I'll be honest and admit that you have a few days (even with all of the automation in the world, 72 example files won't update themselves overnight). I look forward to the pull request!

ayezioro commented 6 years ago

Hi @chriswmackey and @AntonelloDN, I've sent a pull request for the component. Even more bugs were addressed, beyond the above mentioned. I believe this is a nice working version. Please let me know if the request went well. -A.

ayezioro commented 6 years ago

Hi @chriswmackey and @AntonelloDN, I've sent a pull request for the component. Even more bugs were addressed, beyond the above mentioned. I believe this is a nice working version. Please let me know if the request went well. -A.

chriswmackey commented 6 years ago

@ayezioro , unfortunately, the pull request conflicts with a previous change that I made pulling the component out of WIP. Let me know if you are able to send a new pull request. Otherwise, I can see if I can do some conflict resolution and merge it.

ayezioro commented 6 years ago

Hi @chriswmackey, I've sent a new pull request. Hopefully it will work this time. Probably i'll see this tomorrow morning. Thanks, -A.

chriswmackey commented 6 years ago

Ok. We got in all of the changes via https://github.com/mostaphaRoudsari/ladybug/commit/21d8b0de2558a47f7147523ec778f78deeb5fa3c . So we can close out this issue and we're pretty much ready for the release at this point.

ayezioro commented 6 years ago

Thank God!! :-)