GlassHopper
Directories
- .vscode
The `GlassHopper` directory serves as a development environment for a Rhino 8 plugin, specifically configured to streamline the creation and debugging of .NET-based plugins. It primarily contains Visual Studio Code configuration files, including `launch.json` for setting up distinct debugging scenarios (such as coreclr) and `tasks.json` for automating build processes like running `dotnet build`. These components work together to provide an integrated workflow where automated builds trigger and prepare the environment for immediate debugging within the Rhino application. This structure indicates a focused setup for developers who need to rapidly iterate on plugin code while maintaining seamless integration with the host software.
- Attributes
The `GlassHopper` directory serves as a specialized module for customizing the visual interface and interaction model for Grasshopper components by extending the standard `GH_ComponentAttributes` class. It primarily consists of attribute definition files, such as `ComponentComboPlusButtonAttributes.cs` and `ComponentOneButtonAttributes.cs`, which enhance the graphical user experience. These classes are designed to render specific interactive elements, including clickable buttons and combo options, directly within the component visuals. This structure indicates a focus on improving usability through tailored UI rendering rather than core computational logic.
- Components
The GlassHopper directory structure outlines a comprehensive Grasshopper plugin designed for the structural analysis of glass assemblies, primarily integrating with the Maffeis cloud API. It organizes functionality into distinct components that handle material definition, load generation (wind, snow, and self-weight), and structural restraint assignment for finite element modeling. The architecture relies on base classes to manage authentication workflows and job synchronization, ensuring secure communication with remote servers for data retrieval and report generation. Files are systematically categorized by purpose, ranging from geometric mesh processing and stratigraphy construction to result extraction and unit management, facilitating a complete parametric workflow for glass engineering.
- Converter
The `GlassHopper/Converter directory serves as a utility module designed to bridge the gap between the Maffeis Geometry library and Rhino/Grasshopper environments. It contains specialized classes that handle bidirectional mesh conversion, vector transformations, and custom JSON deserialization for database-stored materials. These components work together to ensure seamless data interoperability and format compatibility within the broader GlassHopper application.
- Definitions
GlassHopper is a modular C# library for structural analysis of glass panes, primarily organized within the `GlassHopper.Definitions` namespace. It consists of configuration settings, data models for user authentication and job references, and specialized classes that encapsulate structural metrics like displacement and stress results. These components work together to manage application state, handle API interactions, and define the core data structures required for finite element analysis workflows.
- Extensions
The `GlassHopper` directory appears to be a C# project designed to facilitate RhinoCommon geometry operations, likely serving as a compatibility layer between different SDK versions. The primary component highlighted is `CurveExtensions.cs`, located in the `Extensions` folder, which acts as a utility file providing static helper methods. These helpers specifically bridge functional differences between SDK 7 and SDK 8, ensuring consistent behavior across updates. This structure suggests a modular approach where core geometric logic is abstracted into reusable extension methods for easier integration within the broader application.
- Forms
The GlassHopper application is a .NET Windows Forms project structured around a modular `Forms` namespace, with the provided files specifically implementing the user authentication interface. The system relies on a standard three-file pattern for UI components: `LoginForm.cs` contains the core logic and inheritance from the base Form class, while `LoginForm.Designer.cs` holds the auto-generated code that initializes and configures the visual layout. These two code files are complemented by `LoginForm.resx`, which manages XML-based localization resources to support multilingual text strings for the login dialog. Together, these components demonstrate a tightly coupled relationship where the designer file defines the structure, the main code file handles behavior, and the resource file provides the content, all working in unison within the `GlassHopper.Forms` namespace.
- Helpers
The `GlassHopper/Helpers` directory serves as a centralized repository for static utility classes that provide foundational support across the application. It contains specialized components for managing asynchronous browser-based logins, handling geometric calculations for Rhino 3D modeling, and maintaining a registry of unique component identifiers. Additionally, the folder includes tools for secure data storage using Windows DPAPI, efficient HTTP client management, and abstraction layers for RhinoCommon SDK compatibility. These files collectively streamline common tasks by encapsulating reusable logic, thereby reducing code duplication and ensuring consistent behavior throughout the GlassHopper project.
- Parameters
The `GlassHopper` directory structure centers on a Grasshopper plugin designed to manage organization folder references within a Rhino/Grasshopper workflow. Its primary purpose is to provide custom parameter handling, as evidenced by the inclusion of `Param_OrganizationFolderReference.cs`. This specific file defines a specialized class that inherits from standard Grasshopper parameter types, enabling unique data management for organizational folders. The components are organized under a `Parameters` namespace, indicating a modular approach where distinct logical units handle specific reference types. This structure suggests a focused library dedicated to extending Grasshopper's native capabilities with custom organizational metadata tools.
- Properties
The `GlassHopper` directory structure represents a .NET-based software project designed to integrate with Rhino 3D, likely serving as a plugin or extension for the CAD platform. Its primary purpose is to facilitate debugging and execution through specific configuration profiles defined in the `launchSettings.json` file within the Properties folder. This setup indicates a development environment where the application interacts closely with Rhino’s API, allowing developers to test features directly within the host software. The presence of these launch settings highlights a workflow focused on iterative development and seamless integration between the custom code and the Rhino ecosystem.
- Resources
The `GlassHopper/Resources` directory serves as the central repository for visual assets and configuration files for a glass engineering or analysis application named "GlassHopper." It primarily contains numerous PNG icons representing specific physical concepts, such as material types (glass, air, interlayer), structural loads (wind, snow, pressure), and meshing operations, alongside UI elements like authentication and options. These image resources are managed through standard .NET infrastructure, utilizing `Resources.resx` for storage and `Resources.Designer.cs` for strongly-typed programmatic access within the C# application. This structure indicates a specialized software tool focused on technical simulations or data visualization related to glass structures and environmental forces.
- Types
The `GlassHopper directory structure centers on a Grasshopper plugin implementation, specifically featuring wrapper classes that bridge .NET data types with the Grasshopper environment. The primary component highlighted is `GH_OrganizationFolderReference.cs`, which inherits from `GH_Goo<OrganizationFolderReference>` to enable seamless integration of folder reference data within Grasshopper definitions. This file serves as a critical interface, allowing the underlying organizational logic to be manipulated through Grasshopper’s visual programming paradigm. Consequently, the structure supports interoperability between external data sources and the parametric modeling workflow.
- Upgrade
The `GlassHopper project utilizes a dedicated `Upgrade` directory to manage the migration of Grasshopper components from version 1 to version 2. This structure contains specific C# classes, such as `AuthComponentUpgrade` and `GlassAnalysisComponentUpgrade`, which implement the `IGH_UpgradeObject` interface to handle version-specific logic. Each file corresponds to a distinct component, ensuring that individual elements like authentication and glass analysis tools can be seamlessly updated without breaking existing definitions. This modular approach isolates upgrade logic, making the maintenance and evolution of the plugin more organized and predictable.
- obj
This directory structure represents the build and dependency management artifacts for a .NET project named "GlassHopper." It is located within the `obj" folder, which typically stores intermediate files generated during the compilation process. The core components include NuGet-specific configuration files like `.dgspec.json`, `.props`, and `.targets` that define package references and build targets, alongside `project.assets.json` and `project.nuget.cache` which manage resolved dependencies and caching. These files collectively ensure that the build system can correctly resolve and integrate external libraries required by the main project.
Files
- GlassHopper.csproj
The file is an MSBuild project file for a C# or .NET application named "GlassHopper." The UTF-8 BOM (`ef bb bf`) followed by the XML declaration `<?xml...` and the `<Project Sdk="Microsoft.NET.Sdk">` tag confirm it is a standard .NET SDK-style project configuration. This file defines how the software should be built, referenced, and packaged within the Microsoft .NET ecosystem.
- GlassHopperInfo.cs
This file is a C# class named `GlassHopperInfo` that serves as the metadata container for a Grasshopper plugin library called "GlassHopper." It inherits from `GH_AssemblyInfo`, which is required to register the GHA (Grasshopper Assembly) with the Rhino/Grasshopper environment. The class defines key identification details, including a unique GUID, the author's name ("Maffeis Engineering SpA"), and contact information. While it specifies the assembly version and name, the icon and description properties are currently left null or empty. Essentially, this file handles the basic identity and attribution data for the plugin rather than implementing any computational logic.
- GlassHopperLoader.cs
`GlassHopperLoader.cs` is a Grasshopper plugin loader that implements the `GH_AssemblyPriority` interface to manage initialization and lifecycle events. Its primary function is to verify if a local server is running on port 3888 during startup, triggering authentication initialization via `Maffeis.Protection` if the connection succeeds. The file defines static configuration constants for API endpoints and categorizes components into ten distinct groups, such as "Materials," "Analysis," and "Results." It also registers event handlers to clean up HTTP client resources when the Rhino application closes. Additionally, it includes utility methods like `IsServerRunning` to check network connectivity and stubbed logic for document object upgrades.