190607 c1
- Add Pilz.Drawing.Drawing3D.OpenGLFactory - Fix small bugs in Pilz.UI.PaintingControl
This commit is contained in:
6
Pilz.Simple3DFileParser/App.config
Normal file
6
Pilz.Simple3DFileParser/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
</configuration>
|
||||
250
Pilz.Simple3DFileParser/FileParser/Aspose3DLoader.vb
Normal file
250
Pilz.Simple3DFileParser/FileParser/Aspose3DLoader.vb
Normal file
@@ -0,0 +1,250 @@
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Threading
|
||||
Imports Aspose.ThreeD
|
||||
Imports Aspose.ThreeD.Entities
|
||||
Imports Aspose.ThreeD.Formats
|
||||
Imports Aspose.ThreeD.Shading
|
||||
Imports Aspose.ThreeD.Utilities
|
||||
|
||||
Namespace Aspose3DModule
|
||||
|
||||
Public Class Aspose3DLoader
|
||||
|
||||
Private Shared hasActivatedMemoryPatching As Boolean = False
|
||||
|
||||
Private Shared Sub ActivateMemoryPatching()
|
||||
If Not hasActivatedMemoryPatching Then
|
||||
LicenseHelper.AsposeModifyInMemory.ActivateMemoryPatching()
|
||||
hasActivatedMemoryPatching = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Shared Function FromFile(fileName As String, LoadMaterials As Boolean, UpAxis As UpAxis) As Object3D
|
||||
ActivateMemoryPatching()
|
||||
|
||||
'Create new Model
|
||||
Dim obj3d As New Object3D
|
||||
|
||||
'Create new temporary CultureInfo
|
||||
Dim curThread As Thread = Thread.CurrentThread
|
||||
Dim curCultInfo As CultureInfo = curThread.CurrentCulture
|
||||
Dim newCultInfo As New CultureInfo(curCultInfo.Name)
|
||||
newCultInfo.NumberFormat.NumberDecimalSeparator = "."
|
||||
newCultInfo.NumberFormat.PercentDecimalSeparator = "."
|
||||
newCultInfo.NumberFormat.CurrencyDecimalSeparator = "."
|
||||
newCultInfo.NumberFormat.NumberGroupSeparator = ","
|
||||
newCultInfo.NumberFormat.PercentGroupSeparator = ","
|
||||
newCultInfo.NumberFormat.CurrencyGroupSeparator = ","
|
||||
curThread.CurrentCulture = newCultInfo
|
||||
|
||||
'Load Model from file
|
||||
Dim scene As New Scene(fileName)
|
||||
|
||||
'Reset Cultur-Info
|
||||
curThread.CurrentCulture = curCultInfo
|
||||
|
||||
'Triangulate the Model
|
||||
PolygonModifier.Triangulate(scene)
|
||||
|
||||
'Create Dictionary for Materials
|
||||
Dim dicMaterials As New Dictionary(Of Aspose.ThreeD.Shading.Material, Material)
|
||||
|
||||
'Create List of all avaiable Map-States
|
||||
Dim MapNames As String() = {Aspose.ThreeD.Shading.Material.MapDiffuse, Aspose.ThreeD.Shading.Material.MapAmbient, Aspose.ThreeD.Shading.Material.MapSpecular, Aspose.ThreeD.Shading.Material.MapEmissive, Aspose.ThreeD.Shading.Material.MapNormal}
|
||||
Dim ColorNames As String() = {"DiffuseColor", "AmbientColor", "SpecularColor", "EmissiveColor"}
|
||||
|
||||
For Each node As Node In scene.RootNode.ChildNodes
|
||||
|
||||
'Add new Materials, if not added
|
||||
For Each mat As Aspose.ThreeD.Shading.Material In node.Materials
|
||||
If Not dicMaterials.ContainsKey(mat) Then
|
||||
|
||||
'Create new Material
|
||||
Dim newMat As New Material
|
||||
|
||||
'Get TextureBase
|
||||
Dim texBase As TextureBase = Nothing
|
||||
Dim curmnindex As Byte = 0
|
||||
Do While texBase Is Nothing AndAlso curmnindex < MapNames.Length
|
||||
texBase = mat.GetTexture(MapNames(curmnindex))
|
||||
curmnindex += 1
|
||||
Loop
|
||||
|
||||
If texBase IsNot Nothing Then
|
||||
If LoadMaterials Then
|
||||
'Get Texture Image
|
||||
Dim imgFile As String = texBase.GetPropertyValue("FileName")
|
||||
imgFile = imgFile.Replace("/", "\")
|
||||
|
||||
'Load and set Image
|
||||
If imgFile <> "" Then
|
||||
Dim fs As New FileStream(imgFile, FileMode.Open, FileAccess.Read)
|
||||
newMat.Image = Image.FromStream(fs)
|
||||
fs.Close()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Get Texture Color
|
||||
Dim texcol As Vector3? = Nothing
|
||||
Dim curcnindex As Byte = 0
|
||||
Do While texcol Is Nothing AndAlso curcnindex < ColorNames.Length
|
||||
texcol = mat.GetPropertyValue(ColorNames(curcnindex))
|
||||
curcnindex += 1
|
||||
Loop
|
||||
|
||||
If texcol IsNot Nothing Then
|
||||
newMat.Color = Color.FromArgb(texcol?.x, texcol?.y, texcol?.z)
|
||||
End If
|
||||
|
||||
'Add Material to Object3D
|
||||
obj3d.Materials.Add(mat.Name, newMat)
|
||||
|
||||
'Add Dictionary-Entry
|
||||
dicMaterials.Add(mat, newMat)
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
'Get Aspose-Mesh
|
||||
Dim curMesh As Entities.Mesh = node.GetEntity(Of Entities.Mesh)
|
||||
|
||||
If curMesh IsNot Nothing Then
|
||||
|
||||
'Create new Mesh
|
||||
Dim newMesh As New Mesh
|
||||
|
||||
'Create Vertices
|
||||
For Each vert As Vector4 In curMesh.ControlPoints
|
||||
'Create new Vertex
|
||||
Dim newVert As New Vertex
|
||||
|
||||
'Set Vertex Data
|
||||
newVert.X = vert.x
|
||||
newVert.Y = vert.y
|
||||
newVert.Z = vert.z
|
||||
|
||||
'Add new Vertex
|
||||
newMesh.Vertices.Add(newVert)
|
||||
Next
|
||||
|
||||
'Create Normals
|
||||
Dim veNormals As VertexElementNormal = curMesh.GetElement(VertexElementType.Normal)
|
||||
If veNormals IsNot Nothing Then
|
||||
For Each n As Vector4 In veNormals.Data
|
||||
'Create new Normal
|
||||
Dim newNormal As New Normal
|
||||
|
||||
'Set Normal Data
|
||||
newNormal.X = n.x
|
||||
newNormal.Y = n.y
|
||||
newNormal.Z = n.z
|
||||
|
||||
'Add new Normal
|
||||
newMesh.Normals.Add(newNormal)
|
||||
Next
|
||||
End If
|
||||
|
||||
'Create Normals
|
||||
Dim veUVs As VertexElementUV = curMesh.GetElement(VertexElementType.UV)
|
||||
If veUVs IsNot Nothing Then
|
||||
For Each uv As Vector4 In veUVs.Data
|
||||
'Create new UV
|
||||
Dim newUV As New UV
|
||||
|
||||
'Set UV Data
|
||||
newUV.U = uv.x
|
||||
newUV.V = uv.y
|
||||
|
||||
'Add new UV
|
||||
newMesh.UVs.Add(newUV)
|
||||
Next
|
||||
End If
|
||||
|
||||
'Create Normals
|
||||
Dim veVertexColor As VertexElementVertexColor = curMesh.GetElement(VertexElementType.VertexColor)
|
||||
If veVertexColor IsNot Nothing Then
|
||||
For Each n As Vector4 In veVertexColor.Data
|
||||
'Create new Normal
|
||||
Dim newVC As New VertexColor
|
||||
|
||||
'Set Normal Data
|
||||
newVC.R = n.x
|
||||
newVC.G = n.y
|
||||
newVC.B = n.z
|
||||
newVC.A = n.w
|
||||
|
||||
'Add new Normal
|
||||
newMesh.VertexColors.Add(newVC)
|
||||
Next
|
||||
End If
|
||||
|
||||
'Get Material-Indicies
|
||||
Dim veMaterials As VertexElementMaterial = curMesh.GetElement(VertexElementType.Material)
|
||||
|
||||
'Definde Index for VertexElement.Indicies
|
||||
Dim veIndex As Integer = 0
|
||||
|
||||
'Build Polygones
|
||||
For iPoly = 0 To curMesh.Polygons.Count - 1
|
||||
'Get current Polygon
|
||||
Dim poly As Integer() = curMesh.Polygons(iPoly)
|
||||
|
||||
'Create new Face
|
||||
Dim f As New Face
|
||||
|
||||
'Set Texture, if avaiable
|
||||
If veMaterials IsNot Nothing Then
|
||||
f.Material = dicMaterials(node.Materials(veMaterials.Indices(iPoly)))
|
||||
ElseIf node.Material IsNot Nothing Then
|
||||
f.Material = dicMaterials(node.Material)
|
||||
End If
|
||||
|
||||
For Each index As Integer In poly
|
||||
'Create new Point
|
||||
Dim p As New Point
|
||||
|
||||
'Set Vertex
|
||||
p.Vertex = newMesh.Vertices(index)
|
||||
|
||||
'Set Normal
|
||||
If veNormals IsNot Nothing Then
|
||||
p.Normal = newMesh.Normals(veNormals.Indices(veIndex))
|
||||
End If
|
||||
|
||||
'Set UV
|
||||
If veUVs IsNot Nothing Then
|
||||
p.UV = newMesh.UVs(veUVs.Indices(veIndex))
|
||||
End If
|
||||
|
||||
'Set Vertex Color
|
||||
If veVertexColor IsNot Nothing Then
|
||||
p.VertexColor = newMesh.VertexColors(veVertexColor.Indices(veIndex))
|
||||
End If
|
||||
|
||||
'Add new Point
|
||||
f.Points.Add(p)
|
||||
|
||||
'Increment VertexElementIndicies-Index
|
||||
veIndex += 1
|
||||
Next
|
||||
|
||||
'Add new Face
|
||||
newMesh.Faces.Add(f)
|
||||
Next
|
||||
|
||||
'Add new Mesh
|
||||
obj3d.Meshes.Add(newMesh)
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
'Return the new Object3D
|
||||
Return obj3d
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
391
Pilz.Simple3DFileParser/FileParser/AssimpLoader.vb
Normal file
391
Pilz.Simple3DFileParser/FileParser/AssimpLoader.vb
Normal file
@@ -0,0 +1,391 @@
|
||||
Imports System.IO
|
||||
Imports Assimp
|
||||
Imports Assimp.Unmanaged
|
||||
|
||||
Namespace AssimpModule
|
||||
|
||||
Public Class AssimpLoader
|
||||
|
||||
Public Shared PathToAssimpLib32 As String = "Assimp32.dll"
|
||||
Public Shared PathToAssimpLib64 As String = "Assimp64.dll"
|
||||
|
||||
Friend Shared Sub LoadAssimpLibs()
|
||||
If Not AssimpLibrary.Instance.IsLibraryLoaded Then
|
||||
AssimpLibrary.Instance.LoadLibrary(PathToAssimpLib32, PathToAssimpLib64)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Shared Function FromFile(fileName As String, LoadMaterials As Boolean, UpAxis As UpAxis) As Object3D
|
||||
Dim LoadedImages As New Dictionary(Of String, Image)
|
||||
Dim newObj As New Object3D
|
||||
Dim daeMdl As Scene = Nothing
|
||||
Dim ac As New AssimpContext
|
||||
Dim channelIndicies As New Dictionary(Of Material, Integer)
|
||||
|
||||
daeMdl = ac.ImportFile(fileName, PostProcessPreset.TargetRealTimeMaximumQuality Or PostProcessSteps.Triangulate)
|
||||
|
||||
For Each et As EmbeddedTexture In daeMdl.Textures
|
||||
If et.HasCompressedData Then
|
||||
Dim newMat As New Material
|
||||
|
||||
Dim ms As New MemoryStream(et.CompressedData)
|
||||
newMat.Image = Image.FromStream(ms)
|
||||
ms.Close()
|
||||
|
||||
newObj.Materials.Add("tex_" & daeMdl.Textures.IndexOf(et), newMat)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each mat As Assimp.Material In daeMdl.Materials
|
||||
Dim newMat As New Material
|
||||
Dim texSlot As TextureSlot? = Nothing
|
||||
Dim col4d As Color4D? = Nothing
|
||||
|
||||
newMat.Opacity = mat.Opacity
|
||||
|
||||
Select Case True
|
||||
Case mat.HasTextureNormal
|
||||
texSlot = mat.TextureNormal
|
||||
Case mat.HasTextureDiffuse
|
||||
texSlot = mat.TextureDiffuse
|
||||
Case mat.HasTextureAmbient
|
||||
texSlot = mat.TextureAmbient
|
||||
Case mat.HasTextureSpecular
|
||||
texSlot = mat.TextureSpecular
|
||||
End Select
|
||||
|
||||
Select Case True
|
||||
Case mat.HasColorDiffuse
|
||||
col4d = mat.ColorDiffuse
|
||||
Case mat.HasColorAmbient
|
||||
col4d = mat.ColorAmbient
|
||||
Case mat.HasColorSpecular
|
||||
col4d = mat.ColorSpecular
|
||||
End Select
|
||||
|
||||
If texSlot IsNot Nothing Then
|
||||
Dim filePath As String = texSlot.Value.FilePath
|
||||
|
||||
If LoadMaterials Then
|
||||
If filePath <> "" Then
|
||||
Dim combiPath As String = Path.Combine(Path.GetDirectoryName(fileName), filePath)
|
||||
If File.Exists(combiPath) Then
|
||||
newMat.Image = LoadImage(combiPath, LoadedImages)
|
||||
ElseIf File.Exists(filePath) Then
|
||||
newMat.Image = LoadImage(filePath, LoadedImages)
|
||||
End If
|
||||
ElseIf texSlot.Value.TextureIndex > -1 AndAlso daeMdl.Textures.Count > texSlot.Value.TextureIndex Then
|
||||
Dim et As EmbeddedTexture = daeMdl.Textures(texSlot.Value.TextureIndex)
|
||||
If et.HasCompressedData Then
|
||||
Dim ms As New MemoryStream(et.CompressedData)
|
||||
newMat.Image = Image.FromStream(ms)
|
||||
ms.Close()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
channelIndicies.Add(newMat, texSlot.Value.UVIndex)
|
||||
End If
|
||||
|
||||
If col4d IsNot Nothing Then
|
||||
newMat.Color = Color.FromArgb(col4d.Value.R * 255, col4d.Value.G * 255, col4d.Value.B * 255)
|
||||
End If
|
||||
|
||||
newObj.Materials.Add(mat.Name, newMat)
|
||||
Next
|
||||
|
||||
Dim newMesh As New Mesh
|
||||
newObj.Meshes.Add(newMesh)
|
||||
|
||||
Dim dicVertices As New Dictionary(Of Vector3D, Vertex)
|
||||
Dim dicNormals As New Dictionary(Of Vector3D, Normal)
|
||||
Dim dicUVs As New Dictionary(Of Vector3D, UV)
|
||||
Dim dicVertexColors As New Dictionary(Of Color4D, VertexColor)
|
||||
|
||||
For Each m As Assimp.Mesh In daeMdl.Meshes
|
||||
Dim curMat As Material
|
||||
If m.MaterialIndex > -1 AndAlso newObj.Materials.Count > m.MaterialIndex Then
|
||||
curMat = newObj.Materials.ElementAt(m.MaterialIndex).Value
|
||||
Else
|
||||
curMat = Nothing
|
||||
End If
|
||||
|
||||
For Each n As Vector3D In m.Normals
|
||||
If Not dicNormals.ContainsKey(n) Then
|
||||
Dim newNormal As New Normal
|
||||
|
||||
Select Case UpAxis
|
||||
Case UpAxis.Y
|
||||
newNormal.X = n.X
|
||||
newNormal.Y = n.Y
|
||||
newNormal.Z = n.Z
|
||||
Case UpAxis.Z
|
||||
newNormal.X = n.Y
|
||||
newNormal.Y = n.Z
|
||||
newNormal.Z = n.X
|
||||
End Select
|
||||
|
||||
newMesh.Normals.Add(newNormal)
|
||||
dicNormals.Add(n, newNormal)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each v As Vector3D In m.Vertices
|
||||
If Not dicVertices.ContainsKey(v) Then
|
||||
Dim newVert As New Vertex
|
||||
|
||||
Select Case UpAxis
|
||||
Case UpAxis.Y
|
||||
newVert.X = v.X
|
||||
newVert.Y = v.Y
|
||||
newVert.Z = v.Z
|
||||
Case UpAxis.Z
|
||||
newVert.X = v.Y
|
||||
newVert.Y = v.Z
|
||||
newVert.Z = v.X
|
||||
End Select
|
||||
|
||||
newMesh.Vertices.Add(newVert)
|
||||
dicVertices.Add(v, newVert)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each uvList As List(Of Vector3D) In m.TextureCoordinateChannels
|
||||
For Each uv As Vector3D In uvList
|
||||
If Not dicUVs.ContainsKey(uv) Then
|
||||
Dim newUV As New UV
|
||||
|
||||
newUV.U = uv.X
|
||||
newUV.V = uv.Y
|
||||
|
||||
newMesh.UVs.Add(newUV)
|
||||
dicUVs.Add(uv, newUV)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
For Each vcList As List(Of Color4D) In m.VertexColorChannels
|
||||
For Each vc As Color4D In vcList
|
||||
If Not dicVertexColors.ContainsKey(vc) Then
|
||||
Dim newVC As New VertexColor
|
||||
|
||||
newVC.R = vc.R
|
||||
newVC.G = vc.G
|
||||
newVC.B = vc.B
|
||||
newVC.A = vc.A
|
||||
|
||||
newMesh.VertexColors.Add(newVC)
|
||||
dicVertexColors.Add(vc, newVC)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
For Each f As Assimp.Face In m.Faces
|
||||
If f.HasIndices Then
|
||||
Dim newFace As New Face With {.Material = curMat}
|
||||
|
||||
For Each index As Integer In f.Indices
|
||||
If index > -1 Then
|
||||
Dim newPoint As New Point
|
||||
|
||||
If m.HasVertices Then
|
||||
newPoint.Vertex = dicVertices(m.Vertices(index))
|
||||
End If
|
||||
|
||||
If m.HasNormals Then
|
||||
newPoint.Normal = dicNormals(m.Normals(index))
|
||||
End If
|
||||
|
||||
If curMat IsNot Nothing AndAlso channelIndicies.ContainsKey(curMat) Then
|
||||
Dim tkey As Integer = channelIndicies(curMat)
|
||||
|
||||
If m.HasTextureCoords(tkey) Then
|
||||
newPoint.UV = dicUVs(m.TextureCoordinateChannels(tkey)(index))
|
||||
End If
|
||||
|
||||
If m.HasVertexColors(tkey) Then
|
||||
newPoint.VertexColor = dicVertexColors(m.VertexColorChannels(tkey)(index))
|
||||
End If
|
||||
End If
|
||||
|
||||
newFace.Points.Add(newPoint)
|
||||
End If
|
||||
Next
|
||||
|
||||
If newFace.Points.Count = 3 Then
|
||||
newMesh.Faces.Add(newFace)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
Return newObj
|
||||
End Function
|
||||
|
||||
Public Shared Sub ToFile(fileName As String, obj As Object3D)
|
||||
Dim mdl As New Scene
|
||||
Dim dicMatIndex As New Dictionary(Of Material, Integer)
|
||||
|
||||
Dim texDir As String = ""
|
||||
If obj.Materials.Count > 0 Then
|
||||
texDir = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName))
|
||||
If Not Directory.Exists(texDir) Then
|
||||
Directory.CreateDirectory(texDir)
|
||||
End If
|
||||
End If
|
||||
|
||||
For Each kvp As KeyValuePair(Of String, Material) In obj.Materials
|
||||
Dim mat As New Assimp.Material
|
||||
|
||||
mat.Name = If(kvp.Key <> "", kvp.Key, "_" & mdl.Materials.Count)
|
||||
mat.Opacity = mat.Opacity
|
||||
|
||||
Dim texslot As New TextureSlot
|
||||
texslot.TextureIndex = mdl.Textures.Count
|
||||
texslot.TextureType = TextureType.Diffuse
|
||||
texslot.UVIndex = 0
|
||||
|
||||
Dim ms As New MemoryStream
|
||||
kvp.Value.Image.Save(ms, Imaging.ImageFormat.Png)
|
||||
'Dim tex As New EmbeddedTexture("png", ms.GetBuffer)
|
||||
ms.Close()
|
||||
|
||||
If kvp.Value.Image IsNot Nothing Then
|
||||
texslot.FilePath = Path.Combine(texDir, mat.Name & ".png")
|
||||
File.WriteAllBytes(texslot.FilePath, ms.GetBuffer)
|
||||
End If
|
||||
|
||||
'mdl.Textures.Add(tex)
|
||||
mat.AddMaterialTexture(texslot)
|
||||
mdl.Materials.Add(mat)
|
||||
|
||||
If kvp.Value.Color IsNot Nothing Then
|
||||
With kvp.Value.Color.Value
|
||||
mat.ColorDiffuse = New Color4D(.R / 255, .G / 255, .B / 255, 1)
|
||||
End With
|
||||
End If
|
||||
|
||||
dicMatIndex.Add(kvp.Value, mdl.Materials.Count - 1)
|
||||
Next
|
||||
|
||||
Dim dicTexMesh As New Dictionary(Of Material, Assimp.Mesh)
|
||||
Dim dicMeshDicVertIndex As New Dictionary(Of Assimp.Mesh, Dictionary(Of Vertex, Integer))
|
||||
Dim dicCounter As New Dictionary(Of Assimp.Mesh, Integer)
|
||||
|
||||
For Each mesh As Mesh In obj.Meshes
|
||||
For Each f As Face In mesh.Faces
|
||||
Dim m As Assimp.Mesh
|
||||
|
||||
If dicTexMesh.ContainsKey(f.Material) Then
|
||||
m = dicTexMesh(f.Material)
|
||||
Else
|
||||
m = New Assimp.Mesh("Mesh_" & mdl.MeshCount + 1)
|
||||
m.PrimitiveType = PrimitiveType.Triangle
|
||||
If dicMatIndex.ContainsKey(f.Material) Then
|
||||
m.MaterialIndex = dicMatIndex(f.Material)
|
||||
End If
|
||||
mdl.Meshes.Add(m)
|
||||
dicTexMesh.Add(f.Material, m)
|
||||
dicMeshDicVertIndex.Add(m, New Dictionary(Of Vertex, Integer))
|
||||
dicCounter.Add(m, 0)
|
||||
End If
|
||||
|
||||
Dim newFace As New Assimp.Face
|
||||
|
||||
For Each p As Point In f.Points
|
||||
newFace.Indices.Add(dicCounter(m))
|
||||
|
||||
If p.Vertex IsNot Nothing Then
|
||||
Dim vert As New Vector3D
|
||||
vert.X = p.Vertex.X
|
||||
vert.Y = p.Vertex.Y
|
||||
vert.Z = p.Vertex.Z
|
||||
m.Vertices.Add(vert)
|
||||
Else
|
||||
m.Vertices.Add(New Vector3D(0, 0, 0))
|
||||
End If
|
||||
|
||||
If p.Normal IsNot Nothing Then
|
||||
Dim norm As New Vector3D
|
||||
norm.X = p.Normal.X
|
||||
norm.Y = p.Normal.Y
|
||||
norm.Z = p.Normal.Z
|
||||
m.Normals.Add(norm)
|
||||
Else
|
||||
m.Normals.Add(New Vector3D(0, 0, 0))
|
||||
End If
|
||||
|
||||
'If p.UV IsNot Nothing Then
|
||||
' Dim uv As New Vector3D
|
||||
' uv.X = p.UV.U
|
||||
' uv.Y = p.UV.V
|
||||
' m.TextureCoordinateChannels(0).Add(uv)
|
||||
'Else
|
||||
' m.TextureCoordinateChannels(0).Add(New Vector3D(0, 0, 0))
|
||||
'End If
|
||||
|
||||
'If p.VertexColor IsNot Nothing Then
|
||||
' Dim vc As New Color4D
|
||||
' vc.R = p.VertexColor.R
|
||||
' vc.G = p.VertexColor.G
|
||||
' vc.B = p.VertexColor.B
|
||||
' vc.A = p.VertexColor.A
|
||||
' m.VertexColorChannels(0).Add(vc)
|
||||
'Else
|
||||
' m.VertexColorChannels(0).Add(New Color4D(0, 0, 0, 0))
|
||||
'End If
|
||||
|
||||
dicCounter(m) += 1
|
||||
Next
|
||||
|
||||
m.Faces.Add(newFace)
|
||||
Next
|
||||
Next
|
||||
|
||||
'Add Root Node
|
||||
mdl.RootNode = New Node(Path.GetFileName(fileName))
|
||||
|
||||
'Add Mesh Indicies
|
||||
For i As Integer = 0 To mdl.MeshCount - 1
|
||||
mdl.RootNode.MeshIndices.Add(i)
|
||||
Next
|
||||
|
||||
Dim ac As New AssimpContext
|
||||
|
||||
Dim formatID As String = ""
|
||||
Dim myExt As String = Path.GetExtension(fileName).ToLower.Substring(1)
|
||||
For Each efd As ExportFormatDescription In ac.GetSupportedExportFormats
|
||||
If myExt = efd.FileExtension Then
|
||||
formatID = efd.FormatId
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
ac.ExportFile(mdl, fileName, formatID)
|
||||
End Sub
|
||||
|
||||
Private Shared Function LoadImage(fileName As String, loadedImages As Dictionary(Of String, Image)) As Image
|
||||
If File.Exists(fileName) Then
|
||||
If loadedImages.ContainsKey(fileName) Then
|
||||
Return loadedImages(fileName)
|
||||
Else
|
||||
Dim fs As New FileStream(fileName, FileMode.Open, FileAccess.Read)
|
||||
Dim img As Image = Image.FromStream(fs)
|
||||
fs.Close()
|
||||
|
||||
For Each kvp In loadedImages
|
||||
If IsTheSameAs(img, kvp.Value) Then
|
||||
Return kvp.Value
|
||||
End If
|
||||
Next
|
||||
|
||||
loadedImages.Add(fileName, img)
|
||||
Return img
|
||||
End If
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
391
Pilz.Simple3DFileParser/FileParser/Obj.vb
Normal file
391
Pilz.Simple3DFileParser/FileParser/Obj.vb
Normal file
@@ -0,0 +1,391 @@
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Threading
|
||||
Imports Pilz.S3DFileParser.Exceptions
|
||||
|
||||
Namespace ObjModule
|
||||
|
||||
Public Class ObjFile
|
||||
|
||||
Public Shared Function FromFile(FileName As String, LoadMaterials As Boolean, UpAxis As UpAxis) As Object3D
|
||||
Dim curThread As Thread = Thread.CurrentThread
|
||||
Dim curCultInfo As CultureInfo = curThread.CurrentCulture
|
||||
Dim newCultInfo As New CultureInfo(curCultInfo.Name)
|
||||
newCultInfo.NumberFormat.NumberDecimalSeparator = "."
|
||||
newCultInfo.NumberFormat.PercentDecimalSeparator = "."
|
||||
newCultInfo.NumberFormat.CurrencyDecimalSeparator = "."
|
||||
newCultInfo.NumberFormat.NumberGroupSeparator = ","
|
||||
newCultInfo.NumberFormat.PercentGroupSeparator = ","
|
||||
newCultInfo.NumberFormat.CurrencyGroupSeparator = ","
|
||||
curThread.CurrentCulture = newCultInfo
|
||||
|
||||
Dim newObj As New Object3D
|
||||
Dim newMesh As New Mesh
|
||||
Dim curObjPath As String = Path.GetDirectoryName(FileName)
|
||||
|
||||
Dim mtllibs As New Dictionary(Of String, MaterialLib)
|
||||
|
||||
Dim curMaterialLib As MaterialLib = Nothing
|
||||
Dim curMaterial As Material = Nothing
|
||||
|
||||
Dim srObj As New StreamReader(FileName, Text.Encoding.ASCII)
|
||||
Dim line As String = ""
|
||||
|
||||
Do Until srObj.EndOfStream
|
||||
line = srObj.ReadLine.Trim
|
||||
|
||||
If line <> "" Then
|
||||
|
||||
Select Case True
|
||||
Case line.StartsWith("mtllib ")
|
||||
Dim name As String = line.Substring(7)
|
||||
|
||||
If Not mtllibs.ContainsKey(name) Then
|
||||
Dim mtlfile As String = Path.Combine(curObjPath, name)
|
||||
If Not File.Exists(mtlfile) Then Throw New MaterialException("Material Library not found!")
|
||||
|
||||
Dim newmtl As New MaterialLib
|
||||
newmtl.FromFile(mtlfile, LoadMaterials)
|
||||
mtllibs.Add(name, newmtl)
|
||||
curMaterialLib = newmtl
|
||||
|
||||
For Each kvp As KeyValuePair(Of String, Material) In curMaterialLib.Materials
|
||||
If Not newObj.Materials.ContainsKey(kvp.Key) Then newObj.Materials.Add(kvp.Key, kvp.Value)
|
||||
Next
|
||||
Else
|
||||
curMaterialLib = mtllibs(name)
|
||||
End If
|
||||
|
||||
Case line.StartsWith("usemtl ")
|
||||
curMaterial = curMaterialLib.Materials(line.Substring(7))
|
||||
|
||||
Case line.StartsWith("v ")
|
||||
If line.Contains("nan") Then line = line.Replace("nan", "0")
|
||||
Dim splitXYZ() As String = line.Substring(2).Split(" "c)
|
||||
|
||||
Dim tX As Double = Convert.ToDouble(splitXYZ(0))
|
||||
Dim tY As Double = Convert.ToDouble(splitXYZ(1))
|
||||
Dim tZ As Double = Convert.ToDouble(splitXYZ(2))
|
||||
|
||||
Dim v As New Vertex
|
||||
Select Case UpAxis
|
||||
Case UpAxis.Y
|
||||
v.X = tX
|
||||
v.Y = tY
|
||||
v.Z = tZ
|
||||
Case UpAxis.Z
|
||||
v.X = tY
|
||||
v.Y = tZ
|
||||
v.Z = tX
|
||||
End Select
|
||||
newMesh.Vertices.Add(v)
|
||||
|
||||
Case line.StartsWith("vt ")
|
||||
Dim uvstr() As String = line.Substring(3).Split(" "c)
|
||||
Dim uv As New UV With {
|
||||
.U = Convert.ToSingle(uvstr(0)),
|
||||
.V = Convert.ToSingle(uvstr(1))}
|
||||
newMesh.UVs.Add(uv)
|
||||
|
||||
Case line.StartsWith("vn ")
|
||||
Dim splitXYZ() As String = line.Substring(3).Split(" "c)
|
||||
|
||||
Dim tX As Single = Convert.ToSingle(splitXYZ(0))
|
||||
Dim tY As Single = Convert.ToSingle(splitXYZ(1))
|
||||
Dim tZ As Single = Convert.ToSingle(splitXYZ(2))
|
||||
|
||||
Dim n As New Normal
|
||||
Select Case UpAxis
|
||||
Case UpAxis.Y
|
||||
n.X = tX
|
||||
n.Y = tY
|
||||
n.Z = tZ
|
||||
Case UpAxis.Z
|
||||
n.X = tZ
|
||||
n.Y = tY
|
||||
n.Z = tX
|
||||
End Select
|
||||
newMesh.Normals.Add(n)
|
||||
|
||||
Case line.StartsWith("vc ")
|
||||
Dim splitRGB() As String = line.Substring(3).Split(" "c)
|
||||
|
||||
Dim tX As Single = Convert.ToSingle(splitRGB(0))
|
||||
Dim tY As Single = Convert.ToSingle(splitRGB(1))
|
||||
Dim tZ As Single = Convert.ToSingle(splitRGB(2))
|
||||
|
||||
Dim vc As New VertexColor
|
||||
Select Case UpAxis
|
||||
Case UpAxis.Y
|
||||
vc.R = tX
|
||||
vc.G = tY
|
||||
vc.B = tZ
|
||||
Case UpAxis.Z
|
||||
vc.R = tY
|
||||
vc.G = tZ
|
||||
vc.B = tX
|
||||
End Select
|
||||
newMesh.VertexColors.Add(vc)
|
||||
|
||||
Case line.StartsWith("f ")
|
||||
Dim tri As New Face With {.Material = curMaterial}
|
||||
|
||||
For Each xyz As String In line.Substring(2).Split(" "c)
|
||||
xyz = xyz.Trim
|
||||
If xyz = "" Then Continue For
|
||||
|
||||
Dim splitsub() As String = Nothing
|
||||
Dim p As New Point
|
||||
|
||||
Select Case True
|
||||
Case xyz.Contains("/")
|
||||
splitsub = xyz.Split("/"c)
|
||||
Case xyz.Contains("\")
|
||||
splitsub = xyz.Split("\"c)
|
||||
Case Else
|
||||
splitsub = {0, 0, 0}
|
||||
End Select
|
||||
|
||||
Dim v1 As String = splitsub(0)
|
||||
Dim v2 As String = splitsub(1)
|
||||
Dim v3 As String = splitsub(2)
|
||||
|
||||
If v1 <> "" Then
|
||||
p.Vertex = newMesh.Vertices(Convert.ToInt32(v1) - 1)
|
||||
End If
|
||||
|
||||
If v2 <> "" Then
|
||||
p.UV = newMesh.UVs(Convert.ToInt32(v2) - 1)
|
||||
Else
|
||||
Dim newUV As New UV With {.U = 0, .V = 0}
|
||||
p.UV = newUV
|
||||
newMesh.UVs.Add(newUV)
|
||||
End If
|
||||
|
||||
If v3 <> "" Then
|
||||
p.Normal = newMesh.Normals(Convert.ToInt32(v3) - 1)
|
||||
End If
|
||||
|
||||
If splitsub.Count > 3 Then
|
||||
Dim v4 As String = splitsub(3)
|
||||
If v4 <> "" Then p.VertexColor = newMesh.VertexColors(Convert.ToInt32(v4) - 1)
|
||||
End If
|
||||
|
||||
tri.Points.Add(p)
|
||||
Next
|
||||
|
||||
newMesh.Faces.Add(tri)
|
||||
|
||||
End Select
|
||||
|
||||
End If
|
||||
|
||||
Loop
|
||||
newObj.Meshes.Add(newMesh)
|
||||
|
||||
curThread.CurrentCulture = curCultInfo
|
||||
|
||||
srObj.Close()
|
||||
Return newObj
|
||||
End Function
|
||||
|
||||
Public Shared Sub ToFile(FileName As String, obj As Object3D)
|
||||
Dim fs As New FileStream(FileName, FileMode.Create, FileAccess.ReadWrite)
|
||||
Dim sw As New StreamWriter(fs, Text.Encoding.ASCII)
|
||||
|
||||
If obj.Materials.Count > 0 Then
|
||||
Dim mtlName As String = Path.GetFileNameWithoutExtension(FileName) & ".mtl"
|
||||
Dim mtlFile As String = Path.Combine(Path.GetDirectoryName(FileName), mtlName)
|
||||
sw.WriteLine($"mtllib {mtlName}")
|
||||
MaterialLib.ToFile(mtlFile, obj)
|
||||
End If
|
||||
|
||||
Dim curVertCount As Integer = 1
|
||||
Dim curUVCount As Integer = 1
|
||||
Dim curNormCount As Integer = 1
|
||||
Dim curVertColCount As Integer = 1
|
||||
|
||||
For Each m As Mesh In obj.Meshes
|
||||
|
||||
For Each vert As Vertex In m.Vertices
|
||||
sw.WriteLine($"v {vert.X.ToString.Replace(",", ".")} {vert.Y.ToString.Replace(",", ".")} {vert.Z.ToString.Replace(",", ".")}")
|
||||
Next
|
||||
|
||||
For Each uv As UV In m.UVs
|
||||
sw.WriteLine($"vt {uv.U.ToString.Replace(",", ".")} {uv.V.ToString.Replace(",", ".")}")
|
||||
Next
|
||||
|
||||
For Each norm As Normal In m.Normals
|
||||
sw.WriteLine($"vn {norm.X.ToString.Replace(",", ".")} {norm.Y.ToString.Replace(",", ".")} {norm.Z.ToString.Replace(",", ".")}")
|
||||
Next
|
||||
|
||||
For Each vertcol As VertexColor In m.VertexColors
|
||||
sw.WriteLine($"vc {vertcol.R.ToString.Replace(",", ".")} {vertcol.G.ToString.Replace(",", ".")} {vertcol.B.ToString.Replace(",", ".")}")
|
||||
Next
|
||||
|
||||
Dim curMtl As Material = Nothing
|
||||
|
||||
For Each f As Face In m.Faces
|
||||
If curMtl IsNot f.Material Then
|
||||
curMtl = f.Material
|
||||
sw.WriteLine($"usemtl _{GetIndexOfMaterialInList(obj, curMtl)}")
|
||||
End If
|
||||
|
||||
sw.Write("f")
|
||||
|
||||
For Each p As Point In f.Points
|
||||
sw.Write(" ")
|
||||
sw.Write(curVertCount + m.Vertices.IndexOf(p.Vertex))
|
||||
|
||||
sw.Write("/")
|
||||
If p.UV IsNot Nothing Then sw.Write(curUVCount + m.UVs.IndexOf(p.UV))
|
||||
|
||||
sw.Write("/")
|
||||
If p.Normal IsNot Nothing Then sw.Write(curNormCount + m.Normals.IndexOf(p.Normal))
|
||||
|
||||
If m.VertexColors.Count > 0 Then
|
||||
sw.Write("/")
|
||||
If p.VertexColor IsNot Nothing Then sw.Write(curVertColCount + m.VertexColors.IndexOf(p.VertexColor))
|
||||
End If
|
||||
Next
|
||||
|
||||
sw.WriteLine()
|
||||
Next
|
||||
|
||||
curVertCount += m.Vertices.Count
|
||||
curUVCount += m.UVs.Count
|
||||
curNormCount += m.Normals.Count
|
||||
curVertColCount += m.VertexColors.Count
|
||||
Next
|
||||
|
||||
sw.Flush()
|
||||
fs.Close()
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetIndexOfMaterialInList(obj As Object3D, matToFind As Material) As Integer
|
||||
For Index As Integer = 0 To obj.Materials.Count - 1
|
||||
If obj.Materials.ElementAt(Index).Value.Equals(matToFind) Then
|
||||
Return Index
|
||||
End If
|
||||
Next
|
||||
Return -1
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MaterialLib
|
||||
|
||||
Public ReadOnly Property Materials As New Dictionary(Of String, Material)
|
||||
Private ReadOnly LoadedImages As New Dictionary(Of String, Image)
|
||||
|
||||
Public Sub FromFile(fileName As String, LoadMaterials As Boolean)
|
||||
LoadedImages.Clear()
|
||||
|
||||
Dim curMatLibPath As String = Path.GetDirectoryName(fileName)
|
||||
|
||||
Dim curMat As Material = Nothing
|
||||
Dim curName As String = ""
|
||||
|
||||
Dim srMtl As New StreamReader(fileName, Text.Encoding.ASCII)
|
||||
Dim line As String = ""
|
||||
|
||||
Do Until srMtl.EndOfStream
|
||||
line = srMtl.ReadLine
|
||||
|
||||
Select Case True
|
||||
Case line.StartsWith("newmtl ")
|
||||
curMat = New Material
|
||||
curName = line.Substring(7)
|
||||
Materials.Add(curName, curMat)
|
||||
|
||||
Case line.ToLower.StartsWith("kd ")
|
||||
Dim splitColor() As String = line.Substring(3).Split(" "c)
|
||||
Dim col As Color = Color.FromArgb(
|
||||
Convert.ToSingle(Math.Round(255 * splitColor(0))),
|
||||
Convert.ToSingle(Math.Round(255 * splitColor(1))),
|
||||
Convert.ToSingle(Math.Round(255 * splitColor(2))))
|
||||
curMat.Color = col
|
||||
|
||||
Case line.ToLower.StartsWith("d ")
|
||||
curMat.Opacity = Convert.ToSingle(line.Substring(2))
|
||||
|
||||
Case line.ToLower.StartsWith("tr ")
|
||||
curMat.Opacity = 1 - Convert.ToSingle(line.Substring(2))
|
||||
|
||||
Case line.ToLower.StartsWith("map_kd ")
|
||||
If LoadMaterials Then
|
||||
Dim mtlpath As String = line.Substring(7)
|
||||
Dim combipath As String = Path.Combine(curMatLibPath, line.Substring(7))
|
||||
Dim imgfile As String
|
||||
|
||||
If File.Exists(combipath) Then
|
||||
imgfile = combipath
|
||||
ElseIf File.Exists(line.Substring(7)) Then
|
||||
imgfile = mtlpath
|
||||
Else
|
||||
imgfile = ""
|
||||
End If
|
||||
|
||||
If imgfile <> "" Then
|
||||
If LoadedImages.ContainsKey(imgfile) Then
|
||||
curMat.Image = LoadedImages(imgfile)
|
||||
Else
|
||||
Dim fs As New FileStream(imgfile, FileMode.Open, FileAccess.Read)
|
||||
curMat.Image = Image.FromStream(fs)
|
||||
fs.Close()
|
||||
Dim imgExists As Boolean = False
|
||||
For Each kvp In LoadedImages
|
||||
If Not imgExists AndAlso IsTheSameAs(kvp.Value, curMat.Image) Then
|
||||
curMat.Image = kvp.Value
|
||||
imgExists = True
|
||||
End If
|
||||
Next
|
||||
If Not imgExists Then
|
||||
LoadedImages.Add(imgfile, curMat.Image)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Select
|
||||
Loop
|
||||
|
||||
srMtl.Close()
|
||||
End Sub
|
||||
|
||||
Public Shared Sub ToFile(fileName As String, obj As Object3D)
|
||||
Dim fs As New FileStream(fileName, FileMode.Create, FileAccess.ReadWrite)
|
||||
Dim sw As New StreamWriter(fs, Text.Encoding.ASCII)
|
||||
Dim imgDirName As String = Path.GetFileNameWithoutExtension(fileName)
|
||||
Dim imgDirFull As String = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName))
|
||||
|
||||
For Each kvp As KeyValuePair(Of String, Material) In obj.Materials
|
||||
Dim mat As Material = kvp.Value
|
||||
Dim name As String = "_" & ObjFile.GetIndexOfMaterialInList(obj, mat)
|
||||
sw.WriteLine($"newmtl {name}")
|
||||
|
||||
If mat.Color IsNot Nothing Then
|
||||
sw.WriteLine($"kd {mat.Color.Value.R.ToString.Replace(",", ".")} {mat.Color.Value.G.ToString.Replace(",", ".")} {mat.Color.Value.B.ToString.Replace(",", ".")}")
|
||||
End If
|
||||
|
||||
If mat.Opacity IsNot Nothing Then
|
||||
sw.WriteLine($"d {mat.Opacity.Value.ToString.Replace(",", ".")}")
|
||||
End If
|
||||
|
||||
If mat.Image IsNot Nothing Then
|
||||
Dim imgFile As String = name & ".png"
|
||||
|
||||
If Not Directory.Exists(imgDirFull) Then Directory.CreateDirectory(imgDirFull)
|
||||
mat.Image.Save(Path.Combine(imgDirFull, imgFile), Imaging.ImageFormat.Png)
|
||||
|
||||
sw.WriteLine($"map_kd {Path.Combine(imgDirName, imgFile)}")
|
||||
End If
|
||||
Next
|
||||
|
||||
sw.Flush()
|
||||
fs.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
5
Pilz.Simple3DFileParser/Model/Face.vb
Normal file
5
Pilz.Simple3DFileParser/Model/Face.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Public Class Face
|
||||
Public ReadOnly Property Points As New List(Of Point)
|
||||
Public Property Material As Material = Nothing
|
||||
Public Property Tag As Object = Nothing
|
||||
End Class
|
||||
6
Pilz.Simple3DFileParser/Model/Interfaces.vb
Normal file
6
Pilz.Simple3DFileParser/Model/Interfaces.vb
Normal file
@@ -0,0 +1,6 @@
|
||||
Public Interface IToObject3D
|
||||
|
||||
Function ToObject3D() As Object3D
|
||||
Function ToObject3DAsync() As Task(Of Object3D)
|
||||
|
||||
End Interface
|
||||
25
Pilz.Simple3DFileParser/Model/Material.vb
Normal file
25
Pilz.Simple3DFileParser/Model/Material.vb
Normal file
@@ -0,0 +1,25 @@
|
||||
Imports System.Numerics
|
||||
|
||||
Public Class Material
|
||||
Implements IComparable
|
||||
|
||||
Public Property Image As Image = Nothing
|
||||
Public Property Color As Color? = Nothing
|
||||
Public Property Opacity As Single? = Nothing
|
||||
Public Property Wrap As New Vector2(10497, 10497)
|
||||
Public Property Scale As New Vector2(1.0F, 1.0F)
|
||||
Public Property Tag As Object = Nothing
|
||||
|
||||
Public Function CompareTo(obj As Object) As Integer Implements IComparable.CompareTo
|
||||
If obj IsNot Nothing Then
|
||||
If obj Is Me Then
|
||||
Return 0
|
||||
Else
|
||||
Return -1
|
||||
End If
|
||||
Else
|
||||
Return 1
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
41
Pilz.Simple3DFileParser/Model/Mesh.vb
Normal file
41
Pilz.Simple3DFileParser/Model/Mesh.vb
Normal file
@@ -0,0 +1,41 @@
|
||||
Imports System.Numerics
|
||||
|
||||
Public Class Mesh
|
||||
|
||||
Public ReadOnly Property Vertices As New List(Of Vertex)
|
||||
Public ReadOnly Property Normals As New List(Of Normal)
|
||||
Public ReadOnly Property UVs As New List(Of UV)
|
||||
Public ReadOnly Property VertexColors As New List(Of VertexColor)
|
||||
Public ReadOnly Property Faces As New List(Of Face)
|
||||
|
||||
Friend Function GetCenterModelAvg() As Vector3
|
||||
Dim avgX As Integer = 0
|
||||
Dim avgY As Integer = 0
|
||||
Dim avgZ As Integer = 0
|
||||
|
||||
For Each v As Vertex In Vertices
|
||||
avgX += v.X
|
||||
avgY += v.Y
|
||||
avgZ += v.Z
|
||||
Next
|
||||
|
||||
Return New Vector3(avgX, avgY, avgZ)
|
||||
End Function
|
||||
|
||||
Public Sub CenterModel()
|
||||
Dim avg As Vector3 = GetCenterModelAvg()
|
||||
|
||||
avg /= New Vector3(Vertices.Count)
|
||||
|
||||
CenterModel(avg)
|
||||
End Sub
|
||||
|
||||
Public Sub CenterModel(avg As Vector3)
|
||||
For Each v As Vertex In Vertices
|
||||
v.X -= avg.X
|
||||
v.Y -= avg.Y
|
||||
v.Z -= avg.Z
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
11
Pilz.Simple3DFileParser/Model/ModelBoundaries.vb
Normal file
11
Pilz.Simple3DFileParser/Model/ModelBoundaries.vb
Normal file
@@ -0,0 +1,11 @@
|
||||
Imports System.Numerics
|
||||
|
||||
Public Class ModelBoundaries
|
||||
Public ReadOnly Upper As Vector3
|
||||
Public ReadOnly Lower As Vector3
|
||||
|
||||
Public Sub New(upper As Vector3, lower As Vector3)
|
||||
Me.Upper = upper
|
||||
Me.Lower = lower
|
||||
End Sub
|
||||
End Class
|
||||
5
Pilz.Simple3DFileParser/Model/Normal.vb
Normal file
5
Pilz.Simple3DFileParser/Model/Normal.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Public Class Normal
|
||||
Public Property X As Single = 0
|
||||
Public Property Y As Single = 0
|
||||
Public Property Z As Single = 0
|
||||
End Class
|
||||
200
Pilz.Simple3DFileParser/Model/Object3D.vb
Normal file
200
Pilz.Simple3DFileParser/Model/Object3D.vb
Normal file
@@ -0,0 +1,200 @@
|
||||
Imports System.IO
|
||||
Imports System.Numerics
|
||||
|
||||
Public Class Object3D
|
||||
|
||||
Public ReadOnly Property Meshes As New List(Of Mesh)
|
||||
Public ReadOnly Property Materials As New Dictionary(Of String, Material)
|
||||
Public Property Shading As New Shading
|
||||
|
||||
Public Sub ScaleModel(factor As Single)
|
||||
For Each m As Mesh In Meshes
|
||||
For Each v As Vertex In m.Vertices
|
||||
v.X *= factor
|
||||
v.Y *= factor
|
||||
v.Z *= factor
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub OffsetModel(off As Vector3)
|
||||
For Each m As Mesh In Meshes
|
||||
For Each v As Vertex In m.Vertices
|
||||
v.X += off.X
|
||||
v.Y += off.Y
|
||||
v.Z += off.Z
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function GetBoundaries() As ModelBoundaries
|
||||
Dim maxX As Single? = Nothing
|
||||
Dim maxY As Single? = Nothing
|
||||
Dim maxZ As Single? = Nothing
|
||||
Dim minX As Single? = Nothing
|
||||
Dim minY As Single? = Nothing
|
||||
Dim minZ As Single? = Nothing
|
||||
|
||||
For Each m As Mesh In Meshes
|
||||
For Each vert As Vertex In m.Vertices
|
||||
If maxX Is Nothing OrElse vert.X > maxX Then maxX = vert.X
|
||||
If maxY Is Nothing OrElse vert.Y > maxY Then maxY = vert.Y
|
||||
If maxZ Is Nothing OrElse vert.Z > maxZ Then maxZ = vert.Z
|
||||
If minX Is Nothing OrElse vert.X < minX Then minX = vert.X
|
||||
If minY Is Nothing OrElse vert.Y < minY Then minY = vert.Y
|
||||
If minZ Is Nothing OrElse vert.Z < minZ Then minZ = vert.Z
|
||||
Next
|
||||
Next
|
||||
|
||||
If maxX Is Nothing Then maxX = 0
|
||||
If maxY Is Nothing Then maxY = 0
|
||||
If maxZ Is Nothing Then maxZ = 0
|
||||
If minX Is Nothing Then minX = 0
|
||||
If minY Is Nothing Then minY = 0
|
||||
If minZ Is Nothing Then minZ = 0
|
||||
|
||||
Return New ModelBoundaries(New Vector3(maxX, maxY, maxZ),
|
||||
New Vector3(minX, minY, minZ))
|
||||
End Function
|
||||
|
||||
Public Sub SetNullVertices()
|
||||
Dim newVert As New Vertex With {.X = 0, .Y = 0, .Z = 0}
|
||||
Dim nullCounter As Integer
|
||||
|
||||
For Each m As Mesh In Meshes
|
||||
nullCounter = 0
|
||||
|
||||
For Each f As Face In m.Faces
|
||||
For Each p As Point In f.Points
|
||||
If p.Vertex Is Nothing Then
|
||||
p.Vertex = newVert
|
||||
nullCounter += 1
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
If nullCounter > 0 Then
|
||||
m.Vertices.Add(newVert)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub SetNullUVs()
|
||||
Dim newUV As New UV With {.U = 0, .V = 0}
|
||||
Dim nullCounter As Integer
|
||||
|
||||
For Each m As Mesh In Meshes
|
||||
nullCounter = 0
|
||||
|
||||
For Each f As Face In m.Faces
|
||||
For Each p As Point In f.Points
|
||||
If p.UV Is Nothing Then
|
||||
p.UV = newUV
|
||||
nullCounter += 1
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
If nullCounter > 0 Then
|
||||
m.UVs.Add(newUV)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub SetNullNormals()
|
||||
Dim newNormal As New Normal With {.X = 0, .Y = 0, .Z = 1}
|
||||
Dim nullCounter As Integer
|
||||
|
||||
For Each m As Mesh In Meshes
|
||||
nullCounter = 0
|
||||
|
||||
For Each f As Face In m.Faces
|
||||
For Each p As Point In f.Points
|
||||
If p.Normal Is Nothing Then
|
||||
p.Normal = newNormal
|
||||
nullCounter += 1
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
If nullCounter > 0 Then
|
||||
m.Normals.Add(newNormal)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub RemoveUnusedMaterials()
|
||||
'Dim usedMats As New List(Of Material)
|
||||
'Dim unusedMats As New List(Of String)
|
||||
|
||||
'For Each f As Face In Faces
|
||||
' If Not usedMats.Contains(f.Material) Then
|
||||
' usedMats.Add(f.Material)
|
||||
' End If
|
||||
'Next
|
||||
|
||||
'For Each kvp As KeyValuePair(Of String, Material) In Materials
|
||||
' If Not usedMats.Contains(kvp.Value) Then
|
||||
' unusedMats.Add(kvp.Key)
|
||||
' End If
|
||||
'Next
|
||||
|
||||
'For Each k As String In unusedMats
|
||||
' Materials.Remove(k)
|
||||
'Next
|
||||
End Sub
|
||||
|
||||
Public Function ToOneMesh() As Object3D
|
||||
Dim newObject3D As New Object3D
|
||||
Dim newMesh As New Mesh
|
||||
|
||||
For Each mat As KeyValuePair(Of String, Material) In Materials
|
||||
newObject3D.Materials.Add(mat.Key, mat.Value)
|
||||
Next
|
||||
|
||||
For Each m As Mesh In Meshes
|
||||
For Each v As Vertex In m.Vertices
|
||||
newMesh.Vertices.Add(v)
|
||||
Next
|
||||
|
||||
For Each vc As VertexColor In m.VertexColors
|
||||
newMesh.VertexColors.Add(vc)
|
||||
Next
|
||||
|
||||
For Each n As Normal In m.Normals
|
||||
newMesh.Normals.Add(n)
|
||||
Next
|
||||
|
||||
For Each uv As UV In m.UVs
|
||||
newMesh.UVs.Add(uv)
|
||||
Next
|
||||
|
||||
For Each f As Face In m.Faces
|
||||
newMesh.Faces.Add(f)
|
||||
Next
|
||||
Next
|
||||
|
||||
newObject3D.Meshes.Add(newMesh)
|
||||
Return newObject3D
|
||||
End Function
|
||||
|
||||
Public Sub CenterModel()
|
||||
Dim avg As Vector3 = Vector3.Zero
|
||||
Dim vertsCount As ULong = 0
|
||||
|
||||
For Each m As Mesh In Meshes
|
||||
avg += m.GetCenterModelAvg
|
||||
vertsCount += m.Vertices.Count
|
||||
Next
|
||||
|
||||
avg /= vertsCount
|
||||
|
||||
CenterModel(avg)
|
||||
End Sub
|
||||
Public Sub CenterModel(avg As Vector3)
|
||||
For Each m As Mesh In Meshes
|
||||
m.CenterModel(avg)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
6
Pilz.Simple3DFileParser/Model/Point.vb
Normal file
6
Pilz.Simple3DFileParser/Model/Point.vb
Normal file
@@ -0,0 +1,6 @@
|
||||
Public Class Point
|
||||
Public Property Vertex As Vertex = Nothing
|
||||
Public Property UV As UV = Nothing
|
||||
Public Property VertexColor As VertexColor = Nothing
|
||||
Public Property Normal As Normal = Nothing
|
||||
End Class
|
||||
5
Pilz.Simple3DFileParser/Model/Shading.vb
Normal file
5
Pilz.Simple3DFileParser/Model/Shading.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Public Class Shading
|
||||
Public Property AmbientColor As Color = Color.FromArgb(&HFFFFFFFF)
|
||||
Public Property DiffuseColor As Color = Color.FromArgb(&HFF7F7F7F)
|
||||
Public Property DiffusePosition As Vertex = Nothing
|
||||
End Class
|
||||
4
Pilz.Simple3DFileParser/Model/UV.vb
Normal file
4
Pilz.Simple3DFileParser/Model/UV.vb
Normal file
@@ -0,0 +1,4 @@
|
||||
Public Class UV
|
||||
Public Property U As Single = 0
|
||||
Public Property V As Single = 0
|
||||
End Class
|
||||
4
Pilz.Simple3DFileParser/Model/UpAxis.vb
Normal file
4
Pilz.Simple3DFileParser/Model/UpAxis.vb
Normal file
@@ -0,0 +1,4 @@
|
||||
Public Enum UpAxis
|
||||
Y
|
||||
Z
|
||||
End Enum
|
||||
5
Pilz.Simple3DFileParser/Model/Vertex.vb
Normal file
5
Pilz.Simple3DFileParser/Model/Vertex.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Public Class Vertex
|
||||
Public Property X As Double = 0
|
||||
Public Property Y As Double = 0
|
||||
Public Property Z As Double = 0
|
||||
End Class
|
||||
6
Pilz.Simple3DFileParser/Model/VertexColor.vb
Normal file
6
Pilz.Simple3DFileParser/Model/VertexColor.vb
Normal file
@@ -0,0 +1,6 @@
|
||||
Public Class VertexColor
|
||||
Public Property R As Single = 1
|
||||
Public Property G As Single = 1
|
||||
Public Property B As Single = 1
|
||||
Public Property A As Single = 1
|
||||
End Class
|
||||
13
Pilz.Simple3DFileParser/My Project/Application.Designer.vb
generated
Normal file
13
Pilz.Simple3DFileParser/My Project/Application.Designer.vb
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
11
Pilz.Simple3DFileParser/My Project/Application.myapp
Normal file
11
Pilz.Simple3DFileParser/My Project/Application.myapp
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>Form1</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>0</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
35
Pilz.Simple3DFileParser/My Project/AssemblyInfo.vb
Normal file
35
Pilz.Simple3DFileParser/My Project/AssemblyInfo.vb
Normal file
@@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("SimpleFileParser")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Pilzinsel64")>
|
||||
<Assembly: AssemblyProduct("SM64 ROM Manager")>
|
||||
<Assembly: AssemblyCopyright("Copyright © Pilzinsel64 2018")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("21610485-a96f-4808-bf2e-bbf06c65eba1")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
63
Pilz.Simple3DFileParser/My Project/Resources.Designer.vb
generated
Normal file
63
Pilz.Simple3DFileParser/My Project/Resources.Designer.vb
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Pilz.S3DFileParser.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
117
Pilz.Simple3DFileParser/My Project/Resources.resx
Normal file
117
Pilz.Simple3DFileParser/My Project/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
73
Pilz.Simple3DFileParser/My Project/Settings.Designer.vb
generated
Normal file
73
Pilz.Simple3DFileParser/My Project/Settings.Designer.vb
generated
Normal file
@@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Automatische My.Settings-Speicherfunktion"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.Pilz.S3DFileParser.My.MySettings
|
||||
Get
|
||||
Return Global.Pilz.S3DFileParser.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
7
Pilz.Simple3DFileParser/My Project/Settings.settings
Normal file
7
Pilz.Simple3DFileParser/My Project/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
14
Pilz.Simple3DFileParser/Other/Exceptions.vb
Normal file
14
Pilz.Simple3DFileParser/Other/Exceptions.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Namespace Exceptions
|
||||
|
||||
Public Class MaterialException
|
||||
Inherits Exception
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New
|
||||
End Sub
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
26
Pilz.Simple3DFileParser/Other/Extensions.vb
Normal file
26
Pilz.Simple3DFileParser/Other/Extensions.vb
Normal file
@@ -0,0 +1,26 @@
|
||||
Imports System.IO
|
||||
Imports System.Runtime.CompilerServices
|
||||
|
||||
Friend Module Extensions
|
||||
|
||||
<Extension>
|
||||
Public Function GetPropertyValue(base As Object, propertyName As String) As Object
|
||||
Return base?.GetType.GetProperty(propertyName, Reflection.BindingFlags.Public Or Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.Static)?.GetValue(base)
|
||||
End Function
|
||||
|
||||
<Extension>
|
||||
Public Function IsTheSameAs(base As Bitmap, image As Bitmap) As Boolean
|
||||
If base.Size <> image.Size Then Return False
|
||||
|
||||
For y As Integer = 0 To base.Height - 1
|
||||
For x As Integer = 0 To base.Width - 1
|
||||
Dim p1 As Color = base.GetPixel(x, y)
|
||||
Dim p2 As Color = image.GetPixel(x, y)
|
||||
If p1 <> p2 Then Return False
|
||||
Next
|
||||
Next
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Module
|
||||
144
Pilz.Simple3DFileParser/Other/LoaderModule.vb
Normal file
144
Pilz.Simple3DFileParser/Other/LoaderModule.vb
Normal file
@@ -0,0 +1,144 @@
|
||||
Imports System.Reflection
|
||||
Imports Assimp.Unmanaged
|
||||
|
||||
Public Class File3DLoaderModule
|
||||
|
||||
Public Delegate Function LoaderAction(fileName As String, options As LoaderOptions) As Object3D
|
||||
Public Delegate Sub ExporterAction(obj As Object3D, fileName As String)
|
||||
|
||||
Private Shared _LoaderModules As File3DLoaderModule() = Nothing
|
||||
Private Shared _ExporterModules As File3DLoaderModule() = Nothing
|
||||
|
||||
Private ReadOnly method As [Delegate] = Nothing
|
||||
Public ReadOnly Property Name As String
|
||||
Public ReadOnly Property SupportedFormats As IReadOnlyDictionary(Of String, String)
|
||||
|
||||
Public Sub New(name As String, method As LoaderAction, supportedFormats As IReadOnlyDictionary(Of String, String))
|
||||
Me.Name = name
|
||||
Me.method = method
|
||||
Me.SupportedFormats = supportedFormats
|
||||
End Sub
|
||||
|
||||
Public Sub New(name As String, method As ExporterAction, supportedFormats As IReadOnlyDictionary(Of String, String))
|
||||
Me.Name = name
|
||||
Me.method = method
|
||||
Me.SupportedFormats = supportedFormats
|
||||
End Sub
|
||||
|
||||
Public Function InvokeAsync(obj As Object3D, fileName As String) As Task
|
||||
Return Task.Run(Sub() Invoke(obj, fileName))
|
||||
End Function
|
||||
|
||||
Public Sub Invoke(obj As Object3D, fileName As String)
|
||||
method.Method.Invoke(Nothing, {obj, fileName})
|
||||
End Sub
|
||||
|
||||
Public Function InvokeAsync(fileName As String, options As LoaderOptions) As Task(Of Object3D)
|
||||
Return Task.Run(Function() Invoke(fileName, options))
|
||||
End Function
|
||||
|
||||
Public Function Invoke(fileName As String, options As LoaderOptions) As Object3D
|
||||
Return method.Method.Invoke(Nothing, {fileName, options})
|
||||
End Function
|
||||
|
||||
Public Shared ReadOnly Property LoaderModules As File3DLoaderModule()
|
||||
Get
|
||||
If _LoaderModules Is Nothing Then
|
||||
_LoaderModules = GetLoaderModules()
|
||||
End If
|
||||
Return _LoaderModules
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared ReadOnly Property ExporterModules As File3DLoaderModule()
|
||||
Get
|
||||
If _ExporterModules Is Nothing Then
|
||||
_ExporterModules = GetExporterModules()
|
||||
End If
|
||||
Return _ExporterModules
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Shared Function GetLoaderModules() As File3DLoaderModule()
|
||||
Dim list As New List(Of File3DLoaderModule)
|
||||
|
||||
list.Add(New File3DLoaderModule("Simple File Parser",
|
||||
AddressOf LoadViaSimpleFileParser,
|
||||
New Dictionary(Of String, String) From {{"obj", "OBJ"}}))
|
||||
|
||||
AssimpModule.AssimpLoader.LoadAssimpLibs()
|
||||
Dim exts As New Dictionary(Of String, String)
|
||||
For Each fd As Assimp.ExportFormatDescription In AssimpLibrary.Instance.GetExportFormatDescriptions
|
||||
If Not exts.ContainsKey(fd.FileExtension) Then exts.Add(fd.FileExtension, fd.FormatId & " - " & fd.Description)
|
||||
Next
|
||||
|
||||
list.Add(New File3DLoaderModule("Assimp",
|
||||
AddressOf LoadViaAssimp,
|
||||
exts))
|
||||
|
||||
list.Add(New File3DLoaderModule("Aspose.3D",
|
||||
AddressOf LoadViaAspose3D,
|
||||
New Dictionary(Of String, String) From {
|
||||
{"obj", "OBJ"},
|
||||
{"dae", "DAE"},
|
||||
{"fbx", "FBX"},
|
||||
{"stl", "STL"},
|
||||
{"3ds", "3DS"},
|
||||
{"3d", "3D"},
|
||||
{"gltf", "glTF"},
|
||||
{"drc", "DRC"},
|
||||
{"rvm", "RVM"},
|
||||
{"pdf", "PDF"},
|
||||
{"x", "X"},
|
||||
{"jt", "JT"},
|
||||
{"dfx", "DFX"},
|
||||
{"ply", "PLY"},
|
||||
{"3mf", "3MF"},
|
||||
{"ase", "ASE"}}))
|
||||
|
||||
Return list.ToArray
|
||||
End Function
|
||||
|
||||
Private Shared Function GetExporterModules() As File3DLoaderModule()
|
||||
Dim list As New List(Of File3DLoaderModule)
|
||||
|
||||
list.Add(New File3DLoaderModule("Simple File Parser",
|
||||
AddressOf ExportViaSimpleFileParser,
|
||||
New Dictionary(Of String, String) From {{"obj", "OBJ"}}))
|
||||
|
||||
AssimpModule.AssimpLoader.LoadAssimpLibs()
|
||||
Dim exts As New Dictionary(Of String, String)
|
||||
For Each fd As Assimp.ExportFormatDescription In AssimpLibrary.Instance.GetExportFormatDescriptions
|
||||
If Not exts.ContainsKey(fd.FileExtension) Then exts.Add(fd.FileExtension, fd.FormatId & " - " & fd.Description)
|
||||
Next
|
||||
|
||||
list.Add(New File3DLoaderModule("Assimp",
|
||||
AddressOf ExportViaAssimp,
|
||||
exts))
|
||||
|
||||
Return list.ToArray
|
||||
End Function
|
||||
|
||||
Private Shared Function LoadViaSimpleFileParser(fileName As String, options As LoaderOptions) As Object3D
|
||||
Return ObjModule.ObjFile.FromFile(fileName, options.LoadMaterials, options.UpAxis)
|
||||
End Function
|
||||
|
||||
Private Shared Function LoadViaAssimp(fileName As String, options As LoaderOptions) As Object3D
|
||||
AssimpModule.AssimpLoader.LoadAssimpLibs()
|
||||
Return AssimpModule.AssimpLoader.FromFile(fileName, options.LoadMaterials, options.UpAxis)
|
||||
End Function
|
||||
|
||||
Private Shared Function LoadViaAspose3D(fileName As String, options As LoaderOptions) As Object3D
|
||||
Return Aspose3DModule.Aspose3DLoader.FromFile(fileName, options.LoadMaterials, options.UpAxis)
|
||||
End Function
|
||||
|
||||
Private Shared Sub ExportViaSimpleFileParser(o As Object3D, fileName As String)
|
||||
ObjModule.ObjFile.ToFile(fileName, o)
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ExportViaAssimp(o As Object3D, fileName As String)
|
||||
AssimpModule.AssimpLoader.LoadAssimpLibs()
|
||||
AssimpModule.AssimpLoader.ToFile(fileName, o)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
14
Pilz.Simple3DFileParser/Other/LoaderOptions.vb
Normal file
14
Pilz.Simple3DFileParser/Other/LoaderOptions.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Public Class LoaderOptions
|
||||
|
||||
Public Property LoadMaterials As Boolean = False
|
||||
Public Property UpAxis As UpAxis = False
|
||||
|
||||
Public Sub New()
|
||||
End Sub
|
||||
|
||||
Public Sub New(loadMaterials As Boolean, upAxis As UpAxis)
|
||||
Me.LoadMaterials = loadMaterials
|
||||
Me.UpAxis = upAxis
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
154
Pilz.Simple3DFileParser/Pilz.Simple3DFileParser.vbproj
Normal file
154
Pilz.Simple3DFileParser/Pilz.Simple3DFileParser.vbproj
Normal file
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AC955819-7910-450C-940C-7C1989483D4B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<RootNamespace>Pilz.S3DFileParser</RootNamespace>
|
||||
<AssemblyName>Pilz.Simple3DFileParser</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>Pilz.Simple3DFileParser.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>Pilz.Simple3DFileParser.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Aspose.3D, Version=18.4.0.0, Culture=neutral, PublicKeyToken=f071c641d0b4582b, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Aspose.3D.18.4.0\lib\net40\Aspose.3D.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AssimpNet, Version=3.3.2.0, Culture=neutral, PublicKeyToken=0d51b391f59f42a6, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Shared Libs\AssimpNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ColladaSchema">
|
||||
<HintPath>..\..\..\DLL's\ColladaSchema.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\portable-net45+win8+wp8+wpa81\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Drawing" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows.Forms" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Model\Face.vb" />
|
||||
<Compile Include="Model\Material.vb" />
|
||||
<Compile Include="Model\Mesh.vb" />
|
||||
<Compile Include="Model\ModelBoundaries.vb" />
|
||||
<Compile Include="Model\Normal.vb" />
|
||||
<Compile Include="Model\Point.vb" />
|
||||
<Compile Include="Model\Shading.vb" />
|
||||
<Compile Include="Model\UpAxis.vb" />
|
||||
<Compile Include="Model\UV.vb" />
|
||||
<Compile Include="Model\Vertex.vb" />
|
||||
<Compile Include="Model\VertexColor.vb" />
|
||||
<Compile Include="Other\LoaderModule.vb" />
|
||||
<Compile Include="FileParser\Aspose3DLoader.vb" />
|
||||
<Compile Include="FileParser\AssimpLoader.vb" />
|
||||
<Compile Include="Other\Extensions.vb" />
|
||||
<Compile Include="Model\Interfaces.vb" />
|
||||
<Compile Include="Model\Object3D.vb" />
|
||||
<Compile Include="Other\Exceptions.vb" />
|
||||
<Compile Include="FileParser\Obj.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Other\LoaderOptions.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Pilz.LicenseHelper\Pilz.LicenseHelper.csproj">
|
||||
<Project>{67593ff7-c1d1-4529-98c4-61cbd0615f08}</Project>
|
||||
<Name>Pilz.LicenseHelper</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
5
Pilz.Simple3DFileParser/packages.config
Normal file
5
Pilz.Simple3DFileParser/packages.config
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Aspose.3D" version="18.4.0" targetFramework="net45" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user