architecture-building-systems / hive

Rhino Grasshopper plug-in for quick & dirty building simulation
https://www.food4rhino.com/en/app/hive
GNU General Public License v3.0
31 stars 4 forks source link

Adiabatic Surface Selector #821

Open christophwaibel opened 4 months ago

christophwaibel commented 4 months ago

Feature Adding a functionality to select rhino geometry surfaces that are supposed to be adiabatic, i.e., don't contribute to heat losses.

Expected behavior Proposal: In the Hive Building Form, at the Surface Construction Tabs with the u-values, add a button "Select Adiabatic Surfaces". A script will start where you can select surfaces from the Hive Building Polysurface that will be treated as adiabatic henceforth (until deselected..).

As for the physics, simple: Just deduct those surface areas from the total heat loss calculation.

Screenshots image starting point

image select surfaces

image confirm, henceforth marked as adiabatic

christophwaibel commented 4 months ago

VBscript

Option Explicit
'Script written by <insert name>
'Script copyrighted by <insert company name>
'Script version Wednesday, 14 February 2024 20:50:56

Call Main()
Sub Main()

    ' Prompt user to select surfaces
    Dim surfaces
    surfaces = Rhino.GetObjects("Select surfaces", 8) ' 8 corresponds to surface filter

    If IsNull(surfaces) Then
        Exit Sub
    End If

    ' Loop through each selected surface
    Dim surface
    For Each surface In surfaces
        ' Get the center of the surface
        Dim surfaceCenter
        surfaceCenter = Rhino.SurfaceAreaCentroid(surface)

        ' Check if the center is valid
        If Not IsNull(surfaceCenter) Then
            ' Add a text dot at the surface center
            Rhino.AddTextDot "Adiabatic", surfaceCenter(0)
        End If
    Next
End Sub