arif-hanif / elements

A library for generating buildings.

Home Page:https://www.hypar.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elements

A better API for buildings.

Build Status NuGet Donate

Elements is a cross-platform library for creating building elements like Walls, Beams, and Spaces. It's meant to be used by architects, engineers, and other building professionals who want to write code that generates buildings. Here's an example using Elements to create a Beam:

var line = new Line(Vector3.Origin, new Vector3(5,5,5));
var beam = new Beam(line, Profiles.WideFlangeProfile());
var model = new Model();
model.AddElement(beam);
var json = model.ToJson();

Why

When we started Hypar, we needed a small library of building elements that could run in micro-services executing on Linux, and was therefore free of dependencies on host applications like Rhino or Revit. We wanted it to have an API that took the best parts from the various object models and programming APIs available in the AEC space. We wanted it to serialize to formats like JSON and IFC that were useful to architects, engineers, and contractors. And even though the library needed to stand alone, we wanted it to be usable in add-ins to other popular AEC applications like Dynamo, Grasshopper, Revit, and Unity. We looked around and nothing fit the bill, so we started building this.

Donate

Hypar Elements is open source and will remain so forever. Your donation will directly support the development of the Hypar Elements. Hypar Elements has been demonstrated to work in Revit add-ins, Unity projects, and as Lambdas running on AWS. Send us a donation and open a feature request telling us what you'd like it to do.
Donate

Examples

The best examples are those provided in the tests, where we demonstrate usage of almost every function in the library.

Words of Warning

  • The Elements library is currently in beta. Please do not use it for production work.
  • Why we chose C#:
    • C# is a strongly typed language. We want the code checking tools and the compiler to help you write code that you can publish with confidence.
    • Microsoft is investing heavily in C# performance. There are lots of articles out there about Lambda performance. Here's a good one.
    • Dotnet function packages are small. Smaller functions results in faster cold start times in serverless environments.
    • C# libraries can be reused in other popular AEC applications like Dynamo, Grasshopper, Revit, and Unity.

Build

You'll only need to do this if you want to contribute to the library, otherwise you can use the NuGet package that is published regularly.

dotnet build

Test

dotnet test

Third Party Libraries and Specifications

About

A library for generating buildings.

https://www.hypar.io

License:MIT License


Languages

Language:C# 100.0%