H073.HxOBJ 1.0.0

Prefix Reserved
dotnet add package H073.HxOBJ --version 1.0.0
                    
NuGet\Install-Package H073.HxOBJ -Version 1.0.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="H073.HxOBJ" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="H073.HxOBJ" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="H073.HxOBJ" />
                    
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 H073.HxOBJ --version 1.0.0
                    
#r "nuget: H073.HxOBJ, 1.0.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 H073.HxOBJ@1.0.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=H073.HxOBJ&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=H073.HxOBJ&version=1.0.0
                    
Install as a Cake Tool

HxOBJ — Wavefront OBJ/MTL Parser for .NET

HxOBJ is a fast, feature-complete library for loading Wavefront OBJ and MTL files into structured C# objects.


Features

  • Full OBJ Specification — Vertices, normals, texture coordinates, faces, groups, objects, smoothing groups
  • N-gon Support — Triangles, quads, and arbitrary polygons
  • Vertex Colors — Extended v x y z r g b format
  • MTL Materials — Diffuse, ambient, specular, emissive, PBR extensions (roughness, metallic, sheen, clearcoat)
  • Texture Maps — Diffuse, normal/bump, emissive, metallic/roughness with offset/scale/turbulence
  • Async LoadingObjReader.ReadAsync() with cancellation
  • Free-Form Geometry — NURBS curves and surfaces (optional)
  • Span-Based Parsing — Zero-allocation tokenization, string interning, pre-allocated buffers

Installation

dotnet add package H073.HxOBJ
<PackageReference Include="H073.HxOBJ" Version="1.0.0" />

Quick Start

using HxOBJ;

// Load (automatically loads referenced MTL files)
var obj = ObjReader.Read("model.obj");

// With options
var obj = ObjReader.Read("model.obj", new ObjReadOptions { SkipFreeForm = true });

// Async
var obj = await ObjReader.ReadAsync("model.obj");

// Access geometry
foreach (var face in obj.Faces)
{
    foreach (ref var fv in face.Vertices.AsSpan())
    {
        var position = obj.Vertices[fv.VertexIndex].Position;
        // fv.NormalIndex, fv.TexCoordIndex (-1 if absent)
    }
}

// Access materials
foreach (var (name, mat) in obj.Materials)
{
    var diffuse = mat.Kd;        // ObjColor?
    var roughness = mat.Pr;      // float?
    var diffuseMap = mat.MapKd;  // ObjTextureMap?
}

Data Structure

ObjFile
├── Vertices[]       — Position, W, Color
├── Normals[]        — Vector3
├── TexCoords[]      — Vector3 (UVW)
├── Faces[]          — Vertices[], SmoothingGroup, MaterialName, GroupNames[]
├── Lines[]          — VertexIndices[], TexCoordIndices[]
├── Points[]         — VertexIndices[]
├── Groups{}         — Name → FaceIndices[], LineIndices[], PointIndices[]
├── Objects{}        — Name → FaceIndices[], LineIndices[], PointIndices[]
├── Materials{}      — Name → ObjMaterial (colors, scalars, textures, PBR)
├── FreeFormBodies[] — Curves, surfaces, trims (optional)
└── Comments[]       — Preserved comments (optional)

Using MonoGame?

Use HxOBJ.MonoGame — loads OBJ files into a ModelKit Scene with PBR materials, vertex colors, tangent computation, and smoothing group support.


License

MIT

Contact

Discord: sameplayer

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on H073.HxOBJ:

Package Downloads
H073.HxOBJ.MonoGame

MonoGame bridge for HxOBJ — loads OBJ/MTL files into ModelKit scenes with PBR materials, vertex colors, and tangents.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 112 3/16/2026