BugViewer 0.7.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package BugViewer --version 0.7.5
                    
NuGet\Install-Package BugViewer -Version 0.7.5
                    
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="BugViewer" Version="0.7.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BugViewer" Version="0.7.5" />
                    
Directory.Packages.props
<PackageReference Include="BugViewer" />
                    
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 BugViewer --version 0.7.5
                    
#r "nuget: BugViewer, 0.7.5"
                    
#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 BugViewer@0.7.5
                    
#: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=BugViewer&version=0.7.5
                    
Install as a Cake Addin
#tool nuget:?package=BugViewer&version=0.7.5
                    
Install as a Cake Tool

BugViewer

Nuget Ask DeepWiki

BugViewer

Why Bug?

The most appropriate name would be Blazor WebGPU Viewer. This could be abbreviated as BWG Viewer, which is fine - but awkward to say and type. So, we simply change the double-U to a single-U → thus BugViewer.

Description

BugViewer is a Blazor component that renders a 3D file with the new WebGPU. It includes controls to view a single part (as opposed to being a game engine). The goal is to provide a clear method to view 3D parts with minimal Javascript.

The main things that are visualized are:

  • triangles/meshes
  • polylines
  • text billboards

Installation

BugViewer can be installed as Nuget package: https://www.nuget.org/packages/BugViewer/

Usage

Simple scenario

Just add the BugViewer Component to your Razor page.:

        <BugViewer @ref="viewer" Height="80%" Width="80%" />

The ./samples folder contains some examples of how to setup the canvas.

Saving and loading scenes

BugViewer.SceneRequest is the portable presentation contract. It stores 3D geometry, colors, labels, complete steps or lazy step groups, transforms, and 2D plots in versioned UTF-8 JSON. Optional viewer settings, camera, and InitialStep restore the saved view. Saving a stepped request retains the whole timeline, including history limits and null transform barriers, rather than just the displayed frame.

Use SceneRequestViewer to display either kind of request:

@using BugViewer
<SceneRequestViewer @ref="viewer" Scene="request" />

@code {
    private SceneRequestViewer? viewer;
    private SceneRequest request = new();
}
// Save or replace the contents of a SceneRequestViewer.
await viewer.SaveSceneAsync("part.bugscene.json");
await viewer.LoadSceneAsync("part.bugscene.json");

// Persist a request directly, without creating a viewer.
request.Save("part.bugscene.json");
var restored = SceneRequest.Load("part.bugscene.json");
await viewer.LoadSceneAsync(restored);

// Keep the source request with the current step, camera, and display settings.
var current = await viewer.GetSceneAsync();

SceneRequest.Load, Save, LoadAsync, and SaveAsync accept either a file path or a Stream. Component LoadSceneAsync and SaveSceneAsync also accept streams. Stream overloads leave the caller's stream open and operate at its current position; asynchronous I/O overloads accept a cancellation token. File saves replace the destination only after serialization succeeds. Invalid scene files are rejected before changing the viewer. The serializer uses generated metadata and works in trimmed WebAssembly builds.

SceneMesh, ScenePath, ScenePointSet, PlotRequest, and PlotTrace hold the portable data. SceneStepGroup stores source meshes and/or a SceneStepPathSource plus an optional indexed transform list. ScenePoint and SceneTransform retain double precision until the visible frame is converted for rendering. Use Steps for complete frames and StepGroups for shared source data; a request cannot use both. Treat published source collections as immutable so cached step resolution stays valid.

The low-level BugViewer component still accepts renderer-native meshes and lines. SceneViewer adds 3D playback and PlotViewer adds 2D playback; SceneRequestViewer selects between them and provides the component persistence API. Plotly ships with the library and loads only when displaying a 2D request.

TVGL's WebGPUPresenter now produces this shared contract. Its derived PresenterRequest keeps blocking/hold settings and callbacks in the presenter, and source-face references stay in a presenter-side table. Those runtime details are excluded from the file. Reloaded requests retain geometry and playback, but do not recreate live TVGL objects or callbacks.

Browser applications use streams from InputFile and browser downloads instead of local file paths. The LoadAndShowScene sample demonstrates both, including downloadable stepped 3D and 2D examples, loading/error states, and a 256 MB input limit:

dotnet run --project samples/LoadAndShowScene

Open the displayed localhost URL in a WebGPU-capable browser. Choose Load Scene to browse for a .bugscene.json file, then Save Scene to download it with the current settings and view. Scenes with no saved camera are automatically framed. Loading replaces the current request.

Run the persistence and viewer-integration checks with:

dotnet run --project tests/BugViewer.SceneTests

Performance comparison

See the reproducible scene-loading benchmark and validation guide.

Product Compatible and additional computed target framework versions.
.NET 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.

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.7.6 0 10/27/2026
0.7.5 0 10/27/2026
0.7.0 104 10/5/2026
0.6.9 93 9/20/2026
0.6.8 75 9/12/2026
0.6.7 157 9/7/2026
0.6.5 112 9/1/2026
0.6.4 116 8/31/2026
0.6.0 120 8/27/2026
0.5.2 171 1/22/2026
0.5.1 156 1/13/2026
0.5.0 145 1/13/2026