fix: 快捷键更改、心箭图适配

master
Tongg 4 months ago
parent b47f1e83ae
commit 3f9da7bdbd
  1. 2
      ViewModel/BaseWindow/BaseControlVM.cs
  2. 29
      Views/UserControl/ViewportData/Helper/RayHelper.cs

@ -68,7 +68,7 @@ public class BaseControlVM : BaseViewModel
try
{
_hotKeyManager = new HotKeyManager();
var hotKey = new HotKey(Key.R, ModifierKeys.Control | ModifierKeys.Alt);
var hotKey = new HotKey(Key.Q, ModifierKeys.Control | ModifierKeys.Alt);
_hotKeyManager.Register(hotKey);
_hotKeyManager.KeyPressed += OnHotKeyPressed;
}

@ -4,29 +4,17 @@ using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows.Forms;
public class UnityHelper
public class RayHelper
{
//unity渲染结果(运行前清理)
private static string _image_path = AppDomain.CurrentDomain.BaseDirectory + @"Unity\image\";
private static string _image_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\image\";
//unity渲染模型缓存(运行前清理)
private static string _stl_path = AppDomain.CurrentDomain.BaseDirectory + @"Unity\stl\";
private static string _stl_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\";
//用于存放unity渲染插件(版本发布独立更新)
private static string _unity_path = AppDomain.CurrentDomain.BaseDirectory + @"Unity\core\";
private static string _unity_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\core\";
/***
* 1stl文件名ViewportHelperPro.ExportModelsToStl(null, path+filename)
* 2STL文件是否存在 7
* 3 Unity下imagestl两个目录
* 4stl文件paramA
* 5 xx.exe --model=_stl_path+paramA --output=_image_path --type=0/1 00.png 11.png
* 6
* 7 --->> --->>21
* 8
* 9
*
* 0.png1.png
*/
public static void GenerateRender(string modelInfo, string diamondCode)
public static void GenerateRender(string modelInfo, string diamondCode)
{
string fileName = GenerateSignature(modelInfo, diamondCode);
string fullStlPath = Path.Combine(_stl_path, fileName);
@ -46,7 +34,6 @@ public class UnityHelper
CleanDirectory(_stl_path);
// 3. 导出模型为STL
ExportModelsToStl(fullStlPath + ".stl");
ObjExporter.ExportToObj2(ViewportManager.ViewportTriangle, fullStlPath + ".obj");
// 4. 执行Unity渲染命令两次
ExecuteUnityRendering(fileName, 0); // 渲染心图
@ -80,9 +67,7 @@ public class UnityHelper
private static void ExportModelsToStl(string path)
{
// 模拟模型导出逻辑
// 调用ViewportHelperPro.ExportModelsToStl(null, path);
// Console.WriteLine("模型已导出为STL: " + path);
ViewportHelperPro.ExportModelsToStl(null, path);
}
Loading…
Cancel
Save