Elements logo

Elements

Community
znlgis
elements

Use when generating building information models (BIM) programmatically in C#/.NET — wall, beam, column, floor creation, geometry kernel (BREP/CSG), glTF/IFC/JSON serialization, MEP systems, spatial grids. Hypar Elements: the smallest useful BIM — a cross-platform C# library for creating building elements without Revit/Rhino dependencies.

Overview

Publisherznlgis
Repositoryopengis-skills
Skill nameelements
Stars
76
Forks
12
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by znlgis on GitHub. Read the source before you install it.

Installation

Install the Elements AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/znlgis/opengis-skills/tree/main/3d/elements
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/znlgis/opengis-skills.git /tmp/opengis-skills
mkdir -p .claude/skills
cp -r /tmp/opengis-skills/3d/elements .claude/skills/elements
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Elements in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Elements on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Elements is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

项目地址: https://github.com/hypar-io/Elements

官方文档: https://hypar.io/Elements/

NuGet: https://www.nuget.org/packages/Hypar.Elements

许可证: MIT | 最新版本: 2.3.0(NuGet 最高非预发布版;2.4.0 系列尚为 alpha 预发布)

概述

Elements 是 Hypar 公司开源的 建筑信息模型(BIM)编程生成库,专为 AEC(建筑、结构、机电、施工)领域设计。它以纯 C# 代码创建建筑模型——墙、梁、柱、楼板、空间、机电管道等——无需启动任何商业 BIM 软件。

核心特性

特性说明
跨平台netstandard2.0,支持 Linux/macOS/Windows 微服务
零商业依赖不依赖 Revit、Rhino 或任何商业几何内核
混合几何内核简洁的 BREP/CSG 混合内核,擅长"平面带孔"类建模
多格式序列化JSON / glTF / GLB / IFC / DXF / SVG
Schema 驱动JSON Schema 定义自定义元素类型 + 代码生成
建筑元素Wall / Beam / Column / Floor / Panel / Space / Topography
MEP 系统Fitting 管件体系(弯头/三通/变径)、流路分析
空间数据结构Grid1d/Grid2d 轴网、HalfEdgeGraph2d、CellComplex、AdaptiveGrid

环境准备

安装

bash
# NuGet(推荐)
dotnet add package Hypar.Elements

# 可选包
dotnet add package Hypar.Elements.Serialization.IFC    # IFC 导入导出
dotnet add package Hypar.Elements.Serialization.DXF   # DXF 导入导出
dotnet add package Hypar.Elements.Components           # 组件化生成
dotnet add package Hypar.Elements.CodeGeneration       # JSON Schema → C# 代码生成

前置条件

  • .NET 6.0+ SDK(推荐 .NET 8)
  • 无需安装 Revit / Rhino / AutoCAD

核心 API

元素与模型

csharp
using Elements;
using Elements.Geometry;
using Elements.Serialization.glTF;

// 创建模型
var model = new Model();

// 创建墙
var wall = new Wall(
    line: new Line(new Vector3(0, 0, 0), new Vector3(5, 0, 0)),
    height: 3.0,
    thickness: 0.2
);
model.AddElement(wall);

// 创建柱
var column = new Column(
    location: new Vector3(2.5, 0, 0),
    height: 3.0,
    profile: Profiles.WideFlangeProfile(width: 0.2, depth: 0.3)
);
model.AddElement(column);

// 导出 glTF
model.ToGlTF("output.glb");

几何系统

csharp
using Elements.Geometry;

// 向量运算
var a = new Vector3(1, 0, 0);
var b = new Vector3(0, 1, 0);
var cross = a.Cross(b);        // 叉积
var dot = a.Dot(b);            // 点积
var dist = a.DistanceTo(b);    // 距离

// 多边形
var polygon = Polygon.Rectangle(4, 3);
var hole = Polygon.Circle(0.5, 8);
var profile = new Profile(polygon, new[] { hole }); // 带洞轮廓

// 变换
var transform = new Transform(new Vector3(5, 0, 0));
var transformedPolygon = polygon.TransformedPolygon(transform);

实体操作

csharp
// 拉伸
var extrude = new Extrude(profile, 3.0, Vector3.ZAxis);

// 扫掠:需要先给出扫掠路径
var path = new Line(new Vector3(0, 0, 0), new Vector3(0, 0, 3));
var sweep = new Sweep(profile, path, angle);

