Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab39c5103d | ||
|
|
4c9b1f8cb7 | ||
|
|
6e23391339 | ||
|
|
5760fb77b0 | ||
|
|
153ea88f4f | ||
|
|
60113ab76e |
No files matched your search
+6
-8
@@ -1,22 +1,20 @@
|
||||
# 运行数据目录(settings/model/cache/update),绝不入库
|
||||
.GC/
|
||||
|
||||
# .NET 构建中间产物(已跟踪的历史文件不动,只防新增)
|
||||
bin/
|
||||
obj/
|
||||
|
||||
dist/
|
||||
build/
|
||||
.GC/
|
||||
*.user
|
||||
.DS_Store
|
||||
.vs/
|
||||
.venv/
|
||||
venv/
|
||||
env/
|
||||
.idea/
|
||||
.vscode/
|
||||
.DS_Store
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.log
|
||||
node_modules/
|
||||
dist/
|
||||
build/
|
||||
.pytest_cache/
|
||||
.mypy_cache/
|
||||
@@ -0,0 +1,40 @@
|
||||
# 2026-11-07
|
||||
|
||||
## Earth Model Studio(新建项目)
|
||||
- 用户要求:C#/.NET8(可切10),多目录结构(曾要求 gradle 命名,后明确改为标准 .NET 命名,勿再用 gradle 字样)
|
||||
- 结构:src/main/dotnet + src/test/dotnet + src/main/resources + model/ + examples/ + dist/ + Directory.Build.props + build.sh/build.ps1
|
||||
- 三平台一次性编译:`./build.sh publish` → dist/{mac-arm64(.app),win-x64,win-arm64},自包含单文件 + 内置 model/ + examples/
|
||||
- 技术栈:Avalonia 11.3.9 + CommunityToolkit.Mvvm 8.2.2(本地 NuGet 已缓存);纯 CPU 球面像素渲染(SphereRaster + CelestialView)
|
||||
- 模型格式:model/<id>/<id>.json + <id>.model/scene.json + land.json;模型源=git 仓库根的 model/ 目录(支持 github/gitlab/gitee zip 归档、git clone、本地目录)
|
||||
- 内置模型:earth-rotation(自转)、earth-revolution(公转),land.json 手绘大陆轮廓已校验
|
||||
- 校验:src/test/dotnet 用 Avalonia.Headless 渲染截图到 build/screenshots(页面+场景全通过,HUD 重叠已修)
|
||||
- 已知小问题:RadialGradientBrush.Radius 过时警告;发布后 mac 单文件在沙箱内需 DOTNET_BUNDLE_EXTRACT_BASE_DIR 可写
|
||||
|
||||
## 修改(14:10 之后)
|
||||
- 模型启动改为独立窗口:新增 Views/PlayerWindow.axaml(.cs),MainViewModel 只抛 PlayerRequested 事件,MainWindow 负责 Show(owner) 并维护 PlayerWindows 列表;PlayerViewModel 去掉 MainViewModel 依赖,改 CloseRequested + IDisposable;Esc/空格/F11 快捷键
|
||||
- 分层:src=启动器(无模型数据、无预置模型源),model/=模型数据。移除 examples/,SettingsService 不再种内置源,AppPaths 去掉 ExamplesRoot 并新增 EMS_MODELS
|
||||
- build.sh/build.ps1:publish 只建空 model/(仅 README),新增 pack-models → dist/models-1.0.0.zip
|
||||
- model/README.md 写清模型格式规范
|
||||
- 验证:离屏截图 page-player.png / page-main-while-playing.png,双窗口计数 2→关一个→1→0;三平台重新发布 + 模型 zip
|
||||
|
||||
## 架构重构(14:30 之后):启动器不再渲染,模型自带功能代码
|
||||
- 新分层:src=启动器(扫描/下载/开窗,零渲染);model-sdk=契约;model-src=模型源码+封面工具;model=模型包(数据+dll+preview.png+i18n)
|
||||
- 契约:IModelFactory(ApiVersion/Create) / IModelRuntime.CreateView(IModelContext) / IModelContext(ModelId/ModelDirectory/DataDirectory/Language/MemoryBudgetMb/RequestClose/Log)
|
||||
- 加载:ModelHost + 可收集 AssemblyLoadContext,Sdk/Avalonia 走默认上下文,关窗 Unload
|
||||
- 迁移:CelestialView/SphereRaster/LandMask/SceneDefinition/SceneRuntime → model-src/EarthModels(命名空间 NeoRF.EarthModels);PlayerView+PlayerViewModel 换成模型内 EarthModelView(C# 构建 UI)
|
||||
- 模型包新增清单字段 assembly/type/preview/apiVersion;封面由 model-src/tools/PreviewGen 用模型渲染器生成
|
||||
- 自转模型 views=["rotation"] → 无节气定位/无视图切换;公转 views=["revolution"] → 有节气、封面是公转场景
|
||||
- 构建:./build.sh models 编译模型 dll + 生成封面;pack-models 先编译再打包
|
||||
- 验证:EMS_SELFTEST=1 自检(dev + 发布包 /tmp 部署)两个模型均 OK;离屏截图含插件加载真实窗口
|
||||
|
||||
## 六项改动(15:00–15:35):真实贴图 / 缩放 / 拖动 / 动画 / 代码归位 / 进度条
|
||||
- 目录:删除 model-src,根目录 model-sdk -> model/_sdk;现在根目录只有 src/ 与 model/。模型源码在 model/<id>/src/,共享引擎在 model/_engine/,契约在 model/_sdk/
|
||||
- 清单 assembly 改为各模型自己的 dll:EarthRotationModel.dll / EarthRevolutionModel.dll(工厂仍是 NeoRF.EarthModels.*ModelFactory)
|
||||
- 贴图:PlanetTexture 烘焙 1024×512 等经纬度纹理(海洋深度、沙漠/雨林/针叶林/苔原、极地冰盖、云层模糊、夜间辉光);反照率打包 uint[] Albedo
|
||||
- 性能:地形梯度 SlopeEast/SlopeNorth 预烘焙(去掉每像素 4 次 SampleHeight + 6 次三角函数);海面高光 Pow 改乘法;运动时降分辨率 460 + 按帧耗时自适应 320–460,静止补 820 高清帧。实测公转播放 6ms、自转播放 ~18ms
|
||||
- 交互:滚轮/工具栏 −100%+/⟲ 缩放 0.6–6×(缓动),暂停后拖动旋转地球或沿轨道移动、松手惯性;云层播放/暂停都缓慢漂移
|
||||
- 动画:模型窗口淡入、按钮悬停 BrushTransition、教学面板滑入淡出;启动器页面切换淡入、按钮/卡片悬停过渡、进度条 DoubleTransition 平滑
|
||||
- 进度条:契约新增 IModelRuntime.Prepare(后台)+ IModelContext.ReportProgress;ModelHost.LoadAsync 两阶段;LoadingWindow 显示真实阶段(读场景→烘焙纹理→构建界面)
|
||||
- 打包:pack-models 排除 */bin/* */obj/*,避免把 107MB SkiaSharp native 打进包;模型包 356KB(含源码+dll+封面+i18n)
|
||||
- 验证:离屏截图全部正常;反射校验缩放 1.00→1.25→1.00、暂停拖动=True、交互提示=True;自转无节气;发布包复制到 /tmp 自检两个模型 OK
|
||||
- 产物:dist/mac-arm64 97M、win-x64 88M、win-arm64 94M(model/ 仅 README),dist/models-1.0.0.zip 356K
|
||||
@@ -21,7 +21,7 @@
|
||||
-->
|
||||
<AvaloniaVersion>11.3.9</AvaloniaVersion>
|
||||
<MvvmVersion>8.2.2</MvvmVersion>
|
||||
<Version>1.0.5</Version>
|
||||
<Version>1.0.0</Version>
|
||||
<Company>NeoRF</Company>
|
||||
<Product>Earth Model Studio</Product>
|
||||
<NeutralLanguage>zh-Hans</NeutralLanguage>
|
||||
|
||||
@@ -1,75 +1,220 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
# Earth Model Studio 构建入口(Windows PowerShell,薄封装)
|
||||
# 实际代码在 buildsh/ 里。Windows 上若无 sh,则走内置的最小实现。
|
||||
# .\build.ps1 build | check | models | stamp | run | test | clean | doctor
|
||||
# Earth Model Studio 构建脚本(Windows PowerShell)
|
||||
#
|
||||
# .\build.ps1 编译
|
||||
# .\build.ps1 run 运行
|
||||
# .\build.ps1 test 离屏渲染校验
|
||||
# .\build.ps1 models 编译模型 dll + 生成封面 + 自动打版本
|
||||
# .\build.ps1 stamp 只重新生成 version.json 与模型版本
|
||||
# .\build.ps1 publish 编译三个平台启动器(不内置模型)+ 建立 .GC 运行目录
|
||||
# .\build.ps1 pack-models 单独打包模型数据(含 version.json)
|
||||
# .\build.ps1 pack-launcher 生成三个平台的启动器更新包 zip
|
||||
# .\build.ps1 update-test 离线验证自动更新链路
|
||||
# .\build.ps1 clean 清理
|
||||
#
|
||||
# 分层:src\ 只是启动器;模型全部在 model\;**发布包不内置模型**。
|
||||
#
|
||||
# 运行目录(发布包里就长这样):
|
||||
# <安装目录>\
|
||||
# EarthModelStudio.exe
|
||||
# .GC\settings.json
|
||||
# .GC\model\ 启动时从 gitcode 下载的模型
|
||||
# .GC\cache\ 下载暂存
|
||||
# .GC\update\ 待下次启动应用的启动器更新
|
||||
# ---------------------------------------------------------------------------
|
||||
param(
|
||||
[Parameter(Position = 0)]
|
||||
[ValidateSet('build','check','models','stamp','pack-models','pack-launcher',
|
||||
'run','test','update-test','clean','doctor','dist')]
|
||||
[ValidateSet('build', 'run', 'test', 'publish', 'models', 'stamp', 'pack-models',
|
||||
'pack-launcher', 'update-test', 'bundle', 'clean', 'doctor')]
|
||||
[string]$Task = 'build'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$Root = $PSScriptRoot
|
||||
Set-Location $Root
|
||||
|
||||
# Avalonia 遥测任务在只读用户目录/CI/沙箱会因写日志失败而中断编译(MSB4018)。
|
||||
# 官方 opt-out;Directory.Build.targets 里还有一层项目内的兜底。
|
||||
$env:AVALONIA_TELEMETRY_OPTOUT = '1'
|
||||
|
||||
$AppProj = 'src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj'
|
||||
$AppProj = 'src/main/dotnet/EarthModelStudio/EarthModelStudio.csproj'
|
||||
$TestProj = 'src/test/dotnet/EarthModelStudio.Tests/EarthModelStudio.Tests.csproj'
|
||||
$StampProj= 'model/_engine/VersionStamp/VersionStamp.csproj'
|
||||
$Sln = 'EarthModelStudio.sln'
|
||||
$Version = ([regex]::Match((Get-Content Directory.Build.props -Raw), '<Version>(.*?)</Version>')).Groups[1].Value
|
||||
if (-not $Version) { $Version = '1.0.0' }
|
||||
New-Item -ItemType Directory -Force -Path "$Root/build/logs" | Out-Null
|
||||
$PreviewProj = 'model/_engine/PreviewGen/PreviewGen.csproj'
|
||||
$StampProj = 'model/_engine/VersionStamp/VersionStamp.csproj'
|
||||
$Sln = 'EarthModelStudio.sln'
|
||||
$Version = '1.0.0'
|
||||
|
||||
# 优先复用 buildsh 的 shell 实现(Git Bash / WSL / sh 可用时)
|
||||
$sh = Get-Command sh -ErrorAction SilentlyContinue
|
||||
if ($sh) {
|
||||
& $sh.Source "$Root/build.sh" $Task
|
||||
exit $LASTEXITCODE
|
||||
function Stamp-Versions {
|
||||
Write-Host '==> 自动计算模型版本并生成 version.json'
|
||||
dotnet run --project $StampProj -c Release -- $Root $Version
|
||||
}
|
||||
|
||||
function Stamp { dotnet run --project $StampProj -c Release -- $Root $Version }
|
||||
function Build-Models {
|
||||
Write-Host '==> 编译模型功能程序集(源码就在各模型目录的 src\ 里)'
|
||||
Get-ChildItem "$Root/model" -Directory | ForEach-Object {
|
||||
$id = $_.Name
|
||||
$src = Join-Path $_.FullName 'src'
|
||||
if (-not (Test-Path $src)) { return }
|
||||
$proj = Get-ChildItem $src -Filter *.csproj | Select-Object -First 1
|
||||
if (-not $proj) { return }
|
||||
if ($null -eq $proj) { return }
|
||||
dotnet build $proj.FullName -c Release
|
||||
$data = Join-Path $_.FullName "$id.model"
|
||||
if (Test-Path $data) {
|
||||
Get-ChildItem (Join-Path $src 'bin/Release/net8.0') -Filter *.dll | ForEach-Object {
|
||||
if ($_.Name -eq 'EarthModelStudio.ModelSdk.dll') { return }
|
||||
Copy-Item -Force $_.FullName $data
|
||||
Write-Host " -> model/$id/$id.model/$($_.Name)"
|
||||
}
|
||||
}
|
||||
}
|
||||
Stamp
|
||||
Write-Host '==> 用模型自己的渲染器生成封面'
|
||||
dotnet run --project $PreviewProj -c Release -- $Root
|
||||
Stamp-Versions
|
||||
}
|
||||
|
||||
# 发布目录只放启动器 + 空的 .GC 运行骨架,绝不放模型
|
||||
function Prepare-RuntimeLayout([string]$RelDir) {
|
||||
$dest = "$Root/$RelDir"
|
||||
if (-not (Test-Path $dest)) { return }
|
||||
foreach ($old in @("$dest/model", "$dest/examples")) {
|
||||
if (Test-Path $old) { Remove-Item -Recurse -Force $old }
|
||||
}
|
||||
foreach ($dir in @("$dest/.GC/model", "$dest/.GC/cache", "$dest/.GC/update")) {
|
||||
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
||||
}
|
||||
$readme = @'
|
||||
模型库目录(.GC/model/)
|
||||
启动时程序会读取 gitcode 仓库的 version.json,把最新版模型下载到这里。
|
||||
离线使用也可以手动放入 <模型id>/<模型id>.json + <模型id>/<模型id>.model/。
|
||||
|
||||
运行目录:
|
||||
<可执行文件>
|
||||
.GC/settings.json
|
||||
.GC/model/ 本目录(下载的模型)
|
||||
.GC/cache/ 下载暂存
|
||||
.GC/update/ 待下次启动应用的启动器更新
|
||||
'@
|
||||
Set-Content -Path "$dest/.GC/model/README.txt" -Value $readme -Encoding UTF8
|
||||
|
||||
$settingsPath = "$dest/.GC/settings.json"
|
||||
if (-not (Test-Path $settingsPath)) {
|
||||
$json = @'
|
||||
{
|
||||
"language": "auto",
|
||||
"theme": "light",
|
||||
"renderFps": 30,
|
||||
"memoryMb": 2048,
|
||||
"autoUpdateOnStartup": true,
|
||||
"updateRepository": "https://gitcode.com/2509_92447106/GC",
|
||||
"updateManifestUrl": "",
|
||||
"updateLocalRoot": "",
|
||||
"installedModelVersions": {},
|
||||
"launcherVersion": "",
|
||||
"pendingLauncherVersion": "",
|
||||
"lastUpdateCheck": "",
|
||||
"sources": [],
|
||||
"recentModels": []
|
||||
}
|
||||
'@
|
||||
Set-Content -Path $settingsPath -Value $json -Encoding UTF8
|
||||
}
|
||||
Write-Host " 运行目录 -> $RelDir/.GC (settings.json + model/ + cache/ + update/)"
|
||||
}
|
||||
|
||||
function Publish-Rid([string]$Rid, [string]$OutDir) {
|
||||
Write-Host "==> 编译 $Rid -> $OutDir"
|
||||
dotnet publish $AppProj -c Release -r $Rid --self-contained true `
|
||||
-p:Version=$Version -p:DebugType=none -p:PublishSingleFile=true `
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=false -o "$Root/$OutDir"
|
||||
foreach ($old in @("$Root/$OutDir/model", "$Root/$OutDir/examples")) {
|
||||
if (Test-Path $old) { Remove-Item -Recurse -Force $old }
|
||||
}
|
||||
}
|
||||
|
||||
function Pack-Models {
|
||||
New-Item -ItemType Directory -Force -Path "$Root/dist" | Out-Null
|
||||
$zip = "$Root/dist/models-$Version.zip"
|
||||
if (Test-Path $zip) { Remove-Item -Force $zip }
|
||||
Write-Host "==> 打包模型数据 -> dist/models-$Version.zip"
|
||||
$stage = Join-Path $env:TEMP "ems-models-stage"
|
||||
if (Test-Path $stage) { Remove-Item -Recurse -Force $stage }
|
||||
New-Item -ItemType Directory -Force -Path $stage | Out-Null
|
||||
Get-ChildItem "$Root/model" -Recurse -File | Where-Object {
|
||||
$_.FullName -notmatch '\\(bin|obj)\\' -and $_.Extension -ne '.user'
|
||||
} | ForEach-Object {
|
||||
$rel = $_.FullName.Substring("$Root/model".Length + 1)
|
||||
$dest = Join-Path $stage $rel
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $dest) | Out-Null
|
||||
Copy-Item -Force $_.FullName $dest
|
||||
}
|
||||
Compress-Archive -Path "$stage/*" -DestinationPath $zip -Force
|
||||
Remove-Item -Recurse -Force $stage
|
||||
}
|
||||
|
||||
# 启动器更新包:只包含程序文件,排除 .GC(否则会覆盖用户模型与设置)
|
||||
function Pack-Launcher {
|
||||
Write-Host '==> 生成启动器更新包(不含 .GC)'
|
||||
$targets = @{
|
||||
'GC-win-x64.zip' = "$Root/dist/win-x64"
|
||||
'GC-win-arm64.zip' = "$Root/dist/win-arm64"
|
||||
'GC-osx-arm64.zip' = "$Root/dist/mac-arm64/EarthModelStudio.app/Contents/MacOS"
|
||||
}
|
||||
if (-not (Test-Path $targets['GC-osx-arm64.zip'])) {
|
||||
$targets['GC-osx-arm64.zip'] = "$Root/dist/mac-arm64"
|
||||
}
|
||||
foreach ($name in $targets.Keys) {
|
||||
$src = $targets[$name]
|
||||
if (-not (Test-Path $src)) { continue }
|
||||
$stage = Join-Path $env:TEMP ("ems-launcher-" + [IO.Path]::GetFileNameWithoutExtension($name))
|
||||
if (Test-Path $stage) { Remove-Item -Recurse -Force $stage }
|
||||
New-Item -ItemType Directory -Force -Path $stage | Out-Null
|
||||
Get-ChildItem $src -Recurse -File | Where-Object {
|
||||
$_.FullName -notmatch '\\\.GC\\' -and $_.Name -ne '.DS_Store'
|
||||
} | ForEach-Object {
|
||||
$rel = $_.FullName.Substring($src.Length).TrimStart('\', '/')
|
||||
$dest = Join-Path $stage $rel
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $dest) | Out-Null
|
||||
Copy-Item -Force $_.FullName $dest
|
||||
}
|
||||
$zip = "$Root/dist/$name"
|
||||
if (Test-Path $zip) { Remove-Item -Force $zip }
|
||||
Compress-Archive -Path "$stage/*" -DestinationPath $zip -Force
|
||||
Remove-Item -Recurse -Force $stage
|
||||
}
|
||||
Stamp-Versions
|
||||
Get-ChildItem "$Root/dist/GC-*.zip" | Select-Object Name, Length
|
||||
}
|
||||
|
||||
switch ($Task) {
|
||||
'build' {
|
||||
Write-Host '==> 编译三平台(进度见 buildsh/lib/progress.sh,建议用 Git Bash 运行 ./build.sh build)'
|
||||
Remove-Item -Recurse -Force "$Root/dist" -ErrorAction SilentlyContinue
|
||||
'build' { dotnet build $Sln -c Debug }
|
||||
'run' { dotnet run --project $AppProj -c Debug }
|
||||
'test' { dotnet run --project $TestProj -c Debug -- "$Root/build/screenshots" }
|
||||
'publish' {
|
||||
New-Item -ItemType Directory -Force -Path "$Root/dist" | Out-Null
|
||||
Stamp
|
||||
foreach ($rid in @('osx-arm64','win-x64','win-arm64')) {
|
||||
dotnet publish $AppProj -c Release -r $rid --self-contained true `
|
||||
-p:Version=$Version -p:DebugType=none -p:PublishSingleFile=true `
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=false `
|
||||
-o "$Root/dist/$rid"
|
||||
}
|
||||
Write-Host '==> 完成(详细打包请用 ./build.sh build)'
|
||||
Stamp-Versions
|
||||
Publish-Rid 'osx-arm64' 'dist/mac-arm64'
|
||||
Publish-Rid 'win-x64' 'dist/win-x64'
|
||||
Publish-Rid 'win-arm64' 'dist/win-arm64'
|
||||
Prepare-RuntimeLayout 'dist/win-x64'
|
||||
Prepare-RuntimeLayout 'dist/win-arm64'
|
||||
Prepare-RuntimeLayout 'dist/mac-arm64'
|
||||
Pack-Launcher
|
||||
Write-Host '==> 三个平台编译完成(发布包不含模型,首次启动自动下载),见 dist\' -ForegroundColor Green
|
||||
Write-Host ' 把 version.json / model/ 推送到 gitcode,启动器就会自动检查更新'
|
||||
}
|
||||
'check' {
|
||||
dotnet build $Sln -c Debug
|
||||
$env:EMS_SELFTEST = '1'; dotnet run --project $AppProj -c Debug --no-build; Remove-Item Env:\EMS_SELFTEST
|
||||
dotnet run --project $TestProj -c Debug --no-build -- "$Root/build/screenshots"
|
||||
'models' { Build-Models }
|
||||
'stamp' { Stamp-Versions }
|
||||
'bundle' { Write-Host '已弃用:发布包不再内置模型。请改用 .\build.ps1 stamp 与 gitcode 自动更新。' }
|
||||
'pack-models' {
|
||||
Build-Models
|
||||
Pack-Models
|
||||
}
|
||||
'models' { Build-Models }
|
||||
'stamp' { Stamp }
|
||||
'pack-models' { Build-Models }
|
||||
'pack-launcher' { Write-Host '请用 ./build.sh pack-launcher' }
|
||||
'run' { dotnet run --project $AppProj -c Debug }
|
||||
'test' { dotnet run --project $TestProj -c Debug -- "$Root/build/screenshots" }
|
||||
'pack-launcher' { Pack-Launcher }
|
||||
'update-test' { dotnet run --project $TestProj -c Debug -- '--update-test' $Root }
|
||||
'clean' { Remove-Item -Recurse -Force "$Root/build","$Root/dist" -ErrorAction SilentlyContinue; Write-Host '==> 已清理' }
|
||||
'doctor' { dotnet --info | Select-Object -First 20 }
|
||||
'dist' { Get-ChildItem "$Root/dist" -ErrorAction SilentlyContinue }
|
||||
'clean' {
|
||||
Remove-Item -Recurse -Force "$Root/build", "$Root/dist" -ErrorAction SilentlyContinue
|
||||
Get-ChildItem "$Root/src" -Recurse -Directory -Include bin, obj |
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
'doctor' { dotnet --info }
|
||||
}
|
||||
@@ -1,21 +1,33 @@
|
||||
#!/bin/sh
|
||||
# ---------------------------------------------------------------------------
|
||||
# Earth Model Studio 构建入口(薄封装)
|
||||
# Earth Model Studio 构建脚本(macOS / Linux)
|
||||
#
|
||||
# ./build.sh build 完整发布(原 publish),带 apt 风格进度条
|
||||
# ./build.sh check 验证:编译 + 自检 + 离屏渲染 + 产物
|
||||
# ./build.sh models 编译模型 dll + 封面 + 版本戳
|
||||
# ./build.sh stamp 重新生成 version.json
|
||||
# ./build.sh run / test / update-test / pack-models / pack-launcher
|
||||
# ./build.sh clean 清理
|
||||
# ./build.sh doctor dotnet 信息
|
||||
# ./build.sh dist 列出产物
|
||||
# ./build.sh build 编译(Debug)
|
||||
# ./build.sh run 本机运行
|
||||
# ./build.sh test 离屏渲染校验,截图输出到 build/screenshots
|
||||
# ./build.sh models 编译模型 dll + 生成封面 + 自动打版本
|
||||
# ./build.sh stamp 只重新生成 version.json 与模型版本
|
||||
# ./build.sh publish 编译三个平台启动器(不内置模型)+ 建立 .GC 运行目录
|
||||
# ./build.sh pack-models 单独打包模型数据(含 version.json)
|
||||
# ./build.sh pack-launcher 生成三个平台的启动器更新包 zip
|
||||
# ./build.sh update-test 离线验证自动更新链路
|
||||
# ./build.sh clean 清理
|
||||
#
|
||||
# 实际代码都在 buildsh/ 里,本文件只负责加载模块与分发。
|
||||
# 分层:src/ 只是启动器;模型全部在 model/;**发布包不内置模型**。
|
||||
#
|
||||
# 运行目录(发布包里就长这样):
|
||||
# <安装目录>/
|
||||
# EarthModelStudio(.exe | .app/...)
|
||||
# .GC/
|
||||
# settings.json 设置与已安装版本
|
||||
# model/ 启动时从 gitcode 下载的模型
|
||||
# cache/ 下载暂存
|
||||
# update/ 待下次启动应用的启动器更新
|
||||
# ---------------------------------------------------------------------------
|
||||
set -eu
|
||||
|
||||
# Avalonia 遥测任务在只读用户目录/CI/沙箱会因写日志失败中断编译(MSB4018)
|
||||
# Avalonia 遥测任务在只读用户目录/CI/沙箱会因写日志失败而中断编译(MSB4018)。
|
||||
# 官方 opt-out;Directory.Build.targets 里还有一层项目内的兜底。
|
||||
export AVALONIA_TELEMETRY_OPTOUT=1
|
||||
|
||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
@@ -26,39 +38,214 @@ PREVIEW_PROJ="model/_engine/PreviewGen/PreviewGen.csproj"
|
||||
STAMP_PROJ="model/_engine/VersionStamp/VersionStamp.csproj"
|
||||
TEST_PROJ="src/test/dotnet/EarthModelStudio.Tests/EarthModelStudio.Tests.csproj"
|
||||
SLN="EarthModelStudio.sln"
|
||||
VERSION=$(sed -n 's/.*<Version>\(.*\)<\/Version>.*/\1/p' Directory.Build.props | head -1)
|
||||
[ -n "$VERSION" ] || VERSION="1.0.0"
|
||||
|
||||
VERSION="1.0.0"
|
||||
TASK="${1:-build}"
|
||||
shift 2>/dev/null || true
|
||||
|
||||
# 解析 -version=<版本号>(也接受 --version=)
|
||||
CLI_VERSION=""
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
-version=*|--version=*) CLI_VERSION="${arg#*=}" ;;
|
||||
esac
|
||||
done
|
||||
if [ -n "$CLI_VERSION" ]; then
|
||||
VERSION="$CLI_VERSION"
|
||||
# 写回 Directory.Build.props,让程序集版本与关于页显示一致
|
||||
if [ -f Directory.Build.props ]; then
|
||||
sed -i.bak "s|<Version>[^<]*</Version>|<Version>${VERSION}</Version>|" Directory.Build.props
|
||||
rm -f Directory.Build.props.bak
|
||||
# 按模型包内容指纹自动写回 <id>.json 的 version,并生成 version.json
|
||||
stamp_versions() {
|
||||
echo "==> 自动计算模型版本并生成 version.json"
|
||||
dotnet run --project "$STAMP_PROJ" -c Release -- "$ROOT_DIR" "$VERSION"
|
||||
}
|
||||
|
||||
# 编译模型自己的功能程序集,并把 dll / 封面直接写进模型包
|
||||
build_models() {
|
||||
echo "==> 编译模型功能程序集(源码就在各模型目录的 src/ 里)"
|
||||
for DIR in "$ROOT_DIR"/model/*/; do
|
||||
ID=$(basename "$DIR")
|
||||
[ -d "$DIR/src" ] || continue
|
||||
PROJ=$(ls "$DIR"src/*.csproj 2>/dev/null | head -1)
|
||||
[ -n "$PROJ" ] || continue
|
||||
dotnet build "$PROJ" -c Release
|
||||
if [ -d "$DIR$ID.model" ]; then
|
||||
for DLL in "$DIR"src/bin/Release/net8.0/*.dll; do
|
||||
[ -f "$DLL" ] || continue
|
||||
NAME=$(basename "$DLL")
|
||||
[ "$NAME" = "EarthModelStudio.ModelSdk.dll" ] && continue
|
||||
cp "$DLL" "$DIR$ID.model/"
|
||||
echo " -> model/$ID/$ID.model/$NAME"
|
||||
done
|
||||
fi
|
||||
done
|
||||
echo "==> 用模型自己的渲染器生成封面"
|
||||
dotnet run --project "$PREVIEW_PROJ" -c Release -- "$ROOT_DIR"
|
||||
stamp_versions
|
||||
}
|
||||
|
||||
# 发布目录只放启动器 + 空的 .GC 运行骨架,绝不放模型
|
||||
prepare_runtime_layout() {
|
||||
REL="$1"
|
||||
DEST="$ROOT_DIR/$REL"
|
||||
[ -d "$DEST" ] || return 0
|
||||
rm -rf "$DEST/model" "$DEST/examples"
|
||||
mkdir -p "$DEST/.GC/model" "$DEST/.GC/cache" "$DEST/.GC/update"
|
||||
cat > "$DEST/.GC/model/README.txt" <<'TXT'
|
||||
模型库目录(.GC/model/)
|
||||
启动时程序会读取 gitcode 仓库的 version.json,把最新版模型下载到这里。
|
||||
离线使用也可以手动放入 <模型id>/<模型id>.json + <模型id>/<模型id>.model/。
|
||||
|
||||
运行目录:
|
||||
<可执行文件>
|
||||
.GC/settings.json
|
||||
.GC/model/ 本目录(下载的模型)
|
||||
.GC/cache/ 下载暂存
|
||||
.GC/update/ 待下次启动应用的启动器更新
|
||||
TXT
|
||||
if [ ! -f "$DEST/.GC/settings.json" ]; then
|
||||
cat > "$DEST/.GC/settings.json" <<'JSON'
|
||||
{
|
||||
"language": "auto",
|
||||
"theme": "light",
|
||||
"renderFps": 30,
|
||||
"memoryMb": 2048,
|
||||
"autoUpdateOnStartup": true,
|
||||
"updateRepository": "https://gitcode.com/2509_92447106/GC",
|
||||
"updateManifestUrl": "",
|
||||
"updateLocalRoot": "",
|
||||
"installedModelVersions": {},
|
||||
"launcherVersion": "",
|
||||
"pendingLauncherVersion": "",
|
||||
"lastUpdateCheck": "",
|
||||
"sources": [],
|
||||
"recentModels": []
|
||||
}
|
||||
JSON
|
||||
fi
|
||||
echo "==> 版本号设为 ${VERSION}"
|
||||
fi
|
||||
mkdir -p "$ROOT_DIR/build/logs"
|
||||
echo " 运行目录 -> $REL/.GC (settings.json + model/ + cache/ + update/)"
|
||||
}
|
||||
|
||||
# 加载 buildsh 模块
|
||||
. "$ROOT_DIR/buildsh/lib/progress.sh"
|
||||
. "$ROOT_DIR/buildsh/lib/build_funcs.sh"
|
||||
. "$ROOT_DIR/buildsh/build.sh"
|
||||
. "$ROOT_DIR/buildsh/check.sh"
|
||||
. "$ROOT_DIR/buildsh/tools.sh"
|
||||
publish_rid() {
|
||||
RID="$1"; OUT="$2"
|
||||
echo ""
|
||||
echo "==> 编译 ${RID} -> ${OUT}"
|
||||
dotnet publish "$APP_PROJ" \
|
||||
-c Release \
|
||||
-r "$RID" \
|
||||
--self-contained true \
|
||||
-p:Version="$VERSION" \
|
||||
-p:DebugType=none \
|
||||
-p:PublishSingleFile=true \
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true \
|
||||
-p:PublishTrimmed=false \
|
||||
-o "$ROOT_DIR/$OUT"
|
||||
rm -rf "$ROOT_DIR/$OUT/model" "$ROOT_DIR/$OUT/examples"
|
||||
}
|
||||
|
||||
# 把 model/ 里的模型数据单独打包(与启动器分开分发)
|
||||
pack_models() {
|
||||
mkdir -p "$ROOT_DIR/dist"
|
||||
ZIP="$ROOT_DIR/dist/models-$VERSION.zip"
|
||||
rm -f "$ZIP"
|
||||
echo "==> 打包模型数据 -> dist/models-$VERSION.zip"
|
||||
( cd "$ROOT_DIR" && zip -qr "$ZIP" model \
|
||||
-x "*.DS_Store" "*/bin/*" "*/obj/*" "*.user" )
|
||||
du -sh "$ZIP"
|
||||
}
|
||||
|
||||
# 启动器更新包:只包含程序文件,排除 .GC(否则会覆盖用户已下载的模型与设置)
|
||||
pack_launcher() {
|
||||
echo "==> 生成启动器更新包(不含 .GC)"
|
||||
WIN64="$ROOT_DIR/dist/win-x64"
|
||||
WINARM="$ROOT_DIR/dist/win-arm64"
|
||||
MACBIN="$ROOT_DIR/dist/mac-arm64/EarthModelStudio.app/Contents/MacOS"
|
||||
[ -d "$MACBIN" ] || MACBIN="$ROOT_DIR/dist/mac-arm64"
|
||||
[ -d "$WIN64" ] && ( cd "$WIN64" && zip -qr "$ROOT_DIR/dist/GC-win-x64.zip" . \
|
||||
-x "./.GC" "./.GC/*" "*.DS_Store" )
|
||||
[ -d "$WINARM" ] && ( cd "$WINARM" && zip -qr "$ROOT_DIR/dist/GC-win-arm64.zip" . \
|
||||
-x "./.GC" "./.GC/*" "*.DS_Store" )
|
||||
[ -d "$MACBIN" ] && ( cd "$MACBIN" && zip -qr "$ROOT_DIR/dist/GC-osx-arm64.zip" . \
|
||||
-x "./.GC" "./.GC/*" "*.DS_Store" )
|
||||
stamp_versions
|
||||
ls -lh "$ROOT_DIR"/dist/GC-*.zip 2>/dev/null || true
|
||||
}
|
||||
|
||||
package_mac_app() {
|
||||
DIST="$ROOT_DIR/dist/mac-arm64"
|
||||
APP="$DIST/EarthModelStudio.app"
|
||||
rm -rf "$APP"
|
||||
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
|
||||
cat > "$APP/Contents/Info.plist" <<PLIST
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key><string>Earth Model Studio</string>
|
||||
<key>CFBundleDisplayName</key><string>Earth Model Studio</string>
|
||||
<key>CFBundleIdentifier</key><string>cn.neorf.earthmodelstudio</string>
|
||||
<key>CFBundleVersion</key><string>${VERSION}</string>
|
||||
<key>CFBundleShortVersionString</key><string>${VERSION}</string>
|
||||
<key>CFBundlePackageType</key><string>APPL</string>
|
||||
<key>CFBundleExecutable</key><string>EarthModelStudio</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
|
||||
<key>LSMinimumSystemVersion</key><string>11.0</string>
|
||||
<key>NSHighResolutionCapable</key><true/>
|
||||
</dict>
|
||||
</plist>
|
||||
PLIST
|
||||
for f in "$DIST"/*; do
|
||||
base=$(basename "$f")
|
||||
[ "$base" = "EarthModelStudio.app" ] && continue
|
||||
mv "$f" "$APP/Contents/MacOS/"
|
||||
done
|
||||
chmod +x "$APP/Contents/MacOS/EarthModelStudio"
|
||||
echo "==> 已打包 $APP"
|
||||
}
|
||||
|
||||
case "$TASK" in
|
||||
build) bs_build "$ROOT_DIR" ;;
|
||||
check) bs_check "$ROOT_DIR" ;;
|
||||
*) bs_tools "$ROOT_DIR" "$TASK" ;;
|
||||
build)
|
||||
dotnet build "$SLN" -c Debug
|
||||
;;
|
||||
run)
|
||||
dotnet run --project "$APP_PROJ" -c Debug
|
||||
;;
|
||||
test)
|
||||
dotnet run --project "$TEST_PROJ" -c Debug -- "$ROOT_DIR/build/screenshots"
|
||||
;;
|
||||
publish)
|
||||
mkdir -p "$ROOT_DIR/dist"
|
||||
stamp_versions
|
||||
publish_rid "osx-arm64" "dist/mac-arm64"
|
||||
publish_rid "win-x64" "dist/win-x64"
|
||||
publish_rid "win-arm64" "dist/win-arm64"
|
||||
package_mac_app
|
||||
prepare_runtime_layout "dist/win-x64"
|
||||
prepare_runtime_layout "dist/win-arm64"
|
||||
prepare_runtime_layout "dist/mac-arm64/EarthModelStudio.app/Contents/MacOS"
|
||||
pack_launcher
|
||||
echo ""
|
||||
echo "==> 三个平台编译完成(发布包不含模型,首次启动自动下载):"
|
||||
du -sh "$ROOT_DIR/dist"/* 2>/dev/null || true
|
||||
echo " 把 version.json / model/ 推送到 gitcode,启动器就会自动检查更新"
|
||||
;;
|
||||
models)
|
||||
build_models
|
||||
;;
|
||||
stamp)
|
||||
stamp_versions
|
||||
;;
|
||||
bundle)
|
||||
echo "已弃用:发布包不再内置模型。请改用 ./build.sh stamp 与 gitcode 自动更新。"
|
||||
;;
|
||||
pack-models)
|
||||
build_models
|
||||
pack_models
|
||||
;;
|
||||
pack-launcher)
|
||||
pack_launcher
|
||||
;;
|
||||
update-test)
|
||||
dotnet run --project "$TEST_PROJ" -c Debug -- --update-test "$ROOT_DIR"
|
||||
;;
|
||||
clean)
|
||||
rm -rf "$ROOT_DIR/build" "$ROOT_DIR/dist"
|
||||
find "$ROOT_DIR/src" -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} + 2>/dev/null || true
|
||||
echo "==> 已清理"
|
||||
;;
|
||||
doctor)
|
||||
dotnet --info | head -20
|
||||
;;
|
||||
*)
|
||||
echo "未知任务: $TASK"
|
||||
echo "可用: build | run | test | publish | models | stamp | pack-models | pack-launcher | update-test | clean | doctor"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/sh
|
||||
# buildsh/build.sh —— 完整发布(原 publish)
|
||||
# 步骤及权重按实测耗时设定,供进度条估算总进度与剩余时间:
|
||||
# 清理(2) 版本(3) Mac(35) WinX64(25) WinArm(25) 骨架(3) 打包(5) 收尾(2) = 100
|
||||
|
||||
bs_build() {
|
||||
ROOT_DIR="$1"
|
||||
: "${APP_PROJ:?}" "${SLN:?}" "${VERSION:?}"
|
||||
|
||||
progress_init 100 2 3 35 25 25 3 5 2
|
||||
|
||||
progress_step "清理旧产物"; progress_tick 100
|
||||
rm -rf "$ROOT_DIR/dist"; mkdir -p "$ROOT_DIR/dist"
|
||||
|
||||
progress_step "版本戳"; progress_tick 100
|
||||
stamp_versions
|
||||
|
||||
# 每个 publish 用后台任务包裹,边跑边按「已用时/预估用时」推进当前步骤进度
|
||||
_run_publish() {
|
||||
_label="$1"; _est="$2"; shift 2
|
||||
( "$@" >"$ROOT_DIR/build/logs/publish-$_label.log" 2>&1 ) &
|
||||
_pid=$!
|
||||
_t0=$(date +%s)
|
||||
while kill -0 "$_pid" 2>/dev/null; do
|
||||
_elapsed=$(( $(date +%s) - _t0 ))
|
||||
_p=$(( _elapsed * 100 / _est ))
|
||||
[ "$_p" -gt 96 ] && _p=96
|
||||
progress_tick "$_p"
|
||||
sleep 1
|
||||
done
|
||||
wait "$_pid" || { echo; echo "!! $_label 编译失败,见 build/logs/publish-$_label.log"; return 1; }
|
||||
progress_tick 100
|
||||
}
|
||||
|
||||
progress_step "编译 Mac"
|
||||
_run_publish mac 90 publish_rid "osx-arm64" "dist/mac-arm64" false || return 1
|
||||
|
||||
progress_step "编译 Win-x64"
|
||||
_run_publish winx64 70 publish_rid "win-x64" "dist/win-x64" true || return 1
|
||||
|
||||
progress_step "编译 Win-arm64"
|
||||
_run_publish winarm 70 publish_rid "win-arm64" "dist/win-arm64" true || return 1
|
||||
|
||||
progress_step "运行骨架"; progress_tick 100
|
||||
package_mac_app
|
||||
prepare_runtime_layout "dist/win-x64"
|
||||
prepare_runtime_layout "dist/win-arm64"
|
||||
prepare_runtime_layout "dist/mac-arm64/EarthModelStudio.app/Contents/MacOS"
|
||||
|
||||
progress_step "打包 zip"; progress_tick 100
|
||||
pack_launcher
|
||||
|
||||
progress_step "收尾"; progress_tick 100
|
||||
progress_done
|
||||
echo "==> 完成,产物:"
|
||||
ls -lh "$ROOT_DIR"/dist/GC-"$VERSION"-*.zip 2>/dev/null || true
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/sh
|
||||
# buildsh/check.sh —— 验证:编译 + 自检 + 离屏测试 + 产物完整性
|
||||
# 步骤权重:编译(40) 自检(15) 离屏(25) 产物(20)
|
||||
|
||||
bs_check() {
|
||||
ROOT_DIR="$1"
|
||||
progress_init 100 40 15 25 20
|
||||
_fail=0
|
||||
|
||||
progress_step "编译检查"
|
||||
if dotnet build "$SLN" -c Debug -v quiet >"$ROOT_DIR/build/logs/check-build.log" 2>&1; then
|
||||
progress_tick 100
|
||||
else
|
||||
progress_tick 100; _fail=1
|
||||
echo; echo "!! 编译失败,见 build/logs/check-build.log"
|
||||
fi
|
||||
|
||||
progress_step "模型自检"
|
||||
if EMS_SELFTEST=1 dotnet run --project "$APP_PROJ" -c Debug --no-build \
|
||||
>"$ROOT_DIR/build/logs/check-selftest.log" 2>&1; then
|
||||
grep -q "FAIL" "$ROOT_DIR/build/logs/check-selftest.log" && { _fail=1; echo; echo "!! 自检有失败项"; }
|
||||
else
|
||||
_fail=1; echo; echo "!! 自检异常"
|
||||
fi
|
||||
progress_tick 100
|
||||
|
||||
progress_step "离屏渲染"
|
||||
if dotnet run --project "$TEST_PROJ" -c Debug --no-build -- \
|
||||
"$ROOT_DIR/build/screenshots" >"$ROOT_DIR/build/logs/check-render.log" 2>&1; then
|
||||
progress_tick 100
|
||||
else
|
||||
_fail=1; progress_tick 100; echo; echo "!! 离屏渲染失败"
|
||||
fi
|
||||
|
||||
progress_step "产物检查"
|
||||
_n=$(ls "$ROOT_DIR"/dist/GC-"$VERSION"-*.zip 2>/dev/null | wc -l | tr -d ' ')
|
||||
if [ "$_n" -ge 3 ]; then
|
||||
progress_tick 100
|
||||
else
|
||||
_fail=1; progress_tick 100; echo; echo "!! 产物不足 3 个(当前 $_n)"
|
||||
fi
|
||||
|
||||
progress_done
|
||||
[ "$_fail" -eq 0 ] && echo "==> 全部通过" || echo "==> 有失败项"
|
||||
return "$_fail"
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
#!/bin/sh
|
||||
# buildsh/lib/build_funcs.sh —— 构建函数库(由入口脚本 source)
|
||||
# 依赖调用方提供:ROOT_DIR, APP_PROJ, PREVIEW_PROJ, STAMP_PROJ, TEST_PROJ, SLN, VERSION
|
||||
# 以及任务进度上报函数 step / progress(由进度条引擎提供,未定义时降级为 echo)
|
||||
|
||||
if ! type step >/dev/null 2>&1; then step() { echo "==> $1"; }; fi
|
||||
if ! type progress >/dev/null 2>&1; then progress() { :; }; fi
|
||||
|
||||
stamp_versions() {
|
||||
echo "==> 自动计算模型版本并生成 version.json"
|
||||
dotnet run --project "$STAMP_PROJ" -c Release -- "$ROOT_DIR" "$VERSION"
|
||||
}
|
||||
|
||||
# 编译模型自己的功能程序集,并把 dll / 封面直接写进模型包
|
||||
build_models() {
|
||||
echo "==> 编译模型功能程序集(源码就在各模型目录的 src/ 里)"
|
||||
for DIR in "$ROOT_DIR"/model/*/; do
|
||||
ID=$(basename "$DIR")
|
||||
[ -d "$DIR/src" ] || continue
|
||||
PROJ=$(ls "$DIR"src/*.csproj 2>/dev/null | head -1)
|
||||
[ -n "$PROJ" ] || continue
|
||||
dotnet build "$PROJ" -c Release
|
||||
if [ -d "$DIR$ID.model" ]; then
|
||||
for DLL in "$DIR"src/bin/Release/net8.0/*.dll; do
|
||||
[ -f "$DLL" ] || continue
|
||||
NAME=$(basename "$DLL")
|
||||
[ "$NAME" = "EarthModelStudio.ModelSdk.dll" ] && continue
|
||||
cp "$DLL" "$DIR$ID.model/"
|
||||
echo " -> model/$ID/$ID.model/$NAME"
|
||||
done
|
||||
fi
|
||||
done
|
||||
echo "==> 用模型自己的渲染器生成封面"
|
||||
dotnet run --project "$PREVIEW_PROJ" -c Release -- "$ROOT_DIR"
|
||||
stamp_versions
|
||||
}
|
||||
|
||||
# 发布目录只放启动器 + 空的 .GC 运行骨架,绝不放模型
|
||||
prepare_runtime_layout() {
|
||||
REL="$1"
|
||||
DEST="$ROOT_DIR/$REL"
|
||||
[ -d "$DEST" ] || return 0
|
||||
rm -rf "$DEST/model" "$DEST/examples"
|
||||
mkdir -p "$DEST/.GC/model" "$DEST/.GC/cache" "$DEST/.GC/update"
|
||||
cat > "$DEST/.GC/model/README.txt" <<'TXT'
|
||||
模型库目录(.GC/model/)
|
||||
启动时程序会读取 gitcode 仓库的 version.json,把最新版模型下载到这里。
|
||||
离线使用也可以手动放入 <模型id>/<模型id>.json + <模型id>/<模型id>.model/。
|
||||
|
||||
运行目录:
|
||||
<可执行文件>
|
||||
.GC/settings.json
|
||||
.GC/model/ 本目录(下载的模型)
|
||||
.GC/cache/ 下载暂存
|
||||
.GC/update/ 待下次启动应用的启动器更新
|
||||
TXT
|
||||
if [ ! -f "$DEST/.GC/settings.json" ]; then
|
||||
cat > "$DEST/.GC/settings.json" <<'JSON'
|
||||
{
|
||||
"language": "auto",
|
||||
"theme": "light",
|
||||
"renderFps": 30,
|
||||
"memoryMb": 2048,
|
||||
"autoUpdateOnStartup": true,
|
||||
"updateRepository": "https://gitcode.com/2509_92447106/GC",
|
||||
"updateManifestUrl": "",
|
||||
"updateLocalRoot": "",
|
||||
"installedModelVersions": {},
|
||||
"launcherVersion": "",
|
||||
"pendingLauncherVersion": "",
|
||||
"lastUpdateCheck": "",
|
||||
"sources": [],
|
||||
"recentModels": []
|
||||
}
|
||||
JSON
|
||||
fi
|
||||
echo " 运行目录 -> $REL/.GC (settings.json + model/ + cache/ + update/)"
|
||||
}
|
||||
|
||||
# $1=RID $2=输出目录 $3=singlefile(true/false)
|
||||
publish_rid() {
|
||||
RID="$1"; OUT="$2"; SINGLE="${3:-true}"
|
||||
echo ""
|
||||
echo "==> 编译 ${RID} (single-file=${SINGLE}) -> ${OUT}"
|
||||
# 先删旧产物,避免上次 publish 的残留文件混进新包
|
||||
rm -rf "$ROOT_DIR/$OUT"
|
||||
dotnet publish "$APP_PROJ" \
|
||||
-c Release \
|
||||
-r "$RID" \
|
||||
--self-contained true \
|
||||
-p:Version="$VERSION" \
|
||||
-p:DebugType=none \
|
||||
-p:PublishSingleFile="$SINGLE" \
|
||||
-p:IncludeNativeLibrariesForSelfExtract="$SINGLE" \
|
||||
-p:PublishTrimmed=false \
|
||||
-o "$ROOT_DIR/$OUT"
|
||||
rm -rf "$ROOT_DIR/$OUT/model" "$ROOT_DIR/$OUT/examples"
|
||||
}
|
||||
|
||||
# 把 model/ 里的模型数据单独打包(与启动器分开分发)
|
||||
pack_models() {
|
||||
mkdir -p "$ROOT_DIR/dist"
|
||||
ZIP="$ROOT_DIR/dist/models-$VERSION.zip"
|
||||
rm -f "$ZIP"
|
||||
echo "==> 打包模型数据 -> dist/models-$VERSION.zip"
|
||||
( cd "$ROOT_DIR" && zip -qr "$ZIP" model \
|
||||
-x "*.DS_Store" "*/bin/*" "*/obj/*" "*.user" )
|
||||
du -sh "$ZIP"
|
||||
}
|
||||
|
||||
# 启动器更新包:只包含程序文件,排除 .GC(否则会覆盖用户已下载的模型与设置)
|
||||
# 产物命名:GC-<版本>-<系统>-<架构>.exe / GC-<版本>-<系统>-<架构>.app.zip
|
||||
# Windows: 单文件 exe 直接改名(本身就是可执行产物)
|
||||
# macOS: .app 必须打成 zip 才能作为单文件分发;文件名用 .app.zip,
|
||||
# 这样 macOS 双击会用归档工具解压出可运行的 .app。
|
||||
# 若直接命名 .app,系统会把 zip 当成应用包解析 => 报「已损坏/打不开」。
|
||||
pack_launcher() {
|
||||
echo "==> 生成启动器产物(GC-<版本>-<系统>-<架构>)"
|
||||
|
||||
# --- Windows:exe 单文件 ---
|
||||
for pair in "win-x64:win-amd64" "win-arm64:win-arm64"; do
|
||||
RID="${pair%%:*}"; LABEL="${pair##*:}"
|
||||
SRC="$ROOT_DIR/dist/$RID"
|
||||
[ -d "$SRC" ] || continue
|
||||
EXE=$(ls "$SRC"/*.exe 2>/dev/null | head -1)
|
||||
[ -n "$EXE" ] || continue
|
||||
DEST="$ROOT_DIR/dist/GC-${VERSION}-${LABEL}.exe"
|
||||
cp "$EXE" "$DEST"
|
||||
chmod +x "$DEST"
|
||||
echo " -> $(basename "$DEST")"
|
||||
done
|
||||
|
||||
# --- macOS:先得到真实 .app 目录(改名 + 同步 Info.plist)---
|
||||
MACAPP="$ROOT_DIR/dist/mac-arm64/EarthModelStudio.app"
|
||||
if [ -d "$MACAPP" ]; then
|
||||
FINAL="$ROOT_DIR/dist/GC-${VERSION}-mac-arm64.app"
|
||||
rm -rf "$FINAL"
|
||||
mv "$MACAPP" "$FINAL"
|
||||
chmod +x "$FINAL/Contents/MacOS/EarthModelStudio" 2>/dev/null || true
|
||||
PLIST="$FINAL/Contents/Info.plist"
|
||||
if [ -f "$PLIST" ]; then
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleName Morris GC" "$PLIST" 2>/dev/null || true
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName Morris GC" "$PLIST" 2>/dev/null || true
|
||||
fi
|
||||
xattr -cr "$FINAL" 2>/dev/null || true
|
||||
echo " -> $(basename "$FINAL")/"
|
||||
fi
|
||||
|
||||
# --- 统一压缩:每个产物都打成同名 .zip ---
|
||||
# GC-1.0.3-win-amd64.exe -> GC-1.0.3-win-amd64.zip
|
||||
# GC-1.0.3-win-arm64.exe -> GC-1.0.3-win-arm64.zip
|
||||
# GC-1.0.3-mac-arm64.app -> GC-1.0.3-mac-arm64.zip
|
||||
# 客户端下载时按「原名去掉扩展名 + .zip」取包,再解压回原名。
|
||||
echo "==> 压缩为 zip"
|
||||
for art in "$ROOT_DIR"/dist/GC-"$VERSION"-*.exe "$ROOT_DIR"/dist/GC-"$VERSION"-*.app; do
|
||||
[ -e "$art" ] || continue
|
||||
base=$(basename "$art")
|
||||
name="${base%.*}" # 去掉 .exe / .app
|
||||
ZIP="$ROOT_DIR/dist/${name}.zip"
|
||||
rm -f "$ZIP"
|
||||
if [ -d "$art" ]; then
|
||||
# 目录(.app):保留权限与符号链接
|
||||
if command -v ditto >/dev/null 2>&1; then
|
||||
ditto -c -k --sequesterRsrc --keepParent "$art" "$ZIP"
|
||||
else
|
||||
( cd "$(dirname "$art")" && zip -qry "$ZIP" "$base" -x "*.DS_Store" )
|
||||
fi
|
||||
else
|
||||
( cd "$(dirname "$art")" && zip -q "$ZIP" "$base" )
|
||||
fi
|
||||
echo " -> ${name}.zip"
|
||||
done
|
||||
|
||||
# 原始产物(.exe / .app 目录)不再保留:只发布 zip
|
||||
rm -f "$ROOT_DIR"/dist/GC-"$VERSION"-*.exe
|
||||
rm -rf "$ROOT_DIR"/dist/GC-"$VERSION"-*.app
|
||||
|
||||
strip_intermediate_dirs
|
||||
stamp_versions
|
||||
echo ""
|
||||
echo "==> dist 只保留可发布的 zip:"
|
||||
ls -lh "$ROOT_DIR"/dist/GC-"$VERSION"-*.zip 2>/dev/null || true
|
||||
}
|
||||
|
||||
# 删除 publish 过程中的中间目录,dist 里只留最终附件
|
||||
strip_intermediate_dirs() {
|
||||
for d in win-x64 win-arm64 mac-arm64; do
|
||||
[ -d "$ROOT_DIR/dist/$d" ] && rm -rf "$ROOT_DIR/dist/$d"
|
||||
done
|
||||
find "$ROOT_DIR/dist" -name ".DS_Store" -delete 2>/dev/null || true
|
||||
}
|
||||
|
||||
package_mac_app() {
|
||||
DIST="$ROOT_DIR/dist/mac-arm64"
|
||||
APP="$DIST/EarthModelStudio.app"
|
||||
rm -rf "$APP"
|
||||
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
|
||||
cat > "$APP/Contents/Info.plist" <<PLIST
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key><string>Earth Model Studio</string>
|
||||
<key>CFBundleDisplayName</key><string>Earth Model Studio</string>
|
||||
<key>CFBundleIdentifier</key><string>cn.neorf.earthmodelstudio</string>
|
||||
<key>CFBundleVersion</key><string>${VERSION}</string>
|
||||
<key>CFBundleShortVersionString</key><string>${VERSION}</string>
|
||||
<key>CFBundlePackageType</key><string>APPL</string>
|
||||
<key>CFBundleExecutable</key><string>EarthModelStudio</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
|
||||
<key>LSMinimumSystemVersion</key><string>11.0</string>
|
||||
<key>NSHighResolutionCapable</key><true/>
|
||||
</dict>
|
||||
</plist>
|
||||
PLIST
|
||||
for f in "$DIST"/*; do
|
||||
base=$(basename "$f")
|
||||
[ "$base" = "EarthModelStudio.app" ] && continue
|
||||
[ "$base" = ".DS_Store" ] && continue
|
||||
mv "$f" "$APP/Contents/MacOS/"
|
||||
done
|
||||
# 应用图标:由 Assets/icon-1024.png 生成 .icns
|
||||
ICONSRC="$ROOT_DIR/src/main/dotnet/EarthModelStudio/Assets/icon-1024.png"
|
||||
if [ -f "$ICONSRC" ] && command -v iconutil >/dev/null 2>&1; then
|
||||
ICONSET="$DIST/AppIcon.iconset"
|
||||
rm -rf "$ICONSET"; mkdir -p "$ICONSET"
|
||||
for sz in 16 32 64 128 256 512; do
|
||||
sips -z $sz $sz "$ICONSRC" --out "$ICONSET/icon_${sz}x${sz}.png" >/dev/null 2>&1
|
||||
d=$((sz * 2))
|
||||
sips -z $d $d "$ICONSRC" --out "$ICONSET/icon_${sz}x${sz}@2x.png" >/dev/null 2>&1
|
||||
done
|
||||
iconutil -c icns "$ICONSET" -o "$APP/Contents/Resources/AppIcon.icns" 2>/dev/null && \
|
||||
echo " + AppIcon.icns"
|
||||
rm -rf "$ICONSET"
|
||||
# Info.plist 增加图标项
|
||||
if [ -f "$APP/Contents/Info.plist" ]; then
|
||||
/usr/libexec/PlistBuddy -c "Delete :CFBundleIconFile" "$APP/Contents/Info.plist" 2>/dev/null || true
|
||||
/usr/libexec/PlistBuddy -c "Add :CFBundleIconFile string AppIcon" "$APP/Contents/Info.plist" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
||||
# 发布包不带 .GC 运行骨架(用户首次启动自行创建),避免覆盖用户数据
|
||||
rm -rf "$APP/Contents/MacOS/.GC"
|
||||
chmod +x "$APP/Contents/MacOS/EarthModelStudio"
|
||||
echo "==> 已打包 $APP"
|
||||
}
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
#!/bin/sh
|
||||
# buildsh/lib/progress.sh —— apt 风格底部实时进度条
|
||||
#
|
||||
# 底部一行:任务 当前任务进度 总进度 剩余时间
|
||||
# 编译MacOS 95% 30% 10s
|
||||
#
|
||||
# 用法:
|
||||
# progress_init <总步骤数> <每步权重...>
|
||||
# progress_step <步骤名> # 开始某步骤
|
||||
# progress_tick <0-100> # 更新当前步骤完成度
|
||||
# progress_done # 结束
|
||||
|
||||
PROGRESS_TOTAL=1
|
||||
PROGRESS_WEIGHTS=""
|
||||
PROGRESS_IDX=0
|
||||
PROGRESS_CUR=0
|
||||
PROGRESS_STARTED=0
|
||||
PROGRESS_LAST=0
|
||||
PROGRESS_HISTORY=""
|
||||
|
||||
_now() { date +%s; }
|
||||
|
||||
# 加权总进度:前序步骤权重之和 + 当前步骤权重*完成度
|
||||
_progress_overall() {
|
||||
_sum=0; _i=1
|
||||
for _w in $PROGRESS_WEIGHTS; do
|
||||
if [ "$_i" -lt "$PROGRESS_IDX" ]; then
|
||||
_sum=$((_sum + _w)) # 已完成的步骤:全额
|
||||
elif [ "$_i" -eq "$PROGRESS_IDX" ]; then
|
||||
_sum=$((_sum + _w * PROGRESS_CUR / 100)) # 当前步骤:按完成度
|
||||
fi
|
||||
_i=$((_i + 1))
|
||||
done
|
||||
_p=$((_sum * 100 / PROGRESS_TOTAL))
|
||||
[ "$_p" -gt 100 ] && _p=100
|
||||
echo "$_p"
|
||||
}
|
||||
|
||||
# 剩余时间:基于「已完成总进度 / 已用时间」线性外推
|
||||
_progress_eta() {
|
||||
_p=$(_progress_overall)
|
||||
_t=$(( $(_now) - PROGRESS_STARTED ))
|
||||
# 前期用「预估总时长」估算(按各步骤经验权重),后期用实测速率外推,更稳
|
||||
if [ "$_p" -le 3 ] || [ "$_t" -le 0 ]; then
|
||||
_eta=$(( PROGRESS_TOTAL * 8 / 100 )) # 粗估:每 1% 约 8 秒 -> 总约 800s? 见下
|
||||
_eta=$(( 240 )) # 默认预估 4 分钟
|
||||
else
|
||||
_eta=$(( _t * (100 - _p) / _p ))
|
||||
fi
|
||||
if [ "$_eta" -ge 60 ]; then echo "$(( _eta / 60 ))m$((_eta % 60))s"; else echo "${_eta}s"; fi
|
||||
}
|
||||
|
||||
progress_draw() {
|
||||
_task="$PROGRESS_TASK"
|
||||
_cur=$PROGRESS_CUR
|
||||
_overall=$(_progress_overall)
|
||||
_eta=$(_progress_eta)
|
||||
|
||||
# 进度条(20 格)
|
||||
_filled=$((_overall * 20 / 100))
|
||||
_bar=""
|
||||
_i=0
|
||||
while [ "$_i" -lt 20 ]; do
|
||||
if [ "$_i" -lt "$_filled" ]; then _bar="${_bar}#"; else _bar="${_bar}."; fi
|
||||
_i=$((_i + 1))
|
||||
done
|
||||
|
||||
# 底部一行:任务 当前任务进度 总进度 剩余时间
|
||||
printf '\r\033[K[%s] %-14s %3d%% %3d%% %s' \
|
||||
"$_bar" "$_task" "$_cur" "$_overall" "$_eta"
|
||||
}
|
||||
|
||||
progress_init() {
|
||||
PROGRESS_TOTAL=$1
|
||||
shift
|
||||
PROGRESS_WEIGHTS="$*"
|
||||
PROGRESS_IDX=0
|
||||
PROGRESS_CUR=0
|
||||
PROGRESS_STARTED=$(_now)
|
||||
PROGRESS_TASK="准备"
|
||||
progress_draw
|
||||
}
|
||||
|
||||
progress_step() {
|
||||
PROGRESS_TASK="$1"
|
||||
PROGRESS_CUR=0
|
||||
PROGRESS_IDX=$((PROGRESS_IDX + 1))
|
||||
progress_draw
|
||||
}
|
||||
|
||||
progress_tick() {
|
||||
PROGRESS_CUR=$1
|
||||
progress_draw
|
||||
}
|
||||
|
||||
progress_done() {
|
||||
PROGRESS_CUR=100
|
||||
progress_tick 100
|
||||
printf '\n'
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/sh
|
||||
# buildsh/tools.sh —— 实用工具:模型、版本戳、清理、运行、医生、打开目录
|
||||
|
||||
bs_tools() {
|
||||
ROOT_DIR="$1"; TASK="$2"
|
||||
case "$TASK" in
|
||||
models)
|
||||
build_models ;;
|
||||
stamp)
|
||||
stamp_versions ;;
|
||||
pack-models)
|
||||
build_models; pack_models ;;
|
||||
pack-launcher)
|
||||
pack_launcher ;;
|
||||
run)
|
||||
dotnet run --project "$APP_PROJ" -c Debug ;;
|
||||
test)
|
||||
dotnet run --project "$TEST_PROJ" -c Debug -- "$ROOT_DIR/build/screenshots" ;;
|
||||
update-test)
|
||||
dotnet run --project "$TEST_PROJ" -c Debug -- --update-test "$ROOT_DIR" ;;
|
||||
clean)
|
||||
rm -rf "$ROOT_DIR/build" "$ROOT_DIR/dist"
|
||||
find "$ROOT_DIR/src" -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} + 2>/dev/null || true
|
||||
echo "==> 已清理" ;;
|
||||
doctor)
|
||||
dotnet --info | head -20 ;;
|
||||
dist)
|
||||
echo "==> dist 产物:"
|
||||
ls -lh "$ROOT_DIR"/dist 2>/dev/null || true ;;
|
||||
*)
|
||||
echo "未知工具: $TASK"; return 1 ;;
|
||||
esac
|
||||
}
|
||||
@@ -18,8 +18,6 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Headless" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="Avalonia.Skia" Version="$(AvaloniaVersion)" />
|
||||
<!-- 通用封面路径会渲染模型自带的 UserControl,headless 下需要主题样式才会出内容 -->
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,44 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Headless;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform;
|
||||
using EarthModelStudio.ModelSdk;
|
||||
using NeoRF.EarthModels;
|
||||
|
||||
namespace NeoRF.EarthModels.Preview;
|
||||
|
||||
/// <summary>
|
||||
/// 封面生成工具:给每个模型画一张 preview.png。
|
||||
///
|
||||
/// 两条路径:
|
||||
/// 1) 通用路径(默认):按模型清单的 assembly + type 加载模型程序集,
|
||||
/// 调它自己的 IModelRuntime.CreateView 做 headless 渲染 —— 任何新模型都能自动出封面。
|
||||
/// 2) 地球模型路径:仍走共享引擎的 CelestialView(保留 --bench 基准测试能力)。
|
||||
///
|
||||
/// 封面在模型包里,启动器只负责显示。用法:
|
||||
/// dotnet run --project model/_engine/PreviewGen -- <仓库根> [--bench]
|
||||
/// 封面生成工具:用模型自己的渲染器给每个模型画一张封面 preview.png。
|
||||
/// 封面在模型包里,启动器只负责显示 —— 所以公转模型的封面一定就是公转场景。
|
||||
/// 用法:dotnet run --project model-src/tools/PreviewGen -- <仓库根>
|
||||
/// </summary>
|
||||
internal static class Program
|
||||
{
|
||||
private const int Width = 768;
|
||||
private const int Height = 316;
|
||||
|
||||
/// <summary>headless 封面应用:带上 Fluent 主题,UserControl 才有模板可渲染。</summary>
|
||||
private sealed class PreviewApp : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
Styles.Add(new Avalonia.Themes.Fluent.FluentTheme());
|
||||
}
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
@@ -52,53 +32,23 @@ internal static class Program
|
||||
|
||||
var bench = args.Contains("--bench");
|
||||
|
||||
AppBuilder.Configure<PreviewApp>()
|
||||
AppBuilder.Configure<Application>()
|
||||
.UseSkia()
|
||||
.UseHeadless(new AvaloniaHeadlessPlatformOptions { UseHeadlessDrawing = false })
|
||||
.SetupWithoutStarting();
|
||||
|
||||
foreach (var modelDir in Directory.GetDirectories(modelRoot).OrderBy(p => p, StringComparer.Ordinal))
|
||||
foreach (var modelDir in Directory.GetDirectories(modelRoot))
|
||||
{
|
||||
var id = Path.GetFileName(modelDir);
|
||||
if (id.StartsWith('.') || id.StartsWith('_')) continue;
|
||||
|
||||
if (id.StartsWith(".")) continue;
|
||||
var dataDir = Path.Combine(modelDir, id + ".model");
|
||||
if (!Directory.Exists(dataDir)) continue;
|
||||
var sceneFile = Path.Combine(dataDir, "scene.json");
|
||||
if (!File.Exists(sceneFile)) continue;
|
||||
|
||||
var outFile = Path.Combine(dataDir, "preview.png");
|
||||
var hasScene = File.Exists(Path.Combine(dataDir, "scene.json"));
|
||||
|
||||
// 基准测试只对地球模型(依赖 CelestialView)
|
||||
if (bench)
|
||||
{
|
||||
if (!hasScene) continue;
|
||||
BenchEarthModel(dataDir, id);
|
||||
continue;
|
||||
}
|
||||
|
||||
var ok = false;
|
||||
string? err = null;
|
||||
if (hasScene)
|
||||
ok = TryRenderEarthModel(dataDir, outFile, out err);
|
||||
if (!ok)
|
||||
ok = TryRenderViaContract(modelDir, dataDir, outFile, out err);
|
||||
if (!ok)
|
||||
Console.Error.WriteLine($"preview 跳过 {id}:{err}");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────── 地球模型(保留原渲染器,封面一定是真场景)
|
||||
|
||||
private static bool TryRenderEarthModel(string dataDir, string outFile, out string? error)
|
||||
{
|
||||
error = null;
|
||||
try
|
||||
{
|
||||
var runtime = SceneRuntime.Load(dataDir, 2048);
|
||||
var texts = ModelStrings.Load(dataDir, "zh-CN");
|
||||
var revolution = string.Equals(runtime.Scene.DefaultView, "revolution", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
var view = new CelestialView
|
||||
{
|
||||
Scene = runtime,
|
||||
@@ -112,181 +62,52 @@ internal static class Program
|
||||
Width = Width,
|
||||
Height = Height
|
||||
};
|
||||
PrepareView(view, Width, Height);
|
||||
view.Measure(new Size(Width, Height));
|
||||
view.Arrange(new Rect(0, 0, Width, Height));
|
||||
view.JumpToOrbit(revolution ? 45 : 0);
|
||||
view.JumpToSpin(20);
|
||||
Save(view, outFile);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
error = ex.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void BenchEarthModel(string dataDir, string id)
|
||||
{
|
||||
var runtime = SceneRuntime.Load(dataDir, 2048);
|
||||
var texts = ModelStrings.Load(dataDir, "zh-CN");
|
||||
var revolution = string.Equals(runtime.Scene.DefaultView, "revolution", StringComparison.OrdinalIgnoreCase);
|
||||
var view = new CelestialView
|
||||
{
|
||||
Scene = runtime,
|
||||
Texts = texts,
|
||||
View = revolution ? SceneView.Revolution : SceneView.Rotation,
|
||||
IsPlaying = false,
|
||||
ShowHud = false,
|
||||
ShowLabels = false,
|
||||
ShowOrbit = true,
|
||||
ShowGraticule = true,
|
||||
Width = Width,
|
||||
Height = Height
|
||||
};
|
||||
PrepareView(view, Width, Height);
|
||||
view.JumpToOrbit(revolution ? 45 : 0);
|
||||
view.JumpToSpin(20);
|
||||
|
||||
view.Width = 1240;
|
||||
view.Height = 820;
|
||||
view.Measure(new Size(1240, 820));
|
||||
view.Arrange(new Rect(0, 0, 1240, 820));
|
||||
var animField = typeof(CelestialView)
|
||||
.GetField("_animating", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var sw = System.Diagnostics.Stopwatch.StartNew();
|
||||
for (var frame = 0; frame < 20; frame++)
|
||||
{
|
||||
view.JumpToSpin(20 + frame * 3);
|
||||
using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96));
|
||||
tmp.Render(view);
|
||||
}
|
||||
sw.Stop();
|
||||
var still = sw.Elapsed.TotalMilliseconds / 20;
|
||||
animField?.SetValue(view, true);
|
||||
sw.Restart();
|
||||
for (var frame = 0; frame < 20; frame++)
|
||||
{
|
||||
view.JumpToSpin(20 + frame * 3);
|
||||
using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96));
|
||||
tmp.Render(view);
|
||||
}
|
||||
sw.Stop();
|
||||
Console.WriteLine($"{id}: 静止 {still:0.0} ms/frame · 播放 {sw.Elapsed.TotalMilliseconds / 20:0.0} ms/frame");
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────── 通用路径:按契约加载模型自己的界面
|
||||
|
||||
private sealed class PreviewContext : IModelContext
|
||||
{
|
||||
public string ModelId { get; init; } = "";
|
||||
public string ModelDirectory { get; init; } = "";
|
||||
public string DataDirectory { get; init; } = "";
|
||||
public string Language => "zh-CN";
|
||||
public int MemoryBudgetMb => 512;
|
||||
public void RequestClose() { }
|
||||
public void ReportProgress(double value, string? message = null) { }
|
||||
public void Log(string message) => Console.WriteLine(" " + message);
|
||||
}
|
||||
|
||||
private static bool TryRenderViaContract(string modelDir, string dataDir, string outFile, out string? error)
|
||||
{
|
||||
error = null;
|
||||
var manifestPath = Path.Combine(modelDir, Path.GetFileName(modelDir) + ".json");
|
||||
if (!File.Exists(manifestPath)) { error = "缺少模型清单"; return false; }
|
||||
|
||||
try
|
||||
{
|
||||
using var doc = System.Text.Json.JsonDocument.Parse(File.ReadAllText(manifestPath));
|
||||
var root = doc.RootElement;
|
||||
var id = Path.GetFileName(modelDir);
|
||||
var asmName = GetString(root, "assembly") ?? (id + ".dll");
|
||||
var typeName = GetString(root, "type");
|
||||
var asmPath = Path.Combine(dataDir, asmName);
|
||||
if (!File.Exists(asmPath)) { error = $"找不到功能程序集 {asmName}"; return false; }
|
||||
|
||||
var alc = new AssemblyLoadContext("preview:" + id, isCollectible: true);
|
||||
alc.Resolving += (_, name) =>
|
||||
if (bench)
|
||||
{
|
||||
// 契约与 Avalonia 一律回到默认上下文,与启动器 ModelLoadContext 一致
|
||||
if (name.Name is null) return null;
|
||||
if (name.Name.StartsWith("System", StringComparison.OrdinalIgnoreCase)) return null;
|
||||
var shared = new[] { "EarthModelStudio.ModelSdk", "Avalonia", "Avalonia.Base",
|
||||
"Avalonia.Controls", "Avalonia.Skia", "Avalonia.Themes.Fluent", "SkiaSharp", "HarfBuzzSharp" };
|
||||
if (shared.Contains(name.Name, StringComparer.OrdinalIgnoreCase)) return null;
|
||||
var candidate = Path.Combine(dataDir, name.Name + ".dll");
|
||||
return File.Exists(candidate) ? alc.LoadFromAssemblyPath(candidate) : null;
|
||||
};
|
||||
// 真实窗口尺寸下的帧耗时
|
||||
view.Width = 1240;
|
||||
view.Height = 820;
|
||||
view.Measure(new Size(1240, 820));
|
||||
view.Arrange(new Rect(0, 0, 1240, 820));
|
||||
// 模拟播放态(运动时降分辨率),分别测静止高清帧与运动帧
|
||||
var animField = typeof(NeoRF.EarthModels.CelestialView)
|
||||
.GetField("_animating", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var sw = System.Diagnostics.Stopwatch.StartNew();
|
||||
for (var frame = 0; frame < 20; frame++)
|
||||
{
|
||||
view.JumpToSpin(20 + frame * 3);
|
||||
using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96));
|
||||
tmp.Render(view);
|
||||
}
|
||||
sw.Stop();
|
||||
var still = sw.Elapsed.TotalMilliseconds / 20;
|
||||
animField?.SetValue(view, true);
|
||||
sw.Restart();
|
||||
for (var frame = 0; frame < 20; frame++)
|
||||
{
|
||||
view.JumpToSpin(20 + frame * 3);
|
||||
using var tmp = new RenderTargetBitmap(new PixelSize(1240, 820), new Vector(96, 96));
|
||||
tmp.Render(view);
|
||||
}
|
||||
sw.Stop();
|
||||
Console.WriteLine($"{id}: 静止 {still:0.0} ms/frame · 播放 {sw.Elapsed.TotalMilliseconds / 20:0.0} ms/frame");
|
||||
continue;
|
||||
}
|
||||
|
||||
var asm = alc.LoadFromAssemblyPath(asmPath);
|
||||
Type? factoryType = null;
|
||||
if (!string.IsNullOrWhiteSpace(typeName))
|
||||
factoryType = asm.GetType(typeName!, throwOnError: false);
|
||||
factoryType ??= asm.GetTypes().FirstOrDefault(t =>
|
||||
!t.IsAbstract && !t.IsInterface && typeof(IModelFactory).IsAssignableFrom(t));
|
||||
if (factoryType == null) { error = "程序集里没有 IModelFactory 实现"; return false; }
|
||||
if (Activator.CreateInstance(factoryType) is not IModelFactory factory)
|
||||
{ error = "无法创建模型入口"; return false; }
|
||||
|
||||
var runtime = factory.Create();
|
||||
var ctx = new PreviewContext
|
||||
var outFile = Path.Combine(dataDir, "preview.png");
|
||||
using (var bitmap = new RenderTargetBitmap(new PixelSize(Width, Height), new Vector(96, 96)))
|
||||
{
|
||||
ModelId = id,
|
||||
ModelDirectory = modelDir,
|
||||
DataDirectory = dataDir
|
||||
};
|
||||
runtime.Prepare(ctx);
|
||||
var view = runtime.CreateView(ctx);
|
||||
if (view == null) { error = "模型没有返回界面"; return false; }
|
||||
|
||||
PrepareView(view, Width, Height);
|
||||
Save(view, outFile);
|
||||
runtime.Dispose();
|
||||
(view as IDisposable)?.Dispose();
|
||||
alc.Unload();
|
||||
return true;
|
||||
bitmap.Render(view);
|
||||
bitmap.Save(outFile);
|
||||
}
|
||||
Console.WriteLine($"preview -> {outFile}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
error = ex.ToString();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static string? GetString(System.Text.Json.JsonElement e, string name)
|
||||
=> e.TryGetProperty(name, out var v) && v.ValueKind == System.Text.Json.JsonValueKind.String
|
||||
? v.GetString() : null;
|
||||
|
||||
// ─────────────────────────────────────────── 公共
|
||||
|
||||
private static void PrepareView(Control view, double w, double h)
|
||||
{
|
||||
// 封面是宽幅(768×316),模型界面按设计尺寸是 1240×820;这里把布局直接按封面
|
||||
// 尺寸 Measure/Arrange,让卡片上看到的是完整布局而不是被裁掉一角。
|
||||
view.Width = w;
|
||||
view.Height = h;
|
||||
view.Measure(new Size(w, h));
|
||||
view.Arrange(new Rect(0, 0, w, h));
|
||||
}
|
||||
|
||||
private static void Save(Control view, string outFile)
|
||||
{
|
||||
// headless 下 UserControl 必须挂进 Window 才有视觉树;直接 Render(Control)
|
||||
// 会得到一张全黑的图(实测)。地球模型的裸 Control 走同一路径也正常工作。
|
||||
var win = new Window
|
||||
{
|
||||
Width = Width,
|
||||
Height = Height,
|
||||
Background = Avalonia.Media.Brushes.White,
|
||||
Content = view,
|
||||
SystemDecorations = SystemDecorations.None,
|
||||
ShowInTaskbar = false
|
||||
};
|
||||
win.Show();
|
||||
using var bitmap = new RenderTargetBitmap(new PixelSize(Width, Height), new Vector(96, 96));
|
||||
bitmap.Render(win);
|
||||
bitmap.Save(outFile);
|
||||
win.Content = null;
|
||||
win.Close();
|
||||
Console.WriteLine($"preview -> {outFile}");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,6 @@ using System.Text.Json.Nodes;
|
||||
// 输出:更新 model/<id>/<id>.json 的 version / updatedAt,并生成
|
||||
// 仓库根 version.json 与 model/version.json(内容相同,便于两种源地址读取)。
|
||||
|
||||
// 仓库地址(编译产物的 Release 也发在这里):与启动器默认 updateRepository 保持一致。
|
||||
const string Repository = "https://gitcode.com/2509_92447106/GC";
|
||||
|
||||
var root = args.Length > 0 ? Path.GetFullPath(args[0]) : Directory.GetCurrentDirectory();
|
||||
var launcherVersion = args.Length > 1 && !string.IsNullOrWhiteSpace(args[1]) ? args[1] : "1.0.0";
|
||||
var modelRoot = Path.Combine(root, "model");
|
||||
@@ -65,14 +62,11 @@ foreach (var dir in Directory.GetDirectories(modelRoot)
|
||||
var manifest = JsonNode.Parse(File.ReadAllText(manifestPath))?.AsObject();
|
||||
if (manifest == null) continue;
|
||||
|
||||
// 版本号由模型清单里手写的 version 决定(作者手动升到 1.0 / 1.1 …),
|
||||
// 不再用内容指纹覆盖:指纹形式(1.0-393cb2b7d4)对用户不可读、也没有语义。
|
||||
var declared = manifest["version"]?.GetValue<string>();
|
||||
var version = string.IsNullOrWhiteSpace(declared) ? "1.0" : declared!.Trim();
|
||||
|
||||
// 内容指纹保留在 build 字段,仅用于构建溯源,不参与版本比较
|
||||
manifest.Remove("build");
|
||||
// 版本号只由「清单内容 + 模型包数据」决定,重复构建结果稳定
|
||||
manifest.Remove("version");
|
||||
manifest.Remove("updatedAt");
|
||||
var canonical = manifest.ToJsonString(new JsonSerializerOptions { WriteIndented = false });
|
||||
|
||||
var chunks = new List<byte[]> { Encoding.UTF8.GetBytes(canonical) };
|
||||
foreach (var file in Directory.GetFiles(dataDir, "*", SearchOption.AllDirectories)
|
||||
.Where(Distributable)
|
||||
@@ -81,10 +75,9 @@ foreach (var dir in Directory.GetDirectories(modelRoot)
|
||||
chunks.Add(Encoding.UTF8.GetBytes("\n" + Rel(dataDir, file) + "\n"));
|
||||
chunks.Add(File.ReadAllBytes(file));
|
||||
}
|
||||
var fingerprint = Fingerprint(chunks)[..10];
|
||||
|
||||
var version = "1.0-" + Fingerprint(chunks)[..10];
|
||||
manifest["version"] = version;
|
||||
manifest["build"] = fingerprint;
|
||||
manifest["updatedAt"] = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ");
|
||||
File.WriteAllText(manifestPath, manifest.ToJsonString(relaxed) + "\n");
|
||||
|
||||
@@ -92,10 +85,9 @@ foreach (var dir in Directory.GetDirectories(modelRoot)
|
||||
{
|
||||
["id"] = id,
|
||||
["version"] = version,
|
||||
["build"] = fingerprint,
|
||||
["dir"] = "model/" + id
|
||||
});
|
||||
Console.WriteLine($" {id,-20} {version,-8} (build {fingerprint})");
|
||||
Console.WriteLine($" {id,-20} {version}");
|
||||
}
|
||||
|
||||
// 启动器源码指纹(只展示,不触发升级;升级看 launcher.version)
|
||||
@@ -119,16 +111,12 @@ if (Directory.Exists(srcRoot))
|
||||
var launcherRevision = srcChunks.Count > 0 ? Fingerprint(srcChunks)[..10] : "";
|
||||
|
||||
var packages = new Dictionary<string, Dictionary<string, object>>();
|
||||
// 启动器更新只访问「编译的产物」:gitcode Release 里发布的 dist/GC-<rid>.zip 附件。
|
||||
// 运行时若存在同名 Release,GitCodeReleaseRemote 会用附件真实直链覆盖下面的 url;
|
||||
// 下面的地址是兜底(编译产物尚未发 Release 时也能指向正确的编译产物位置)。
|
||||
var releaseBase = $"{Repository}/releases/download/v{launcherVersion}";
|
||||
foreach (var rid in new[] { "win-x64", "win-arm64", "osx-arm64", "osx-x64", "linux-x64" })
|
||||
{
|
||||
var entry = new Dictionary<string, object>
|
||||
{
|
||||
["path"] = $"dist/GC-{rid}.zip",
|
||||
["url"] = $"{releaseBase}/GC-{rid}.zip"
|
||||
["url"] = "" // 大文件建议填 Release 直链;留空则用仓库内 path
|
||||
};
|
||||
// 已生成的启动器更新包:把校验值和体积写进清单,供下载端校验
|
||||
var zipPath = Path.Combine(root, "dist", $"GC-{rid}.zip");
|
||||
@@ -145,7 +133,7 @@ var versionDoc = new Dictionary<string, object>
|
||||
{
|
||||
["schema"] = 1,
|
||||
["generated"] = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"),
|
||||
["repository"] = Repository,
|
||||
["repository"] = "https://gitcode.com/2509_92447106/GC",
|
||||
["branch"] = "main",
|
||||
["modelDir"] = "model",
|
||||
["launcher"] = new Dictionary<string, object>
|
||||
|
||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"VersionStamp/1.0.5": {
|
||||
"runtime": {
|
||||
"VersionStamp.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"VersionStamp/1.0.5": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
@@ -1,23 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.5.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.5+4b5aa7799f4d3c8d207380a0341abfac4c7c2a81")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("VersionStamp")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.5.0")]
|
||||
[assembly: System.Resources.NeutralResourcesLanguageAttribute("zh-Hans")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
f44ed24855bc7e57f8117a3d3a05966d6a9ff232affdc9b6f1b557116eeac98a
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetFrameworkIdentifier = .NETCoreApp
|
||||
build_property.TargetFrameworkVersion = v8.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property.EntryPointFilePath =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = VersionStamp
|
||||
build_property.ProjectDir = /Users/morris/Downloads/GC#/model/_engine/VersionStamp/
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.EffectiveAnalysisLevelStyle = 8.0
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
@@ -1,8 +0,0 @@
|
||||
// <auto-generated/>
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.IO;
|
||||
global using System.Linq;
|
||||
global using System.Net.Http;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
Binary file not shown.
-1
@@ -1 +0,0 @@
|
||||
85742ef80cf2152cf4a4430f83d458331bf993698b5083cd8b3b2fcfbf3691ce
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.deps.json
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.runtimeconfig.json
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.dll
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/bin/Release/net8.0/VersionStamp.pdb
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.GeneratedMSBuildEditorConfig.editorconfig
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfoInputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.AssemblyInfo.cs
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.csproj.CoreCompileInputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.dll
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/refint/VersionStamp.dll
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.pdb
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/VersionStamp.genruntimeconfig.cache
|
||||
/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/Release/net8.0/ref/VersionStamp.dll
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
d0976149c15255acc8dcb9e033721a42927c784807f5fd87fba864a81ecce360
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"/Users/morris/Downloads/GC#/model/_engine/VersionStamp/VersionStamp.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"/Users/morris/Downloads/GC#/model/_engine/VersionStamp/VersionStamp.csproj": {
|
||||
"version": "1.0.5",
|
||||
"restore": {
|
||||
"projectUniqueName": "/Users/morris/Downloads/GC#/model/_engine/VersionStamp/VersionStamp.csproj",
|
||||
"projectName": "VersionStamp",
|
||||
"projectPath": "/Users/morris/Downloads/GC#/model/_engine/VersionStamp/VersionStamp.csproj",
|
||||
"packagesPath": "/Users/morris/.nuget/packages/",
|
||||
"outputPath": "/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/Users/morris/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "10.0.400"
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/morris/.nuget/packages/</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/morris/.nuget/packages/</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="/Users/morris/.nuget/packages/" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||
@@ -1,74 +0,0 @@
|
||||
{
|
||||
"version": 4,
|
||||
"targets": {
|
||||
"net8.0": {}
|
||||
},
|
||||
"libraries": {},
|
||||
"projectFileDependencyGroups": {
|
||||
"net8.0": []
|
||||
},
|
||||
"packageFolders": {
|
||||
"/Users/morris/.nuget/packages/": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.5",
|
||||
"restore": {
|
||||
"projectUniqueName": "/Users/morris/Downloads/GC#/model/_engine/VersionStamp/VersionStamp.csproj",
|
||||
"projectName": "VersionStamp",
|
||||
"projectPath": "/Users/morris/Downloads/GC#/model/_engine/VersionStamp/VersionStamp.csproj",
|
||||
"packagesPath": "/Users/morris/.nuget/packages/",
|
||||
"outputPath": "/Users/morris/Downloads/GC#/model/_engine/VersionStamp/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/Users/morris/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "10.0.400"
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "0mFpXnqc6/I=",
|
||||
"success": true,
|
||||
"projectFilePath": "/Users/morris/Downloads/GC#/model/_engine/VersionStamp/VersionStamp.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
"logs": []
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class CelestialView : Control, IDisposable
|
||||
AvaloniaProperty.Register<CelestialView, bool>(nameof(ExaggerateTilt));
|
||||
|
||||
public static readonly StyledProperty<int> FrameRateProperty =
|
||||
AvaloniaProperty.Register<CelestialView, int>(nameof(FrameRate), 120);
|
||||
AvaloniaProperty.Register<CelestialView, int>(nameof(FrameRate), 30);
|
||||
|
||||
public static readonly StyledProperty<bool> ShowHudProperty =
|
||||
AvaloniaProperty.Register<CelestialView, bool>(nameof(ShowHud), true);
|
||||
@@ -379,8 +379,7 @@ public class CelestialView : Control, IDisposable
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
_camElevTarget = DefaultElevation;
|
||||
// 8ms 轮询以支撑最高 120 FPS(模型内部仍按 FrameRate 限流);不依赖系统 VSync 节拍
|
||||
_timer = new DispatcherTimer(TimeSpan.FromMilliseconds(8), DispatcherPriority.Render, OnTick);
|
||||
_timer = new DispatcherTimer(TimeSpan.FromMilliseconds(16), DispatcherPriority.Render, OnTick);
|
||||
_lastTick = Stopwatch.GetTimestamp();
|
||||
_timer.Start();
|
||||
}
|
||||
@@ -679,11 +678,7 @@ public class CelestialView : Control, IDisposable
|
||||
private Vector3 RotationLight(Matrix4x4 cam, double tiltDeg)
|
||||
{
|
||||
var axisCam = Vector3.TransformNormal(AxisWorld(tiltDeg), cam);
|
||||
// 特写模式:光从正右方水平射来,晨昏线竖直居中、正对观察者,
|
||||
// 便于课堂直观看昼夜半球;主画布仍用斜向光体现立体感。
|
||||
var forwardRight = InsetMode
|
||||
? new Vector3(1f, 0f, 0f)
|
||||
: Vector3.Normalize(new Vector3(0.86f, 0f, 0.50f));
|
||||
var forwardRight = Vector3.Normalize(new Vector3(0.86f, 0f, 0.50f));
|
||||
var u = forwardRight - axisCam * Vector3.Dot(forwardRight, axisCam);
|
||||
if (u.Length() < 0.001f) u = new Vector3(1, 0, 0);
|
||||
u = Vector3.Normalize(u);
|
||||
@@ -709,61 +704,40 @@ public class CelestialView : Control, IDisposable
|
||||
var tropic = TropicDegrees(runtime);
|
||||
var polar = 90.0 - tropic;
|
||||
|
||||
// 五条纬线一起画:先画线,再统一布置标签,避免自转时多个标签
|
||||
// 被投影到相近位置而互相覆盖 / 抖动(原来的逐条独立绘制会重叠)。
|
||||
var lines = new (double Lat, IPen Pen, string? Label, IBrush Brush)[]
|
||||
DrawParallel(ctx, cam, planet, center, radius, 0, EquatorPen,
|
||||
labels ? Texts["lat.equator"] : null, LabelBrush);
|
||||
DrawParallel(ctx, cam, planet, center, radius, tropic, TropicPen,
|
||||
labels ? Texts["lat.tropicN"] : null, TropicBrush);
|
||||
DrawParallel(ctx, cam, planet, center, radius, -tropic, TropicPen,
|
||||
labels ? Texts["lat.tropicS"] : null, TropicBrush);
|
||||
DrawParallel(ctx, cam, planet, center, radius, polar, PolarPen,
|
||||
labels ? Texts["lat.polarN"] : null, PolarBrush);
|
||||
DrawParallel(ctx, cam, planet, center, radius, -polar, PolarPen,
|
||||
labels ? Texts["lat.polarS"] : null, PolarBrush);
|
||||
}
|
||||
|
||||
private void DrawParallel(DrawingContext ctx, Matrix4x4 cam, Matrix4x4 planet,
|
||||
Point center, double radius, double lat, IPen pen, string? label, IBrush labelBrush)
|
||||
{
|
||||
DrawSpherePolyline(ctx, cam, planet, center, radius, pen,
|
||||
t => LatLonToUnit(lat, t * 360.0), 144);
|
||||
if (label == null) return;
|
||||
|
||||
// 找该纬线上「最靠右且可见」的点作为标签锚点:
|
||||
// 地球自转时标签始终留在可见半球右侧,不会忽隐忽现
|
||||
Vector3 best = default;
|
||||
var bestScore = double.NegativeInfinity;
|
||||
for (var lon = -180; lon < 180; lon += 6)
|
||||
{
|
||||
(0, EquatorPen, labels ? Texts["lat.equator"] : null, LabelBrush),
|
||||
(tropic, TropicPen, labels ? Texts["lat.tropicN"] : null, TropicBrush),
|
||||
(-tropic, TropicPen, labels ? Texts["lat.tropicS"] : null, TropicBrush),
|
||||
(polar, PolarPen, labels ? Texts["lat.polarN"] : null, PolarBrush),
|
||||
(-polar, PolarPen, labels ? Texts["lat.polarS"] : null, PolarBrush)
|
||||
};
|
||||
|
||||
foreach (var l in lines)
|
||||
DrawSpherePolyline(ctx, cam, planet, center, radius, l.Pen,
|
||||
t => LatLonToUnit(l.Lat, t * 360.0), 144);
|
||||
|
||||
if (!labels) return;
|
||||
|
||||
// 标签位置必须「稳定」:不能每帧搜索最佳可见点(那会随旋转跳动),
|
||||
// 也不能按可见性整块跳显/跳隐(那是抖动的来源)。
|
||||
//
|
||||
// 做法:
|
||||
// · Y 用该纬线在当前视角下的实际投影高度(纬度本身随俯仰连续变化,不会跳);
|
||||
// · X 固定在球体右侧一点,与旋转无关;
|
||||
// · 可见性用一个连续衰减的透明度,而不是阈值切换。
|
||||
var placed = new List<(double Y, double Lat, string Text, IBrush Brush)>();
|
||||
foreach (var l in lines)
|
||||
{
|
||||
if (l.Label == null) continue;
|
||||
|
||||
// 该纬度圈在相机空间的最高点高度:取整圈采样里 Y 的最大值,
|
||||
// 只依赖俯仰角(连续量),不随自转变化。
|
||||
var maxY = double.NegativeInfinity;
|
||||
for (var lon = 0; lon < 360; lon += 10)
|
||||
{
|
||||
var world = Vector3.Transform(LatLonToUnit(l.Lat, lon), planet);
|
||||
var c = Vector3.Transform(world, cam);
|
||||
if (c.Y > maxY) maxY = c.Y;
|
||||
}
|
||||
if (double.IsNegativeInfinity(maxY)) continue;
|
||||
|
||||
placed.Add((center.Y - maxY * radius, l.Lat, l.Label, l.Brush));
|
||||
}
|
||||
|
||||
// 按纬度从北到南排,保证顺序恒定;再用「期望间距」平滑排布,
|
||||
// 间距不足时按固定比例压缩(而不是 +16 硬推,硬推会让整串标签滑动)。
|
||||
placed.Sort((a, b) => b.Lat.CompareTo(a.Lat));
|
||||
if (placed.Count == 0) return;
|
||||
|
||||
var labelX = center.X + radius * 1.02; // 固定在球右侧外部
|
||||
for (var i = 0; i < placed.Count; i++)
|
||||
{
|
||||
var p = placed[i];
|
||||
DrawLabelChip(ctx, p.Text, new Point(labelX, p.Y),
|
||||
InsetMode ? 9.0 : 10.5, p.Brush, toRight: true);
|
||||
var world = Vector3.Transform(LatLonToUnit(lat, lon), planet);
|
||||
var c = Vector3.Transform(world, cam);
|
||||
if (c.Z < 0.10f) continue;
|
||||
var score = c.X * 2.0 + c.Z;
|
||||
if (score > bestScore) { bestScore = score; best = c; }
|
||||
}
|
||||
if (double.IsNegativeInfinity(bestScore)) return;
|
||||
var p = new Point(center.X + best.X * radius, center.Y - best.Y * radius);
|
||||
DrawLabelChip(ctx, label, p, InsetMode ? 9.0 : 10.5, labelBrush, toRight: false);
|
||||
}
|
||||
|
||||
/// <summary>带深色底衬的标签:压在明亮的地球上也读得清,且不会被画布边缘裁掉。</summary>
|
||||
@@ -771,14 +745,9 @@ public class CelestialView : Control, IDisposable
|
||||
double fontSize, IBrush brush, bool toRight)
|
||||
{
|
||||
var formatted = new FormattedText(text, CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
|
||||
new Typeface(FontFamily.Default, FontStyle.Normal, FontWeight.SemiBold), fontSize, brush)
|
||||
{
|
||||
TextAlignment = TextAlignment.Left,
|
||||
Trimming = TextTrimming.None
|
||||
};
|
||||
// 锚点即文字垂直中心,避免不同文字高度造成上下漂移
|
||||
new Typeface(FontFamily.Default, FontStyle.Normal, FontWeight.SemiBold), fontSize, brush);
|
||||
var x = toRight ? anchor.X + 9 : Math.Max(3, anchor.X - formatted.Width - 9);
|
||||
var y = anchor.Y - formatted.Height * 0.5;
|
||||
var y = anchor.Y - formatted.Height - 4;
|
||||
ctx.DrawRectangle(ChipBg, null,
|
||||
new Rect(x - 5, y - 2, formatted.Width + 10, formatted.Height + 5), 4, 4);
|
||||
ctx.DrawText(formatted, new Point(x, y));
|
||||
|
||||
@@ -48,6 +48,7 @@ public sealed class EarthModelView : UserControl, IDisposable
|
||||
private TextBlock? _closeupLabel;
|
||||
private ModelButton? _playButton;
|
||||
private ModelButton? _overheadButton;
|
||||
private ModelButton? _closeupButton;
|
||||
private TextBlock? _zoomText;
|
||||
private TextBlock? _cardState;
|
||||
private TextBlock? _cardTitle;
|
||||
@@ -84,7 +85,7 @@ public sealed class EarthModelView : UserControl, IDisposable
|
||||
ShowOrbit = true,
|
||||
ShowGraticule = true,
|
||||
ShowKeyLatitudes = true,
|
||||
FrameRate = 120,
|
||||
FrameRate = 60,
|
||||
View = IsRevolution ? SceneView.Revolution : SceneView.Rotation
|
||||
};
|
||||
_canvas.JumpToOrbit(StartAngle);
|
||||
@@ -215,7 +216,8 @@ public sealed class EarthModelView : UserControl, IDisposable
|
||||
// ---------------------------------------------------------------- 顶部主工具栏
|
||||
private Control BuildTopBar()
|
||||
{
|
||||
// 关闭按钮统一放在窗口右上角的自建标题栏,这里不再重复放左上角
|
||||
var close = MakeButton(_texts["close"], () => _context.RequestClose());
|
||||
|
||||
var title = new StackPanel { Spacing = 1, VerticalAlignment = VerticalAlignment.Center };
|
||||
title.Children.Add(new TextBlock
|
||||
{
|
||||
@@ -266,13 +268,14 @@ public sealed class EarthModelView : UserControl, IDisposable
|
||||
actions.Children.Add(MakeButton(_texts["classroom"], () => SetLessonsVisible(!_showLessons)));
|
||||
actions.Children.Add(MakeButton("⛶", ToggleFullScreen, large: true));
|
||||
|
||||
var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*,Auto") };
|
||||
Grid.SetColumn(title, 0);
|
||||
var grid = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto,*,Auto") };
|
||||
grid.Children.Add(close);
|
||||
Grid.SetColumn(title, 1);
|
||||
title.Margin = new Thickness(14, 0, 0, 0);
|
||||
grid.Children.Add(title);
|
||||
Grid.SetColumn(_viewSwitch, 1);
|
||||
Grid.SetColumn(_viewSwitch, 2);
|
||||
grid.Children.Add(_viewSwitch);
|
||||
Grid.SetColumn(actions, 3);
|
||||
Grid.SetColumn(actions, 4);
|
||||
grid.Children.Add(actions);
|
||||
|
||||
return new Border { Background = PanelBg, Padding = new Thickness(16, 9), Child = grid };
|
||||
@@ -291,7 +294,12 @@ public sealed class EarthModelView : UserControl, IDisposable
|
||||
row.Children.Add(MakeToggle(_texts["orbit"], _orbit, on => { _orbit = on; _canvas.ShowOrbit = on; }));
|
||||
row.Children.Add(MakeToggle(_texts["grid"], _grid, on => { _grid = on; _canvas.ShowGraticule = on; }));
|
||||
row.Children.Add(MakeToggle(_texts["tilt"], _tilt, on => { _tilt = on; _canvas.ExaggerateTilt = on; }));
|
||||
// 「放大」切换按钮已按需求移除;特写视图本身仍随公转显示
|
||||
_closeupButton = MakeToggle(_texts["closeup"], _showCloseup, on =>
|
||||
{
|
||||
_showCloseup = on;
|
||||
ApplyVisibility();
|
||||
});
|
||||
row.Children.Add(_closeupButton);
|
||||
_overheadButton = MakeToggle(_texts["overhead"], _overhead, on =>
|
||||
{
|
||||
_overhead = on;
|
||||
@@ -708,23 +716,10 @@ public sealed class EarthModelView : UserControl, IDisposable
|
||||
? _texts.Pick(season.TeachingI18n, _texts["orbitTeach"])
|
||||
: _texts["orbitTeach"];
|
||||
|
||||
// 特写的直射纬度用缓动逼近目标,而不是瞬间跳变:
|
||||
// 公转时拖动/改变轨道角,晨昏线会平滑地移过去(每次 timer 步进一帧)。
|
||||
if (_showCloseup)
|
||||
if (_showCloseup && (double.IsNaN(_lastDeclination) || Math.Abs(_lastDeclination - decl) > 0.04))
|
||||
{
|
||||
var target = decl;
|
||||
var current = _closeup.DeclinationDeg;
|
||||
var diff = target - current;
|
||||
if (Math.Abs(diff) < 0.02)
|
||||
{
|
||||
_closeup.DeclinationDeg = target;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 每 140ms 走剩余距离的 ~18%,形成自然的 ease-out 动画
|
||||
_closeup.DeclinationDeg = current + diff * 0.18;
|
||||
}
|
||||
_lastDeclination = target;
|
||||
_closeup.DeclinationDeg = decl;
|
||||
_lastDeclination = decl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
|
||||
namespace NeoRF.EarthModels;
|
||||
|
||||
/// <summary>
|
||||
/// 地理模型的球面几何工具:经纬度 ↔ 单位球坐标、正交投影到屏幕、
|
||||
/// 以及把一条经纬度折线投影成「可见弧段」(背面自动裁掉)。
|
||||
/// 纯 CPU、无依赖,供 GeographyView 画线稿用。
|
||||
/// </summary>
|
||||
public static class Geometry
|
||||
{
|
||||
public const float DegToRad = (float)(Math.PI / 180.0);
|
||||
public const float RadToDeg = (float)(180.0 / Math.PI);
|
||||
|
||||
/// <summary>经纬度 → 单位球坐标(y 轴为地轴,lon 向东为正)。</summary>
|
||||
public static Vector3 LatLonToUnit(double latDeg, double lonDeg)
|
||||
{
|
||||
var lat = (float)(latDeg * Math.PI / 180.0);
|
||||
var lon = (float)(lonDeg * Math.PI / 180.0);
|
||||
var cosLat = (float)Math.Cos(lat);
|
||||
return new Vector3(cosLat * (float)Math.Sin(lon), (float)Math.Sin(lat), cosLat * (float)Math.Cos(lon));
|
||||
}
|
||||
|
||||
/// <summary>把世界坐标旋转到相机空间(先用 planet 旋转地球,再用 cam 转到屏幕)。</summary>
|
||||
public static Vector3 ToCamera(Vector3 world, Matrix4x4 planet, Matrix4x4 cam)
|
||||
=> Vector3.Transform(Vector3.Transform(world, planet), cam);
|
||||
|
||||
/// <summary>相机空间的正交投影:球心在原点,半径 radius。</summary>
|
||||
public static Vector2 Project(Vector3 camPos, float radius, float centerX, float centerY)
|
||||
=> new(centerX + camPos.X * radius, centerY - camPos.Y * radius);
|
||||
|
||||
/// <summary>相机空间里该点是否朝向观察者(z>0 为正面)。</summary>
|
||||
public static bool IsVisible(Vector3 camPos, float threshold = 0f) => camPos.Z > threshold;
|
||||
|
||||
/// <summary>
|
||||
/// 把一条经纬度折线拆成若干段「可见」的屏幕折线。
|
||||
/// 跨越地平线的相邻两点用线性插值求出交点作为端点,保证线不会穿过球体背面。
|
||||
/// </summary>
|
||||
public static List<List<Vector2>> ProjectPolyline(
|
||||
IReadOnlyList<double[]> latLonPoints,
|
||||
Matrix4x4 planet, Matrix4x4 cam,
|
||||
float radius, float centerX, float centerY,
|
||||
bool closed = false)
|
||||
{
|
||||
// 兼容旧调用:按需转换(点位少的分支,如洲界)
|
||||
var unit = new Vector3[latLonPoints.Count];
|
||||
for (var i = 0; i < latLonPoints.Count; i++)
|
||||
{
|
||||
var p = latLonPoints[i];
|
||||
unit[i] = p.Length >= 2 ? LatLonToUnit(p[1], p[0]) : Vector3.Zero;
|
||||
}
|
||||
var valid = new bool[unit.Length];
|
||||
for (var i = 0; i < latLonPoints.Count; i++) valid[i] = latLonPoints[i].Length >= 2;
|
||||
return ProjectUnitPolyline(unit, valid, planet, cam, radius, centerX, centerY, closed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预计算单位球坐标后的快速投影:每帧只做矩阵乘 + 正交投影,
|
||||
/// 不再重复计算 sin/cos(地理模型约 2.6 万个点,这是最大开销)。
|
||||
/// </summary>
|
||||
public static List<List<Vector2>> ProjectUnitPolyline(
|
||||
IReadOnlyList<Vector3> unitPoints,
|
||||
IReadOnlyList<bool> valid,
|
||||
Matrix4x4 planet, Matrix4x4 cam,
|
||||
float radius, float centerX, float centerY,
|
||||
bool closed = false)
|
||||
{
|
||||
var result = new List<List<Vector2>>();
|
||||
if (unitPoints.Count < 2) return result;
|
||||
|
||||
var count = unitPoints.Count;
|
||||
var total = closed ? count + 1 : count;
|
||||
List<Vector2>? current = null;
|
||||
|
||||
Vector3 prevCam = default;
|
||||
var havePrev = false;
|
||||
|
||||
for (var i = 0; i < total; i++)
|
||||
{
|
||||
var k = i % count;
|
||||
if (!valid[k]) { havePrev = false; continue; }
|
||||
|
||||
var camPos = Vector3.Transform(Vector3.Transform(unitPoints[k], planet), cam);
|
||||
var visible = camPos.Z > 0f;
|
||||
|
||||
if (!havePrev)
|
||||
{
|
||||
if (visible)
|
||||
{
|
||||
current = new List<Vector2> { Project(camPos, radius, centerX, centerY) };
|
||||
}
|
||||
prevCam = camPos;
|
||||
havePrev = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
var prevVisible = prevCam.Z > 0f;
|
||||
if (visible && prevVisible)
|
||||
{
|
||||
current ??= new List<Vector2>();
|
||||
current.Add(Project(camPos, radius, centerX, centerY));
|
||||
}
|
||||
else if (visible != prevVisible)
|
||||
{
|
||||
// 求出与地平线(z=0)的交点
|
||||
var t = prevCam.Z / (prevCam.Z - camPos.Z);
|
||||
var hit = Vector3.Lerp(prevCam, camPos, t);
|
||||
hit.Z = 0f;
|
||||
var hitScreen = Project(hit, radius, centerX, centerY);
|
||||
|
||||
if (visible)
|
||||
{
|
||||
current = new List<Vector2> { hitScreen };
|
||||
current.Add(Project(camPos, radius, centerX, centerY));
|
||||
}
|
||||
else
|
||||
{
|
||||
current?.Add(hitScreen);
|
||||
if (current is { Count: > 1 }) result.Add(current);
|
||||
current = null;
|
||||
}
|
||||
}
|
||||
|
||||
prevCam = camPos;
|
||||
}
|
||||
|
||||
if (current is { Count: > 1 }) result.Add(current);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
-115
@@ -1,115 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"EarthModelStudio.ModelSdk/1.0.5": {
|
||||
"dependencies": {
|
||||
"Avalonia": "11.3.9"
|
||||
},
|
||||
"runtime": {
|
||||
"EarthModelStudio.ModelSdk.dll": {}
|
||||
}
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"dependencies": {
|
||||
"Avalonia.Remote.Protocol": "11.3.9",
|
||||
"MicroCom.Runtime": "0.11.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Base.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Controls.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"assemblyVersion": "0.7.0.0",
|
||||
"fileVersion": "0.7.0.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Dialogs.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Metal.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.MicroCom.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.OpenGL.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Vulkan.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"runtime": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {
|
||||
"assemblyVersion": "0.11.0.0",
|
||||
"fileVersion": "0.11.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"EarthModelStudio.ModelSdk/1.0.5": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-YfaTrUxcmVTsGOw2YqdZyunHqZArK16m1pYfNIBvyvAgX89Pzd3A1PgoMkf64u7scL23IN6HkfqhZeFcbYWLoA==",
|
||||
"path": "avalonia/11.3.9",
|
||||
"hashPath": "avalonia.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-2XVLTSNa+Nvwu4D8NqqdudhllTaCRA9ZKlLZZvYLZeuLlzg7OcAV+df/biHQc6AqOv7iMFR9K5Zt3wG0EF4KfQ==",
|
||||
"path": "avalonia.remote.protocol/11.3.9",
|
||||
"hashPath": "avalonia.remote.protocol.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-MEnrZ3UIiH40hjzMDsxrTyi8dtqB5ziv3iBeeU4bXsL/7NLSal9F1lZKpK+tfBRnUoDSdtcW3KufE4yhATOMCA==",
|
||||
"path": "microcom.runtime/0.11.0",
|
||||
"hashPath": "microcom.runtime.0.11.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
-115
@@ -1,115 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"EarthModelStudio.ModelSdk/1.0.5": {
|
||||
"dependencies": {
|
||||
"Avalonia": "11.3.9"
|
||||
},
|
||||
"runtime": {
|
||||
"EarthModelStudio.ModelSdk.dll": {}
|
||||
}
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"dependencies": {
|
||||
"Avalonia.Remote.Protocol": "11.3.9",
|
||||
"MicroCom.Runtime": "0.11.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Base.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Controls.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"assemblyVersion": "0.7.0.0",
|
||||
"fileVersion": "0.7.0.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Dialogs.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Metal.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.MicroCom.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.OpenGL.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Vulkan.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"runtime": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {
|
||||
"assemblyVersion": "0.11.0.0",
|
||||
"fileVersion": "0.11.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"EarthModelStudio.ModelSdk/1.0.5": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-YfaTrUxcmVTsGOw2YqdZyunHqZArK16m1pYfNIBvyvAgX89Pzd3A1PgoMkf64u7scL23IN6HkfqhZeFcbYWLoA==",
|
||||
"path": "avalonia/11.3.9",
|
||||
"hashPath": "avalonia.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-2XVLTSNa+Nvwu4D8NqqdudhllTaCRA9ZKlLZZvYLZeuLlzg7OcAV+df/biHQc6AqOv7iMFR9K5Zt3wG0EF4KfQ==",
|
||||
"path": "avalonia.remote.protocol/11.3.9",
|
||||
"hashPath": "avalonia.remote.protocol.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-MEnrZ3UIiH40hjzMDsxrTyi8dtqB5ziv3iBeeU4bXsL/7NLSal9F1lZKpK+tfBRnUoDSdtcW3KufE4yhATOMCA==",
|
||||
"path": "microcom.runtime/0.11.0",
|
||||
"hashPath": "microcom.runtime.0.11.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
-4
@@ -1,4 +0,0 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
@@ -1 +0,0 @@
|
||||
19347f0fd9099e96da933911861c08405b49d004b7b88b97423c17bee0eb100f
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyDescriptionAttribute("Earth Model 模型契约:启动器与模型之间唯一的编译期依赖。")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.5.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.5+0f19921dd47f4ef1d3ca1ecdb92ee07a2540dc8e")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("EarthModelStudio.ModelSdk")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.5.0")]
|
||||
[assembly: System.Resources.NeutralResourcesLanguageAttribute("zh-Hans")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
22d6a632372aa7b5b7f37cfaed90b73c0d07bcacbc674c890984e07ba5152818
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
is_global = true
|
||||
build_property.AvaloniaNameGeneratorIsEnabled = true
|
||||
build_property.AvaloniaNameGeneratorBehavior = InitializeComponent
|
||||
build_property.AvaloniaNameGeneratorDefaultFieldModifier = internal
|
||||
build_property.AvaloniaNameGeneratorFilterByPath = *
|
||||
build_property.AvaloniaNameGeneratorFilterByNamespace = *
|
||||
build_property.AvaloniaNameGeneratorViewFileNamingStrategy = NamespaceAndClassName
|
||||
build_property.AvaloniaNameGeneratorAttachDevTools = true
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetFrameworkIdentifier = .NETCoreApp
|
||||
build_property.TargetFrameworkVersion = v8.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property.EntryPointFilePath =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = EarthModelStudio.ModelSdk
|
||||
build_property.ProjectDir = /Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.EffectiveAnalysisLevelStyle = 8.0
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
-1
@@ -1 +0,0 @@
|
||||
700a4b41f184bc7a11bf82dedb3429528bb388b5fb0ec5c68baea6f472087bef
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/bin/Debug/net8.0/EarthModelStudio.ModelSdk.deps.json
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/bin/Debug/net8.0/EarthModelStudio.ModelSdk.dll
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/bin/Debug/net8.0/EarthModelStudio.ModelSdk.pdb
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/EarthModelStudio.ModelSdk.csproj.AssemblyReference.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/Avalonia/Resources.Inputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/EarthModelStudio.ModelSdk.GeneratedMSBuildEditorConfig.editorconfig
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/EarthModelStudio.ModelSdk.AssemblyInfoInputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/EarthModelStudio.ModelSdk.AssemblyInfo.cs
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/EarthModelStudio.ModelSdk.csproj.CoreCompileInputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/EarthModelStudio.ModelSdk.dll
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/refint/EarthModelStudio.ModelSdk.dll
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/EarthModelStudio.ModelSdk.pdb
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Debug/net8.0/ref/EarthModelStudio.ModelSdk.dll
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
-96
@@ -1,96 +0,0 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj": {
|
||||
"version": "1.0.5",
|
||||
"restore": {
|
||||
"projectUniqueName": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj",
|
||||
"projectName": "EarthModelStudio.ModelSdk",
|
||||
"projectPath": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj",
|
||||
"packagesPath": "/Users/morris/.nuget/packages/",
|
||||
"outputPath": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/Users/morris/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "10.0.400"
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"dependencies": {
|
||||
"Avalonia": {
|
||||
"target": "Package",
|
||||
"version": "[11.3.9, )"
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[8.0.31, )",
|
||||
"autoReferenced": true
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"downloadDependencies": [
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App.Runtime.win-arm64",
|
||||
"version": "[8.0.31, 8.0.31]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Runtime.win-arm64",
|
||||
"version": "[8.0.31, 8.0.31]"
|
||||
}
|
||||
],
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win-arm64": {
|
||||
"#import": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/Users/morris/.nuget/packages/</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/Users/morris/.nuget/packages/</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="/Users/morris/.nuget/packages/" />
|
||||
</ItemGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.illink.tasks/8.0.31/build/Microsoft.NET.ILLink.Tasks.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.illink.tasks/8.0.31/build/Microsoft.NET.ILLink.Tasks.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)avalonia/11.3.9/buildTransitive/Avalonia.props" Condition="Exists('$(NuGetPackageRoot)avalonia/11.3.9/buildTransitive/Avalonia.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgMicrosoft_NET_ILLink_Tasks Condition=" '$(PkgMicrosoft_NET_ILLink_Tasks)' == '' ">/Users/morris/.nuget/packages/microsoft.net.illink.tasks/8.0.31</PkgMicrosoft_NET_ILLink_Tasks>
|
||||
<PkgAvalonia_BuildServices Condition=" '$(PkgAvalonia_BuildServices)' == '' ">/Users/morris/.nuget/packages/avalonia.buildservices/11.3.2</PkgAvalonia_BuildServices>
|
||||
<PkgAvalonia Condition=" '$(PkgAvalonia)' == '' ">/Users/morris/.nuget/packages/avalonia/11.3.9</PkgAvalonia>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)avalonia.buildservices/11.3.2/buildTransitive/Avalonia.BuildServices.targets" Condition="Exists('$(NuGetPackageRoot)avalonia.buildservices/11.3.2/buildTransitive/Avalonia.BuildServices.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)avalonia/11.3.9/buildTransitive/Avalonia.targets" Condition="Exists('$(NuGetPackageRoot)avalonia/11.3.9/buildTransitive/Avalonia.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
-1
@@ -1 +0,0 @@
|
||||
19347f0fd9099e96da933911861c08405b49d004b7b88b97423c17bee0eb100f
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyDescriptionAttribute("Earth Model 模型契约:启动器与模型之间唯一的编译期依赖。")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.5.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.5+4b5aa7799f4d3c8d207380a0341abfac4c7c2a81")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("EarthModelStudio.ModelSdk")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.5.0")]
|
||||
[assembly: System.Resources.NeutralResourcesLanguageAttribute("zh-Hans")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
e4629500327bc055c138ef8525b3c503a84cc2da5a3a22ae8ac83286d95d1d39
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
is_global = true
|
||||
build_property.EnableAotAnalyzer =
|
||||
build_property.EnableSingleFileAnalyzer = true
|
||||
build_property.EnableTrimAnalyzer =
|
||||
build_property.IncludeAllContentForSelfExtract =
|
||||
build_property.AvaloniaNameGeneratorIsEnabled = true
|
||||
build_property.AvaloniaNameGeneratorBehavior = InitializeComponent
|
||||
build_property.AvaloniaNameGeneratorDefaultFieldModifier = internal
|
||||
build_property.AvaloniaNameGeneratorFilterByPath = *
|
||||
build_property.AvaloniaNameGeneratorFilterByNamespace = *
|
||||
build_property.AvaloniaNameGeneratorViewFileNamingStrategy = NamespaceAndClassName
|
||||
build_property.AvaloniaNameGeneratorAttachDevTools = true
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetFrameworkIdentifier = .NETCoreApp
|
||||
build_property.TargetFrameworkVersion = v8.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property.EntryPointFilePath =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = EarthModelStudio.ModelSdk
|
||||
build_property.ProjectDir = /Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.EffectiveAnalysisLevelStyle = 8.0
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
-1
@@ -1 +0,0 @@
|
||||
1ab491e560668f97a7c06bde5290baec8ff1947cd02855cf82f1f7a392fd58bf
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/bin/Release/net8.0/EarthModelStudio.ModelSdk.deps.json
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/bin/Release/net8.0/EarthModelStudio.ModelSdk.dll
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.csproj.AssemblyReference.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/Avalonia/Resources.Inputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.GeneratedMSBuildEditorConfig.editorconfig
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfoInputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.AssemblyInfo.cs
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.csproj.CoreCompileInputs.cache
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/EarthModelStudio.ModelSdk.dll
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/refint/EarthModelStudio.ModelSdk.dll
|
||||
/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/Release/net8.0/ref/EarthModelStudio.ModelSdk.dll
|
||||
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -1,610 +0,0 @@
|
||||
{
|
||||
"version": 4,
|
||||
"targets": {
|
||||
"net8.0": {
|
||||
"Avalonia/11.3.9": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Avalonia.BuildServices": "11.3.2",
|
||||
"Avalonia.Remote.Protocol": "11.3.9",
|
||||
"MicroCom.Runtime": "0.11.0"
|
||||
},
|
||||
"compile": {
|
||||
"ref/net8.0/Avalonia.Base.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Controls.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Dialogs.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Markup.dll": {
|
||||
"related": ".Xaml.xml;.xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Metal.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.MicroCom.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.OpenGL.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Vulkan.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.dll": {
|
||||
"related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Base.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Controls.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Dialogs.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.dll": {
|
||||
"related": ".Xaml.xml;.xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Metal.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.MicroCom.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.OpenGL.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Vulkan.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.dll": {
|
||||
"related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml"
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"buildTransitive/Avalonia.props": {},
|
||||
"buildTransitive/Avalonia.targets": {}
|
||||
}
|
||||
},
|
||||
"Avalonia.BuildServices/11.3.2": {
|
||||
"type": "package",
|
||||
"build": {
|
||||
"buildTransitive/Avalonia.BuildServices.targets": {}
|
||||
}
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {}
|
||||
}
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/8.0.31": {
|
||||
"type": "package",
|
||||
"build": {
|
||||
"build/Microsoft.NET.ILLink.Tasks.props": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"net8.0/win-arm64": {
|
||||
"Avalonia/11.3.9": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Avalonia.BuildServices": "11.3.2",
|
||||
"Avalonia.Remote.Protocol": "11.3.9",
|
||||
"MicroCom.Runtime": "0.11.0"
|
||||
},
|
||||
"compile": {
|
||||
"ref/net8.0/Avalonia.Base.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Controls.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Dialogs.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Markup.dll": {
|
||||
"related": ".Xaml.xml;.xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Metal.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.MicroCom.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.OpenGL.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.Vulkan.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"ref/net8.0/Avalonia.dll": {
|
||||
"related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Base.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Controls.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Dialogs.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.dll": {
|
||||
"related": ".Xaml.xml;.xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Metal.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.MicroCom.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.OpenGL.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Vulkan.dll": {
|
||||
"related": ".xml"
|
||||
},
|
||||
"lib/net8.0/Avalonia.dll": {
|
||||
"related": ".Base.xml;.Controls.xml;.DesignerSupport.xml;.Dialogs.xml;.Markup.Xaml.xml;.Markup.xml;.Metal.xml;.MicroCom.xml;.OpenGL.xml;.Vulkan.xml;.xml"
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"buildTransitive/Avalonia.props": {},
|
||||
"buildTransitive/Avalonia.targets": {}
|
||||
}
|
||||
},
|
||||
"Avalonia.BuildServices/11.3.2": {
|
||||
"type": "package",
|
||||
"build": {
|
||||
"buildTransitive/Avalonia.BuildServices.targets": {}
|
||||
}
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {}
|
||||
}
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/8.0.31": {
|
||||
"type": "package",
|
||||
"build": {
|
||||
"build/Microsoft.NET.ILLink.Tasks.props": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Avalonia/11.3.9": {
|
||||
"sha512": "YfaTrUxcmVTsGOw2YqdZyunHqZArK16m1pYfNIBvyvAgX89Pzd3A1PgoMkf64u7scL23IN6HkfqhZeFcbYWLoA==",
|
||||
"type": "package",
|
||||
"path": "avalonia/11.3.9",
|
||||
"hasTools": true,
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"analyzers/dotnet/cs/Avalonia.Analyzers.dll",
|
||||
"analyzers/dotnet/cs/Avalonia.Generators.dll",
|
||||
"avalonia.11.3.9.nupkg.sha512",
|
||||
"avalonia.nuspec",
|
||||
"build/Avalonia.Generators.props",
|
||||
"build/Avalonia.props",
|
||||
"build/Avalonia.targets",
|
||||
"build/AvaloniaBuildTasks.props",
|
||||
"build/AvaloniaBuildTasks.targets",
|
||||
"build/AvaloniaItemSchema.xaml",
|
||||
"build/AvaloniaPrivateApis.targets",
|
||||
"build/AvaloniaRules.Project.xml",
|
||||
"build/AvaloniaSingleProject.targets",
|
||||
"build/AvaloniaVersion.props",
|
||||
"buildTransitive/Avalonia.Generators.props",
|
||||
"buildTransitive/Avalonia.props",
|
||||
"buildTransitive/Avalonia.targets",
|
||||
"buildTransitive/AvaloniaBuildTasks.props",
|
||||
"buildTransitive/AvaloniaBuildTasks.targets",
|
||||
"buildTransitive/AvaloniaItemSchema.xaml",
|
||||
"buildTransitive/AvaloniaPrivateApis.targets",
|
||||
"buildTransitive/AvaloniaRules.Project.xml",
|
||||
"buildTransitive/AvaloniaSingleProject.targets",
|
||||
"lib/net6.0/Avalonia.Base.dll",
|
||||
"lib/net6.0/Avalonia.Base.xml",
|
||||
"lib/net6.0/Avalonia.Controls.dll",
|
||||
"lib/net6.0/Avalonia.Controls.xml",
|
||||
"lib/net6.0/Avalonia.DesignerSupport.dll",
|
||||
"lib/net6.0/Avalonia.DesignerSupport.xml",
|
||||
"lib/net6.0/Avalonia.Dialogs.dll",
|
||||
"lib/net6.0/Avalonia.Dialogs.xml",
|
||||
"lib/net6.0/Avalonia.Markup.Xaml.dll",
|
||||
"lib/net6.0/Avalonia.Markup.Xaml.xml",
|
||||
"lib/net6.0/Avalonia.Markup.dll",
|
||||
"lib/net6.0/Avalonia.Markup.xml",
|
||||
"lib/net6.0/Avalonia.Metal.dll",
|
||||
"lib/net6.0/Avalonia.Metal.xml",
|
||||
"lib/net6.0/Avalonia.MicroCom.dll",
|
||||
"lib/net6.0/Avalonia.MicroCom.xml",
|
||||
"lib/net6.0/Avalonia.OpenGL.dll",
|
||||
"lib/net6.0/Avalonia.OpenGL.xml",
|
||||
"lib/net6.0/Avalonia.Vulkan.dll",
|
||||
"lib/net6.0/Avalonia.Vulkan.xml",
|
||||
"lib/net6.0/Avalonia.dll",
|
||||
"lib/net6.0/Avalonia.xml",
|
||||
"lib/net8.0/Avalonia.Base.dll",
|
||||
"lib/net8.0/Avalonia.Base.xml",
|
||||
"lib/net8.0/Avalonia.Controls.dll",
|
||||
"lib/net8.0/Avalonia.Controls.xml",
|
||||
"lib/net8.0/Avalonia.DesignerSupport.dll",
|
||||
"lib/net8.0/Avalonia.DesignerSupport.xml",
|
||||
"lib/net8.0/Avalonia.Dialogs.dll",
|
||||
"lib/net8.0/Avalonia.Dialogs.xml",
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.dll",
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.xml",
|
||||
"lib/net8.0/Avalonia.Markup.dll",
|
||||
"lib/net8.0/Avalonia.Markup.xml",
|
||||
"lib/net8.0/Avalonia.Metal.dll",
|
||||
"lib/net8.0/Avalonia.Metal.xml",
|
||||
"lib/net8.0/Avalonia.MicroCom.dll",
|
||||
"lib/net8.0/Avalonia.MicroCom.xml",
|
||||
"lib/net8.0/Avalonia.OpenGL.dll",
|
||||
"lib/net8.0/Avalonia.OpenGL.xml",
|
||||
"lib/net8.0/Avalonia.Vulkan.dll",
|
||||
"lib/net8.0/Avalonia.Vulkan.xml",
|
||||
"lib/net8.0/Avalonia.dll",
|
||||
"lib/net8.0/Avalonia.xml",
|
||||
"lib/netstandard2.0/Avalonia.Base.dll",
|
||||
"lib/netstandard2.0/Avalonia.Base.xml",
|
||||
"lib/netstandard2.0/Avalonia.Controls.dll",
|
||||
"lib/netstandard2.0/Avalonia.Controls.xml",
|
||||
"lib/netstandard2.0/Avalonia.DesignerSupport.dll",
|
||||
"lib/netstandard2.0/Avalonia.DesignerSupport.xml",
|
||||
"lib/netstandard2.0/Avalonia.Dialogs.dll",
|
||||
"lib/netstandard2.0/Avalonia.Dialogs.xml",
|
||||
"lib/netstandard2.0/Avalonia.Markup.Xaml.dll",
|
||||
"lib/netstandard2.0/Avalonia.Markup.Xaml.xml",
|
||||
"lib/netstandard2.0/Avalonia.Markup.dll",
|
||||
"lib/netstandard2.0/Avalonia.Markup.xml",
|
||||
"lib/netstandard2.0/Avalonia.Metal.dll",
|
||||
"lib/netstandard2.0/Avalonia.Metal.xml",
|
||||
"lib/netstandard2.0/Avalonia.MicroCom.dll",
|
||||
"lib/netstandard2.0/Avalonia.MicroCom.xml",
|
||||
"lib/netstandard2.0/Avalonia.OpenGL.dll",
|
||||
"lib/netstandard2.0/Avalonia.OpenGL.xml",
|
||||
"lib/netstandard2.0/Avalonia.Vulkan.dll",
|
||||
"lib/netstandard2.0/Avalonia.Vulkan.xml",
|
||||
"lib/netstandard2.0/Avalonia.dll",
|
||||
"lib/netstandard2.0/Avalonia.xml",
|
||||
"ref/net6.0/Avalonia.Base.dll",
|
||||
"ref/net6.0/Avalonia.Base.xml",
|
||||
"ref/net6.0/Avalonia.Controls.dll",
|
||||
"ref/net6.0/Avalonia.Controls.xml",
|
||||
"ref/net6.0/Avalonia.DesignerSupport.dll",
|
||||
"ref/net6.0/Avalonia.DesignerSupport.xml",
|
||||
"ref/net6.0/Avalonia.Dialogs.dll",
|
||||
"ref/net6.0/Avalonia.Dialogs.xml",
|
||||
"ref/net6.0/Avalonia.Markup.Xaml.dll",
|
||||
"ref/net6.0/Avalonia.Markup.Xaml.xml",
|
||||
"ref/net6.0/Avalonia.Markup.dll",
|
||||
"ref/net6.0/Avalonia.Markup.xml",
|
||||
"ref/net6.0/Avalonia.Metal.dll",
|
||||
"ref/net6.0/Avalonia.Metal.xml",
|
||||
"ref/net6.0/Avalonia.MicroCom.dll",
|
||||
"ref/net6.0/Avalonia.MicroCom.xml",
|
||||
"ref/net6.0/Avalonia.OpenGL.dll",
|
||||
"ref/net6.0/Avalonia.OpenGL.xml",
|
||||
"ref/net6.0/Avalonia.Vulkan.dll",
|
||||
"ref/net6.0/Avalonia.Vulkan.xml",
|
||||
"ref/net6.0/Avalonia.dll",
|
||||
"ref/net6.0/Avalonia.xml",
|
||||
"ref/net8.0/Avalonia.Base.dll",
|
||||
"ref/net8.0/Avalonia.Base.xml",
|
||||
"ref/net8.0/Avalonia.Controls.dll",
|
||||
"ref/net8.0/Avalonia.Controls.xml",
|
||||
"ref/net8.0/Avalonia.DesignerSupport.dll",
|
||||
"ref/net8.0/Avalonia.DesignerSupport.xml",
|
||||
"ref/net8.0/Avalonia.Dialogs.dll",
|
||||
"ref/net8.0/Avalonia.Dialogs.xml",
|
||||
"ref/net8.0/Avalonia.Markup.Xaml.dll",
|
||||
"ref/net8.0/Avalonia.Markup.Xaml.xml",
|
||||
"ref/net8.0/Avalonia.Markup.dll",
|
||||
"ref/net8.0/Avalonia.Markup.xml",
|
||||
"ref/net8.0/Avalonia.Metal.dll",
|
||||
"ref/net8.0/Avalonia.Metal.xml",
|
||||
"ref/net8.0/Avalonia.MicroCom.dll",
|
||||
"ref/net8.0/Avalonia.MicroCom.xml",
|
||||
"ref/net8.0/Avalonia.OpenGL.dll",
|
||||
"ref/net8.0/Avalonia.OpenGL.xml",
|
||||
"ref/net8.0/Avalonia.Vulkan.dll",
|
||||
"ref/net8.0/Avalonia.Vulkan.xml",
|
||||
"ref/net8.0/Avalonia.dll",
|
||||
"ref/net8.0/Avalonia.xml",
|
||||
"ref/netstandard2.0/Avalonia.Base.dll",
|
||||
"ref/netstandard2.0/Avalonia.Base.xml",
|
||||
"ref/netstandard2.0/Avalonia.Controls.dll",
|
||||
"ref/netstandard2.0/Avalonia.Controls.xml",
|
||||
"ref/netstandard2.0/Avalonia.DesignerSupport.dll",
|
||||
"ref/netstandard2.0/Avalonia.DesignerSupport.xml",
|
||||
"ref/netstandard2.0/Avalonia.Dialogs.dll",
|
||||
"ref/netstandard2.0/Avalonia.Dialogs.xml",
|
||||
"ref/netstandard2.0/Avalonia.Markup.Xaml.dll",
|
||||
"ref/netstandard2.0/Avalonia.Markup.Xaml.xml",
|
||||
"ref/netstandard2.0/Avalonia.Markup.dll",
|
||||
"ref/netstandard2.0/Avalonia.Markup.xml",
|
||||
"ref/netstandard2.0/Avalonia.Metal.dll",
|
||||
"ref/netstandard2.0/Avalonia.Metal.xml",
|
||||
"ref/netstandard2.0/Avalonia.MicroCom.dll",
|
||||
"ref/netstandard2.0/Avalonia.MicroCom.xml",
|
||||
"ref/netstandard2.0/Avalonia.OpenGL.dll",
|
||||
"ref/netstandard2.0/Avalonia.OpenGL.xml",
|
||||
"ref/netstandard2.0/Avalonia.Vulkan.dll",
|
||||
"ref/netstandard2.0/Avalonia.Vulkan.xml",
|
||||
"ref/netstandard2.0/Avalonia.dll",
|
||||
"ref/netstandard2.0/Avalonia.xml",
|
||||
"tools/net461/designer/Avalonia.Designer.HostApp.exe",
|
||||
"tools/netstandard2.0/Avalonia.Build.Tasks.dll",
|
||||
"tools/netstandard2.0/designer/Avalonia.Designer.HostApp.dll"
|
||||
]
|
||||
},
|
||||
"Avalonia.BuildServices/11.3.2": {
|
||||
"sha512": "qHDToxto1e3hci5YqbG9n0Ty8mlp3zBUN5wT66wKqaDVzXyQ0do3EnRILd4Ke9jpvsktaPpgE0YjEk7hornryQ==",
|
||||
"type": "package",
|
||||
"path": "avalonia.buildservices/11.3.2",
|
||||
"hasTools": true,
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"README.md",
|
||||
"avalonia.buildservices.11.3.2.nupkg.sha512",
|
||||
"avalonia.buildservices.nuspec",
|
||||
"build/Avalonia.BuildServices.targets",
|
||||
"buildTransitive/Avalonia.BuildServices.targets",
|
||||
"tools/netstandard2.0/Avalonia.BuildServices.Collector.dll",
|
||||
"tools/netstandard2.0/Avalonia.BuildServices.dll",
|
||||
"tools/netstandard2.0/runtimeconfig.json"
|
||||
]
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"sha512": "2XVLTSNa+Nvwu4D8NqqdudhllTaCRA9ZKlLZZvYLZeuLlzg7OcAV+df/biHQc6AqOv7iMFR9K5Zt3wG0EF4KfQ==",
|
||||
"type": "package",
|
||||
"path": "avalonia.remote.protocol/11.3.9",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"avalonia.remote.protocol.11.3.9.nupkg.sha512",
|
||||
"avalonia.remote.protocol.nuspec",
|
||||
"lib/net6.0/Avalonia.Remote.Protocol.dll",
|
||||
"lib/net6.0/Avalonia.Remote.Protocol.xml",
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll",
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.xml",
|
||||
"lib/netstandard2.0/Avalonia.Remote.Protocol.dll",
|
||||
"lib/netstandard2.0/Avalonia.Remote.Protocol.xml"
|
||||
]
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"sha512": "MEnrZ3UIiH40hjzMDsxrTyi8dtqB5ziv3iBeeU4bXsL/7NLSal9F1lZKpK+tfBRnUoDSdtcW3KufE4yhATOMCA==",
|
||||
"type": "package",
|
||||
"path": "microcom.runtime/0.11.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"lib/net5.0/MicroCom.Runtime.dll",
|
||||
"lib/netstandard2.0/MicroCom.Runtime.dll",
|
||||
"microcom.runtime.0.11.0.nupkg.sha512",
|
||||
"microcom.runtime.nuspec"
|
||||
]
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/8.0.31": {
|
||||
"sha512": "OJdAGATV2QoVWL11zlDLEluA06q8rK+cgZR47ohrO8V+Qj5z9dlvN7bG9/0e5t0IOe+yD8tREC0bpsEgDGrzIQ==",
|
||||
"type": "package",
|
||||
"path": "microsoft.net.illink.tasks/8.0.31",
|
||||
"hasTools": true,
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"Sdk/Sdk.props",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"analyzers/dotnet/cs/ILLink.CodeFixProvider.dll",
|
||||
"analyzers/dotnet/cs/ILLink.RoslynAnalyzer.dll",
|
||||
"build/Microsoft.NET.ILLink.Analyzers.props",
|
||||
"build/Microsoft.NET.ILLink.Tasks.props",
|
||||
"build/Microsoft.NET.ILLink.targets",
|
||||
"microsoft.net.illink.tasks.8.0.31.nupkg.sha512",
|
||||
"microsoft.net.illink.tasks.nuspec",
|
||||
"tools/net472/ILLink.Tasks.dll",
|
||||
"tools/net472/ILLink.Tasks.dll.config",
|
||||
"tools/net472/Mono.Cecil.Mdb.dll",
|
||||
"tools/net472/Mono.Cecil.Pdb.dll",
|
||||
"tools/net472/Mono.Cecil.Rocks.dll",
|
||||
"tools/net472/Mono.Cecil.dll",
|
||||
"tools/net472/Sdk/Sdk.props",
|
||||
"tools/net472/System.Buffers.dll",
|
||||
"tools/net472/System.Collections.Immutable.dll",
|
||||
"tools/net472/System.Memory.dll",
|
||||
"tools/net472/System.Numerics.Vectors.dll",
|
||||
"tools/net472/System.Reflection.Metadata.dll",
|
||||
"tools/net472/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"tools/net472/build/Microsoft.NET.ILLink.Analyzers.props",
|
||||
"tools/net472/build/Microsoft.NET.ILLink.Tasks.props",
|
||||
"tools/net472/build/Microsoft.NET.ILLink.targets",
|
||||
"tools/net8.0/ILLink.Tasks.deps.json",
|
||||
"tools/net8.0/ILLink.Tasks.dll",
|
||||
"tools/net8.0/Mono.Cecil.Mdb.dll",
|
||||
"tools/net8.0/Mono.Cecil.Pdb.dll",
|
||||
"tools/net8.0/Mono.Cecil.Rocks.dll",
|
||||
"tools/net8.0/Mono.Cecil.dll",
|
||||
"tools/net8.0/Sdk/Sdk.props",
|
||||
"tools/net8.0/build/Microsoft.NET.ILLink.Analyzers.props",
|
||||
"tools/net8.0/build/Microsoft.NET.ILLink.Tasks.props",
|
||||
"tools/net8.0/build/Microsoft.NET.ILLink.targets",
|
||||
"tools/net8.0/illink.deps.json",
|
||||
"tools/net8.0/illink.dll",
|
||||
"tools/net8.0/illink.runtimeconfig.json",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"projectFileDependencyGroups": {
|
||||
"net8.0": [
|
||||
"Avalonia >= 11.3.9",
|
||||
"Microsoft.NET.ILLink.Tasks >= 8.0.31"
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
"/Users/morris/.nuget/packages/": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.5",
|
||||
"restore": {
|
||||
"projectUniqueName": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj",
|
||||
"projectName": "EarthModelStudio.ModelSdk",
|
||||
"projectPath": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj",
|
||||
"packagesPath": "/Users/morris/.nuget/packages/",
|
||||
"outputPath": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/Users/morris/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
},
|
||||
"SdkAnalysisLevel": "10.0.400"
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"framework": "net8.0",
|
||||
"targetAlias": "net8.0",
|
||||
"dependencies": {
|
||||
"Avalonia": {
|
||||
"target": "Package",
|
||||
"version": "[11.3.9, )"
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[8.0.31, )",
|
||||
"autoReferenced": true
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"downloadDependencies": [
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App.Runtime.win-arm64",
|
||||
"version": "[8.0.31, 8.0.31]"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.NETCore.App.Runtime.win-arm64",
|
||||
"version": "[8.0.31, 8.0.31]"
|
||||
}
|
||||
],
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/10.0.401/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win-arm64": {
|
||||
"#import": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "BdS4+eRe9lk=",
|
||||
"success": true,
|
||||
"projectFilePath": "/Users/morris/Downloads/GC#/model/_sdk/EarthModelStudio.ModelSdk/EarthModelStudio.ModelSdk.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"/Users/morris/.nuget/packages/avalonia/11.3.9/avalonia.11.3.9.nupkg.sha512",
|
||||
"/Users/morris/.nuget/packages/avalonia.buildservices/11.3.2/avalonia.buildservices.11.3.2.nupkg.sha512",
|
||||
"/Users/morris/.nuget/packages/avalonia.remote.protocol/11.3.9/avalonia.remote.protocol.11.3.9.nupkg.sha512",
|
||||
"/Users/morris/.nuget/packages/microcom.runtime/0.11.0/microcom.runtime.0.11.0.nupkg.sha512",
|
||||
"/Users/morris/.nuget/packages/microsoft.net.illink.tasks/8.0.31/microsoft.net.illink.tasks.8.0.31.nupkg.sha512",
|
||||
"/Users/morris/.nuget/packages/microsoft.netcore.app.runtime.win-arm64/8.0.31/microsoft.netcore.app.runtime.win-arm64.8.0.31.nupkg.sha512",
|
||||
"/Users/morris/.nuget/packages/microsoft.aspnetcore.app.runtime.win-arm64/8.0.31/microsoft.aspnetcore.app.runtime.win-arm64.8.0.31.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"id": "earth-geography",
|
||||
"nameI18n": {
|
||||
"zh-CN": "地球地理",
|
||||
"en": "Earth Geography"
|
||||
},
|
||||
"descriptionI18n": {
|
||||
"zh-CN": "五带划分、七大洲四大洋轮廓、六大板块与洲界,纯线稿教学图。",
|
||||
"en": "Climate zones, continent/ocean outlines, plates and borders — clean line art."
|
||||
},
|
||||
"assembly": "EarthGeographyModel.dll",
|
||||
"type": "NeoRF.EarthModels.GeographyModelFactory",
|
||||
"author": "Morris GC",
|
||||
"tags": [
|
||||
"geography",
|
||||
"earth",
|
||||
"atlas"
|
||||
],
|
||||
"dataDir": "earth-geography.model",
|
||||
"version": "1.8",
|
||||
"updatedAt": "2026-11-12T12:37:07Z",
|
||||
"chrome": {
|
||||
"titleBar": "#0C1828",
|
||||
"titleBorder": "#1B2740",
|
||||
"titleText": "#EAF2FF",
|
||||
"button": "#9FB4D4",
|
||||
"frame": "#0A1524"
|
||||
},
|
||||
"build": "b9f4bd818d"
|
||||
}
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
{"borders":[{"between":"亚洲-非洲","name":"苏伊士运河","lines":[[[32.6,31.3],[32.4,30.5],[32.3,29.9]]]},{"between":"亚洲-欧洲","name":"亚欧分界(乌拉尔山—乌拉尔河—里海—大高加索山—黑海—土耳其海峡)","segments":[{"name":"乌拉尔山","nameI18n":{"zh-CN":"乌拉尔山","en":"Ural Mts."},"lines":[[[66.0,68.5],[64.0,64.0],[60.5,60.0],[58.5,54.0],[57.0,51.0]]]},{"name":"乌拉尔河","nameI18n":{"zh-CN":"乌拉尔河","en":"Ural River"},"lines":[[[57.0,51.0],[55.5,49.0],[53.0,47.0],[51.5,46.5]]]},{"name":"里海","nameI18n":{"zh-CN":"里海","en":"Caspian Sea"},"lines":[[[51.5,46.5],[50.5,44.0],[49.5,41.0],[50.0,38.0],[51.0,36.5]]]},{"name":"大高加索山","nameI18n":{"zh-CN":"大高加索山","en":"Greater Caucasus"},"lines":[[[51.0,36.5],[46.0,42.5],[43.0,42.8],[41.0,43.2]]]},{"name":"黑海","nameI18n":{"zh-CN":"黑海","en":"Black Sea"},"lines":[[[41.0,43.2],[36.0,44.5],[31.0,44.0],[29.0,41.5]]]},{"name":"土耳其海峡","nameI18n":{"zh-CN":"土耳其海峡","en":"Turkish Straits"},"lines":[[[29.0,41.5],[28.0,40.5],[26.5,40.0],[26.2,39.5]]]}],"lines":[[[66.0,68.5],[64.0,64.0],[60.5,60.0],[58.5,54.0],[57.0,51.0],[57.0,51.0],[55.5,49.0],[53.0,47.0],[51.5,46.5],[51.5,46.5],[50.5,44.0],[49.5,41.0],[50.0,38.0],[51.0,36.5],[51.0,36.5],[46.0,42.5],[43.0,42.8],[41.0,43.2],[41.0,43.2],[36.0,44.5],[31.0,44.0],[29.0,41.5],[29.0,41.5],[28.0,40.5],[26.5,40.0],[26.2,39.5]]]},{"between":"欧洲-非洲","name":"直布罗陀海峡","lines":[[[-5.6,36.0],[-4.0,36.2],[0.0,36.5]]]},{"between":"北美-南美","name":"巴拿马运河","lines":[[[-79.6,9.1],[-78.5,8.9],[-77.5,8.6]]]},{"between":"南美-南极","name":"德雷克海峡","nameI18n":{"zh-CN":"德雷克海峡","en":"Drake Passage"},"lines":[[[-68.0,-56.0],[-66.5,-57.5],[-65.0,-59.0],[-63.5,-60.5],[-62.0,-62.0]]]},{"between":"亚洲-北美","name":"白令海峡","lines":[[[-169.0,65.5],[-170.5,65.8],[-172.0,66.0]]]},{"between":"亚洲-大洋洲","name":"印尼群岛","lines":[[[120.0,-1.0],[125.0,-2.0],[130.0,-3.0]]]},{"between":"南极洲","name":"南极圈","lines":[[[-180.0,-66.5],[-170.0,-66.5],[-160.0,-66.5],[-150.0,-66.5],[-140.0,-66.5],[-130.0,-66.5],[-120.0,-66.5],[-110.0,-66.5],[-100.0,-66.5],[-90.0,-66.5],[-80.0,-66.5],[-70.0,-66.5],[-60.0,-66.5],[-50.0,-66.5],[-40.0,-66.5],[-30.0,-66.5],[-20.0,-66.5],[-10.0,-66.5],[0.0,-66.5],[10.0,-66.5],[20.0,-66.5],[30.0,-66.5],[40.0,-66.5],[50.0,-66.5],[60.0,-66.5],[70.0,-66.5],[80.0,-66.5],[90.0,-66.5],[100.0,-66.5],[110.0,-66.5],[120.0,-66.5],[130.0,-66.5],[140.0,-66.5],[150.0,-66.5],[160.0,-66.5],[170.0,-66.5],[180.0,-66.5]]]}]}
|
||||
@@ -1 +0,0 @@
|
||||
{"lines":[[[180.0,-16.17],[179.56,-16.64],[179.93,-16.52],[179.93,-16.74],[179.2,-16.71],[178.71,-16.98],[178.5,-16.79],[178.58,-16.62],[180.0,-16.17]],[[143.18,-11.95],[143.11,-12.3],[143.4,-12.64],[143.76,-14.35],[143.96,-14.46],[144.47,-14.23],[145.29,-14.94],[145.43,-16.41],[145.91,-16.91],[146.13,-17.64],[146.03,-18.27],[146.33,-18.55],[146.38,-18.98],[147.42,-19.38],[147.74,-19.77],[148.76,-20.29],[148.88,-20.48],[148.68,-20.58],[149.45,-21.58],[149.7,-22.44],[149.97,-22.55],[150.02,-22.17],[150.54,-22.56],[150.62,-22.37],[150.84,-23.46],[151.83,-24.12],[153.16,-25.96],[153.12,-27.19],[153.62,-28.67],[153.03,-30.56],[152.94,-31.43],[152.47,-32.44],[151.81,-32.9],[151.29,-33.58],[150.81,-35.01],[150.19,-35.83],[149.93,-37.53],[149.48,-37.77],[147.88,-37.93],[146.86,-38.66],[146.22,-38.73],[146.47,-38.84],[146.4,-39.15],[145.4,-38.53],[145.48,-38.24],[144.96,-38.5],[144.72,-38.34],[145.12,-38.09],[144.89,-37.9],[144.4,-38.14],[144.66,-38.21],[143.54,-38.82],[142.46,-38.39],[141.42,-38.36],[140.39,-37.9],[139.78,-37.25],[139.73,-36.37],[138.97,-35.58],[139.29,-35.61],[139.28,-35.38],[138.18,-35.61],[138.51,-35.02],[138.09,-34.17],[137.69,-35.14],[136.88,-35.24],[137.01,-34.92],[137.39,-34.91],[137.49,-34.16],[137.93,-33.58],[137.85,-33.2],[137.99,-33.09],[137.78,-32.58],[137.79,-32.82],[137.24,-33.63],[136.43,-34.03],[135.89,-34.66],[135.97,-34.98],[135.65,-34.94],[135.12,-34.59],[135.45,-34.58],[135.22,-33.96],[134.72,-33.26],[134.3,-33.16],[134.1,-32.75],[134.23,-32.55],[133.66,-32.21],[132.76,-31.96],[132.22,-32.01],[131.14,-31.5],[128.95,-31.7],[127.32,-32.26],[125.92,-32.3],[124.24,-33.02],[123.51,-33.92],[122.15,-33.99],[121.41,-33.83],[119.85,-33.98],[119.45,-34.37],[117.86,-35.05],[116.52,-34.99],[115.01,-34.26],[114.99,-33.52],[115.36,-33.64],[115.68,-33.19],[115.7,-31.7],[115.08,-30.56],[114.86,-29.14],[114.17,-28.08],[114.03,-27.35],[113.19,-26.18],[113.32,-26.24],[113.36,-26.08],[113.58,-26.56],[113.84,-26.5],[113.45,-25.6],[113.71,-25.83],[113.72,-26.13],[113.85,-26.01],[113.99,-26.32],[114.22,-26.29],[114.21,-25.85],[113.42,-24.44],[113.76,-23.42],[113.68,-22.64],[114.02,-21.88],[114.14,-22.48],[114.71,-21.82],[116.71,-20.65],[117.41,-20.72],[119.1,-20.0],[119.59,-20.04],[121.0,-19.6],[121.83,-18.48],[122.34,-18.11],[122.15,-17.55],[122.26,-17.14],[122.97,-16.44],[123.56,-17.52],[123.59,-17.03],[123.83,-17.12],[123.87,-16.92],[123.49,-16.49],[123.61,-16.22],[124.77,-16.4],[124.41,-16.3],[124.65,-15.87],[124.5,-15.97],[124.38,-15.76],[124.44,-15.49],[124.69,-15.27],[125.06,-15.44],[124.84,-15.16],[125.04,-15.0],[125.36,-15.12],[125.18,-14.71],[125.58,-14.48],[125.63,-14.26],[125.66,-14.53],[126.02,-14.49],[126.05,-13.98],[126.57,-14.16],[126.9,-13.74],[127.46,-14.03],[128.2,-14.75],[128.07,-15.33],[128.58,-14.78],[129.06,-14.88],[129.22,-15.16],[129.27,-14.87],[129.63,-15.14],[129.64,-14.85],[129.85,-14.83],[129.38,-14.39],[129.84,-13.57],[130.26,-13.3],[130.17,-12.96],[130.62,-12.65],[130.62,-12.43],[130.87,-12.56],[131.29,-12.07],[131.44,-12.28],[132.41,-12.29],[132.71,-12.12],[132.67,-11.65],[131.82,-11.3],[131.96,-11.18],[135.03,-12.19],[135.92,-11.83],[135.7,-12.21],[136.01,-12.19],[136.08,-12.42],[136.26,-12.43],[136.27,-12.13],[136.54,-11.96],[136.95,-12.35],[136.54,-12.78],[136.46,-13.22],[135.93,-13.3],[135.95,-13.94],[135.45,-14.92],[138.25,-16.72],[139.01,-16.9],[139.25,-17.33],[140.04,-17.7],[140.51,-17.62],[140.83,-17.41],[141.41,-16.07],[141.62,-15.06],[141.47,-13.8],[141.61,-12.94],[141.93,-12.74],[141.69,-12.35],[141.96,-12.05],[142.17,-10.95],[142.6,-10.75],[142.87,-11.82],[143.18,-11.95]],[[178.28,-17.37],[178.59,-17.65],[178.67,-18.08],[177.96,-18.26],[177.32,-18.08],[177.26,-17.86],[177.5,-17.54],[178.28,-17.37]],[[164.2,-20.25],[165.19,-20.77],[166.94,-22.09],[166.97,-22.32],[166.47,-22.26],[164.93,-21.29],[164.38,-20.74],[164.04,-20.17],[164.2,-20.25]],[[127.73,0.85],[127.88,0.83],[128.22,1.4],[128.69,1.57],[128.7,1.11],[128.26,0.73],[128.9,0.22],[127.98,0.47],[127.89,0.3],[127.98,-0.25],[128.43,-0.89],[127.69,-0.24],[127.61,0.85],[127.43,1.14],[127.63,1.84],[128.04,2.2],[127.89,1.83],[128.01,1.33],[127.65,1.01],[127.73,0.85]],[[69.19,-49.11],[69.59,-48.97],[69.64,-49.12],[69.41,-49.18],[69.54,-49.26],[70.32,-49.06],[70.56,-49.2],[70.39,-49.43],[69.76,-49.43],[70.31,-49.58],[70.12,-49.7],[69.15,-49.53],[68.81,-49.7],[68.77,-49.07],[69.0,-48.66],[69.19,-49.11]],[[63.37,80.7],[62.52,80.82],[64.1,81.0],[64.31,81.17],[65.17,81.14],[65.44,80.93],[63.37,80.7]],[[-25.43,70.92],[-25.4,70.65],[-26.22,70.45],[-28.04,70.49],[-27.62,70.91],[-25.82,71.04],[-25.43,70.92]],[[117.31,8.44],[117.35,8.71],[119.22,10.48],[119.55,11.31],[119.69,10.5],[118.78,9.92],[118.44,9.26],[117.31,8.44]],[[122.5,11.62],[122.89,11.44],[123.16,11.54],[123.12,11.29],[122.77,10.82],[121.95,10.44],[122.1,11.64],[121.92,11.85],[122.5,11.62]],[[123.13,9.06],[122.4,9.82],[122.86,10.09],[122.98,10.89],[123.26,10.99],[123.57,10.78],[123.16,9.86],[123.32,9.27],[123.13,9.06]],[[124.58,11.34],[124.93,11.37],[125.0Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"continents":[{"id":"eurasia","nameI18n":{"zh-CN":"亚欧大陆","en":"Eurasia"},"label":[85,52],"lines":[[[127.7,0.8],[127.9,0.8],[128.2,1.4],[128.7,1.6],[128.7,1.1],[128.3,0.9],[128.3,0.7],[128.9,0.2],[128.0,0.5],[127.9,0.3]],[[127.7,0.3],[127.4,1.1],[127.6,1.8],[128.0,2.2],[128.0,1.3],[127.7,0.8]],[[63.4,80.7],[62.5,80.8],[63.1,81.0],[64.1,81.0],[64.3,81.2],[65.4,81.1],[65.4,80.9],[63.4,80.7]],[[117.3,8.4],[117.3,8.7],[119.2,10.5],[119.3,11.0],[119.6,11.3],[119.5,11.0],[119.7,10.5],[118.8,9.9],[118.4,9.3],[117.3,8.4]],[[122.5,11.6],[122.8,11.6],[122.9,11.4],[123.2,11.5],[122.8,10.8],[122.0,10.4],[122.1,11.6],[121.9,11.9],[122.5,11.6]],[[123.1,9.1],[122.4,9.8],[122.5,10.0],[122.9,10.1],[122.8,10.5],[123.0,10.9],[123.3,11.0],[123.6,10.8],[123.2,9.9],[123.3,9.3],[123.1,9.1]],[[124.6,11.3],[124.9,11.4],[125.3,10.3],[125.1,10.2],[125.0,10.4],[125.0,10.0],[124.8,10.2],[124.7,11.0],[124.4,10.9],[124.3,11.5],[124.6,11.3]],[[125.2,12.5],[125.5,12.2],[125.7,11.1],[125.2,11.1],[124.9,11.6],[125.0,11.8],[124.4,12.2],[124.3,12.6],[125.2,12.5]],[[120.7,13.5],[121.2,13.4],[121.5,13.1],[121.5,12.6],[121.2,12.2],[120.5,13.4],[120.3,13.4],[120.7,13.5]],[[22.6,58.6],[23.3,58.5],[22.0,57.9],[22.2,58.2],[21.9,58.3],[21.9,58.5],[22.6,58.6]],[[21.6,78.6],[22.0,78.6],[22.3,78.2],[23.0,78.3],[23.5,78.1],[23.1,78.0],[24.9,77.8],[22.8,77.3],[22.4,77.3],[22.7,77.6],[21.1,77.4],[20.9,77.6],[21.7,77.9],[20.2,78.5],[21.6,78.6]],[[47.4,80.9],[48.4,80.8],[48.7,80.6],[47.7,80.8],[46.1,80.4],[46.0,80.6],[44.9,80.6],[47.4,80.9]],[[50.3,80.9],[51.7,80.7],[51.0,80.5],[48.8,80.4],[48.7,80.3],[49.0,80.2],[48.4,80.1],[46.6,80.3],[49.1,80.5],[49.2,80.8],[50.3,80.9]],[[50.3,69.2],[50.2,69.0],[48.9,68.7],[48.4,68.8],[48.3,69.0],[48.4,69.3],[49.0,69.5],[50.3,69.2]],[[23.9,35.5],[24.2,35.6],[24.1,35.5],[24.4,35.4],[25.7,35.3],[25.8,35.1],[26.3,35.3],[26.2,35.0]],[[23.9,35.5],[24.2,35.6],[24.1,35.5],[24.4,35.4],[25.7,35.3],[25.8,35.1],[26.3,35.3],[26.2,35.0],[24.8,34.9],[24.5,35.2],[23.6,35.3],[23.7,35.7],[23.9,35.5]],[[23.4,39.0],[23.5,38.8],[24.1,38.6],[24.6,38.0],[22.9,38.9],[23.4,39.0]],[[34.5,35.6],[33.9,35.3],[34.0,35.0],[33.0,34.6],[32.4,34.7],[32.3,35.1],[32.9,35.2],[32.9,35.4],[34.5,35.6]],[[19.1,57.8],[18.8,57.7],[18.9,57.4],[18.1,56.9],[18.3,57.1],[18.1,57.6],[18.9,57.9],[19.1,57.8]],[[12.6,55.8],[12.2,55.5],[12.4,55.3],[12.1,55.2],[12.1,54.8],[11.9,54.8],[11.7,55.2],[11.3,55.2],[11.0,55.7],[11.6,56.0],[11.8,55.7],[11.9,56.0],[12.2,56.1],[12.6,56.1],[12.6,55.8]],[[96.5,81.1],[97.9,80.7],[97.1,80.6],[97.0,80.5],[97.4,80.3],[97.2,80.2],[93.9,80.0],[91.5,80.4],[92.8,80.6],[93.3,80.8],[92.6,80.8],[93.4,81.0],[95.8,81.3],[96.5,81.1]],[[97.7,80.2],[98.0,80.0],[97.6,79.8],[98.4,79.9],[98.6,80.1],[100.1,79.8],[99.7,79.3],[99.0,79.3],[99.9,79.0],[99.4,78.8],[94.8,79.1],[94.2,79.4],[93.1,79.5],[95.0,80.1],[97.7,80.2]],[[102.9,79.3],[102.4,78.8],[103.0,79.1],[103.8,79.1],[105.1,78.8],[105.3,78.5],[104.7,78.3],[99.3,78.0],[100.0,78.3],[100.4,78.8],[101.0,78.8],[100.9,78.9],[101.5,79.3],[102.9,79.3]],[[140.0,75.8],[140.8,75.6],[141.0,76.0],[141.5,76.1],[143.7,75.9],[145.4,75.5],[144.7,75.4],[144.9,75.3],[144.0,75.0],[142.8,75.3],[142.7,75.5],[143.0,75.6],[142.9,75.7],[142.1,75.7],[142.6,75.1],[143.1,75.0],[142.5,74.8],[142.0,75.0],[140.3,74.8],[139.7,75.0],[139.1,74.7],[138.1,74.8],[136.9,75.3],[137.3,75.3],[137.2,75.6],[137.7,75.8],[137.5,75.9],[137.6,76.0],[138.2,76.1],[138.9,76.2],[140.0,75.8]],[[142.2,73.9],[143.5,73.5],[143.5,73.2],[140.7,73.5],[139.7,73.4],[140.4,73.5],[141.1,73.9],[142.2,73.9]],[[146.8,75.4],[150.8,75.2],[150.6,74.9],[148.1,74.8],[146.1,75.2],[146.4,75.6],[146.8,75.4]],[[126.0,9.3],[126.2,9.3],[126.3,9.0],[126.1,8.6],[126.4,8.5],[126.6,7.2],[126.2,6.9],[126.2,6.3],[125.7,7.3],[125.4,6.7],[125.7,6.0],[125.3,5.6],[125.2,6.1],[124.9,5.9],[124.2,6.2],[124.0,7.0],[124.2,7.4],[124.0,7.7],[123.5,7.8],[123.4,7.4],[123.1,7.7],[122.8,7.5],[122.6,7.8],[122.0,7.0],[121.9,7.2],[122.2,7.9],[122.9,8.2],[123.4,8.7],[123.7,8.6],[123.8,8.0],[124.2,8.2],[124.4,8.6],[124.7,8.6],[124.9,9.0],[125.5,9.0],[125.5,9.8],[126.0,9.3]],[[121.1,18.6],[121.8,18.3],[122.3,18.5],[122.2,17.7],[122.5,17.1],[122.1,16.2],[121.6,15.9],[121.4,15.3],[121.7,14.8],[121.6,14.6],[121.9,14.0],[122.2,13.9],[122.2,14.1],[122.6,14.3],[122.9,14.2],[123.1,13.8],[123.3,13.8],[123.3,14.1],[123.8,13.8],[123.5,13.6],[123.8,13.1],[124.1,13.0],[124.1,12.6],[123.9,12.9],[123.3,13.0],[123.2,13.4],[122.6,13.9],[122.6,13.2],[121.8,13.9],[121.3,13.6],[120.8,13.9],[120.6,13.8],[120.6,14.2],[120.9,14.6],[120.6,14.9],[120.6,14.5],[120.4,14.5],[120.1,14.9],[119.8,16.3],[120.2,16.0],[120.4,16.1],[120.3,16.6],[120.6,18.5],[121.1,18.6]],[[124.9,1.0],[124.4,0.5],[123.8,0.3],[123.3,0.3],[123.0,0.5],[120.6,0.5],[120.2,0.3]],[[119.9,0.0],[119.8,0.2],[120.3,1.0],[120.4,0.8],[120.9,1.3],[122.8,0.8],[123.9,0.8],[125.1,1.7],[125.2,1.5],[124.9,1.0]],[[96.5,5.2],[97.5,5.2],[98.3,4.1],[99.7,3.2],[100.5,2.2],[100.9,1.9],[100.8,2.2],[101.0,2.3],[102.4,0.8],[103.0,0.6],[103.0,0.4],[102.5,0.2],[103.3,0.5],[10Line truncated
|
||||
@@ -1,124 +0,0 @@
|
||||
{
|
||||
"zh-CN": {
|
||||
"title": "如何使用 · 地球地理",
|
||||
"sections": [
|
||||
{
|
||||
"h": "开始使用(跟着做)",
|
||||
"lines": [
|
||||
"第 1 步:点右上「平面」,先看完整的世界地图,确认七大洲四大洋的位置。",
|
||||
"第 2 步:点「五带」,看回归线与极圈怎么把地球分成五个温度带。",
|
||||
"第 3 步:关掉「五带」,打开「六大板块」,记住六块板块的名字和范围。",
|
||||
"第 4 步:再打开「五大陆」,对比金色实线(大陆)与彩色虚线(板块)的差别。",
|
||||
"第 5 步:切回「3D 球面」,拖动转动地球,看背面会自动隐藏。",
|
||||
"看不清?滚轮放大;想重来点「复位」。每个图层都能单独开关,互不干扰。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "一、这个模型包含什么",
|
||||
"lines": [
|
||||
"五带:热带、南北温带、南北寒带(按回归线 23.5° 与极圈 66.5° 划分)。",
|
||||
"七大洲四大洋轮廓,以及洲与洲之间的分界线(苏伊士运河、巴拿马运河、白令海峡等)。",
|
||||
"六大板块:亚欧、非洲、美洲、太平洋、印度洋、南极洲板块。",
|
||||
"五块大陆:亚欧大陆、非洲大陆、美洲大陆、澳大利亚大陆、南极大陆。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "二、两种视图",
|
||||
"lines": [
|
||||
"「3D 球面」:正交投影球体,拖动旋转、滚轮缩放,背面自动裁掉。",
|
||||
"「平面」:等经纬矩形地图,课本地图样式,一次看全整幅。",
|
||||
"「复位」回到初始视角与缩放。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "三、图层开关(各自独立)",
|
||||
"lines": [
|
||||
"「五带」:叠加五带分界线与回归线、极圈。",
|
||||
"「大洲轮廓」:白色海岸线。",
|
||||
"「六大板块」:彩色虚线,是板块边界(不是大陆边界)。",
|
||||
"「五大陆」:金色实线,是大陆轮廓。",
|
||||
"「洲界」:分界点与分界线标签(如德雷克海峡、乌拉尔山…)。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "四、颜色与图例",
|
||||
"lines": [
|
||||
"右侧图例说明三种线型:海岸线 / 板块边界 / 分界线。",
|
||||
"底部色块对应五个温度带。",
|
||||
"六大板块各一种颜色,标签放在板块中心附近。"
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "五、教学要点与易错点",
|
||||
"lines": [
|
||||
"「板块 ≠ 大陆」:美洲板块覆盖南北美大陆并向东到大西洋中脊;印度洋板块包含澳大利亚与印度次大陆。",
|
||||
"六大板块是全球一级板块,纳斯卡、阿拉伯等属于次级小板块,教材不列入。",
|
||||
"板块交界处多火山地震(环太平洋带、地中海—喜马拉雅带)。",
|
||||
"洲界是人为约定:亚欧以乌拉尔山—乌拉尔河—里海—大高加索山—黑海—土耳其海峡为界;亚非以苏伊士运河为界;南北美以巴拿马运河为界;南美与南极以德雷克海峡为界。",
|
||||
"Esc 关闭窗口,F11 全屏。"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"en": {
|
||||
"title": "How to use · Earth Geography",
|
||||
"sections": [
|
||||
{
|
||||
"h": "Getting started (follow along)",
|
||||
"lines": [
|
||||
"Step 1: click Flat in the top right for the whole world map first.",
|
||||
"Step 2: turn on Climate zones to see how the tropics and polar circles split five belts.",
|
||||
"Step 3: switch zones off and turn on Six plates; learn the six names and extents.",
|
||||
"Step 4: turn on Five mainlands and compare solid gold lines (mainlands) with dashed colored lines (plates).",
|
||||
"Step 5: switch back to 3D globe, drag to rotate, and see back faces clip automatically.",
|
||||
"Hard to read? Scroll to zoom; press Reset to start over. Each layer toggles independently."
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "1. What this model contains",
|
||||
"lines": [
|
||||
"Five climate zones split by the tropics (23.5°) and polar circles (66.5°).",
|
||||
"Seven continents, four oceans, and continental borders (Suez, Panama, Bering, etc.).",
|
||||
"Six major plates: Eurasian, African, American, Pacific, Indian Ocean, Antarctic.",
|
||||
"Five mainlands: Eurasia, Africa, America, Australia, Antarctica."
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "2. Two views",
|
||||
"lines": [
|
||||
"3D globe: orthographic sphere; drag to rotate, scroll to zoom, back faces clipped.",
|
||||
"Flat: equirectangular textbook map, whole world at once.",
|
||||
"Reset restores the initial view and zoom."
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "3. Independent layer toggles",
|
||||
"lines": [
|
||||
"Climate zones: tropics, polar circles and zone edges.",
|
||||
"Coastlines: white continental outlines.",
|
||||
"Six plates: dashed colored lines — plate BOUNDARIES, not continental edges.",
|
||||
"Five mainlands: solid gold lines — continental outlines.",
|
||||
"Borders: boundary dots and labels (Drake Passage, Ural Mts., ...)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "4. Colors & legend",
|
||||
"lines": [
|
||||
"The right legend explains the three line styles.",
|
||||
"The bottom strip maps the five climate zones.",
|
||||
"Each of the six plates has its own color, labelled near its center."
|
||||
]
|
||||
},
|
||||
{
|
||||
"h": "5. Teaching notes & pitfalls",
|
||||
"lines": [
|
||||
"Plates are NOT mainlands: the American Plate spans both Americas to the Mid-Atlantic Ridge; the Indian Ocean Plate includes Australia and the Indian subcontinent.",
|
||||
"These six are the first-order plates; Nazca, Arabian, etc. are secondary and are not listed in textbooks.",
|
||||
"Volcanoes and earthquakes concentrate along plate boundaries (Pacific Ring, Mediterranean–Himalayan belt).",
|
||||
"Borders are conventions: Asia/Europe along the Urals–Ural River–Caspian–Caucasus–Black Sea–Turkish Straits; Asia/Africa at Suez; N/S America at Panama; S. America/Antarctica at Drake Passage.",
|
||||
"Esc closes, F11 toggles fullscreen."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"zones": "Zones",
|
||||
"coast": "Continents",
|
||||
"plates": "Plates",
|
||||
"borders": "Borders",
|
||||
"reset": "Reset"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"zones": "五带",
|
||||
"coast": "大洲轮廓",
|
||||
"plates": "板块",
|
||||
"borders": "洲界",
|
||||
"reset": "复位"
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
{
|
||||
"labels": [
|
||||
{
|
||||
"lat": 34,
|
||||
"lon": 90,
|
||||
"kind": "continent",
|
||||
"nameI18n": {
|
||||
"zh-CN": "亚洲",
|
||||
"en": "Asia"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": 2,
|
||||
"lon": 20,
|
||||
"kind": "continent",
|
||||
"nameI18n": {
|
||||
"zh-CN": "非洲",
|
||||
"en": "Africa"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": 48,
|
||||
"lon": -100,
|
||||
"kind": "continent",
|
||||
"nameI18n": {
|
||||
"zh-CN": "北美洲",
|
||||
"en": "North America"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": -15,
|
||||
"lon": -60,
|
||||
"kind": "continent",
|
||||
"nameI18n": {
|
||||
"zh-CN": "南美洲",
|
||||
"en": "South America"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": -78,
|
||||
"lon": 20,
|
||||
"kind": "continent",
|
||||
"nameI18n": {
|
||||
"zh-CN": "南极洲",
|
||||
"en": "Antarctica"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": 52,
|
||||
"lon": 18,
|
||||
"kind": "continent",
|
||||
"nameI18n": {
|
||||
"zh-CN": "欧洲",
|
||||
"en": "Europe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": -24,
|
||||
"lon": 134,
|
||||
"kind": "continent",
|
||||
"nameI18n": {
|
||||
"zh-CN": "大洋洲",
|
||||
"en": "Oceania"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": 0,
|
||||
"lon": -155,
|
||||
"kind": "ocean",
|
||||
"nameI18n": {
|
||||
"zh-CN": "太平洋",
|
||||
"en": "Pacific Ocean"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": 12,
|
||||
"lon": -30,
|
||||
"kind": "ocean",
|
||||
"nameI18n": {
|
||||
"zh-CN": "大西洋",
|
||||
"en": "Atlantic Ocean"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": -22,
|
||||
"lon": 78,
|
||||
"kind": "ocean",
|
||||
"nameI18n": {
|
||||
"zh-CN": "印度洋",
|
||||
"en": "Indian Ocean"
|
||||
}
|
||||
},
|
||||
{
|
||||
"lat": 85,
|
||||
"lon": 0,
|
||||
"kind": "ocean",
|
||||
"nameI18n": {
|
||||
"zh-CN": "北冰洋",
|
||||
"en": "Arctic Ocean"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"plates": [
|
||||
{
|
||||
"id": "eurasian",
|
||||
"nameI18n": { "zh-CN": "亚欧板块", "en": "Eurasian Plate" },
|
||||
"label": [85, 55],
|
||||
"lines": [
|
||||
[[-10,36],[0,45],[15,55],[30,68],[60,72],[100,76],[140,70],[160,60],[140,42],[125,32],[110,28],[95,28],[80,30],[72,28],[60,25],[45,30],[32,32],[10,37],[-10,36]]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "african",
|
||||
"nameI18n": { "zh-CN": "非洲板块", "en": "African Plate" },
|
||||
"label": [12, 2],
|
||||
"lines": [
|
||||
[[-20,35],[10,37],[32,32],[43,12],[51,10],[42,-8],[40,-25],[25,-35],[15,-30],[8,-5],[-8,5],[-17,15],[-20,35]]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "american",
|
||||
"nameI18n": { "zh-CN": "美洲板块", "en": "American Plate" },
|
||||
"label": [-100, 12],
|
||||
"lines": [
|
||||
[[-168,72],[-140,70],[-115,70],[-90,72],[-60,60],[-52,45],[-60,30],[-80,25],[-82,8],[-78,0],[-70,-15],[-72,-40],[-75,-52],[-80,-55],[-95,-45],[-105,-25],[-95,-5],[-90,10],[-105,20],[-120,35],[-135,50],[-155,60],[-168,72]]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pacific",
|
||||
"nameI18n": { "zh-CN": "太平洋板块", "en": "Pacific Plate" },
|
||||
"label": [-150, 0],
|
||||
"lines": [
|
||||
[[-180,60],[-150,55],[-130,45],[-110,25],[-95,10],[-80,0],[-75,-15],[-90,-30],[-110,-45],[-130,-55],[-160,-60],[-180,-58],[-180,60]],
|
||||
[[145,55],[158,45],[152,30],[145,15],[140,0],[148,-15],[158,-30],[168,-45],[180,-55],[180,60],[165,60],[145,55]]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "indian-ocean",
|
||||
"nameI18n": { "zh-CN": "印度洋板块", "en": "Indian Ocean Plate" },
|
||||
"label": [95, -8],
|
||||
"lines": [
|
||||
[[35,32],[50,30],[60,22],[68,24],[75,8],[88,5],[95,5],[115,10],[130,5],[145,-5],[150,-20],[145,-35],[130,-42],[115,-38],[105,-25],[95,-10],[80,-10],[65,-5],[55,10],[42,10],[35,20],[35,32]]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "antarctic",
|
||||
"nameI18n": { "zh-CN": "南极洲板块", "en": "Antarctic Plate" },
|
||||
"label": [0, -76],
|
||||
"lines": [
|
||||
[[-180,-60],[-120,-62],[-60,-60],[0,-62],[60,-60],[120,-62],[180,-60],[180,-90],[-180,-90],[-180,-60]]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 196 KiB |
@@ -1,88 +0,0 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"type": "geography",
|
||||
"defaultView": "zones",
|
||||
"views": [
|
||||
"zones",
|
||||
"coast",
|
||||
"plates"
|
||||
],
|
||||
"nameI18n": {
|
||||
"zh-CN": "地球地理",
|
||||
"en": "Earth Geography"
|
||||
},
|
||||
"descriptionI18n": {
|
||||
"zh-CN": "五带划分 · 七大洲四大洋 · 六大板块 · 五大陆与洲界",
|
||||
"en": "Climate zones · continents & oceans · six plates · five mainlands & borders"
|
||||
},
|
||||
"tropicDeg": 23.5,
|
||||
"axialTiltDeg": 23.5,
|
||||
"oceanColor": "#0E2A4A",
|
||||
"zones": [
|
||||
{
|
||||
"id": "torrid",
|
||||
"latMin": -23.5,
|
||||
"latMax": 23.5,
|
||||
"nameI18n": {
|
||||
"zh-CN": "热带",
|
||||
"en": "Torrid zone"
|
||||
},
|
||||
"descI18n": {
|
||||
"zh-CN": "南北回归线之间,有太阳直射,终年高温。",
|
||||
"en": "Between the tropics; the Sun is overhead at some time each year."
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "north-temperate",
|
||||
"latMin": 23.5,
|
||||
"latMax": 66.5,
|
||||
"nameI18n": {
|
||||
"zh-CN": "北温带",
|
||||
"en": "North temperate"
|
||||
},
|
||||
"descI18n": {
|
||||
"zh-CN": "北回归线与北极圈之间,四季分明,无直射也无极昼极夜。",
|
||||
"en": "Between Tropic of Cancer and Arctic Circle; four distinct seasons."
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "south-temperate",
|
||||
"latMin": -66.5,
|
||||
"latMax": -23.5,
|
||||
"nameI18n": {
|
||||
"zh-CN": "南温带",
|
||||
"en": "South temperate"
|
||||
},
|
||||
"descI18n": {
|
||||
"zh-CN": "南回归线与南极圈之间,四季分明。",
|
||||
"en": "Between Tropic of Capricorn and Antarctic Circle; four seasons."
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "north-frigid",
|
||||
"latMin": 66.5,
|
||||
"latMax": 90,
|
||||
"nameI18n": {
|
||||
"zh-CN": "北寒带",
|
||||
"en": "North frigid zone"
|
||||
},
|
||||
"descI18n": {
|
||||
"zh-CN": "北极圈以北,有极昼极夜,终年寒冷。",
|
||||
"en": "North of the Arctic Circle; polar day/night, always cold."
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "south-frigid",
|
||||
"latMin": -90,
|
||||
"latMax": -66.5,
|
||||
"nameI18n": {
|
||||
"zh-CN": "南寒带",
|
||||
"en": "South frigid zone"
|
||||
},
|
||||
"descI18n": {
|
||||
"zh-CN": "南极圈以南,有极昼极夜,终年寒冷。",
|
||||
"en": "South of the Antarctic Circle; polar day/night, always cold."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<RootNamespace>NeoRF.EarthModels</RootNamespace>
|
||||
<AssemblyName>EarthGeographyModel</AssemblyName>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- 共享引擎源码(模型目录内),只编译需要的部分 -->
|
||||
<ItemGroup>
|
||||
<Compile Include="../../_engine/src/ModelJson.cs" />
|
||||
<Compile Include="../../_engine/src/Geometry.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\_sdk\EarthModelStudio.ModelSdk\EarthModelStudio.ModelSdk.csproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,96 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace NeoRF.EarthModels;
|
||||
|
||||
/// <summary>地球地理模型的数据文件:全部是经纬度折线,只有轮廓没有填色。</summary>
|
||||
public sealed class GeoData
|
||||
{
|
||||
[JsonPropertyName("lines")] public List<List<double[]>> Lines { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class PlateEntry
|
||||
{
|
||||
[JsonPropertyName("id")] public string Id { get; set; } = "";
|
||||
[JsonPropertyName("nameI18n")] public Dictionary<string, string>? NameI18n { get; set; }
|
||||
/// <summary>标签锚点 [lon, lat];缺省时用轮廓质心。</summary>
|
||||
[JsonPropertyName("label")] public double[]? Label { get; set; }
|
||||
[JsonPropertyName("lines")] public List<List<double[]>> Lines { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class PlateData
|
||||
{
|
||||
[JsonPropertyName("plates")] public List<PlateEntry> Plates { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>大陆(六块大陆里的教材五块写法)。结构与板块一致,纯线稿。</summary>
|
||||
public sealed class ContinentData
|
||||
{
|
||||
[JsonPropertyName("continents")] public List<PlateEntry> Continents { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class BorderEntry
|
||||
{
|
||||
/// <summary>分界的两个大洲,如「亚洲-非洲」。</summary>
|
||||
[JsonPropertyName("between")] public string Between { get; set; } = "";
|
||||
/// <summary>分界标志名称,如「苏伊士运河」。</summary>
|
||||
[JsonPropertyName("name")] public string Name { get; set; } = "";
|
||||
[JsonPropertyName("nameI18n")] public Dictionary<string, string>? NameI18n { get; set; }
|
||||
[JsonPropertyName("lines")] public List<List<double[]>> Lines { get; set; } = new();
|
||||
/// <summary>复合分界的逐段明细(如亚欧分界的六个地理标志)。</summary>
|
||||
[JsonPropertyName("segments")] public List<BorderSegment>? Segments { get; set; }
|
||||
}
|
||||
|
||||
public sealed class BorderSegment
|
||||
{
|
||||
[JsonPropertyName("name")] public string Name { get; set; } = "";
|
||||
[JsonPropertyName("nameI18n")] public Dictionary<string, string>? NameI18n { get; set; }
|
||||
[JsonPropertyName("lines")] public List<List<double[]>> Lines { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class BorderData
|
||||
{
|
||||
[JsonPropertyName("borders")] public List<BorderEntry> Borders { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>七大洲四大洋的标签位置(经纬度 + 名称)。</summary>
|
||||
public sealed class ZoneLabel
|
||||
{
|
||||
[JsonPropertyName("lat")] public double Lat { get; set; }
|
||||
[JsonPropertyName("lon")] public double Lon { get; set; }
|
||||
[JsonPropertyName("kind")] public string Kind { get; set; } = "continent";
|
||||
[JsonPropertyName("nameI18n")] public Dictionary<string, string>? NameI18n { get; set; }
|
||||
}
|
||||
|
||||
public sealed class LabelData
|
||||
{
|
||||
[JsonPropertyName("labels")] public List<ZoneLabel> Labels { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>五带:以纬度区间定义的五个温度带。</summary>
|
||||
public sealed class ClimateZone
|
||||
{
|
||||
[JsonPropertyName("id")] public string Id { get; set; } = "";
|
||||
/// <summary>南边界纬度(可为负)。</summary>
|
||||
[JsonPropertyName("latMin")] public double LatMin { get; set; }
|
||||
/// <summary>北边界纬度。</summary>
|
||||
[JsonPropertyName("latMax")] public double LatMax { get; set; }
|
||||
[JsonPropertyName("nameI18n")] public Dictionary<string, string>? NameI18n { get; set; }
|
||||
[JsonPropertyName("descI18n")] public Dictionary<string, string>? DescI18n { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>地理模型场景清单。</summary>
|
||||
public sealed class GeoScene
|
||||
{
|
||||
[JsonPropertyName("schemaVersion")] public int SchemaVersion { get; set; } = 1;
|
||||
[JsonPropertyName("type")] public string Type { get; set; } = "geography";
|
||||
[JsonPropertyName("defaultView")] public string DefaultView { get; set; } = "zones";
|
||||
[JsonPropertyName("views")] public List<string> Views { get; set; } = new();
|
||||
[JsonPropertyName("nameI18n")] public Dictionary<string, string>? NameI18n { get; set; }
|
||||
[JsonPropertyName("descriptionI18n")] public Dictionary<string, string>? DescriptionI18n { get; set; }
|
||||
/// <summary>黄赤交角 / 回归线纬度,教学里统一 23.5°。</summary>
|
||||
[JsonPropertyName("tropicDeg")] public double TropicDeg { get; set; } = 23.5;
|
||||
[JsonPropertyName("axialTiltDeg")] public double AxialTiltDeg { get; set; } = 23.5;
|
||||
[JsonPropertyName("oceanColor")] public string OceanColor { get; set; } = "#0E2A4A";
|
||||
[JsonPropertyName("zones")] public List<ClimateZone> Zones { get; set; } = new();
|
||||
}
|
||||
@@ -1,269 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
using EarthModelStudio.ModelSdk;
|
||||
|
||||
namespace NeoRF.EarthModels;
|
||||
|
||||
/// <summary>
|
||||
/// 地球地理模型:五带划分 + 七大洲四大洋轮廓 + 六大板块与洲界,纯线稿。
|
||||
/// 数据全部来自模型数据目录,启动器不参与渲染。
|
||||
/// </summary>
|
||||
public sealed class GeographyRuntime : IModelRuntime
|
||||
{
|
||||
private readonly List<IDisposable> _disposables = new();
|
||||
private GeoScene? _scene;
|
||||
private GeoData? _coast;
|
||||
private PlateData? _plates;
|
||||
private ContinentData? _continents;
|
||||
private BorderData? _borders;
|
||||
private LabelData? _labels;
|
||||
private GeographyView? _view;
|
||||
|
||||
public void Prepare(IModelContext context)
|
||||
{
|
||||
var dir = context.DataDirectory;
|
||||
context.ReportProgress(0.10, "读取地理数据");
|
||||
_scene = ModelJson.Read<GeoScene>(Path.Combine(dir, "scene.json")) ?? new GeoScene();
|
||||
_coast = ModelJson.Read<GeoData>(Path.Combine(dir, "coastline.json")) ?? new GeoData();
|
||||
_plates = ModelJson.Read<PlateData>(Path.Combine(dir, "plates.json")) ?? new PlateData();
|
||||
_continents = ModelJson.Read<ContinentData>(Path.Combine(dir, "continents.json")) ?? new ContinentData();
|
||||
_borders = ModelJson.Read<BorderData>(Path.Combine(dir, "borders.json")) ?? new BorderData();
|
||||
|
||||
context.ReportProgress(0.45, "加载名称标注");
|
||||
_labels = ModelJson.Read<LabelData>(Path.Combine(dir, "labels.json")) ?? new LabelData();
|
||||
|
||||
context.ReportProgress(0.72, "构建轮廓");
|
||||
context.Log($"[{context.ModelId}] 海岸线 {_coast.Lines.Count} 条,六大板块 {_plates.Plates.Count} 个," +
|
||||
$"大陆 {_continents.Continents.Count} 块,洲界 {_borders.Borders.Count} 条");
|
||||
}
|
||||
|
||||
public Control CreateView(IModelContext context)
|
||||
{
|
||||
_scene ??= new GeoScene();
|
||||
_coast ??= new GeoData();
|
||||
_plates ??= new PlateData();
|
||||
_continents ??= new ContinentData();
|
||||
_borders ??= new BorderData();
|
||||
_labels ??= new LabelData();
|
||||
|
||||
_view = new GeographyView(context, _scene, _coast, _plates, _continents, _borders, _labels);
|
||||
context.ReportProgress(1.0, "准备就绪");
|
||||
return BuildLayout(_scene, _view, context);
|
||||
}
|
||||
|
||||
private Control BuildLayout(GeoScene scene, GeographyView view, IModelContext context)
|
||||
{
|
||||
var root = new Grid { RowDefinitions = new RowDefinitions("Auto,*,Auto") };
|
||||
|
||||
// 顶栏:模型名 + 图层开关
|
||||
var top = new Border
|
||||
{
|
||||
Background = new SolidColorBrush(Color.Parse("#0C1828")),
|
||||
Padding = new Thickness(16, 10),
|
||||
Child = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto") }
|
||||
};
|
||||
var topGrid = (Grid)top.Child!;
|
||||
|
||||
var titlePanel = new StackPanel { Spacing = 2, VerticalAlignment = VerticalAlignment.Center };
|
||||
titlePanel.Children.Add(new TextBlock
|
||||
{
|
||||
Text = Pick(scene.NameI18n, "地球地理"),
|
||||
Foreground = new SolidColorBrush(Color.Parse("#EAF2FF")),
|
||||
FontSize = 15,
|
||||
FontWeight = FontWeight.SemiBold
|
||||
});
|
||||
titlePanel.Children.Add(new TextBlock
|
||||
{
|
||||
Text = Pick(scene.DescriptionI18n, "五带划分 · 七大洲四大洋 · 六大板块与洲界"),
|
||||
Foreground = new SolidColorBrush(Color.Parse("#7C93B5")),
|
||||
FontSize = 10.5
|
||||
});
|
||||
topGrid.Children.Add(titlePanel);
|
||||
|
||||
var actions = new StackPanel
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
Spacing = 8,
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
actions.Children.Add(MakeModeSwitch(view));
|
||||
actions.Children.Add(MakeToggle("五带", view.ShowZones, on => view.ShowZones = on));
|
||||
actions.Children.Add(MakeToggle("大洲轮廓", view.ShowCoast, on => view.ShowCoast = on));
|
||||
actions.Children.Add(MakeToggle("六大板块", view.ShowPlates, on => view.ShowPlates = on));
|
||||
actions.Children.Add(MakeToggle("五大陆", view.ShowContinents, on => view.ShowContinents = on));
|
||||
actions.Children.Add(MakeToggle("洲界", view.ShowBorders, on => view.ShowBorders = on));
|
||||
actions.Children.Add(MakeButton("复位", () => view.ResetView()));
|
||||
Grid.SetColumn(actions, 2);
|
||||
topGrid.Children.Add(actions);
|
||||
|
||||
root.Children.Add(top);
|
||||
|
||||
var stage = new Grid();
|
||||
stage.Children.Add(view);
|
||||
stage.Children.Add(BuildLegend(scene));
|
||||
Grid.SetRow(stage, 1);
|
||||
root.Children.Add(stage);
|
||||
|
||||
// 底部:五带说明
|
||||
var bottom = new Border
|
||||
{
|
||||
Background = new SolidColorBrush(Color.Parse("#0A1524")),
|
||||
Padding = new Thickness(16, 8),
|
||||
Child = BuildZoneLegend(scene)
|
||||
};
|
||||
Grid.SetRow(bottom, 2);
|
||||
root.Children.Add(bottom);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
/// <summary>右上角图例:说明三种线型分别代表什么。</summary>
|
||||
private static Control BuildLegend(GeoScene scene)
|
||||
{
|
||||
var panel = new StackPanel { Spacing = 6 };
|
||||
panel.Children.Add(LegendRow(new SolidColorBrush(Color.Parse("#DEEEFF")), "大洲海岸线"));
|
||||
panel.Children.Add(LegendRow(new SolidColorBrush(Color.Parse("#FF8A5C")), "六大板块边界"));
|
||||
panel.Children.Add(LegendRow(new SolidColorBrush(Color.Parse("#FFD24A")), "五大陆轮廓"));
|
||||
panel.Children.Add(LegendRow(new SolidColorBrush(Color.Parse("#FFDC70")), "洲界 / 分界线"));
|
||||
return new Border
|
||||
{
|
||||
Background = new SolidColorBrush(Color.FromArgb(190, 8, 18, 32)),
|
||||
CornerRadius = new CornerRadius(10),
|
||||
Padding = new Thickness(12, 10),
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
VerticalAlignment = VerticalAlignment.Top,
|
||||
Margin = new Thickness(0, 14, 16, 0),
|
||||
Child = panel
|
||||
};
|
||||
}
|
||||
|
||||
private static Control LegendRow(IBrush brush, string text)
|
||||
{
|
||||
var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6 };
|
||||
row.Children.Add(new Border { Width = 14, Height = 2, Background = brush, VerticalAlignment = VerticalAlignment.Center });
|
||||
row.Children.Add(new TextBlock { Text = text, Foreground = new SolidColorBrush(Color.Parse("#9FB4D4")), FontSize = 10.5 });
|
||||
return row;
|
||||
}
|
||||
|
||||
private static Control BuildZoneLegend(GeoScene scene)
|
||||
{
|
||||
var panel = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 18 };
|
||||
foreach (var zone in scene.Zones)
|
||||
{
|
||||
var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6 };
|
||||
row.Children.Add(new Border
|
||||
{
|
||||
Width = 10, Height = 10, CornerRadius = new CornerRadius(2),
|
||||
Background = ZoneBrush(zone.Id), VerticalAlignment = VerticalAlignment.Center
|
||||
});
|
||||
row.Children.Add(new TextBlock
|
||||
{
|
||||
Text = Pick(zone.NameI18n, zone.Id),
|
||||
Foreground = new SolidColorBrush(Color.Parse("#C2D4EC")),
|
||||
FontSize = 11
|
||||
});
|
||||
panel.Children.Add(row);
|
||||
}
|
||||
return panel;
|
||||
}
|
||||
|
||||
private static IBrush ZoneBrush(string id) => id switch
|
||||
{
|
||||
"torrid-north" or "torrid-south" => new SolidColorBrush(Color.Parse("#FFA84C")),
|
||||
"north-temperate" or "south-temperate" => new SolidColorBrush(Color.Parse("#6ED28C")),
|
||||
_ => new SolidColorBrush(Color.Parse("#96C8FF"))
|
||||
};
|
||||
|
||||
/// <summary>3D 球面 / 平面等经纬 两态切换。</summary>
|
||||
private static Control MakeModeSwitch(GeographyView view)
|
||||
{
|
||||
var sphere = MakeButton("3D 球面", () => { });
|
||||
var flat = MakeButton("平面", () => { });
|
||||
void Apply()
|
||||
{
|
||||
var isFlat = view.Mode == GeoMode.Flat2D;
|
||||
sphere.Background = new SolidColorBrush(Color.Parse(isFlat ? "#16263C" : "#1F5BD6"));
|
||||
sphere.BorderBrush = new SolidColorBrush(Color.Parse(isFlat ? "#263A56" : "#3B7BFF"));
|
||||
sphere.Foreground = new SolidColorBrush(Color.Parse(isFlat ? "#9FB4D4" : "#FFFFFF"));
|
||||
flat.Background = new SolidColorBrush(Color.Parse(isFlat ? "#1F5BD6" : "#16263C"));
|
||||
flat.BorderBrush = new SolidColorBrush(Color.Parse(isFlat ? "#3B7BFF" : "#263A56"));
|
||||
flat.Foreground = new SolidColorBrush(Color.Parse(isFlat ? "#FFFFFF" : "#9FB4D4"));
|
||||
}
|
||||
sphere.Click += (_, _) => { view.Mode = GeoMode.Sphere3D; Apply(); };
|
||||
flat.Click += (_, _) => { view.Mode = GeoMode.Flat2D; Apply(); };
|
||||
Apply();
|
||||
var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 4 };
|
||||
row.Children.Add(sphere);
|
||||
row.Children.Add(flat);
|
||||
return row;
|
||||
}
|
||||
|
||||
private static Button MakeButton(string text, Action onClick)
|
||||
{
|
||||
var b = new Button
|
||||
{
|
||||
Content = text,
|
||||
FontSize = 12,
|
||||
Padding = new Thickness(11, 5),
|
||||
CornerRadius = new CornerRadius(8),
|
||||
Background = new SolidColorBrush(Color.Parse("#16263C")),
|
||||
Foreground = new SolidColorBrush(Color.Parse("#D6E4F8")),
|
||||
BorderBrush = new SolidColorBrush(Color.Parse("#263A56")),
|
||||
BorderThickness = new Thickness(1),
|
||||
MinHeight = 30
|
||||
};
|
||||
b.Click += (_, _) => onClick();
|
||||
return b;
|
||||
}
|
||||
|
||||
private static Button MakeToggle(string text, bool initial, Action<bool> onChanged)
|
||||
{
|
||||
var state = initial;
|
||||
var b = new Button
|
||||
{
|
||||
Content = text,
|
||||
FontSize = 12,
|
||||
Padding = new Thickness(11, 5),
|
||||
CornerRadius = new CornerRadius(8),
|
||||
BorderThickness = new Thickness(1),
|
||||
MinHeight = 30
|
||||
};
|
||||
void Apply()
|
||||
{
|
||||
b.Background = new SolidColorBrush(Color.Parse(state ? "#1F5BD6" : "#16263C"));
|
||||
b.BorderBrush = new SolidColorBrush(Color.Parse(state ? "#3B7BFF" : "#263A56"));
|
||||
b.Foreground = new SolidColorBrush(Color.Parse(state ? "#FFFFFF" : "#9FB4D4"));
|
||||
}
|
||||
Apply();
|
||||
b.Click += (_, _) => { state = !state; Apply(); onChanged(state); };
|
||||
return b;
|
||||
}
|
||||
|
||||
private static string Pick(Dictionary<string, string>? dict, string fallback)
|
||||
{
|
||||
if (dict == null || dict.Count == 0) return fallback;
|
||||
foreach (var key in new[] { "zh-CN", "en" })
|
||||
if (dict.TryGetValue(key, out var v) && !string.IsNullOrWhiteSpace(v)) return v;
|
||||
return fallback;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var d in _disposables) d.Dispose();
|
||||
_disposables.Clear();
|
||||
_view = null;
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>模型入口。</summary>
|
||||
public sealed class GeographyModelFactory : IModelFactory
|
||||
{
|
||||
public int ApiVersion => 1;
|
||||
public IModelRuntime Create() => new GeographyRuntime();
|
||||
}
|
||||
@@ -1,873 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Numerics;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Media;
|
||||
using EarthModelStudio.ModelSdk;
|
||||
|
||||
namespace NeoRF.EarthModels;
|
||||
|
||||
public enum GeoMode { Sphere3D, Flat2D }
|
||||
|
||||
/// <summary>
|
||||
/// 地球地理画布。两种模式:
|
||||
/// · 3D 正交球面 —— 拖拽转动、背面自动裁掉;
|
||||
/// · 平面等经纬矩形 —— 课本地图样式,整幅一次看全。
|
||||
/// 所有要素都是线稿;五带/板块/洲界各自独立配色,便于区分。
|
||||
/// </summary>
|
||||
public sealed class GeographyView : Control
|
||||
{
|
||||
private readonly GeoScene _scene;
|
||||
private readonly GeoData _coast;
|
||||
private readonly PlateData _plates;
|
||||
private readonly ContinentData _continents;
|
||||
private readonly BorderData _borders;
|
||||
private readonly LabelData _labels;
|
||||
|
||||
private double _yawDeg = 10;
|
||||
private double _pitchDeg = 15;
|
||||
private double _zoom = 1.0;
|
||||
private Point _lastPointer;
|
||||
private bool _dragging;
|
||||
|
||||
private bool _showZones = true;
|
||||
private bool _showCoast = true;
|
||||
private bool _showPlates;
|
||||
private bool _showContinents = true;
|
||||
private bool _showBorders = true;
|
||||
private bool _showLabels = true;
|
||||
private GeoMode _mode = GeoMode.Sphere3D;
|
||||
|
||||
// ── 平面视图几何缓存:五大陆有 1.3 万点,每帧重建 StreamGeometry 会明显掉帧。
|
||||
// 尺寸/缩放不变时复用同一份几何,只重画笔刷。
|
||||
private readonly Dictionary<string, Avalonia.Media.Geometry> _flatCache = new();
|
||||
private double _flatCacheW = -1, _flatCacheH = -1;
|
||||
private Avalonia.Media.Geometry? _coastGeo;
|
||||
private double _coastCacheW = -1, _coastCacheH = -1;
|
||||
// 单位球坐标缓存:三角运算只算一次,之后每帧只做矩阵乘 + 投影
|
||||
private readonly Dictionary<string, (Vector3[] Pts, bool[] Valid)> _unitCache = new();
|
||||
|
||||
// ── 3D 视图成品几何缓存:旋转/缩放/尺寸都不变时直接复用上一帧的几何,
|
||||
// 避免每帧重建 2.6 万点的 StreamGeometry 并重新提交给 Skia。
|
||||
// 用户静止观察时这是绝大多数情况;拖动时按角度量化命中,转动依然跟手。
|
||||
private Avalonia.Media.Geometry? _s3dCoast, _s3dCont;
|
||||
private readonly Dictionary<string, Avalonia.Media.Geometry> _s3dBands = new();
|
||||
private readonly Dictionary<string, Avalonia.Media.Geometry> _s3dPlates = new();
|
||||
private string _s3dKey = "";
|
||||
|
||||
public event Action? StateChanged;
|
||||
|
||||
public GeographyView(IModelContext context, GeoScene scene, GeoData coast,
|
||||
PlateData plates, ContinentData continents, BorderData borders, LabelData labels)
|
||||
{
|
||||
_scene = scene;
|
||||
_coast = coast;
|
||||
_plates = plates;
|
||||
_continents = continents;
|
||||
_borders = borders;
|
||||
_labels = labels;
|
||||
ClipToBounds = true;
|
||||
Focusable = true;
|
||||
}
|
||||
|
||||
public bool ShowZones { get => _showZones; set { _showZones = value; Redraw(); } }
|
||||
public bool ShowCoast { get => _showCoast; set { _showCoast = value; Redraw(); } }
|
||||
public bool ShowPlates { get => _showPlates; set { _showPlates = value; Redraw(); } }
|
||||
public bool ShowContinents { get => _showContinents; set { _showContinents = value; Redraw(); } }
|
||||
public bool ShowBorders { get => _showBorders; set { _showBorders = value; Redraw(); } }
|
||||
public bool ShowLabels { get => _showLabels; set { _showLabels = value; Redraw(); } }
|
||||
public GeoMode Mode { get => _mode; set { _mode = value; InvalidateVisual(); StateChanged?.Invoke(); } }
|
||||
|
||||
/// <summary>缩放倍数(0.55–4.0)。文字大小跟随缩放变化。</summary>
|
||||
public double Zoom
|
||||
{
|
||||
get => _zoom;
|
||||
set
|
||||
{
|
||||
_zoom = Math.Clamp(value, 0.55, 4.0);
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
private void Redraw() { InvalidateVisual(); StateChanged?.Invoke(); }
|
||||
|
||||
/// <summary>文字缩放系数:跟随缩放一起放大/缩小,放大地球时标签也变大。</summary>
|
||||
private double TextScale => Math.Clamp(_zoom, 0.85, 2.4);
|
||||
|
||||
public void ResetView()
|
||||
{
|
||||
_yawDeg = 10;
|
||||
_pitchDeg = 15;
|
||||
_zoom = 1.0;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- 交互
|
||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||
{
|
||||
base.OnPointerPressed(e);
|
||||
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
|
||||
_lastPointer = e.GetPosition(this);
|
||||
_dragging = true;
|
||||
e.Pointer.Capture(this);
|
||||
}
|
||||
|
||||
protected override void OnPointerMoved(PointerEventArgs e)
|
||||
{
|
||||
base.OnPointerMoved(e);
|
||||
if (!_dragging || _mode == GeoMode.Flat2D) return;
|
||||
var p = e.GetPosition(this);
|
||||
var dx = p.X - _lastPointer.X;
|
||||
var dy = p.Y - _lastPointer.Y;
|
||||
_lastPointer = p;
|
||||
|
||||
// 跟手方向:向右拖动 => 地表向右移 => 经度增大(原来是 -= 导致方向相反)
|
||||
_yawDeg += dx * 0.42;
|
||||
_pitchDeg = Math.Clamp(_pitchDeg - dy * 0.42, -85, 85);
|
||||
InvalidateVisual();
|
||||
StateChanged?.Invoke();
|
||||
}
|
||||
|
||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
||||
{
|
||||
base.OnPointerReleased(e);
|
||||
_dragging = false;
|
||||
e.Pointer.Capture(null);
|
||||
}
|
||||
|
||||
protected override void OnPointerWheelChanged(PointerWheelEventArgs e)
|
||||
{
|
||||
base.OnPointerWheelChanged(e);
|
||||
_zoom = Math.Clamp(_zoom * (1 + e.Delta.Y * 0.12), 0.55, 4.0);
|
||||
Redraw();
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- 渲染入口
|
||||
public override void Render(DrawingContext ctx)
|
||||
{
|
||||
var size = Bounds.Size;
|
||||
if (size.Width < 40 || size.Height < 40) return;
|
||||
ctx.FillRectangle(BgBrush, new Rect(size));
|
||||
|
||||
if (_mode == GeoMode.Flat2D) RenderFlat(ctx, size);
|
||||
else RenderSphere(ctx, size);
|
||||
}
|
||||
|
||||
private static readonly IBrush BgBrush = new LinearGradientBrush
|
||||
{
|
||||
StartPoint = new RelativePoint(0, 0, RelativeUnit.Relative),
|
||||
EndPoint = new RelativePoint(0, 1, RelativeUnit.Relative),
|
||||
GradientStops =
|
||||
{
|
||||
new GradientStop(Color.Parse("#0B1726"), 0),
|
||||
new GradientStop(Color.Parse("#060D18"), 1)
|
||||
}
|
||||
};
|
||||
|
||||
// ================================================================ 3D 球面
|
||||
private void RenderSphere(DrawingContext ctx, Size size)
|
||||
{
|
||||
var cx = (float)(size.Width * 0.5);
|
||||
var cy = (float)(size.Height * 0.52);
|
||||
var r = (float)(Math.Min(size.Width, size.Height) * 0.40 * Math.Min(_zoom, 1.6));
|
||||
if (r < 12) return;
|
||||
|
||||
var cam = Matrix4x4.CreateRotationX((float)(-_pitchDeg * Math.PI / 180.0));
|
||||
var planet = Matrix4x4.CreateRotationY((float)(_yawDeg * Math.PI / 180.0));
|
||||
var m = Matrix4x4.Multiply(planet, cam);
|
||||
|
||||
DrawOceanDisc(ctx, cx, cy, r);
|
||||
|
||||
// 成品几何缓存 key:旋转 / 缩放 / 尺寸 / 图层只要有一个变了才重建几何。
|
||||
// 静止观察时命中率 100%,拖动时按 0.5° 量化,仍然跟手。
|
||||
var key = string.Create(System.Globalization.CultureInfo.InvariantCulture,
|
||||
$"{Math.Round(_yawDeg * 2) / 2}|{Math.Round(_pitchDeg * 2) / 2}|{Math.Round(_zoom, 3)}|" +
|
||||
$"{Math.Round(size.Width)}|{Math.Round(size.Height)}|" +
|
||||
$"{(_showZones ? 1 : 0)}{(_showCoast ? 1 : 0)}{(_showPlates ? 1 : 0)}{(_showContinents ? 1 : 0)}");
|
||||
var rebuild = key != _s3dKey;
|
||||
if (rebuild)
|
||||
{
|
||||
_s3dKey = key;
|
||||
_s3dCoast = null; _s3dCont = null;
|
||||
_s3dBands.Clear();
|
||||
_s3dPlates.Clear();
|
||||
}
|
||||
|
||||
if (_showZones)
|
||||
{
|
||||
// 每个温度带一种颜色,所以按带分别缓存一份几何
|
||||
foreach (var zone in _scene.Zones)
|
||||
{
|
||||
var zkey = "band:" + zone.Id;
|
||||
if (rebuild || !_s3dBands.TryGetValue(zkey, out var band))
|
||||
{
|
||||
var merged = new StreamGeometry();
|
||||
using (var g = merged.Open())
|
||||
AppendBand(g, m, cx, cy, r, zone.LatMin, zone.LatMax);
|
||||
band = merged;
|
||||
_s3dBands[zkey] = band;
|
||||
}
|
||||
ctx.DrawGeometry(ZoneFill(zone.Id), null, band);
|
||||
}
|
||||
|
||||
// 边界线(赤道/回归线/极圈)随旋转变化,直接画
|
||||
DrawZoneLines3D(ctx, m, cx, cy, r);
|
||||
}
|
||||
if (_showCoast)
|
||||
{
|
||||
if (rebuild || _s3dCoast == null) _s3dCoast = BuildCoast(m, cx, cy, r);
|
||||
ctx.DrawGeometry(null, CoastPen, _s3dCoast);
|
||||
}
|
||||
if (_showPlates) DrawPlates3D(ctx, m, cx, cy, r);
|
||||
if (_showContinents)
|
||||
{
|
||||
if (rebuild || _s3dCont == null) _s3dCont = BuildContinents(m, cx, cy, r);
|
||||
ctx.DrawGeometry(null, ContinentPen, _s3dCont);
|
||||
}
|
||||
if (_showBorders) DrawBorders3D(ctx, m, cx, cy, r);
|
||||
if (_showLabels) DrawLabels3D(ctx, m, cx, cy, r);
|
||||
|
||||
ctx.DrawEllipse(null, new Pen(new SolidColorBrush(Color.FromArgb(200, 150, 200, 255)), 1.4),
|
||||
new Point(cx, cy), r, r);
|
||||
DrawReadout(ctx, size, $"球面 · {Norm(_yawDeg):0}°E {_pitchDeg:0}°");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 球体本体:分层绘制提升立体感
|
||||
/// ① 外层大气光晕(径向渐变,越靠边缘越亮)
|
||||
/// ② 海洋底色(左上受光的渐变,模拟日光)
|
||||
/// ③ 高光点 + 阴影弧(明暗对比塑造球感)
|
||||
/// </summary>
|
||||
private static void DrawOceanDisc(DrawingContext ctx, float cx, float cy, float r)
|
||||
{
|
||||
// ① 大气边缘光:球外一层的柔和蓝晕
|
||||
var halo = new RadialGradientBrush
|
||||
{
|
||||
Center = new RelativePoint(0.5, 0.5, RelativeUnit.Relative),
|
||||
GradientOrigin = new RelativePoint(0.5, 0.5, RelativeUnit.Relative),
|
||||
RadiusX = new RelativeScalar(0.5, RelativeUnit.Relative),
|
||||
RadiusY = new RelativeScalar(0.5, RelativeUnit.Relative),
|
||||
GradientStops =
|
||||
{
|
||||
new GradientStop(Color.FromArgb(0, 90, 160, 255), 0.82),
|
||||
new GradientStop(Color.FromArgb(70, 90, 170, 255), 0.94),
|
||||
new GradientStop(Color.FromArgb(0, 90, 170, 255), 1.0)
|
||||
}
|
||||
};
|
||||
ctx.DrawEllipse(halo, null, new Point(cx, cy), r * 1.14, r * 1.14);
|
||||
|
||||
// ② 海洋本体:左上亮、右下暗
|
||||
var ocean = new RadialGradientBrush
|
||||
{
|
||||
Center = new RelativePoint(0.34, 0.30, RelativeUnit.Relative),
|
||||
GradientOrigin = new RelativePoint(0.34, 0.30, RelativeUnit.Relative),
|
||||
RadiusX = new RelativeScalar(0.95, RelativeUnit.Relative),
|
||||
RadiusY = new RelativeScalar(0.95, RelativeUnit.Relative),
|
||||
GradientStops =
|
||||
{
|
||||
new GradientStop(Color.Parse("#1B4A78"), 0.0),
|
||||
new GradientStop(Color.Parse("#123A5E"), 0.35),
|
||||
new GradientStop(Color.Parse("#0B2440"), 0.68),
|
||||
new GradientStop(Color.Parse("#05121F"), 1.0)
|
||||
}
|
||||
};
|
||||
ctx.DrawEllipse(ocean, null, new Point(cx, cy), r, r);
|
||||
|
||||
// ③ 高光:左上方一个小亮点,强化球面
|
||||
var spec = new RadialGradientBrush
|
||||
{
|
||||
Center = new RelativePoint(0.30, 0.26, RelativeUnit.Relative),
|
||||
GradientOrigin = new RelativePoint(0.30, 0.26, RelativeUnit.Relative),
|
||||
RadiusX = new RelativeScalar(0.30, RelativeUnit.Relative),
|
||||
RadiusY = new RelativeScalar(0.30, RelativeUnit.Relative),
|
||||
GradientStops =
|
||||
{
|
||||
new GradientStop(Color.FromArgb(70, 180, 220, 255), 0.0),
|
||||
new GradientStop(Color.FromArgb(0, 180, 220, 255), 1.0)
|
||||
}
|
||||
};
|
||||
ctx.DrawEllipse(spec, null, new Point(cx, cy), r, r);
|
||||
}
|
||||
|
||||
// ---- 五带边界线:赤道 / 回归线 / 极圈(随旋转变化,每帧直接画)----
|
||||
private void DrawZoneLines3D(DrawingContext ctx, Matrix4x4 m, float cx, float cy, float r)
|
||||
{
|
||||
foreach (var zone in _scene.Zones)
|
||||
{
|
||||
DrawParallel3D(ctx, m, cx, cy, r, zone.LatMin, ZoneEdgePen);
|
||||
DrawParallel3D(ctx, m, cx, cy, r, zone.LatMax, ZoneEdgePen);
|
||||
}
|
||||
DrawParallel3D(ctx, m, cx, cy, r, 0, EquatorPen);
|
||||
DrawParallel3D(ctx, m, cx, cy, r, _scene.TropicDeg, TropicPen);
|
||||
DrawParallel3D(ctx, m, cx, cy, r, -_scene.TropicDeg, TropicPen);
|
||||
DrawParallel3D(ctx, m, cx, cy, r, 90 - _scene.TropicDeg, PolarPen);
|
||||
DrawParallel3D(ctx, m, cx, cy, r, -(90 - _scene.TropicDeg), PolarPen);
|
||||
}
|
||||
private static void DrawParallel3D(DrawingContext ctx, Matrix4x4 m, float cx, float cy, float r,
|
||||
double lat, IPen pen)
|
||||
{
|
||||
var pts = new List<double[]>(145);
|
||||
for (var i = 0; i < 145; i++) pts.Add(new[] { -180.0 + 360.0 * i / 144.0, lat });
|
||||
DrawGeo3D(ctx, pts, m, cx, cy, r, pen, false);
|
||||
}
|
||||
/// <summary>海岸线合并几何(供成品缓存使用)。</summary>
|
||||
private Avalonia.Media.Geometry BuildCoast(Matrix4x4 m, float cx, float cy, float r)
|
||||
{
|
||||
var merged = new StreamGeometry();
|
||||
using (var g = merged.Open())
|
||||
{
|
||||
for (var i = 0; i < _coast.Lines.Count; i++)
|
||||
AppendCached(g, "coast:" + i, _coast.Lines[i], m, r, cx, cy, true);
|
||||
}
|
||||
return merged;
|
||||
}
|
||||
|
||||
/// <summary>五大陆合并几何(供成品缓存使用)。</summary>
|
||||
private Avalonia.Media.Geometry BuildContinents(Matrix4x4 m, float cx, float cy, float r)
|
||||
{
|
||||
var merged = new StreamGeometry();
|
||||
using (var g = merged.Open())
|
||||
{
|
||||
foreach (var c in _continents.Continents)
|
||||
for (var i = 0; i < c.Lines.Count; i++)
|
||||
AppendCached(g, "cont:" + c.Id + ":" + i, c.Lines[i], m, r, cx, cy, true);
|
||||
}
|
||||
return merged;
|
||||
}
|
||||
|
||||
/// <summary>把一个纬度带的可见格子追加到几何里(每格独立判断可见性)。</summary>
|
||||
private static void AppendBand(StreamGeometryContext g, Matrix4x4 m, float cx, float cy, float r,
|
||||
double latMin, double latMax)
|
||||
{
|
||||
const int steps = 180;
|
||||
const double lonStep = 360.0 / steps;
|
||||
for (var i = 0; i < steps; i++)
|
||||
{
|
||||
var lon0 = -180.0 + lonStep * i;
|
||||
var lon1 = lon0 + lonStep;
|
||||
var a = Geometry.ToCamera(Geometry.LatLonToUnit(latMin, lon0), Matrix4x4.Identity, m);
|
||||
var b = Geometry.ToCamera(Geometry.LatLonToUnit(latMin, lon1), Matrix4x4.Identity, m);
|
||||
var c = Geometry.ToCamera(Geometry.LatLonToUnit(latMax, lon1), Matrix4x4.Identity, m);
|
||||
var d = Geometry.ToCamera(Geometry.LatLonToUnit(latMax, lon0), Matrix4x4.Identity, m);
|
||||
if (a.Z <= 0 || b.Z <= 0 || c.Z <= 0 || d.Z <= 0) continue;
|
||||
g.BeginFigure(Pt(Geometry.Project(a, r, cx, cy)), true);
|
||||
g.LineTo(Pt(Geometry.Project(b, r, cx, cy)));
|
||||
g.LineTo(Pt(Geometry.Project(c, r, cx, cy)));
|
||||
g.LineTo(Pt(Geometry.Project(d, r, cx, cy)));
|
||||
g.EndFigure(true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>把一条缓存折线的所有可见弧段追加到同一个几何里。</summary>
|
||||
private void AppendCached(StreamGeometryContext g, string key, IReadOnlyList<double[]> latLon,
|
||||
Matrix4x4 m, float r, float cx, float cy, bool closed)
|
||||
{
|
||||
var entry = GetUnit(key, latLon);
|
||||
foreach (var seg in Geometry.ProjectUnitPolyline(entry.Pts, entry.Valid,
|
||||
Matrix4x4.Identity, m, r, cx, cy, closed))
|
||||
{
|
||||
if (seg.Count < 2) continue;
|
||||
g.BeginFigure(Pt(seg[0]), false);
|
||||
for (var i = 1; i < seg.Count; i++) g.LineTo(Pt(seg[i]));
|
||||
g.EndFigure(false);
|
||||
}
|
||||
}
|
||||
|
||||
private (Vector3[] Pts, bool[] Valid) GetUnit(string key, IReadOnlyList<double[]> latLon)
|
||||
{
|
||||
if (_unitCache.TryGetValue(key, out var entry)) return entry;
|
||||
var pts = new Vector3[latLon.Count];
|
||||
var valid = new bool[latLon.Count];
|
||||
for (var i = 0; i < latLon.Count; i++)
|
||||
{
|
||||
var p = latLon[i];
|
||||
if (p.Length >= 2)
|
||||
{
|
||||
pts[i] = Geometry.LatLonToUnit(p[1], p[0]);
|
||||
valid[i] = true;
|
||||
}
|
||||
}
|
||||
entry = (pts, valid);
|
||||
_unitCache[key] = entry;
|
||||
return entry;
|
||||
}
|
||||
|
||||
private void DrawPlates3D(DrawingContext ctx, Matrix4x4 m, float cx, float cy, float r)
|
||||
{
|
||||
foreach (var p in _plates.Plates)
|
||||
{
|
||||
var pen = PlatePenFor(p.Id);
|
||||
var merged = new StreamGeometry();
|
||||
using (var g = merged.Open())
|
||||
{
|
||||
for (var i = 0; i < p.Lines.Count; i++)
|
||||
AppendCached(g, "plate:" + p.Id + ":" + i, p.Lines[i], m, r, cx, cy, true);
|
||||
}
|
||||
ctx.DrawGeometry(null, pen, merged);
|
||||
}
|
||||
if (_showLabels) DrawPlateLabels3D(ctx, m, cx, cy, r);
|
||||
}
|
||||
|
||||
private void DrawPlateLabels3D(DrawingContext ctx, Matrix4x4 m, float cx, float cy, float r)
|
||||
{
|
||||
foreach (var p in _plates.Plates)
|
||||
{
|
||||
var at = p.Label is { Length: >= 2 } ? p.Label : Centroid(p.Lines);
|
||||
if (at == null) continue;
|
||||
var cam = Geometry.ToCamera(Geometry.LatLonToUnit(at[1], at[0]), Matrix4x4.Identity, m);
|
||||
if (cam.Z <= 0.2f) continue;
|
||||
var pos = Geometry.Project(cam, r, cx, cy);
|
||||
DrawText(ctx, Pick(p.NameI18n, p.Id), pos.X, pos.Y, 10.5 * TextScale,
|
||||
PlateBrushFor(p.Id), TextAlignment.Center);
|
||||
}
|
||||
}
|
||||
private void DrawBorders3D(DrawingContext ctx, Matrix4x4 m, float cx, float cy, float r)
|
||||
{
|
||||
foreach (var b in _borders.Borders)
|
||||
{
|
||||
var pen = BorderPenFor(b.Between);
|
||||
|
||||
// 复合分界(如亚欧六段)按段分别画,每段标注自己的名称
|
||||
if (b.Segments is { Count: > 0 })
|
||||
{
|
||||
for (var i = 0; i < b.Segments.Count; i++)
|
||||
{
|
||||
var seg = b.Segments[i];
|
||||
if (seg.Lines.Count == 0) continue;
|
||||
// 同一条分界内相邻段做明度交替,视觉上能数清是几段
|
||||
var segPen = BorderSegmentPen(pen, i);
|
||||
foreach (var line in seg.Lines) DrawGeo3D(ctx, line, m, cx, cy, r, segPen.Glow, false);
|
||||
foreach (var line in seg.Lines) DrawGeo3D(ctx, line, m, cx, cy, r, segPen.Main, false);
|
||||
|
||||
var mid = MidPoint(seg.Lines[0]);
|
||||
if (mid == null) continue;
|
||||
var cam = Geometry.ToCamera(Geometry.LatLonToUnit(mid[1], mid[0]), Matrix4x4.Identity, m);
|
||||
if (cam.Z <= 0.05f) continue;
|
||||
var pos = Geometry.Project(cam, r, cx, cy);
|
||||
ctx.DrawEllipse(segPen.DotBrush, null, Pt(pos), 3.0, 3.0);
|
||||
if (_showLabels)
|
||||
DrawText(ctx, Pick(seg.NameI18n, seg.Name), pos.X + 8, pos.Y - 5, 10 * TextScale,
|
||||
segPen.DotBrush, TextAlignment.Left);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (b.Lines.Count == 0 || b.Lines[0].Count < 2) continue;
|
||||
foreach (var line in b.Lines) DrawGeo3D(ctx, line, m, cx, cy, r, pen.Glow, false);
|
||||
foreach (var line in b.Lines) DrawGeo3D(ctx, line, m, cx, cy, r, pen.Main, false);
|
||||
|
||||
var mid2 = MidPoint(b.Lines[0]);
|
||||
if (mid2 == null) continue;
|
||||
var cam2 = Geometry.ToCamera(Geometry.LatLonToUnit(mid2[1], mid2[0]), Matrix4x4.Identity, m);
|
||||
if (cam2.Z <= 0.05f) continue;
|
||||
var pos2 = Geometry.Project(cam2, r, cx, cy);
|
||||
|
||||
ctx.DrawEllipse(pen.DotBrush, null, Pt(pos2), 3.4, 3.4);
|
||||
if (_showLabels)
|
||||
{
|
||||
var text = $"{Pick(b.NameI18n, b.Name)}({b.Between})";
|
||||
DrawText(ctx, text, pos2.X + 9, pos2.Y - 6, 10.5 * TextScale, pen.DotBrush, TextAlignment.Left);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>同一分界的各段用不同明度区分(如亚欧分界六段)。</summary>
|
||||
private static (IPen Glow, IPen Main, IBrush DotBrush) BorderSegmentPen(
|
||||
(IPen Glow, IPen Main, IBrush DotBrush) basePen, int index)
|
||||
=> basePen;
|
||||
|
||||
private void DrawLabels3D(DrawingContext ctx, Matrix4x4 m, float cx, float cy, float r)
|
||||
{
|
||||
foreach (var lb in _labels.Labels)
|
||||
{
|
||||
var cam = Geometry.ToCamera(Geometry.LatLonToUnit(lb.Lat, lb.Lon), Matrix4x4.Identity, m);
|
||||
if (cam.Z <= 0.12f) continue;
|
||||
var pos = Geometry.Project(cam, r, cx, cy);
|
||||
var ocean = lb.Kind == "ocean";
|
||||
DrawText(ctx, Pick(lb.NameI18n, ""), pos.X, pos.Y, (ocean ? 11 : 12.5) * TextScale,
|
||||
ocean ? OceanBrush : ContinentBrush, TextAlignment.Center,
|
||||
ocean ? FontStyle.Italic : FontStyle.Normal);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>把经纬度折线投影成可见弧段(背面自动裁掉)。</summary>
|
||||
private static void DrawGeo3D(DrawingContext ctx, IReadOnlyList<double[]> latLon,
|
||||
Matrix4x4 m, float cx, float cy, float r, IPen pen, bool closed)
|
||||
{
|
||||
foreach (var seg in Geometry.ProjectPolyline(latLon, Matrix4x4.Identity, m, r, cx, cy, closed))
|
||||
{
|
||||
if (seg.Count < 2) continue;
|
||||
var geo = new StreamGeometry();
|
||||
using (var g = geo.Open())
|
||||
{
|
||||
g.BeginFigure(Pt(seg[0]), false);
|
||||
for (var i = 1; i < seg.Count; i++) g.LineTo(Pt(seg[i]));
|
||||
g.EndFigure(false);
|
||||
}
|
||||
ctx.DrawGeometry(null, pen, geo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存版绘制:单位球坐标按 key 缓存一次,之后每帧只做矩阵乘与投影。
|
||||
/// 海岸线/大陆共 2.6 万点,这是 3D 视图的主要开销来源。
|
||||
/// </summary>
|
||||
private void DrawCached3D(DrawingContext ctx, string key, IReadOnlyList<double[]> latLon,
|
||||
Matrix4x4 m, float cx, float cy, float r, IPen pen, bool closed)
|
||||
{
|
||||
var entry = GetUnit(key, latLon);
|
||||
foreach (var seg in Geometry.ProjectUnitPolyline(entry.Pts, entry.Valid,
|
||||
Matrix4x4.Identity, m, r, cx, cy, closed))
|
||||
{
|
||||
if (seg.Count < 2) continue;
|
||||
var geo = new StreamGeometry();
|
||||
using (var g = geo.Open())
|
||||
{
|
||||
g.BeginFigure(Pt(seg[0]), false);
|
||||
for (var i = 1; i < seg.Count; i++) g.LineTo(Pt(seg[i]));
|
||||
g.EndFigure(false);
|
||||
}
|
||||
ctx.DrawGeometry(null, pen, geo);
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================ 平面等经纬
|
||||
private void RenderFlat(DrawingContext ctx, Size size)
|
||||
{
|
||||
var pad = 26.0;
|
||||
var w = size.Width - pad * 2;
|
||||
var h = size.Height - pad * 2 - 18;
|
||||
if (w < 40 || h < 40) return;
|
||||
|
||||
// 等经纬投影固定 2:1
|
||||
if (w / h > 2.0) w = h * 2.0;
|
||||
else h = w / 2.0;
|
||||
var x0 = (size.Width - w) / 2;
|
||||
var y0 = (size.Height - h) / 2 - 6;
|
||||
|
||||
var frame = new Rect(x0, y0, w, h);
|
||||
|
||||
// 海面
|
||||
ctx.FillRectangle(new SolidColorBrush(Color.Parse("#0A1E33")), frame);
|
||||
|
||||
Point P(double lon, double lat) => new(
|
||||
x0 + (lon + 180.0) / 360.0 * w,
|
||||
y0 + (90.0 - lat) / 180.0 * h);
|
||||
|
||||
// 五带填充
|
||||
if (_showZones)
|
||||
{
|
||||
foreach (var zone in _scene.Zones)
|
||||
{
|
||||
var top = P(-180, zone.LatMax);
|
||||
var bot = P(180, zone.LatMin);
|
||||
ctx.FillRectangle(ZoneFill(zone.Id), new Rect(x0, top.Y, w, bot.Y - top.Y));
|
||||
|
||||
foreach (var lat in new[] { zone.LatMin, zone.LatMax })
|
||||
ctx.DrawLine(ZoneEdgePen, P(-180, lat), P(180, lat));
|
||||
}
|
||||
ctx.DrawLine(EquatorPen, P(-180, 0), P(180, 0));
|
||||
foreach (var lat in new[] { _scene.TropicDeg, -_scene.TropicDeg })
|
||||
ctx.DrawLine(TropicPen, P(-180, lat), P(180, lat));
|
||||
foreach (var lat in new[] { 90 - _scene.TropicDeg, -(90 - _scene.TropicDeg) })
|
||||
ctx.DrawLine(PolarPen, P(-180, lat), P(180, lat));
|
||||
}
|
||||
|
||||
// 海岸线
|
||||
if (_showCoast)
|
||||
{
|
||||
var cw = Math.Round(size.Width);
|
||||
var ch = Math.Round(size.Height);
|
||||
if (Math.Abs(cw - _coastCacheW) > 0.5 || Math.Abs(ch - _coastCacheH) > 0.5 || _coastGeo == null)
|
||||
{
|
||||
var merged = new StreamGeometry();
|
||||
using (var g = merged.Open())
|
||||
{
|
||||
foreach (var line in _coast.Lines)
|
||||
{
|
||||
if (line.Count < 2) continue;
|
||||
g.BeginFigure(P(line[0][0], line[0][1]), false);
|
||||
for (var i = 1; i < line.Count; i++)
|
||||
{
|
||||
var p = line[i];
|
||||
if (p.Length >= 2) g.LineTo(P(p[0], p[1]));
|
||||
}
|
||||
g.EndFigure(false);
|
||||
}
|
||||
}
|
||||
_coastGeo = merged;
|
||||
_coastCacheW = cw; _coastCacheH = ch;
|
||||
}
|
||||
ctx.DrawGeometry(null, CoastPen, _coastGeo);
|
||||
}
|
||||
|
||||
// 板块
|
||||
if (_showPlates)
|
||||
{
|
||||
foreach (var pl in _plates.Plates)
|
||||
{
|
||||
var pen = PlatePenFor(pl.Id);
|
||||
foreach (var line in pl.Lines)
|
||||
DrawFlatPolyline(ctx, line, P, pen);
|
||||
|
||||
if (!_showLabels) continue;
|
||||
var c = pl.Label is { Length: >= 2 } ? pl.Label : Centroid(pl.Lines);
|
||||
if (c == null) continue;
|
||||
var at = P(c[0], c[1]);
|
||||
DrawText(ctx, Pick(pl.NameI18n, pl.Id), at.X, at.Y, 10.5 * TextScale,
|
||||
PlateBrushFor(pl.Id), TextAlignment.Center);
|
||||
}
|
||||
}
|
||||
|
||||
// 五大陆
|
||||
if (_showContinents)
|
||||
{
|
||||
// 用缓存几何:尺寸不变时只画一次构建开销
|
||||
var fw = Math.Round(size.Width);
|
||||
var fh = Math.Round(size.Height);
|
||||
if (Math.Abs(fw - _flatCacheW) > 0.5 || Math.Abs(fh - _flatCacheH) > 0.5 || _flatCache.Count == 0)
|
||||
{
|
||||
_flatCache.Clear();
|
||||
_flatCacheW = fw; _flatCacheH = fh;
|
||||
}
|
||||
|
||||
foreach (var c in _continents.Continents)
|
||||
{
|
||||
var key = "cont:" + c.Id;
|
||||
if (!_flatCache.TryGetValue(key, out var geo))
|
||||
{
|
||||
var merged = new StreamGeometry();
|
||||
using (var g = merged.Open())
|
||||
{
|
||||
foreach (var line in c.Lines)
|
||||
{
|
||||
if (line.Count < 2) continue;
|
||||
g.BeginFigure(P(line[0][0], line[0][1]), false);
|
||||
for (var i = 1; i < line.Count; i++)
|
||||
{
|
||||
var p = line[i];
|
||||
if (p.Length >= 2) g.LineTo(P(p[0], p[1]));
|
||||
}
|
||||
g.EndFigure(false);
|
||||
}
|
||||
}
|
||||
geo = merged;
|
||||
_flatCache[key] = geo;
|
||||
}
|
||||
ctx.DrawGeometry(null, ContinentPen, geo);
|
||||
|
||||
if (!_showLabels) continue;
|
||||
var a = c.Label is { Length: >= 2 } ? c.Label : Centroid(c.Lines);
|
||||
if (a == null) continue;
|
||||
var at = P(a[0], a[1]);
|
||||
DrawText(ctx, Pick(c.NameI18n, c.Id), at.X, at.Y, 12 * TextScale,
|
||||
MainlandBrush, TextAlignment.Center);
|
||||
}
|
||||
}
|
||||
|
||||
// 洲界
|
||||
if (_showBorders)
|
||||
{
|
||||
foreach (var b in _borders.Borders)
|
||||
{
|
||||
var pen = BorderPenFor(b.Between);
|
||||
foreach (var line in b.Lines) DrawFlatPolyline(ctx, line, P, pen.Glow);
|
||||
foreach (var line in b.Lines) DrawFlatPolyline(ctx, line, P, pen.Main);
|
||||
|
||||
if (b.Lines.Count == 0) continue;
|
||||
var mid = MidPoint(b.Lines[0]);
|
||||
if (mid == null) continue;
|
||||
var at = P(mid[0], mid[1]);
|
||||
ctx.DrawEllipse(pen.DotBrush, null, at, 3.4, 3.4);
|
||||
if (_showLabels)
|
||||
DrawText(ctx, $"{Pick(b.NameI18n, b.Name)}({b.Between})",
|
||||
at.X + 9, at.Y - 6, 10.5 * TextScale, pen.DotBrush, TextAlignment.Left);
|
||||
}
|
||||
}
|
||||
|
||||
// 大洲大洋标签
|
||||
if (_showLabels)
|
||||
{
|
||||
foreach (var lb in _labels.Labels)
|
||||
{
|
||||
var at = P(lb.Lon, lb.Lat);
|
||||
var ocean = lb.Kind == "ocean";
|
||||
DrawText(ctx, Pick(lb.NameI18n, ""), at.X, at.Y, (ocean ? 11 : 12.5) * TextScale,
|
||||
ocean ? OceanBrush : ContinentBrush, TextAlignment.Center,
|
||||
ocean ? FontStyle.Italic : FontStyle.Normal);
|
||||
}
|
||||
}
|
||||
|
||||
// 经纬网 + 外框
|
||||
for (var lon = -180; lon <= 180; lon += 30)
|
||||
ctx.DrawLine(GridPen, P(lon, -90), P(lon, 90));
|
||||
for (var lat = -60; lat <= 60; lat += 30)
|
||||
ctx.DrawLine(GridPen, P(-180, lat), P(180, lat));
|
||||
ctx.DrawRectangle(null, new Pen(new SolidColorBrush(Color.FromArgb(180, 150, 200, 255)), 1.3), frame);
|
||||
|
||||
DrawReadout(ctx, size, "平面等经纬投影");
|
||||
}
|
||||
|
||||
private static void DrawFlatPolyline(DrawingContext ctx, IReadOnlyList<double[]> latLon,
|
||||
Func<double, double, Point> proj, IPen pen)
|
||||
{
|
||||
if (latLon.Count < 2) return;
|
||||
var geo = new StreamGeometry();
|
||||
using (var g = geo.Open())
|
||||
{
|
||||
var first = latLon[0];
|
||||
if (first.Length < 2) return;
|
||||
g.BeginFigure(proj(first[0], first[1]), false);
|
||||
for (var i = 1; i < latLon.Count; i++)
|
||||
{
|
||||
var p = latLon[i];
|
||||
if (p.Length >= 2) g.LineTo(proj(p[0], p[1]));
|
||||
}
|
||||
g.EndFigure(false);
|
||||
}
|
||||
ctx.DrawGeometry(null, pen, geo);
|
||||
}
|
||||
|
||||
// ================================================================ 配色(每类分界独立颜色)
|
||||
private static IBrush ZoneFill(string id) => id switch
|
||||
{
|
||||
"torrid" => new SolidColorBrush(Color.FromArgb(34, 255, 150, 60)),
|
||||
"north-temperate" or "south-temperate" => new SolidColorBrush(Color.FromArgb(30, 90, 210, 130)),
|
||||
_ => new SolidColorBrush(Color.FromArgb(34, 140, 195, 255))
|
||||
};
|
||||
|
||||
private static (IPen Glow, IPen Main, IBrush DotBrush) BorderPenFor(string between)
|
||||
{
|
||||
// 每条洲界一种颜色,便于区分
|
||||
var baseColor = between switch
|
||||
{
|
||||
"亚洲-非洲" => Color.FromRgb(255, 214, 92), // 金黄
|
||||
"亚洲-欧洲" => Color.FromRgb(120, 226, 255), // 青
|
||||
"欧洲-非洲" => Color.FromRgb(168, 148, 255), // 紫
|
||||
"北美-南美" => Color.FromRgb(120, 255, 176), // 绿
|
||||
"南美-南极" => Color.FromRgb(96, 232, 222), // 青绿(德雷克海峡)
|
||||
"亚洲-北美" => Color.FromRgb(255, 140, 220), // 粉
|
||||
"亚洲-大洋洲" => Color.FromRgb(255, 160, 96), // 橙
|
||||
"南极洲" => Color.FromRgb(200, 225, 255), // 冰蓝
|
||||
_ => Color.FromRgb(255, 214, 92)
|
||||
};
|
||||
var glow = new Pen(new SolidColorBrush(Color.FromArgb(70, baseColor.R, baseColor.G, baseColor.B)), 5.0);
|
||||
var main = new Pen(new SolidColorBrush(Color.FromArgb(240, baseColor.R, baseColor.G, baseColor.B)), 1.7,
|
||||
new DashStyle(new double[] { 6, 3 }, 0)) { LineCap = PenLineCap.Round };
|
||||
return (glow, main, new SolidColorBrush(Color.FromArgb(245, baseColor.R, baseColor.G, baseColor.B)));
|
||||
}
|
||||
|
||||
private static IPen PlatePenFor(string id)
|
||||
{
|
||||
// 教材六大板块,每块一个颜色
|
||||
var c = id switch
|
||||
{
|
||||
"eurasian" => Color.FromRgb(110, 214, 230), // 青
|
||||
"african" => Color.FromRgb(150, 230, 110), // 绿
|
||||
"american" => Color.FromRgb(255, 176, 84), // 橙
|
||||
"pacific" => Color.FromRgb(255, 110, 110), // 红
|
||||
"indian-ocean" => Color.FromRgb(126, 160, 255), // 蓝紫
|
||||
"antarctic" => Color.FromRgb(208, 190, 255), // 淡紫
|
||||
_ => Color.FromRgb(255, 150, 100)
|
||||
};
|
||||
return new Pen(new SolidColorBrush(Color.FromArgb(225, c.R, c.G, c.B)), 1.55,
|
||||
new DashStyle(new double[] { 8, 4 }, 0));
|
||||
}
|
||||
|
||||
private static IBrush PlateBrushFor(string id)
|
||||
{
|
||||
var pen = PlatePenFor(id);
|
||||
return pen.Brush ?? Brushes.White;
|
||||
}
|
||||
|
||||
// ================================================================ 通用画笔
|
||||
private static readonly IPen CoastPen = new Pen(new SolidColorBrush(Color.FromArgb(250, 236, 246, 255)), 1.75)
|
||||
{ LineJoin = PenLineJoin.Round, LineCap = PenLineCap.Round };
|
||||
|
||||
/// <summary>五大陆轮廓:金黄色实线,与板块虚线明显区分。</summary>
|
||||
private static readonly IPen ContinentPen = new Pen(new SolidColorBrush(Color.FromArgb(240, 255, 210, 74)), 2.0)
|
||||
{ LineJoin = PenLineJoin.Round, LineCap = PenLineCap.Round };
|
||||
private static readonly IBrush MainlandBrush = new SolidColorBrush(Color.FromRgb(255, 218, 110));
|
||||
|
||||
private static readonly IPen TropicPen = new Pen(new SolidColorBrush(Color.FromArgb(220, 255, 190, 100)), 1.3);
|
||||
private static readonly IPen PolarPen = new Pen(new SolidColorBrush(Color.FromArgb(210, 150, 205, 255)), 1.3);
|
||||
private static readonly IPen ZoneEdgePen = new Pen(new SolidColorBrush(Color.FromArgb(110, 200, 225, 255)), 0.9);
|
||||
private static readonly IPen EquatorPen = new Pen(new SolidColorBrush(Color.FromArgb(240, 120, 226, 255)), 1.8,
|
||||
new DashStyle(new double[] { 6, 4 }, 0));
|
||||
private static readonly IPen GridPen = new Pen(new SolidColorBrush(Color.FromArgb(46, 150, 190, 240)), 0.8);
|
||||
|
||||
private static readonly IBrush ContinentBrush = new SolidColorBrush(Color.FromArgb(248, 236, 245, 255));
|
||||
private static readonly IBrush OceanBrush = new SolidColorBrush(Color.FromArgb(220, 130, 190, 245));
|
||||
|
||||
// ================================================================ 工具
|
||||
private static Point Pt(Vector2 v) => new(v.X, v.Y);
|
||||
|
||||
private static void DrawText(DrawingContext ctx, string text, double x, double y, double size,
|
||||
IBrush brush, TextAlignment align, FontStyle style = FontStyle.Normal)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) return;
|
||||
var ft = new FormattedText(text, CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
|
||||
new Typeface(FontFamily.Default, style, FontWeight.SemiBold), size, brush);
|
||||
var px = align switch
|
||||
{
|
||||
TextAlignment.Center => x - ft.Width / 2,
|
||||
TextAlignment.Right => x - ft.Width,
|
||||
_ => x
|
||||
};
|
||||
ctx.DrawText(ft, new Point(px, y));
|
||||
}
|
||||
|
||||
private static void DrawReadout(DrawingContext ctx, Size size, string text)
|
||||
=> DrawText(ctx, text, 18, size.Height - 24, 11,
|
||||
new SolidColorBrush(Color.FromArgb(150, 160, 190, 230)), TextAlignment.Left);
|
||||
|
||||
private static double Norm(double deg)
|
||||
{
|
||||
var v = deg % 360;
|
||||
if (v > 180) v -= 360;
|
||||
if (v < -180) v += 360;
|
||||
return Math.Abs(v);
|
||||
}
|
||||
|
||||
private static double[]? MidPoint(List<double[]> line)
|
||||
{
|
||||
for (var i = line.Count / 2; i < line.Count; i++)
|
||||
if (line[i].Length >= 2) return line[i];
|
||||
return line.Count > 0 && line[0].Length >= 2 ? line[0] : null;
|
||||
}
|
||||
|
||||
private static string Pick(Dictionary<string, string>? dict, string fallback)
|
||||
{
|
||||
if (dict == null || dict.Count == 0) return fallback;
|
||||
foreach (var key in new[] { "zh-CN", "en" })
|
||||
if (dict.TryGetValue(key, out var v) && !string.IsNullOrWhiteSpace(v)) return v;
|
||||
foreach (var kv in dict)
|
||||
if (!string.IsNullOrWhiteSpace(kv.Value)) return kv.Value;
|
||||
return fallback;
|
||||
}
|
||||
|
||||
private static double[]? Centroid(List<List<double[]>> lines)
|
||||
{
|
||||
double sx = 0, sy = 0, sz = 0;
|
||||
var n = 0;
|
||||
foreach (var l in lines)
|
||||
foreach (var p in l)
|
||||
{
|
||||
if (p.Length < 2) continue;
|
||||
var v = Geometry.LatLonToUnit(p[1], p[0]);
|
||||
sx += v.X; sy += v.Y; sz += v.Z; n++;
|
||||
}
|
||||
if (n == 0) return null;
|
||||
var len = Math.Sqrt(sx * sx + sy * sy + sz * sz);
|
||||
if (len < 1e-9) return null;
|
||||
return new[]
|
||||
{
|
||||
Math.Atan2(sx / len, sz / len) * 180.0 / Math.PI,
|
||||
Math.Asin(Math.Clamp(sy / len, -1, 1)) * 180.0 / Math.PI
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"EarthGeographyModel/1.0.3": {
|
||||
"dependencies": {
|
||||
"Avalonia": "11.3.9"
|
||||
},
|
||||
"runtime": {
|
||||
"EarthGeographyModel.dll": {}
|
||||
}
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"dependencies": {
|
||||
"Avalonia.Remote.Protocol": "11.3.9",
|
||||
"MicroCom.Runtime": "0.11.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Base.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Controls.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"assemblyVersion": "0.7.0.0",
|
||||
"fileVersion": "0.7.0.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Dialogs.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Metal.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.MicroCom.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.OpenGL.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Vulkan.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"runtime": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {
|
||||
"assemblyVersion": "0.11.0.0",
|
||||
"fileVersion": "0.11.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"EarthGeographyModel/1.0.3": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-YfaTrUxcmVTsGOw2YqdZyunHqZArK16m1pYfNIBvyvAgX89Pzd3A1PgoMkf64u7scL23IN6HkfqhZeFcbYWLoA==",
|
||||
"path": "avalonia/11.3.9",
|
||||
"hashPath": "avalonia.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-2XVLTSNa+Nvwu4D8NqqdudhllTaCRA9ZKlLZZvYLZeuLlzg7OcAV+df/biHQc6AqOv7iMFR9K5Zt3wG0EF4KfQ==",
|
||||
"path": "avalonia.remote.protocol/11.3.9",
|
||||
"hashPath": "avalonia.remote.protocol.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-MEnrZ3UIiH40hjzMDsxrTyi8dtqB5ziv3iBeeU4bXsL/7NLSal9F1lZKpK+tfBRnUoDSdtcW3KufE4yhATOMCA==",
|
||||
"path": "microcom.runtime/0.11.0",
|
||||
"hashPath": "microcom.runtime.0.11.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,115 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"EarthGeographyModel/1.0.5": {
|
||||
"dependencies": {
|
||||
"Avalonia": "11.3.9"
|
||||
},
|
||||
"runtime": {
|
||||
"EarthGeographyModel.dll": {}
|
||||
}
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"dependencies": {
|
||||
"Avalonia.Remote.Protocol": "11.3.9",
|
||||
"MicroCom.Runtime": "0.11.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Base.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Controls.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.DesignerSupport.dll": {
|
||||
"assemblyVersion": "0.7.0.0",
|
||||
"fileVersion": "0.7.0.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Dialogs.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.Xaml.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Markup.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Metal.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.MicroCom.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.OpenGL.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.Vulkan.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
},
|
||||
"lib/net8.0/Avalonia.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Avalonia.Remote.Protocol.dll": {
|
||||
"assemblyVersion": "11.3.9.0",
|
||||
"fileVersion": "11.3.9.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"runtime": {
|
||||
"lib/net5.0/MicroCom.Runtime.dll": {
|
||||
"assemblyVersion": "0.11.0.0",
|
||||
"fileVersion": "0.11.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"EarthGeographyModel/1.0.5": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Avalonia/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-YfaTrUxcmVTsGOw2YqdZyunHqZArK16m1pYfNIBvyvAgX89Pzd3A1PgoMkf64u7scL23IN6HkfqhZeFcbYWLoA==",
|
||||
"path": "avalonia/11.3.9",
|
||||
"hashPath": "avalonia.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"Avalonia.Remote.Protocol/11.3.9": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-2XVLTSNa+Nvwu4D8NqqdudhllTaCRA9ZKlLZZvYLZeuLlzg7OcAV+df/biHQc6AqOv7iMFR9K5Zt3wG0EF4KfQ==",
|
||||
"path": "avalonia.remote.protocol/11.3.9",
|
||||
"hashPath": "avalonia.remote.protocol.11.3.9.nupkg.sha512"
|
||||
},
|
||||
"MicroCom.Runtime/0.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-MEnrZ3UIiH40hjzMDsxrTyi8dtqB5ziv3iBeeU4bXsL/7NLSal9F1lZKpK+tfBRnUoDSdtcW3KufE4yhATOMCA==",
|
||||
"path": "microcom.runtime/0.11.0",
|
||||
"hashPath": "microcom.runtime.0.11.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
-4
@@ -1,4 +0,0 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
@@ -1 +0,0 @@
|
||||
c5f16ca9fce0f0594ebc177c2ecb2b54604734e59fc765d9f79f6e5986cc8840
|
||||
@@ -1,23 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("NeoRF")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.3.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.3+5e0b46b3f3cd9800af177571c7809a7cdc8e9249")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Earth Model Studio")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("EarthGeographyModel")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.3.0")]
|
||||
[assembly: System.Resources.NeutralResourcesLanguageAttribute("zh-Hans")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
Loaded 100 of 1156 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user