| 182 | } |
| 183 | |
| 184 | bool Polygon::thickenLine(const double thickness) |
| 185 | { |
| 186 | if (vertices_.size() != 2) return false; |
| 187 | const Vector connection(vertices_[1] - vertices_[0]); |
| 188 | const Vector orthogonal = thickness * Vector(connection.y(), -connection.x()).normalized(); |
| 189 | std::vector<Position> newVertices; |
| 190 | newVertices.reserve(4); |
| 191 | newVertices.push_back(vertices_[0] + orthogonal); |
| 192 | newVertices.push_back(vertices_[0] - orthogonal); |
| 193 | newVertices.push_back(vertices_[1] - orthogonal); |
| 194 | newVertices.push_back(vertices_[1] + orthogonal); |
| 195 | vertices_ = newVertices; |
| 196 | return true; |
| 197 | } |
| 198 | |
| 199 | bool Polygon::offsetInward(const double margin) |
| 200 | { |
nothing calls this directly
no outgoing calls
no test coverage detected