Sunday 16 December 2018

If you use plugins from series of post about 'circle based plugins' (CreateCircle, CreateCircleSector, CreateCircleSegment etc.) or you look at source code - you will spot some drawbacks:
  • new features (polygons) might be added to layer that is in Layer Panel
  • duplication of code:
    • creating inner and outer arc - it can be done in function
    • calculation points (start and end of arc) can be done simpler (function, class)
  • lack of some precondition checking:
    • missing validation if radius is greater then 0, 
    • missing validation if outer radius is greater then inner radius 
    • missing validation if bearings from and to are not equal
  •  if we have to create a lot of such polygons it would be convenient to create them in one layer and using one plugins, in which we could choose what kind of polygon we need

No comments:

Post a Comment