Zumen 0.2.0

dotnet add package Zumen --version 0.2.0
                    
NuGet\Install-Package Zumen -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zumen" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zumen" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Zumen" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zumen --version 0.2.0
                    
#r "nuget: Zumen, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zumen@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zumen&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Zumen&version=0.2.0
                    
Install as a Cake Tool

.NET のラッパー

ネイティブのライブラリ(zumen_abi1.dll・libzumen_abi1.so・libzumen_abi1.dylib)の C ABI を、P/Invoke で呼ぶ薄いラッパーです(決定 0011・決定 0196)。.NET Framework 4.8 には netstandard2.0、.NET 8 以降には net8.0 のアセンブリを出します。

  • NuGet の Zumen で配ります(決定 0003・決定 0205)。パッケージには、対象ごとのネイティブのライブラリを runtimes/{rid}/native に入れます。
  • NuGet の依存はありません。型つきの要求と応答(System.Text.Json)は、標準で持つ net8.0 の側にだけあります。netstandard2.0 の側では、JSON の文字列かバイト列で読み書きします。
  • ZumenLibrary.Load() は、パッケージに入れたライブラリを読みます。手で作ったライブラリは Load(道筋) で読みます。32 bit の Windows では、関数を stdcall で呼びます。
  • Zumen/Messages.g.cs・Zumen/Constants.g.cs は、schema/ から cargo xtask codegen で生成します。手で直さないでください。
  • パッケージの直下に LICENSE-MIT・LICENSE-APACHE、各 runtimes/{rid}/native/ に対象の ABI の依存の本文 THIRD_PARTY_LICENSES を入れます。作成と検査の手順は xtask/release にあります。
  • 各 RID の CycloneDX SBOM は、同じディレクトリの {ライブラリ名}.cdx.json にあります。

使い方

using System;
using System.IO;
using Zumen;
using Zumen.Messages;

var zumen = ZumenLibrary.Load(); // 手で作ったものは Load("target/release/zumen_abi1.dll")
using var session = zumen.Open();
session.Push("a.dxf", File.ReadAllBytes("a.dxf"));
try
{
    var doc = session.Call<OpenResult>(new OpenRequest { V = Versions.SchemaMajor, Input = "a.dxf" }).Result!.Doc;
    var scene = session.Call<SceneResult>(new SceneRequest { V = Versions.SchemaMajor, Doc = doc, From = "space/0" });
    var columns = Scene.Read(session.Take(scene.Blobs[0].Id));
    ReadOnlySpan<double> origins = columns.Column<double>("chunk_origins");
}
catch (ZumenException error)
{
    // failed の応答は error.Response にあり、診断を持ちます
    Console.WriteLine($"{error.StatusName} {error.ResponseText}");
}
名前 中身
ZumenLibrary.Load ライブラリを読み込み、関数と ABI のメジャーバージョンを確かめる。道筋を渡さなければ、パッケージに入れたものを読む
ZumenLibrary.Open セッションを作る(zm_session_new)。using で閉じる
Session.Push・Call・CallBytes・Take・Cancel・Dispose API の関数(zm_push・zm_call・zm_take・zm_cancel・zm_session_close)。状態が ok でなければ ZumenException を投げる
Scene.Read シーンの blob を読む。セクションは Column<T>(net8.0、写さない ReadOnlySpan<T>)か ToArray<T> で引く(schema/scene.toml)

要求と応答の形は schema/messages.json にあり、Zumen.Messages に record の型があります。Operations.Types が、op から要求と結果の型を引きます。列挙は string で持ち、値を定数で出すので、知らない値も受け取れます。形が値で決まるフィールド(geometry・edit など)は JsonElement(netstandard2.0 では object)で持ち、タグの値から Geometry.Variants などで型を引いて読み直します。Cancel は、ほかのスレッドから呼べます。

テスト

cargo build -p zumen-abi
dotnet run --project bindings/dotnet/tests/Conformance --framework net10.0 -- target/debug/libzumen_abi1.so

tests/Conformance は、適合テストの組をこのラッパーで流し、ハッシュの一覧が hashes.txt と一致することを確かめます。CI は、テストの行列の Linux x64・macOS arm64・Windows x64 で .NET 10 を、Windows x86 で 32 bit の .NET Framework 4.8 を流します。

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 42 11/10/2026