mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: meshTools: Add functions to write lines and vectors to .obj files
This commit is contained in:
@ -215,6 +215,39 @@ void Foam::meshTools::writeOBJ
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::meshTools::writeOBJ
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const point& p1,
|
||||||
|
const point& p2,
|
||||||
|
label& count
|
||||||
|
)
|
||||||
|
{
|
||||||
|
os << "v" << ' ' << p1.x() << ' ' << p1.y() << ' ' << p1.z() << endl;
|
||||||
|
os << "v" << ' ' << p2.x() << ' ' << p2.y() << ' ' << p2.z() << endl;
|
||||||
|
|
||||||
|
os << "l" << " " << (count + 1) << " " << (count + 2) << endl;
|
||||||
|
|
||||||
|
count += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::meshTools::writeOBJ
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const point& p1,
|
||||||
|
const point& p2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
os << "v" << ' ' << p1.x() << ' ' << p1.y() << ' ' << p1.z() << endl;
|
||||||
|
|
||||||
|
os << "vn"
|
||||||
|
<< ' ' << p2.x() - p1.x()
|
||||||
|
<< ' ' << p2.y() - p1.y()
|
||||||
|
<< ' ' << p2.z() - p1.z() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::meshTools::writeOBJ
|
void Foam::meshTools::writeOBJ
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
|
|||||||
@ -107,6 +107,24 @@ namespace meshTools
|
|||||||
const point& pt
|
const point& pt
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Write obj representation of a line connecting two points
|
||||||
|
// Need to keep track of points that have been added. count starts at 0
|
||||||
|
void writeOBJ
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const point& p1,
|
||||||
|
const point& p2,
|
||||||
|
label& count
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Write obj representation of a point p1 with a vector from p1 to p2
|
||||||
|
void writeOBJ
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const point& p1,
|
||||||
|
const point& p2
|
||||||
|
);
|
||||||
|
|
||||||
//- Write obj representation of faces subset
|
//- Write obj representation of faces subset
|
||||||
void writeOBJ
|
void writeOBJ
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user