I am looking at the Sun command and the shadows that it creates are good. At this stage, my interest is in the one day sun study, at a single point in time on the day. I have searched, but cannot see any way to create the shadow as a hatch object. I am guessing that it might be due to the fact that objects can both receive and cast shadows, and that a single shadow ‘patch’ can potentially be received over multiple objects and the ground plane. I have read various threads here and understand that it is a complicated matter, with some best fit techniques in play to accommodate resource limitations and data availability.
Capturing the screen image is about all I can see as a work around, but that is a bit clunky and not dynamic. Ideally I would like to create the shadows as hatches, so that they can be assigned to layers and included in layout details. I suspect that the answer will be in the negative, but is there any way to translate the shadows to hatches? For simplicity, the hatches could be limited to the parts of the shadows which are received on the ground plane, ignoring any shadows which are received on objects.
Thank you RM. I saw references to Ladybug yesterday. Cyclops appears to be Windoze only. Re Ladybug, I have not ventured into the Grasshopper world, and I am trying to maintain a Rhino UI solution without the usual compatibility issues that arise between the core software and plug ins. I hope that it is possible to achieve the objective within the core Rhino environment.
Sorry I forgot that cyclops is windows only seemed like it would be a good fit.
Ladybug is intense but you could use it for what you are doing but I understand you want to maintain staying in Rhino.
This user posted a basic python script. I think there are other scripts on the forum perhaps Pascal wrote a vector shadows script. Try looking a Pascal’s scripts he posted or search this forum.
It appears that the missing link is the use of the Sun dialog values as the light source and target. If someone could provide a head start on changes to the script to use these values, it would help immensely.
The relevant values from the Sun dialog are:
The angle from the Y axis to North.
The Date and Time.
The Daylight Saving setting.
The Latitude and Longitude.
My understanding is that if these values would have to be used to provide the light source and direction to the script.
I thought that I might be able to modify Pascal’s script to use the Sun methods, although I expect that it might not be that simple.
This chased me down a rabbit hole of installing Python 3, then Pip, then CMake, then another module. Even after that, I still stumbled on the No module named ‘rhino3dm’ error when trying to execute a Python script in Rhino.
Not sure how you ended up trying to use rhino3dm, but that is not the right approach.
You’ll want investigate using Python 3 or C# directly in Rhino. You can do that by running the Rhino command _ScriptEditor. That will give you access to RhinoCommon, the SDK inside Rhino.
Before you dive in deep, the is a mesh shadow outline component in Grasshopper. If you just need the shadow of one object on a plane then you can use something like this, I baked the hatches to SomeLayer.
@Nathan I want hatches or surfaces or curves to be created to represent the shadows on the ground plane from multiple buildings, each of which contain many polysurfaces, extrusaions, surfaces etc. The shadows are to be created from the Sun parameters, not a light source in the model space. If there is a GH solution to this, that would be better than a script.
@Nathan I might be getting close. I have attached a test model and GH. I am new to GH, so there is a missing link in my understanding. I have set the model Sun as the light source, but I am not seeing any output after Baking the Pattern Hatch.
I found that the Latitude and Longitude in the Model Sun had no values, so I Baked them, but still no hatches.
Making progress. The model Sun had not received the Latitude and Longitude. I provided values, and it now produces curves. More work required, but I will update the GH file later.
@nathanletwory Nearly there. It is working, with a couple of questions arising.
For the Sun dialog, Rhino wants the North angle adjustment specified as the angle from the X axis to the model North, moving counter clockwise. Grasshopper wants it specified as the angle from the Y axis to the model North, moving counter clockwise. I’m Rhino, I have it set as 351 degrees. In Grasshopper, I have to set it at 41 degrees to achieve the same shadow. There is no combination of 351 and 41 with 90 degree allowances for the X / Y reference differences that gets back to 360 degrees. Could this be due to Azimuth, Altitude or other factors? Those 2 do not appear in the Sun control in GH, so I cannot test their impact.
I have included a Model Location control in GH, but cannot get it to link to the model to obtain the model values.
The Time Zone is set to UTC + 10.00 in Rhino. To see the same shadow in GH, The Sun control has to be set to UTC + 11.00. Both have Daylight Saving turned on.