mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Only use triangles to calculate the mesh bounding box.
This commit is contained in:
parent
6f940a473e
commit
5c1cfa4bc9
1 changed files with 12 additions and 3 deletions
|
@ -1393,10 +1393,19 @@ lcMesh* lcPiecesLibrary::CreateMesh(PieceInfo* Info, lcLibraryMeshData& MeshData
|
|||
|
||||
DstVertex.Position = lcVector3LDrawToLeoCAD(SrcVertex.Position);
|
||||
DstVertex.Normal = lcPackNormal(lcVector3LDrawToLeoCAD(SrcVertex.Normal));
|
||||
}
|
||||
|
||||
lcVector3& Position = DstVertex.Position;
|
||||
Min = lcMin(Min, Position);
|
||||
Max = lcMax(Max, Position);
|
||||
for (const lcLibraryMeshSection* Section : MeshData.mSections[MeshDataIdx])
|
||||
{
|
||||
if (Section->mPrimitiveType != LC_MESH_TRIANGLES)
|
||||
continue;
|
||||
|
||||
for (quint32 Index : Section->mIndices)
|
||||
{
|
||||
lcVector3 Position = lcVector3LDrawToLeoCAD(Vertices[Index].Position);
|
||||
Min = lcMin(Min, Position);
|
||||
Max = lcMax(Max, Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue