Skip to content
Snippets Groups Projects
Commit 8980559e authored by laurence's avatar laurence
Browse files

ENH: meshTools: Add functions to write lines and vectors to .obj files

parent dfac3204
Branches
Tags
No related merge requests found
......@@ -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
(
Ostream& os,
......
......@@ -107,6 +107,24 @@ namespace meshTools
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
void writeOBJ
(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment