Skip to content

Commit

Permalink
updating console output + dependencies++
Browse files Browse the repository at this point in the history
  • Loading branch information
bertt committed Jun 5, 2024
1 parent 4a8cb0d commit 0ad35f0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
17 changes: 15 additions & 2 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using subtree;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
Expand All @@ -33,6 +34,9 @@ static void Main(string[] args)

var version = Assembly.GetExecutingAssembly().GetName().Version;

var stopWatch = new Stopwatch();
stopWatch.Start();

Console.WriteLine("Tool: I3dm.export");
Console.WriteLine("Version: " + version);
Console.WriteLine($"Exporting instances from {o.Table}...");
Expand Down Expand Up @@ -126,12 +130,14 @@ static void Main(string[] args)
}

Console.WriteLine($"Maximum instances per tile: " + o.MaxFeaturesPerTile);
Console.WriteLine("Start generating tiles...");

var tile = new Tile(0, 0, 0);
var tiles = ImplicitTiling.GenerateTiles(o, conn, bbox_wgs84, tile, new List<Tile>(), contentDirectory, epsg, translate, (bool)o.UseGpuInstancing);
Console.WriteLine("Start generating tiles...");

Console.WriteLine();
Console.WriteLine($"Tiles written: {tiles.Count}");
Console.WriteLine("Start writing tileset files...");

var subtreeFiles = SubtreeCreator.GenerateSubtreefiles(tiles);
foreach (var s in subtreeFiles)
Expand All @@ -140,19 +146,26 @@ static void Main(string[] args)
var subtreefile = $"{subtreesDirectory}{Path.AltDirectorySeparatorChar}{t.Z}_{t.X}_{t.Y}.subtree";
File.WriteAllBytes(subtreefile, s.Value);
}
Console.WriteLine($"Subtree tiles written: {subtreeFiles.Count}");

var subtreeLevels = subtreeFiles.Count > 1 ? ((Tile)subtreeFiles.ElementAt(1).Key).Z : 2;
var availableLevels = tiles.Max(t => t.Z) + 1;

var tilesetjson = TreeSerializer.ToImplicitTileset(rootBoundingVolumeRegion, o.GeometricError, availableLevels, subtreeLevels, version, translate, (bool)o.UseGpuInstancing, transform);
var file = $"{o.Output}{Path.AltDirectorySeparatorChar}tileset.json";
Console.WriteLine($"Subtree files written: {subtreeFiles.Count}");
Console.WriteLine("SubtreeLevels: " + subtreeLevels);
Console.WriteLine("SubdivisionScheme: QUADTREE");
Console.WriteLine("Refine method: ADD");
Console.WriteLine($"Geometric error: {o.GeometricError}");
Console.WriteLine($"Writing {file}...");
File.WriteAllText(file, tilesetjson);


stopWatch.Stop();

var timeSpan = stopWatch.Elapsed;
Console.WriteLine("Time: {0}h {1}m {2}s {3}ms", Math.Floor(timeSpan.TotalHours), timeSpan.Minutes, timeSpan.Seconds, timeSpan.Milliseconds);

Console.WriteLine("End of process");
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/i3dm.export.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="i3dm.tile" Version="1.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Npgsql" Version="8.0.2" />
<PackageReference Include="SharpGLTF.Ext.3DTiles" Version="1.0.0-alpha0031" />
<PackageReference Include="SharpGLTF.Toolkit" Version="1.0.0-alpha0031" />
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="SharpGLTF.Ext.3DTiles" Version="1.0.0" />
<PackageReference Include="SharpGLTF.Toolkit" Version="1.0.0" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
<PackageReference Include="subtree" Version="1.4.4" />
<PackageReference Include="subtree" Version="1.4.7" />
<PackageReference Include="Wkx" Version="0.5.1" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="myget.org" value="https://www.myget.org/F/bertt/api/v3/index.json"/>
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion tests/i3dm.export.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 0ad35f0

Please sign in to comment.