From: Krzysztof K. <twe...@gm...> - 2014-03-23 17:47:32
|
2014-03-23 18:05 GMT+01:00 Nathan Hurst <nj...@nj...>: > I agree, I've always disliked H/VLine, but on the other hand, it is > very important that we can directly represent all svg paths. This was > actually one of the motivators for 2geom in the first place. > > Is there another way which would allow affine transforms to fail > gracefully if one of the curves in a path were not transformable? > This is a place where I would use exceptions in python, but C++ > exceptions are somewhat unpopular IIRC. Throwing an exception when a H/VLine is found during a transform is a terrible idea, and defeats the whole point of having an operator*=(Affine const &) function. Instead, the LineSegment could contain a flag set at construction that says whether it was constructed as a hline or a vline. Note that strictly speaking we cannot losslessly represent all SVG paths, because in 2Geom all paths are in absolute coordinates and there is no direct representation for the "S" and "T" operators. Regards, Krzysztof |