Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
7 February 2017 at 18:42 in reply to: [SOLVED] reading STL file vertices from my own component #8518DaliaBlocked
Your hint and the tutorial example was very useful!
I could make what I wanted to do.
Thanks Erik!Dalia
2 February 2017 at 14:31 in reply to: [SOLVED] reading STL file vertices from my own component #8498DaliaBlockedThanks Erik!
OK, I’ll use the loader.
I have a basic scene in which I included a component defined by myself let say myComponent.
In the myComponent handle event “updateOnBeginStep” I have the following code:std::cout<<"MyComponent updateOnBeginStep!"<<std::endl;
which is working fine which means that I can handle the event, and sofa does not crash.
Now when I add :
std::cout<<"MyComponent updateOnBeginStep!"<<std::endl; sofa::core::loader::MeshLoader *my_mesh; my_mesh->setFilename("/mesh_models/test_mesh.stl"); sofa::helper::vector< Vector3 > my_vertices; my_vertices = my_mesh->getVertices ();
Sofa crashes at the setFilename line!
In the debug mode the heap is :
0 sofa::core::objectmodel::DDGNode::updateIfDirty DDGNode.h 192 0x7ffff7b3ba8c 1 sofa::core::objectmodel::Data<std::__cxx11::string>::beginEdit Data.h 437 0x7ffff4726757 2 sofa::core::objectmodel::DataFileName::setValue DataFileName.h 91 0x7ffff6782d07 3 sofa::core::loader::BaseLoader::setFilename BaseLoader.h 117 0x7fff9fdd98c3 4 sofa::component::controller::MyComponent<int>::updateOnBeginStep MyComponent.cpp 167 0x7fff9fdeb62a 5 sofa::component::controller::MyComponent<int>::handleEvent MyComponent.cpp 115 0x7fff9fdeb0ab
I hope that this description is clear? What should I do to load the file and access to its vertices?
Dalia
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)