| 204 | } |
| 205 | |
| 206 | Primitive* SimpleTextBuilder::buildPrimitive() const |
| 207 | { |
| 208 | auto* ph=new Polyhedron(); |
| 209 | ph->setType(PrimitiveTypes::Lines); |
| 210 | |
| 211 | int n=0; |
| 212 | decimal x=location.x(); |
| 213 | decimal y=location.y(); |
| 214 | decimal z=location.z(); |
| 215 | for(QChar c: text) { |
| 216 | const Letter ch=characters->value(c); |
| 217 | for(const auto& p: ch) { |
| 218 | Polygon& pg=ph->createPolygon(); |
| 219 | for(const auto& pt: p) { |
| 220 | decimal cx=pt.x(); |
| 221 | decimal cy=pt.y(); |
| 222 | decimal cz=pt.z(); |
| 223 | ph->createVertex(Point(cx+x,cy+y,cz+z)); |
| 224 | pg.append(n++); |
| 225 | } |
| 226 | } |
| 227 | if(c=='.') |
| 228 | x+=0.75; |
| 229 | else |
| 230 | x+=1.5; |
| 231 | } |
| 232 | |
| 233 | return ph; |
| 234 | } |