Forum Replies Created
-
AuthorPosts
-
SdAutoBlocked
Hi,
I want to use this function to give a force to one extremity of this model.
I have another question, when using
“JointSpringForceFieldRigid3d::Spring s1(0, 1, softKst, hardKst, softKsr, hardKsr, blocKsr, -3.14159, 1.57080, -1.73790, 1.47379, -2.18160, 0.00010, kd);”
how it knows the 2 objects -> ie -> Object1 and Object2
because I still have an error in execution[WARNING] [JointSpringForceField] Link update failed for object1 =
[WARNING] [JointSpringForceField] Link update failed for object2 =
[WARNING] [JointSpringForceField] Init of PairInteractionForceField node failed!
Erreur de segmentation (core dumped)
Thank youSdAutoBlocked// One solver for all the graph EulerImplicitSolver::SPtr solver = sofa::core::objectmodel::New<EulerImplicitSolver>(); solver->setName("solver"); solver->f_printLog.setValue(false); groot->addObject(solver); CGLinearSolver::SPtr linearSolver = New<CGLinearSolver>(); linearSolver->setName("linearSolver"); linearSolver->f_maxIter.setValue(200); linearSolver->f_tolerance.setValue(1e-5); linearSolver->f_smallDenominatorThreshold.setValue(1e-5); groot->addObject(linearSolver); // joint spring force field double kd = 1.E-1; double softKst = 1.E7; double hardKst = 1.E8; double softKsr = 1.; double hardKsr = 1.E7; double blocKsr = 3.E5; JointSpringForceFieldRigid3d::SPtr joint = addNew<JointSpringForceFieldRigid3d>(jointNode,"joint"); // s1 JointSpringForceFieldRigid3d::Spring s1(0, 1, softKst, hardKst, softKsr, hardKsr, blocKsr, -3.14159, 1.57080, -1.73790, 1.47379, -2.18160, 0.00010, kd); s1.setFreeAxis(true, true, true, true, true, true); Vec<3,double> t1; t1[0]=1.E-4; t1[1]=1.E-4; t1[2]=1.E-4; s1.setInitLength(t1); //add Spring joint->addSpring(s1); // ================================= Visual Node================================== Node::SPtr visuNode = rigidNode->createChild("bones"); Node::SPtr torsoNode = visuNode->createChild("torso"); component::visualmodel::OglModel::SPtr ribs = addNew< component::visualmodel::OglModel >(torsoNode,"ribs"); ribs->setFilename( sofa::helper::system::DataRepository.getFile("../applications/tutorials/anatomyModelling/mesh/bones/ribs.obj") );
SdAutoBlockedthank you for your reply
I use in the main.cpp file the JointSpringForceField class and I put the linear solver, my question is how to add addForce() in this program.
here is some line of code:SdAutoBlockedHi sir,
finally, i have added in CMakeLists the missing libraries and it is working correctlycmake_minimum_required(VERSION 2.8.12) project(runSofa) #modifier.......................................................................... set(SofaFramework_DIR /home/user/sofa/v16.08/build/install/lib/cmake/SofaFramework) set(TinyXML_DIR /home/user/sofa/v16.08/build/install/lib/cmake/TinyXML) set(GTest_DIR /home/user/sofa/v16.08/build/install/lib/cmake/GTest) set(SofaGeneral_DIR/home/user/sofa/v16.08/build/install/lib/cmake) #.................................................................................. option(RUNSOFA_INSTALL_AS_BUNDLE "Create a bundle containing all the installation files (Only Mac OS X for now)" OFF) link_directories(/home/user/sofa/v16.08/build/install/lib) link_directories(/home/user/sofa/v16.08/build/install/lib/cmake/SofaGeneral) link_directories(/home/user/sofa/v16.08/build/lib) #..................................................................................... if(APPLE) set(RC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/runSOFA.icns") else() set(RC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/sofa.rc") endif() find_package(SofaFramework REQUIRED) # to get SOFA_HAVE_GLUT if(APPLE) set_source_files_properties(${RC_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") endif() if(APPLE AND RUNSOFA_INSTALL_AS_BUNDLE) add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${RC_FILES} Main.cpp ) else() add_executable(${PROJECT_NAME} ${RC_FILES} Main.cpp) endif() if(APPLE) set_target_properties( ${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE "runSOFA.icns" ) endif() #modifier............................................................. include_directories("/home/user/sofa/v16.08/build/install/include") include_directories("/home/user/sofa/v16.08/src/applications") include_directories("/home/user/sofa/v16.08/build/install/lib/cmake") target_link_libraries(${PROJECT_NAME} SofaComponentGeneral SofaBaseTopology) #...... target_link_libraries(${PROJECT_NAME} SofaComponentAdvanced SofaComponentMisc) target_link_libraries(${PROJECT_NAME} SofaSimulationGraph) target_link_libraries(${PROJECT_NAME} SofaGuiMain) #....... target_link_libraries(${PROJECT_NAME} SofaValidation) target_link_libraries(${PROJECT_NAME} SofaGeneralLoader) target_link_libraries(${PROJECT_NAME} SofaSimulationCommon) target_link_libraries(${PROJECT_NAME} SofaSimulationCore) target_link_libraries(${PROJECT_NAME} SofaSimulationTree) target_link_libraries(${PROJECT_NAME} SofaCore) target_link_libraries(${PROJECT_NAME} SofaGuiCommon) target_link_libraries(${PROJECT_NAME} SofaComponentBase) target_link_libraries(${PROJECT_NAME} SofaComponentCommon) #........................................................................... if(SOFA_HAVE_GLUT) target_compile_definitions(${PROJECT_NAME} PUBLIC "SOFA_HAVE_GLUT_GUI") endif() if(APPLE AND RUNSOFA_INSTALL_AS_BUNDLE) # set(CPACK_COMPONENTS_ALL BundlePack) set_property(GLOBAL PROPERTY RUNSOFA_CPACK_COMPONENTS_ALL BundlePack) include(cmake/bundle.cmake) else() sofa_install_targets(SofaGui runSofa "") endif()
thank’s
SdAutoBlockedDear Sir,
I tried to compile Main.cpp but I found a problem in CMakeLists.txt which seems to me that it is not complete. I mean there are some libraries that are not specified with target_link_librarie. I did not want to add all of them by hand since, I think this will take time to have them all and in the correct order. Could you please help me on this ?
I show you the error I get:
Undefined symbols for architecture x86_64:“sofa::simulation::getSimulation()”, referenced from:
_main in Main.cpp.o
“sofa::simulation::setSimulation(sofa::simulation::Simulation*)”, referenced from:
_main in Main.cpp.o
“sofa::simulation::tree::TreeSimulation::TreeSimulation()”, referenced from:
_main in Main.cpp.o
“sofa::simulation::tree::init()”, referenced from:
_main in Main.cpp.o
“sofa::simulation::tree::cleanup()”, referenced from:
_main in Main.cpp.o
“sofa::simulation::common::cleanup()”, referenced from:
_main in Main.cpp.o
“sofa::simulation::Visitor::Visitor(sofa::core::ExecParams const*)”, referenced from:
sofa::component::misc::ReadStateActivator::ReadStateActivator(sofa::core::ExecParams const*, bool) in Main.cpp.o
“sofa::simulation::Visitor::~Visitor()”, referenced from:
sofa::component::misc::ReadStateActivator::~ReadStateActivator() in Main.cpp.o
sofa::component::misc::CompareStateCreator::~CompareStateCreator() in Main.cpp.o
“sofa::gui::GUIManager::AddGUIOption(char const*)”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::SetDimension(int, int)”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::ListSupportedGUI(char)”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::CurrentSimulation()”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::Init(char const*, char const*)”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::MainLoop(boost::intrusive_ptr<sofa::simulation::Node>, char const*)”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::SetScene(boost::intrusive_ptr<sofa::simulation::Node>, char const*, bool)”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::closeGUI()”, referenced from:
_main in Main.cpp.o
“sofa::gui::GUIManager::createGUI(boost::intrusive_ptr<sofa::simulation::Node>, char const*)”, referenced from:
_main in Main.cpp.o
Best,
SdAutoBlockedDear Sir,
I would like to write a scene in cpp but the corresponding help link is still under construction. Could you please give me some guidelines to do it ?
BestSdAutoBlockedHi sir,
Thank’s for your answer,
I have a nother question, I tried to compile the file “src/doc/src_exemple/example3” on Qt creator, it showed me an error at the file “scene.h“, and I didn’t found this file in sofa.Thank’s sir
SdAutoBlockedHi sir,
I already saw the example but i want to know if i can remove a part of the liver for examination, or make a wound and suture it.
Thank you sir
-
AuthorPosts