├── SolidModelBrowser ├── icon3a.ico ├── app.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Controls │ ├── DoubleValuesInput.xaml │ ├── PropertyPanel.xaml │ ├── Scene.xaml │ ├── NumericBox.xaml │ ├── ColorInput.xaml │ ├── FileNavigationPanel.xaml │ ├── ColorInput.xaml.cs │ ├── DoubleValuesInput.xaml.cs │ ├── TextEncodedImage.cs │ ├── UCamera.cs │ ├── NumericBox.xaml.cs │ ├── PropertyPanel.xaml.cs │ ├── Scene.xaml.cs │ └── FileNavigationPanel.xaml.cs ├── App.xaml ├── App.xaml.cs ├── Exports │ ├── Export.cs │ ├── ExportOBJ.cs │ ├── ExportSTLAscii.cs │ ├── ExportSTLBinary.cs │ ├── ExportPLYAscii.cs │ ├── ExportPLYBinary.cs │ └── Export3MF.cs ├── HelpString.cs ├── PropertyInfoAttribute.cs ├── SettingsWindow.xaml.cs ├── SettingsWindow.xaml ├── Imports │ ├── Import.cs │ ├── ImportOBJ.cs │ ├── ImportSTL.cs │ ├── ImportGCODE.cs │ ├── Import3MF.cs │ └── ImportPLY.cs ├── MainWindowSettings.cs ├── Styles │ ├── Colors.xaml │ └── ColorsLight.xaml ├── SolidModelBrowser.csproj ├── MainWindow.xaml ├── Settings.cs └── MainWindow.xaml.cs ├── LICENSE.txt ├── SolidModelBrowser.sln ├── README.md ├── changelog.md ├── .gitattributes └── .gitignore /SolidModelBrowser/icon3a.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/questfulcat/SolidModelBrowser/HEAD/SolidModelBrowser/icon3a.ico -------------------------------------------------------------------------------- /SolidModelBrowser/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /SolidModelBrowser/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SolidModelBrowser/Controls/DoubleValuesInput.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /SolidModelBrowser/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SolidModelBrowser/Controls/PropertyPanel.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SolidModelBrowser/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | namespace SolidModelBrowser 5 | { 6 | public partial class App : Application 7 | { 8 | public static void SetTheme(string theme) 9 | { 10 | Current.Resources.Clear(); 11 | 12 | ResourceDictionary rdColors = new ResourceDictionary(); 13 | rdColors.Source = new Uri("pack://application:,,,/SolidModelBrowser;component/Styles/" + theme); 14 | Current.Resources.MergedDictionaries.Add(rdColors); 15 | 16 | ResourceDictionary rdStyles = new ResourceDictionary(); 17 | rdStyles.Source = new Uri("pack://application:,,,/SolidModelBrowser;component/Styles/Styles.xaml"); 18 | Current.Resources.MergedDictionaries.Add(rdStyles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SolidModelBrowser/Exports/Export.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Windows.Media.Media3D; 6 | 7 | namespace SolidModelBrowser 8 | { 9 | internal abstract class Export 10 | { 11 | public string Extension { get; protected set; } = ""; 12 | public string Description { get; protected set; } = ""; 13 | public bool InitialXRotationNeeded { get; protected set; } 14 | 15 | public abstract void Save(MeshGeometry3D mesh, string filename); 16 | 17 | public static List Exports = new List(); 18 | 19 | static Export() 20 | { 21 | Type thisT = MethodBase.GetCurrentMethod().DeclaringType; 22 | var importTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.BaseType != null && t.BaseType == thisT); 23 | foreach (var importType in importTypes) Exports.Add((Export)Activator.CreateInstance(importType)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SolidModelBrowser/Controls/Scene.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 questfulcat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SolidModelBrowser/Exports/ExportOBJ.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Text; 3 | using System.Windows.Media.Media3D; 4 | 5 | namespace SolidModelBrowser 6 | { 7 | internal class ExportOBJ : Export 8 | { 9 | public ExportOBJ() 10 | { 11 | Extension = "obj"; 12 | Description = "OBJ"; 13 | InitialXRotationNeeded = true; 14 | } 15 | 16 | public override void Save(MeshGeometry3D mesh, string filename) 17 | { 18 | StringBuilder sb = new StringBuilder(); 19 | sb.AppendLine($"# Exported from SolidModelBrowser"); 20 | sb.AppendLine("o default"); 21 | 22 | int q = mesh.TriangleIndices.Count; 23 | int nq = mesh.Normals.Count; 24 | 25 | foreach (var p in mesh.Positions) sb.AppendLine($"v {p.X} {p.Y} {p.Z}"); 26 | foreach (var n in mesh.Normals) sb.AppendLine($"vn {n.X} {n.Y} {n.Z}"); 27 | for (int c = 0; c < q; c += 3) sb.AppendLine($"f {mesh.TriangleIndices[c] + 1} {mesh.TriangleIndices[c + 1] + 1} {mesh.TriangleIndices[c + 2] + 1}"); 28 | 29 | File.WriteAllText(filename, sb.ToString()); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SolidModelBrowser/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Этот код создан программой. 4 | // Исполняемая версия:4.0.30319.42000 5 | // 6 | // Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае 7 | // повторной генерации кода. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SolidModelBrowser.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SolidModelBrowser.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32421.90 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolidModelBrowser", "SolidModelBrowser\SolidModelBrowser.csproj", "{CE656CE1-8F90-4831-B3DA-FAFFD375DDE6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CE656CE1-8F90-4831-B3DA-FAFFD375DDE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CE656CE1-8F90-4831-B3DA-FAFFD375DDE6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CE656CE1-8F90-4831-B3DA-FAFFD375DDE6}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CE656CE1-8F90-4831-B3DA-FAFFD375DDE6}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {A142B785-A2E6-49B9-8F6B-B60503B28F68} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SolidModelBrowser/HelpString.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SolidModelBrowser 8 | { 9 | public partial class MainWindow 10 | { 11 | string help = $@"Solid Model Browser v {version} 12 | 13 | F1 - Show/hide this help 14 | F2 - Diffuse material on/off 15 | F3 - Specular material on/off 16 | F4 - Emissive material on/off 17 | F5 - Reload file, reset camera 18 | F6 - Save image, snapshot to PNG 19 | F7 - Open current file in external application (if defined) 20 | F8 - Switch camera Perspective/Orthographic modes 21 | C - Turn camera at model center 22 | A, D - Rotate model around Z axis 23 | S, W - Rotate model around X axis 24 | E, Q - Rotate model around Y axis 25 | G, R - Set Camera at model frontside/backside view 26 | T, B - Set Camera at model top/bottom view 27 | F, H - Set Camera at model left/right view 28 | O - Show/hide XYZ axes 29 | P - Show/hide ground polygon 30 | CTRL+F - Recreate smooth mesh in flat mode (flat polygon lighting) 31 | CTRL+W - Wireframe mode 32 | CTRL+S - Export current model 33 | I - show/hide model info 34 | LeftShift - hold left shift to drag window by viewport 35 | 36 | Grigoriy E. (questfulcat) 2025 (C)"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SolidModelBrowser/Controls/NumericBox.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SolidModelBrowser/Controls/ColorInput.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | A 11 | 12 | R 13 | 14 | G 15 | 16 | B 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SolidModelBrowser/Controls/FileNavigationPanel.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 |