75 } |
75 } |
76 |
76 |
77 QVector<LDPolygon> LDCylinder::rasterizePolygons(DocumentManager* context, Winding winding) |
77 QVector<LDPolygon> LDCylinder::rasterizePolygons(DocumentManager* context, Winding winding) |
78 { |
78 { |
79 Model cylinderBody {context}; |
79 Model cylinderBody {context}; |
80 buildPrimitiveBody(cylinderBody, winding); |
80 buildPrimitiveBody(cylinderBody); |
81 QVector<LDPolygon> result; |
81 QVector<LDPolygon> result; |
|
82 bool cachedShouldInvert = shouldInvert(winding, context); |
82 |
83 |
83 for (LDObject* object : cylinderBody.objects()) |
84 for (LDObject* object : cylinderBody.objects()) |
84 { |
85 { |
85 for (int i = 0; i < object->numVertices(); i += 1) |
86 for (int i = 0; i < object->numVertices(); i += 1) |
86 { |
87 { |
103 } |
104 } |
104 |
105 |
105 return result; |
106 return result; |
106 } |
107 } |
107 |
108 |
108 void LDCylinder::buildPrimitiveBody(Model& model, Winding winding) const |
109 void LDCylinder::buildPrimitiveBody(Model& model) const |
109 { |
110 { |
110 PrimitiveModel primitive; |
111 PrimitiveModel primitive; |
111 primitive.type = PrimitiveModel::Cylinder; |
112 primitive.type = PrimitiveModel::Cylinder; |
112 primitive.segments = m_segments; |
113 primitive.segments = m_segments; |
113 primitive.divisions = m_divisions; |
114 primitive.divisions = m_divisions; |
114 primitive.ringNumber = 0; |
115 primitive.ringNumber = 0; |
115 primitive.generateCylinder(model, winding); |
116 primitive.generateCylinder(model); |
116 } |
117 } |
117 |
118 |
118 QString LDCylinder::objectListText() const |
119 QString LDCylinder::objectListText() const |
119 { |
120 { |
120 QString result = format("Cylinder %1 %2, (", m_segments / m_divisions, position().toString(true)); |
121 QString result = format("Cylinder %1 %2, (", m_segments / m_divisions, position().toString(true)); |