There used to be an easy way to obtain coordinates of endpoints of a linear edge:
No that's not correct. With the old behaviour where from an edge a LineSegment instead of an infinite Line was returned it's not necessarily true that the segment's start point is coincident the edge's start vertex because it also depends on the edge's orientation.
A reliable way to determine the start vertex is to check its orientation: if it is set to
forward then it's the start vertex, if it's set to
reversed then it's the end vertex.
For more information have a look at this thread:
https://forum.freecadweb.org/viewtopic.php?t=18204
Based on Yorik's example I have put together this code snippet which must be tested with 0.16 (or the setting to activate the old behaviour)
Code: Select all
b = Part.makeBox(2,2,2)
b.Edges[2].Orientation # => Reversed
b.Edges[2].Curve # => <Line (0,2,0) (0,2,2) >
b.Edges[2].Vertexes[0].Point, b.Edges[2].Vertexes[0].Orientation # => (Vector (0.0, 2.0, 2.0), 'Forward')
b.Edges[2].Vertexes[1].Point, b.Edges[2].Vertexes[1].Orientation # => (Vector (0.0, 2.0, 0.0), 'Reversed')
In this case the line's start point is (0,2,0) but the edge's start vertex is (0,2,2)