The question of calculation shading area in Sketchup with ruby api

Can somebody help me ? Now I am developing a plug-in about building simulation in Sketchup. The shading can be displayed, but How can I calculate its area with ruby API.

Shading usually describes incomplete illumination (half shadow) like the shadow gradient on the sides of a curved surface. If you want to measure an area, you probably want complete shadow.

Shadows are not SketchUp entities or drawing elements. They are rendering output and not (directly) accessible through the API.

See here for a solution to draw shadows as faces (however that modifies the user’s model), then you sum the area for these faces. Keep in mind that nested components can be scaled/transformed down (or up), so face areas appear bigger (smaller) than they are. In such cases use the second argument for Face#area(transformation).

Have you seen that there exist already many extensions that calculate the sum of the shadow area? Before investing a lot of effort, have you evaluated how your idea will be distinct from the existing ones (innovative)?


Hi , Aerilius ,many thanks for your kind reply. I am developing a software about solar application, which uses sketchup to design 3D scene . The shading area is the key factor influencing the solar energy output. I am not quite sure which method is the more appropriate for us. If we draw shadows ourselves,I think it will be very difficult under complex building situations. If we only evaluate the shading area displayed by sketchup,maybe it will be easier.

Hi Aerilius,

You mentioned that there exists already many extensions that calculate the sum of the shadow area? Could you please let me know the names of these.

I am also very interesed in evaluating shade on solar modules as a measure of shaded area of designated faces using sketchup. Its pretty common for addins such as skelion to evaluate shade as a % reduction in solar radiation, but knowledge of whether each submodule of a PV module is shaded is needed for an accurate performance prediction. I would be grateful if you could let me know if there are any sketchup tools that output this type of data.

Kind Regards,

Hi Lynette,
check out Shadow Projector (with Faces[Edged]%sq). It can draw shadows as faces and add labels of the percentage (or total area) of a face in shadow. If the solar modules are sufficiently simple models (rectangles, instead of overdetailed framing) this should work well enough.

Otherwise there is Skelion that you mentioned already and 1001 shadows which can draw a series of shadows over time or sky exposure as hemispheres.