MCPcopy Create free account
hub / github.com/GilesBathgate/RapCAD / buildPrimitive

Method buildPrimitive

src/simpletextbuilder.cpp:206–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206Primitive* 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}

Callers

nothing calls this directly

Calls 8

PointClass · 0.85
xMethod · 0.80
yMethod · 0.80
zMethod · 0.80
valueMethod · 0.80
appendMethod · 0.80
setTypeMethod · 0.45
createVertexMethod · 0.45

Tested by

no test coverage detected