Thu 21 Jun 2012 11:06:20 PM UTC, comment #3:
The Arc was not intended to be 2D, but I needed it for the DXF tools. It would be good to have an implementation that is 3D, but allows many different ways to initialize it. We also should try to make it consistent with the other curve types. Thus the points should probably be stored as
self.coords = [startpoint, center, endpoint]
This is the same like e.g. a BezierSpline(degree=2). The middle point is a control point that defines how the curve looks like.
Thus PolyLine([P0,P1,P2]), BezierSpline([P0,P1,P2]) and Arc([P0,P1,P2]) would all be curves starting in P0 and ending in P2.
But it is more complex than it looks (that's why we now still have a mess with Arc and Arc3).
Problems I see for now:
1. In 3D there is no unique way to define the zero value for angles like there is in the x-y plane (and parallel planes). Thus computing the angle range from the points may be disappointing.
2. As Arc is derived from Geometry, one can transform the curve. The transformed curve should however either remain an Arc (then we have to limit the possible transformations) or return an object of some other class.
So maybe we will have to go for an implementation that looks like this:
[center point, start point, normal vector, opening angle]
or maybe first define an EllipticArc using
[center point, start point, end point, normal vector]
and declaring Arc a specialisation that checks if start and end points are at same distance of center.
|