c++ - Filling in gaps for outlines -


I'm using an algorithm to generate quads. These settings have become algorithm:

< Pre> zero oggyonfunction: :: Generally available poly (const std :: vector & lt; std :: vector & gt; gtl gt; & gt; and input; std :: vector & gt; gflfl & gt; and output , Int width) {output.clear (); If (input.size () & lt; 2) {return; } ATTP; Float Darlin; Float Peplen; POINTFLOAT start; POINTFLOAT end; POINTFLOAT dir; POINTFLOAT ndir; POINTFLOAT perp; POINTFLOAT nperp; POINTFLOAT PERPOFFSESS; POINTFLOAT DIOSSESSETS; POINTFLOAT p0, p1, p2, p3; (Unsigned int i = 0; i & lt; input.size () - 1; ++ i) {start.x = stable_account & lt; Float & gt; (For input [i] [0]); Start.y = static_cast & lt; Float & gt; (Input [i] [1]); End.x = static_cast & lt; Float & gt; (Input [i + 1] [0]); End.y = static_cast & lt; Float & gt; (Input [i + 1] [1]); Dir.x = end.x - start.x; Dir.y = end.y - start.y; Dirlen = sqrt ((dir.x * dir.x) + (dir.y * dir.y)); Ndir.x = static_cast & lt; Float & gt; (Dir.x * 1.0 / dirlen); Ndir.y = static_cast & lt; Float & gt; (Dir.y * 1.0 / dirlen); Perp.x = dir.y; Perp.y = -dir.x; Perplen = sqrt ((perp.x * perp.x) + (perp.y * perp.y)); Nperp.x = static_cast & lt; Float & gt; (Perp.x * 1.0 / perplan); Nperp.y = Static_cast & lt; Float & gt; (Perp.y * 1.0 / perplen); Perpoffset.x = static_cast & lt; Float & gt; (Nperp.x * width * 0.5); Perpoffset.y = static_cast & lt; Float & gt; (Nperp.y * width * 0.5); Diroffset.x = static_cast & lt; Float & gt; (Ndir.x * 0 * 0.5); Diroffset.y = static_cast & lt; Float & gt; (Ndir.y * 0 * 0.5); // p0 = start + perpoffset - diroffset // p1 = start - perpoffset - diroffset // p2 = end + perpoffset + dieoffet // p3 = end - perpoffset + diroffset p0.x = start.x + perpoffset.x - diroffset. X; P0.y = start.y + perpoffset.y - diroffset.y; P1.x = start.x - perpoffset.x - diroffset.x; P1.y = start.y - perpoffset.y - diroffset.y; P2.x = end.x + perpoffset.x + diroffset.x; P2.y = end.y + perpoffset.y + diroffset.y; P3.x = end.x - perpoffset.x + diroffset.x; P3.y = end.y - perpoffset.y + diroffset.y; Output.push_back (p2.x); Output.push_back (p2.y); Output.push_back (p0.x); Output.push_back (p0.y); Output.push_back (p1.x); Output.push_back (p1.y); Output.push_back (p3.x); Output.push_back (p3.y); }}

The problem is that here it has been seen as the interval:

There should be a way to correct it. I see a pattern but I could not understand it. One way to fill the missing inbreedings is to thank

Edit: My See.

Add a triangle "outside" (check the mark of 2D in the center) connects to the center of the mixer of the center.

If you want, you want to get fantasy, although you want to meet a more circular external, although this cost corresponds to more triangles.

In addition, if you are going to use the lines that are broad and so closely divided, then you can try them first to reduce the overdra / polycount.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -