Commit 0cefbfd1 authored by Mike Kremer's avatar Mike Kremer

Added length and vector functions to get edge's length and convert it to a vector.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@221 66977474-1d4b-4f09-8fe9-267525286df2
parent 847e701f
......@@ -133,6 +133,18 @@ public:
TopologyKernelT::clear(_clearProps);
}
typename PointT::value_type length(const EdgeHandle& _eh) const {
const Edge& e = TopologyKernelT::edge(_eh);
return (vertex(e.to_vertex()) - vertex(e.from_vertex())).length();
}
PointT vector(const EdgeHandle& _eh) const {
const Edge& e = TopologyKernelT::edge(_eh);
return (vertex(e.to_vertex()) - vertex(e.from_vertex()));
}
PointT barycenter(const EdgeHandle& _eh) const {
return PointT(0.5 * vertex(TopologyKernelT::edge(_eh).from_vertex()) +
0.5 * vertex(TopologyKernelT::edge(_eh).to_vertex()));
......
Markdown is supported
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