opencsg-net

opencsg-net is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 82 tokens per session (4,347 once invoked), scanned A, original, MIT.

A .NET library for building 3D shapes from cubes, spheres, and cylinders, then combining or cutting them with set-like operations. CSG, or constructive solid geometry, means creating complex solids from simpler shapes.

In plain words
What is it for?
Use it in C# programs to move, rotate, scale, union, subtract, or intersect solids and export the result as an ASCII or binary STL file for 3D workflows.
Why use it?
It removes the need to implement basic solid modelling and shape-combination calculations yourself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it in C# programs to move, rotate, scale, union, subtract, or intersect solids and export the result as an ASCII or binary STL file for 3D workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/opencsg-net
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill opencsg-net
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opencsg-net

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/opencsg-net/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/opencsg-net)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/opencsg-net"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/opencsg-net/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for opencsg-net

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/opencsg-net"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/opencsg-net.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,347 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.04347
Opus 5.5 $0.00033 $0.01739
Sonnet 5.5 $0.00016 $0.00869
Haiku 4.5 $0.00008 $0.00435

Measured 13d ago against content hash 6982f341459c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

opencsg-net scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

3d/opencsg-net/SKILL.md · 319 lines

How it starts

The opening of the file, as written. The whole thing — 319 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://github.com/znlgis/OpenCSG.NET

NuGet: https://www.nuget.org/packages/OpenCSG.NET

许可证: MIT | 最新版本: 1.4.0(GitHub tag v1.4.0 与 NuGet 一致;csproj 里 <Version>0.0.0</Version> 只是占位,版本由 CI 在打包时注入)

概述

OpenCSG.NET 是一个面向 .NET 的 构造实体几何(CSG)建模库。提供基础形体(立方体、球体、圆柱体、圆锥、拉伸体、楔形体)、布尔运算(并集、差集、交集)、型钢截面库、声明式 CSG 树(含 JSON 序列化)、STL 导出,以及把实体投影成三视图的制图能力。netstandard2.0,MIT 授权。

核心特性

特性 说明
依赖 唯一 PackageReference 是 System.Text.Json 8.0.6(供 CSG 树 JSON 序列化用),其余无外部依赖
跨平台 netstandard2.0;测试/样例/性能工程为 net8.0
CSG 布尔运算 Union / Subtract / Intersect(params 支持一次传多个)
基础形体 Cube / Sphere / Cylinder / Cone / Extrude / Wedge
变换 Translate / RotateX-Y-Z / Scale / Transform(Matrix4x4)
声明式 CSG 树 CsgNode 记录类型 + CsgNodes 工厂 + CsgEvaluator.Evaluate + CsgSerialization JSON 往返
型钢截面 Profiles:Rectangle / HBeam / Channel / SquareTube / Trapezoid / Capsule / LShape
STL 导出 Solid.WriteStl(TextWriter / BinaryWriter)与 StlWriter.WriteAscii/WriteBinary(path)
三视图投影 ViewProjector + ViewDirections(主/俯/左)+ ViewArcFitter(投影线段的圆弧识别)
BSP 树 迭代式 BSP 树实现(非递归),不会栈溢出

上游关系

OpenJsCad csg.js (JavaScript)
└── praeclarum/Csg (手工 C# 移植)
    └── hypar-io/Csg
        ├── Csg (Union 原点居中修复、NaN 校验)
        └── DotNetCsg (二进制 STL、迭代 BSP、RotateX/Y/Z)
            └── OpenCSG.NET (本项目 — 合并两者改进)

环境准备

安装

dotnet add package OpenCSG.NET

前置条件

  • .NET Standard 2.0+(库本身)
  • .NET 8+(构建/测试/示例)
  • 构建整个解决方案需要 .NET 9+ SDK:dotnet build OpenCSG.NET.slnx
  • 数值口径:布尔运算按 绝对容差 1e-5 合并顶点/平面,坐标量级到 1e6 仍然正确(仓库有测量坐标回归测试)

精度与网格约定(官方 README 固化)

  • 布尔结果可能出现 T 顶点接缝(没有 T 顶点清理 pass):面没有面积洞(按体积累等式 A ∪ B = A + B − A ∩ B 验证过),但不保证是严格闭合的二维流形
  • 负缩放(镜像)矩阵会按行列式识别并翻转顶点缠绕与平面法线,镜像体仍朝外

核心 API

基础形体

using Csg;
using static Csg.Solids;

// 立方体
var cube = Cube(size: 2, center: true);
var cube2 = Cube(width: 3, height: 2, depth: 1);          // 三边尺寸
var cube3 = Cube(new Vector3D(3, 2, 1), center: false);   // 或按向量给尺寸

// 球体
var sphere = Sphere(r: 1, center: true);

// 圆柱体
var cylinder = Cylinder(r: 0.5, h: 3, center: true);

Read the full file on GitHub · 319 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago Changed · +100 lines 6982f341459c
  2. 1mo ago Changed 920840bdbb4b
  3. 1mo ago Changed 43da62d80402
  4. 1mo ago First seen · 219 lines · 82 tokens per session scan A 493be7b29726

Subscribe to this mod's changes

opencsg-net is a skill published in the GitHub repository znlgis/opengis-skills (75 stars, last pushed today), licensed MIT. It adds 82 tokens to every session and 4,347 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

opentelemetry-net-instrumentation

Provides guidance for implementing OpenTelemetry instrumentation in .NET codebases, covering tracing (Activities/Spans), metrics, logs, naming conventions, error handling, performance, SDK setup, resources, context propagation, and API design best practices.

Aaronontheweb/dotnet-skills · 56 tokens

wpf

Build and modernize WPF applications on .NET with correct XAML, data binding, commands, threading, styling, and Windows desktop migration decisions. USE FOR: working on WPF UI, MVVM, binding, commands, or desktop modernization; migrating WPF from .NET Framework to .NET; integrating newer Windows capabilities into a…

managedcode/dotnet-skills · 122 tokens

mcp

Build or consume Model Context Protocol (MCP) servers and clients in .NET using the official MCP C# SDK, including stdio, Streamable HTTP, tools, prompts, resources, and capability negotiation. USE FOR: .NET MCP servers or clients; stdio versus HTTP transport choices; tools, resources, prompts, completions, and…

managedcode/dotnet-skills · 123 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

managedcode/dotnet-skills · 149 tokens

semantic-kernel

Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable. USE FOR: adding AI-driven prompts, plugins, or orchestration to a .NET app; reviewing kernel construction, service registration, or plugin usage; building…

managedcode/dotnet-skills · 116 tokens

sharpconsoleui

Use SharpConsoleUI to build full terminal (TUI) applications in .NET — equally suited to full-screen single-window apps and multi-window desktops with overlapping draggable windows — using a compositor, a DOM layout engine, and 40+ reactive controls (data tables, tree views, forms, an embedded PTY terminal, markdown…

managedcode/dotnet-skills · 190 tokens