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.