mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: OBJedgeFormat: support 2 vertex faces (blender)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -141,8 +141,6 @@ bool Foam::fileFormats::OBJedgeFormat::read(const fileName& filename)
|
||||
}
|
||||
else if (cmd == "l")
|
||||
{
|
||||
edge edgeRead;
|
||||
|
||||
// Assume 'l' is followed by space.
|
||||
string::size_type endNum = 1;
|
||||
|
||||
@ -164,6 +162,33 @@ bool Foam::fileFormats::OBJedgeFormat::read(const fileName& filename)
|
||||
dynEdges.append(edgeRead);
|
||||
}
|
||||
}
|
||||
else if (cmd == "f")
|
||||
{
|
||||
// Support for faces with 2 vertices
|
||||
|
||||
// Assume 'f' is followed by space.
|
||||
string::size_type endNum = 1;
|
||||
|
||||
readVertices
|
||||
(
|
||||
line,
|
||||
endNum,
|
||||
dynVertices
|
||||
);
|
||||
|
||||
if (dynVertices.size() == 2)
|
||||
{
|
||||
for (label i = 1; i < dynVertices.size(); i++)
|
||||
{
|
||||
edge edgeRead(dynVertices[i-1], dynVertices[i]);
|
||||
|
||||
dynUsedPoints[edgeRead[0]] = edgeRead[0];
|
||||
dynUsedPoints[edgeRead[1]] = edgeRead[1];
|
||||
|
||||
dynEdges.append(edgeRead);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// cull unused points
|
||||
|
||||
Reference in New Issue
Block a user