Skip to content

Commit

Permalink
[OMEdit] Faster loading of STL files (#10296)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotheruserofgithub committed Mar 3, 2023
1 parent 8d28dc0 commit f91ef36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion OMEdit/OMEditLIB/Animation/Visualization.cpp
Expand Up @@ -47,6 +47,7 @@
#include <osg/ShapeDrawable>
#include <osg/StateAttribute>
#include <osg/Texture2D>
#include <osgDB/Options>
#include <osgDB/ReadFile>
#include <osgGA/OrbitManipulator>
#include <osgUtil/CullVisitor>
Expand Down Expand Up @@ -1284,7 +1285,9 @@ void OSGScene::setUpScene(std::vector<ShapeObject>& shapes)
if (shape._type.compare("stl") == 0)
{ //cad node
//std::cout<<"It's a stl and the filename is "<<shape._fileName<<std::endl;
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(shape._fileName);
// Disable mesh optimization because it is too expensive (see OSG commit a082b57)
osg::ref_ptr<osgDB::Options> options = new osgDB::Options("noTriStripPolygons");
osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(shape._fileName, options.get());
if (node.valid())
{
osg::ref_ptr<osg::Material> material = new osg::Material();
Expand Down

0 comments on commit f91ef36

Please sign in to comment.