Skip to content

Instantly share code, notes, and snippets.

@TAK-EMI
Created February 19, 2013 15:53
Show Gist options
  • Save TAK-EMI/4987089 to your computer and use it in GitHub Desktop.
Save TAK-EMI/4987089 to your computer and use it in GitHub Desktop.
NGが出力されて無限ループに陥ってしまうコード。
#include <FK/FK.h>
int main()
{
fk_ShapeViewer viewer(600, 660);
fk_Solid shape;
shape.makePrism(3, 10.0, 10.0, 20.0);
shape.uniteLoop(shape.getEData(18));
shape.uniteLoop(shape.getEData(14));
shape.uniteLoop(shape.getEData(8));
fk_Solid ss, *s;
ss.cloneShape(&shape);
//s = &shape;
s = &ss;
fk_Edge *e = s->getNextE(NULL);
while(e != NULL)
{
if(!s->existEdge(e))
std::cout << "NG" << std::endl;
e = s->getNextE(e);
}
viewer.setShape(0, &shape);
viewer.setDrawMode(FK_POLYMODE | FK_LINEMODE);
viewer.setScale(10.0);
while(viewer.draw() == true);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment