232 else { |
232 else { |
233 return glm::vec2{s2.x(), s2.y()}; |
233 return glm::vec2{s2.x(), s2.y()}; |
234 } |
234 } |
235 }; |
235 }; |
236 const glm::vec3 zvec = this->gridMatrix[2]; |
236 const glm::vec3 zvec = this->gridMatrix[2]; |
237 { |
237 if (this->inputPolygon.bufferSize() >= 3) { |
238 const glm::vec2 p1 = extremity(this->inputPolygon[0] + zvec); |
238 const glm::vec2 p1 = extremity(this->inputPolygon[0] + zvec); |
239 const glm::vec2 p2 = extremity(this->inputPolygon[0] - zvec); |
239 const glm::vec2 p2 = extremity(this->inputPolygon[0] - zvec); |
240 const glm::vec2 lateral = glm::normalize(glm::mat2{{0, 1}, {-1, 0}} * (p2 - p1)); |
240 const glm::vec2 lateral = glm::normalize(glm::mat2{{0, 1}, {-1, 0}} * (p2 - p1)); |
241 painter->setPen(QPen{Qt::white, 3}); |
241 painter->setPen(QPen{Qt::white, 3}); |
242 painter->drawLine(vecToQPoint(p1), vecToQPoint(p2)); |
242 painter->drawLine(vecToQPoint(p1), vecToQPoint(p2)); |
246 const QPointF s_notchcenter = this->renderer->modelToScreenCoordinates(notch); |
246 const QPointF s_notchcenter = this->renderer->modelToScreenCoordinates(notch); |
247 const QPointF notch_s1 = s_notchcenter + notchsize * 0.5f * vecToQPoint(lateral); |
247 const QPointF notch_s1 = s_notchcenter + notchsize * 0.5f * vecToQPoint(lateral); |
248 const QPointF notch_s2 = s_notchcenter - notchsize * 0.5f * vecToQPoint(lateral); |
248 const QPointF notch_s2 = s_notchcenter - notchsize * 0.5f * vecToQPoint(lateral); |
249 painter->drawLine(notch_s1, notch_s2); |
249 painter->drawLine(notch_s1, notch_s2); |
250 } |
250 } |
251 } |
|
252 if (this->inputPolygon.polygonSize() >= 3) { |
|
253 const opt<float> height = this->cylinderHeight(); |
251 const opt<float> height = this->cylinderHeight(); |
254 if (height.has_value()) { |
252 if (height.has_value()) { |
255 const glm::vec3 heightvec = height.value_or(0) * zvec; |
253 const glm::vec3 heightvec = height.value_or(0) * zvec; |
256 const glm::vec3 p = this->inputPolygon[1] + 0.5f * heightvec; |
254 const glm::vec3 p = this->inputPolygon[1] + 0.5f * heightvec; |
257 QFont font{}; |
255 QFont font{}; |