Sewlore.SvgMeasurementMarks
0.1.0
dotnet add package Sewlore.SvgMeasurementMarks --version 0.1.0
NuGet\Install-Package Sewlore.SvgMeasurementMarks -Version 0.1.0
<PackageReference Include="Sewlore.SvgMeasurementMarks" Version="0.1.0" />
<PackageVersion Include="Sewlore.SvgMeasurementMarks" Version="0.1.0" />
<PackageReference Include="Sewlore.SvgMeasurementMarks" />
paket add Sewlore.SvgMeasurementMarks --version 0.1.0
#r "nuget: Sewlore.SvgMeasurementMarks, 0.1.0"
#:package Sewlore.SvgMeasurementMarks@0.1.0
#addin nuget:?package=Sewlore.SvgMeasurementMarks&version=0.1.0
#tool nuget:?package=Sewlore.SvgMeasurementMarks&version=0.1.0
Sewlore.SvgMeasurementMarks
A small .NET Standard 2.0 library for physically dimensioned SVG calibration squares, rulers and measurement labels. Input units are mm, cm and inches; all drawing coordinates are normalized to millimetres using exact decimal arithmetic.
By Sewlore. For consistent baselines, measuring-point labels and recording methods, read the fabric measurement methods guide.
Use
The prepared local package is version 0.1.0. This README does not assert that a registry release already exists. Install the built .nupkg from your local package folder, or reference the source project:
dotnet add package Sewlore.SvgMeasurementMarks --version 0.1.0 --source ./artifacts
using Sewlore.SvgMeasurementMarks;
var sheet = new SvgSheet(
new Length(210, MeasurementUnit.Millimetre),
new Length(297, MeasurementUnit.Millimetre));
sheet.AddCalibrationSquare(15, 15, new Length(5, MeasurementUnit.Centimetre));
sheet.AddRuler(15, 90, new Length(6, MeasurementUnit.Inch),
new Length(0.25m, MeasurementUnit.Inch), majorEvery: 4);
sheet.AddMeasurementLabel(15, 130, new Length(10, MeasurementUnit.Centimetre),
"Before-wash baseline");
File.WriteAllText("reference.svg", sheet.ToSvg());
AddRuler supports horizontal and vertical orientation. Intervals can use a different unit than the ruler length. The final endpoint is included even when the last interval is partial. Tick labels use the ruler's input unit; labels with recurring decimals display up to six decimal places while geometry retains decimal precision.
Print and layout limits
- The root SVG has physical
width/heightin mm and a matching millimetreviewBox. Dimensions describe the geometric centreline of the 0.2 mm stroke. - Print at actual size / 100%, disable fit-to-page scaling, and measure the calibration square with a physical ruler. The library cannot validate a printer, browser zoom, paper, cutting accuracy or hardware.
- Sheet dimensions are limited to 1-10,000 mm. Marks must fit with their stroke and standard label area; a ruler is limited to 10,000 intervals. Long text can visually exceed a mark: font metrics and text wrapping are not computed.
- XML text is encoded. Invalid XML characters, unsupported units, negative lengths, zero mark lengths, conversion overflow and out-of-bounds geometry are rejected. Generated output contains no script, hyperlinks, external images or network requests.
- Measurement marks are reference graphics; they do not constitute a complete fitted pattern or a validated fabric-testing protocol.
Build and test
Library consumers need a .NET Standard 2.0 compatible runtime. The included tests and example generator require a .NET 10 SDK.
dotnet test tests/Sewlore.SvgMeasurementMarks.Tests.csproj -c Release
dotnet pack Sewlore.SvgMeasurementMarks/Sewlore.SvgMeasurementMarks.csproj -c Release -o artifacts
dotnet run --project examples/GenerateSheets/GenerateSheets.csproj -c Release -- examples/generated
Tests cover exact physical-unit conversion, SVG viewport geometry, partial and mixed-unit ruler intervals, vertical orientation, measurement spans, Turkish decimal formatting, XML injection, invalid inputs and failure atomicity. SVG physical dimensions follow the W3C SVG coordinate specification.
MIT licensed. Developed with AI assistance; source and tests are included for inspection. No telemetry and no runtime third-party package dependencies.
| Product | Versions 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 was computed. 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. |
-
.NETStandard 2.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.1.0 | 126 | 10/11/2026 |
Initial functional release with physically dimensioned SVG generation and native unit tests. Print at actual size and verify the calibration square with a physical ruler.