MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / SaveMeshAsOBJSimple

Function SaveMeshAsOBJSimple

Source/URLab/Public/Utils/MeshUtils.h:52–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51template <typename VertexType, typename IndexType>
52int SaveMeshAsOBJSimple(const FString& FilePath, const Chaos::TArrayCollectionArray<VertexType>& Vertices,
53 const TArray<Chaos::TVector<IndexType, 3>>& Indices)
54{
55 FString OutputString;
56
57 // Write vertices
58 for (const auto& Vertex : Vertices)
59 {
60 OutputString += FString::Printf(TEXT("v %f %f %f\n"), Vertex.X / 100, -Vertex.Y / 100, Vertex.Z / 100);
61 }
62
63 // Write indices
64 for (const auto& Index : Indices)
65 {
66 OutputString += FString::Printf(TEXT("f %d %d %d\n"), Index.Z + 1, Index.Y + 1, Index.X + 1);
67 }
68
69 return FFileHelper::SaveStringToFile(OutputString, *FilePath) ? 1 : 0;
70}
71
72template <typename VertexType, typename IndexType>
73int SaveMeshAsOBJComplex(const FString& FilePath, const Chaos::TArrayCollectionArray<VertexType>& Vertices,

Callers 1

SaveMeshFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected