Rhino.Scripting.QrCode 0.2.0

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

logo

Rhino.Scripting.QrCode

Rhino.Scripting.QrCode on nuget.org Build Status Docs Build Status license code size

Rhino.Scripting.QrCode is a small library for creating QR codes as Rhino3D Meshes or Hatches.
It uses ZXing.Net to encode the text.
The QR code is vector geometry, not an image, so it stays sharp at any size.

It works in Rhino 8 and later, from F#, C# and Python.

The QR code is created at the World Origin with a size of 1.0 x 1.0 units, using the high error correction level (30%).
Text with non-ASCII characters is encoded as UTF-8.

Use in F#

For example in the Fesh.Rhino scripting editor:

#r "nuget: Rhino.Scripting.QrCode"
open Rhino
open Rhino.Geometry
open Rhino.Scripting

let doc = RhinoDoc.ActiveDoc

// as a Mesh, scaled to 50 units
let mesh = QrCode.asMesh "https://www.rhino3d.com"
mesh.Transform(Transform.Scale(Point3d.Origin, 50.0)) |> ignore
doc.Objects.AddMesh(mesh) |> ignore

// as Hatches, using the 'Solid' hatch pattern of the active document
for hatch in QrCode.asHatches "https://www.rhino3d.com" do
    doc.Objects.AddHatch(hatch) |> ignore

doc.Views.Redraw()

Use in C#

For example in the Rhino 8 script editor:

#r "nuget: Rhino.Scripting.QrCode"
using Rhino;
using Rhino.Scripting;

var mesh = QrCode.asMesh("https://www.rhino3d.com");
RhinoDoc.ActiveDoc.Objects.AddMesh(mesh);
RhinoDoc.ActiveDoc.Views.Redraw();

Use in Python

  1. Get the files Rhino.Scripting.QrCode.dll, zxing.dll and FSharp.Core.dll into one folder.
    Run dotnet build on this repository, then they are all in bin/Release/net48.
    If you download dll files instead, you might need to unblock them first:

    unblock

  2. Reference the dll in IronPython:

import clr
clr.AddReferenceToFileAndPath(r"C:\path\to\bin\Release\net48\Rhino.Scripting.QrCode.dll")
import Rhino
from Rhino.Scripting import QrCode

mesh = QrCode.asMesh("https://www.rhino3d.com")
Rhino.RhinoDoc.ActiveDoc.Objects.AddMesh(mesh)
Rhino.RhinoDoc.ActiveDoc.Views.Redraw()

Full API Documentation

goswinr.github.io/Rhino.Scripting.QrCode

Alternatives

There are other QR code tools for Rhino that create images instead of geometry,
see discourse.mcneel.com.

Contributing

Contributions are welcome even for small things like typos. If you have problems with this library please submit an issue.

License

MIT

Changelog

see CHANGELOG.md

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. 
.NET Framework net48 is compatible.  net481 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.2.0 92 10/10/2026

### Added

- First release on nuget.org

### Changed

- Target net48, net8.0 and net10.0, for Rhino 8 and later. Rhino 6 and 7 are not supported anymore
- Reference RhinoCommon 8 instead of 6
- Update ZXing.Net from 0.16.6 to 0.16.11
- NuGet package id is `Rhino.Scripting.QrCode` instead of `Rhino6.Scripting.QrCode`

### Fixed

- The QR code had an extra empty row and column, so it was smaller than 1.0 unit and shifted up by one module
- Characters outside of ISO-8859-1, like '€' or '中', were encoded as '?'. Text with non-ASCII characters is encoded as UTF-8 now
- `asHatches` used a fixed tolerance of 0.01, bigger than a module of QR codes with more than 100 modules. It is relative to the module size now
- `asHatches` adds the 'Solid' hatch pattern to the document if it is missing, instead of failing
- `asMesh` returns a Mesh with normals
- README examples