// CSG 布尔运算
var a = new Cube(2, 2, 2);
var b = new Sphere(1.5);
var result = a.Union(b);         // 并集
var diff = a.Subtract(b);        // 差集
var intersect = a.Intersect(b);  // 交集

序列化

csharp
// JSON
var json = model.ToJson();
var model2 = Model.FromJson(json);

// glTF/GLB
model.ToGlTF("model.glb");
var model3 = Model.FromGlTF("model.glb");

// IFC(需 Hypar.Elements.Serialization.IFC)
model.ToIFC("model.ifc");
var model4 = Model.FromIFC("model.ifc");

典型工作流

创建完整房间模型

csharp
using Elements;
using Elements.Geometry;

var model = new Model();

// 地板
var floor = Floor.Create(
    profile: Polygon.Rectangle(6, 4),
    thickness: 0.3
);
model.AddElement(floor);

// 四面墙
var roomProfile = Polygon.Rectangle(6, 4);
foreach (var segment in roomProfile.Segments())
{
    var wall = new Wall(segment, height: 3.0, thickness: 0.15);
    model.AddElement(wall);
}

// 柱
for (int x = -2; x <= 2; x += 4)
{
    for (int y = -1; y <= 1; y += 2)
    {
        var col = new Column(
            location: new Vector3(x, y, 0),
            height: 3.0,
            profile: Profiles.WideFlangeProfile(0.15, 0.25)
        );
        model.AddElement(col);
    }
}

// 导出
model.ToGlTF("room.glb");

最佳实践

  1. 精度控制:使用 Vector3.Epsilon = 1e-05 进行浮点比较,使用 IsAlmostEqualTo() 等辅助方法
  2. 坐标系:右手坐标系,+Z 朝上,无量纲(除非方法明确要求)
  3. 实例化:使用 Element Instance 模式复用定义,避免重复创建相同构件
  4. Schema 扩展:通过 JSON Schema + CodeGeneration 定义自定义元素类型

常见问题

问题解决方案
如何在 Linux 微服务中运行?Elements 是 netstandard2.0,完全支持 Linux Docker 部署
如何导出到 Revit?通过 IFC 格式中转:Elements → IFC → Revit
几何操作在不同平台结果不一致?使用 IsAlmostEqualTo() 等精度辅助方法,避免直接 == 比较
如何创建自定义建筑元素?继承 Element 类,用 JSON Schema 定义属性,用 CodeGeneration 生成代码
NuGet 该装哪个版本?稳定线是 2.3.0;2.4.0 系列还都是 -alpha.* 预发布,生产项目留在 2.3.0

AI 使用建议

推荐工作流

  1. 创建 Model:new Model() → 添加建筑元素(Wall/Column/Floor/Beam)
  2. 几何构建:使用 Polygon.Rectangle()、Vector3、Line 构建几何轮廓
  3. 实体操作:Extrude(拉伸)、Sweep(扫掠)、CSG 布尔运算(Union/Subtract/Intersect)
  4. 序列化导出:model.ToGlTF()(推荐 glTF/GLB)、model.ToJson()、model.ToIFC()(需额外包)
  5. 自定义元素:继承 Element,用 JSON Schema 定义属性,通过 CodeGeneration 生成代码

关键注意事项

  • 坐标系:右手坐标系,+Z 朝上,无量纲
  • 浮点比较:使用 Vector3.Epsilon 和 IsAlmostEqualTo(),不要直接用 ==
  • 零依赖:不依赖 Revit/Rhino,可完全在 Linux Docker 中运行
  • IFC 导出:需额外安装 Hypar.Elements.Serialization.IFC 包
  • 实例化复用:相同构件使用 Element Instance 模式,避免重复创建

相关技能


参考资源

Frequently asked questions

What does the Elements AI skill do?

Use when generating building information models (BIM) programmatically in C#/.NET — wall, beam, column, floor creation, geometry kernel (BREP/CSG), glTF/IFC/JSON serialization, MEP systems, spatial grids. Hypar Elements: the smallest useful BIM — a cross-platform C# library for creating building elements without Revit/Rhino dependencies.

Why use Elements on TypingMind?

Because you install it once and use it with any model. Elements is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Elements in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/znlgis/opengis-skills/tree/main/3d/elements. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Elements?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Elements?

As many as you like. As long as a model supports skills, you can use Elements with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Elements AI skill free?

Yes. It is published on GitHub by znlgis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