Infinite Extrusion Bug

xtitus

08-09-2014 11:16:52

I've found some type of bug...but not exactly sure what's going on. I'm extruding a circle along a 3D spline, and sometimes it okay, other times I think the indexes or something get messed up and the extrusion looks like it goes out to infinity. I've isolated one senario where this happens and made a test code to replicate. I've also attached images of this in point / wireframe / solid for reference. I'm using the library code at the latest in the repo. Any ideas on what the issue might be? Below is the test code for this instance. If you zoomed out, you'd see straight lines extending out to infinity to the right... The wireframe image illustrates the issue the best.


Procedural::CatmullRomSpline3 curve = Procedural::CatmullRomSpline3();

curve.setNumSeg(1);

std::vector<Ogre::Vector3> test;

test.push_back(Ogre::Vector3(-8.91404, 218.203, -14.5234));
test.push_back(Ogre::Vector3(-8.81021, 219.189, -11.6918));
test.push_back(Ogre::Vector3(-8.91404, 218.203, -14.5233));
test.push_back(Ogre::Vector3(-9.01786, 217.217, -17.3549));
test.push_back(Ogre::Vector3(-9.12169, 216.232, -20.1864));
test.push_back(Ogre::Vector3(-7.80048, 216.1, -22.8766));
test.push_back(Ogre::Vector3(-9.05608, 214.661, -25.1905));

for(int i=0; i<test.size(); i++)
curve.addPoint(test);

Procedural::Path p = curve.realizePath();

Procedural::Shape s = Procedural::CircleShape().setRadius(1).realizeShape();

Procedural::Extruder().setExtrusionPath(&p).setShapeToExtrude(&s).setCapped(false).realizeMesh("foo");

Ogre::Entity* blah = mSceneMgr->createEntity("foo");
mSceneMgr->getRootSceneNode()->attachObject(blah);



[attachment=1]issue_wireframe.jpg[/attachment]
[attachment=2]issue_solid.jpg[/attachment]
[attachment=0]issue_points.jpg[/attachment]

xtitus

08-09-2014 16:44:21

As an update, I think my algorithm generating some of the values has a few issues, and this set I notice that the 3rd entry is really close to the same value as the first, which might be screwing it up. Might be one of those things where it's part library and part user error.

mikachu

09-09-2014 22:27:38

I confirm that the 1st and 3rd point being almost the same screws things up a bit, because it's detected as a self-intersection, which triggers an algorithm to make the intersection look cool (that feature is still beta, though, and it doesn't handle extreme cases very well)