From e37e40a8ffb3bf87ab848207ce49fbe26e0ca870 Mon Sep 17 00:00:00 2001 From: "Zone.N" Date: Mon, 30 Oct 2023 21:52:58 +0800 Subject: [PATCH 1/2] fix: run demo2d Signed-off-by: Zone.N --- .github/workflows/workflow.yml | 4 +- cmake/3rd.cmake | 12 +- cmake/add_header.cmake | 11 -- deps.md | 2 +- src/CMakeLists.txt | 2 +- src/demo2d/CMakeLists.txt | 38 +++--- src/demo2d/include/SPHSolver.h | 1 + src/demo2d/src/SPHSolver.cpp | 6 +- src/engine/CMakeLists.txt | 225 ++++++++++++++++----------------- 9 files changed, 150 insertions(+), 151 deletions(-) delete mode 100644 cmake/add_header.cmake diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0997274..a6f5ff6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,7 +26,7 @@ jobs: run: | sudo apt update sudo apt install --fix-missing -y doxygen graphviz clang-format clang-tidy cppcheck lcov - sudo apt install --fix-missing -y gcc g++ libspdlog-dev + sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev - name: Build run: | @@ -48,7 +48,7 @@ jobs: run: | sudo apt update sudo apt install --fix-missing -y doxygen graphviz clang-format clang-tidy cppcheck lcov - sudo apt install --fix-missing -y gcc g++ libspdlog-dev + sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev - name: Build run: | diff --git a/cmake/3rd.cmake b/cmake/3rd.cmake index 096dc9a..4573744 100644 --- a/cmake/3rd.cmake +++ b/cmake/3rd.cmake @@ -76,9 +76,9 @@ CPMAddPackage( GITHUB_REPOSITORY glfw/glfw GIT_TAG 3.3.8 OPTIONS - "GLFW_BUILD_TESTS OFF" - "GLFW_BUILD_EXAMPLES OFF" - "GLFW_BULID_DOCS OFF" + "GLFW_BUILD_TESTS OFF" + "GLFW_BUILD_EXAMPLES OFF" + "GLFW_BULID_DOCS OFF" ) # https://github.com/g-truc/glm @@ -214,3 +214,9 @@ if (NOT GLUT_FOUND) message(FATAL_ERROR "GLUT not found.\n" "Following https://www.opengl.org/resources/libraries/glut/ to install.") endif () + +find_package(OpenGL REQUIRED) +if (NOT OpenGL_FOUND) + message(FATAL_ERROR "OpenGL not found.\n" + "Following https://www.opengl.org/ to install.") +endif () diff --git a/cmake/add_header.cmake b/cmake/add_header.cmake deleted file mode 100644 index 989a9c7..0000000 --- a/cmake/add_header.cmake +++ /dev/null @@ -1,11 +0,0 @@ - -# This file is a part of Simple-XX/SimplePhysicsEngine -# (https://github.com/Simple-XX/SimplePhysicsEngine). -# -# add_header.cmake for Simple-XX/SimplePhysicsEngine. -# 将头文件路径添加到 _target 的搜索路径中 - -function(add_header_3rd _target) - target_include_directories(${_target} PRIVATE - ${tinyobjloader_SOURCE_DIR}) -endfunction() diff --git a/deps.md b/deps.md index 63514f7..346f970 100644 --- a/deps.md +++ b/deps.md @@ -1,5 +1,5 @@ ubuntu ```shell -sudo apt install -y doxygen graphviz clang-format clang-tidy cppcheck lcov gcc g++ libspdlog-dev libcgal-dev freeglut3-dev +sudo apt install -y doxygen graphviz clang-format clang-tidy cppcheck lcov gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev ``` diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d196c7f..2fc6cb4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,5 +5,5 @@ # CMakeLists.txt for Simple-XX/SimplePhysicsEngine. add_subdirectory(engine) -# add_subdirectory(demo2d) +add_subdirectory(demo2d) # add_subdirectory(demo3d) diff --git a/src/demo2d/CMakeLists.txt b/src/demo2d/CMakeLists.txt index 7315311..d77bf0c 100644 --- a/src/demo2d/CMakeLists.txt +++ b/src/demo2d/CMakeLists.txt @@ -9,28 +9,32 @@ cmake_minimum_required(VERSION 2.6) project(demo2d) file(GLOB_RECURSE demo2d_FILES - "${PROJECT_SOURCE_DIR}/include/*.h" - "${PROJECT_SOURCE_DIR}/src/*.cpp" + "${PROJECT_SOURCE_DIR}/include/*.h" + "${PROJECT_SOURCE_DIR}/src/*.cpp" ) -add_executable(${PROJECT_NAME} - ${demo2d_FILES} +add_executable(${PROJECT_NAME} + ${demo2d_FILES} ) target_include_directories(${PROJECT_NAME} PRIVATE - include - ../ - ../engine/dtk - ../engine/math - ../engine/physics -) + include + ../ + ../engine/dtk + ../engine/math + ../engine/physics +) target_link_libraries(${PROJECT_NAME} PRIVATE - dtk - Boost - CGAL - GLUT - glfw - glm - Eigen + dtk + Boost::headers + Boost::dynamic_linking + CGAL + GLUT::GLUT + glfw + glm + Eigen + OpenGL::GL + glut + GLU ) diff --git a/src/demo2d/include/SPHSolver.h b/src/demo2d/include/SPHSolver.h index 16a5997..fb4f085 100644 --- a/src/demo2d/include/SPHSolver.h +++ b/src/demo2d/include/SPHSolver.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include "Particle.h" #include "Grid.h" diff --git a/src/demo2d/src/SPHSolver.cpp b/src/demo2d/src/SPHSolver.cpp index 99d597e..ec8cbbe 100644 --- a/src/demo2d/src/SPHSolver.cpp +++ b/src/demo2d/src/SPHSolver.cpp @@ -125,14 +125,14 @@ void SPHSolver::findNeighborhoods() neighborhoods = vector>(); float maxDist2 = KERNEL_RANGE * KERNEL_RANGE; - for each (const Particle &p in particles) + for (const Particle &p : particles) { vector neighbors = vector(); vector neighboringCells = grid.getNeighboringCells(p.position); - for each (const Cell &cell in neighboringCells) + for (const Cell &cell : neighboringCells) { - for each (int index in cell) + for (int index : cell) { Eigen::Vector2f x = p.position - particles[index].position; float dist2 = x[0] * x[0] + x[1] * x[1]; diff --git a/src/engine/CMakeLists.txt b/src/engine/CMakeLists.txt index e1bf259..37bc62f 100644 --- a/src/engine/CMakeLists.txt +++ b/src/engine/CMakeLists.txt @@ -14,7 +14,7 @@ file(GLOB_RECURSE dir_headers *.h) set(all_files ${dir_source} ${dir_headers}) -foreach(fileItem ${all_files}) +foreach (fileItem ${all_files}) # Get the directory of the source file get_filename_component(PARENT_DIR "${fileItem}" DIRECTORY) # Remove common directory prefix to make the group @@ -24,126 +24,125 @@ foreach(fileItem ${all_files}) # Group into "Source Files" and "Header Files" set(GROUP "${GROUP}") source_group("${GROUP}" FILES "${fileItem}") -endforeach() +endforeach () -add_library(dtk STATIC - dtk/dtk.cpp - dtk/dtk.h - dtk/dtkArray.h - dtk/dtkAssert.cpp - dtk/dtkAssert.h - dtk/dtkCollisionDetectBasic.cpp - dtk/dtkCollisionDetectBasic.h - dtk/dtkCollisionDetectHierarchy.cpp - dtk/dtkCollisionDetectHierarchy.h - dtk/dtkCollisionDetectHierarchyKDOPS.cpp - dtk/dtkCollisionDetectHierarchyKDOPS.h - dtk/dtkCollisionDetectNode.cpp - dtk/dtkCollisionDetectNode.h - dtk/dtkCollisionDetectNodeKDOPS.cpp - dtk/dtkCollisionDetectNodeKDOPS.h - dtk/dtkCollisionDetectPrimitive.cpp - dtk/dtkCollisionDetectPrimitive.h - dtk/dtkCollisionDetectStage.cpp - # dtk/dtkCollisionDetectStage.cpp.bak - dtk/dtkCollisionDetectStage.h - dtk/dtkConfig.h - dtk/dtkError.h - dtk/dtkErrorManager.cpp - dtk/dtkErrorManager.h - dtk/dtkExports.h - dtk/dtkGraphics.h - dtk/dtkGraphicsKernel.cpp - dtk/dtkGraphicsKernel.h - # dtk/dtkGraphicsKernel.h.bak - dtk/dtkGraphicsTools.h - dtk/dtkIDTypes.h - dtk/dtkImports.h - dtk/dtkInit.h - dtk/dtkIntersectTest.cpp - dtk/dtkIntersectTest.h - dtk/dtkIO.h - dtk/dtkMatrixAlgorithm.h - dtk/dtkPhysCore.cpp - # dtk/dtkPhysCore.cpp.bak - dtk/dtkPhysCore.h - dtk/dtkPhysKnotPlanner.cpp - dtk/dtkPhysKnotPlanner.h - dtk/dtkPhysMassPoint.cpp - dtk/dtkPhysMassPoint.h - dtk/dtkPhysMassSpring.cpp - dtk/dtkPhysMassSpring.h - # dtk/dtkPhysMassSpring.h.bak - dtk/dtkPhysMassSpringCollisionResponse.cpp - dtk/dtkPhysMassSpringCollisionResponse.h - dtk/dtkPhysMassSpringThread.cpp - dtk/dtkPhysMassSpringThread.h - dtk/dtkPhysMassSpringThreadCollisionResponse.cpp - dtk/dtkPhysMassSpringThreadCollisionResponse.h - dtk/dtkPhysParticle.cpp - dtk/dtkPhysParticle.h - dtk/dtkPhysParticleSystem.cpp - dtk/dtkPhysParticleSystem.h - dtk/dtkPhysSpring.cpp - dtk/dtkPhysSpring.h - dtk/dtkPhysTetraMassSpring.cpp - dtk/dtkPhysTetraMassSpring.h - dtk/dtkPoints.h - dtk/dtkPointsReader.cpp - dtk/dtkPointsReader.h - dtk/dtkPointsVector.h - dtk/dtkPointsWriter.cpp - dtk/dtkPointsWriter.h - dtk/dtkProperty.h - dtk/dtkRandom.h - dtk/dtkScene.cpp - dtk/dtkScene.h - dtk/dtkSign.cpp - dtk/dtkSign.h - dtk/dtkStaticMeshEliminator.cpp - dtk/dtkStaticMeshEliminator.h - dtk/dtkStaticTetraMesh.cpp - dtk/dtkStaticTetraMesh.h - dtk/dtkStaticTetraMeshReader.cpp - dtk/dtkStaticTetraMeshReader.h - dtk/dtkStaticTetraMeshWriter.cpp - dtk/dtkStaticTetraMeshWriter.h - dtk/dtkStaticTriangleMesh.cpp - dtk/dtkStaticTriangleMesh.h - dtk/dtkStaticTriangleMeshReader.cpp - dtk/dtkStaticTriangleMeshReader.h - dtk/dtkStaticTriangleMeshWriter.cpp - dtk/dtkStaticTriangleMeshWriter.h - dtk/dtkTime.h - dtk/dtkUtility.h +add_library(dtk STATIC + dtk/dtk.cpp + dtk/dtk.h + dtk/dtkArray.h + dtk/dtkAssert.cpp + dtk/dtkAssert.h + dtk/dtkCollisionDetectBasic.cpp + dtk/dtkCollisionDetectBasic.h + dtk/dtkCollisionDetectHierarchy.cpp + dtk/dtkCollisionDetectHierarchy.h + dtk/dtkCollisionDetectHierarchyKDOPS.cpp + dtk/dtkCollisionDetectHierarchyKDOPS.h + dtk/dtkCollisionDetectNode.cpp + dtk/dtkCollisionDetectNode.h + dtk/dtkCollisionDetectNodeKDOPS.cpp + dtk/dtkCollisionDetectNodeKDOPS.h + dtk/dtkCollisionDetectPrimitive.cpp + dtk/dtkCollisionDetectPrimitive.h + dtk/dtkCollisionDetectStage.cpp + # dtk/dtkCollisionDetectStage.cpp.bak + dtk/dtkCollisionDetectStage.h + dtk/dtkConfig.h + dtk/dtkError.h + dtk/dtkErrorManager.cpp + dtk/dtkErrorManager.h + dtk/dtkExports.h + dtk/dtkGraphics.h + dtk/dtkGraphicsKernel.cpp + dtk/dtkGraphicsKernel.h + # dtk/dtkGraphicsKernel.h.bak + dtk/dtkGraphicsTools.h + dtk/dtkIDTypes.h + dtk/dtkImports.h + dtk/dtkInit.h + dtk/dtkIntersectTest.cpp + dtk/dtkIntersectTest.h + dtk/dtkIO.h + dtk/dtkMatrixAlgorithm.h + dtk/dtkPhysCore.cpp + # dtk/dtkPhysCore.cpp.bak + dtk/dtkPhysCore.h + dtk/dtkPhysKnotPlanner.cpp + dtk/dtkPhysKnotPlanner.h + dtk/dtkPhysMassPoint.cpp + dtk/dtkPhysMassPoint.h + dtk/dtkPhysMassSpring.cpp + dtk/dtkPhysMassSpring.h + # dtk/dtkPhysMassSpring.h.bak + dtk/dtkPhysMassSpringCollisionResponse.cpp + dtk/dtkPhysMassSpringCollisionResponse.h + dtk/dtkPhysMassSpringThread.cpp + dtk/dtkPhysMassSpringThread.h + dtk/dtkPhysMassSpringThreadCollisionResponse.cpp + dtk/dtkPhysMassSpringThreadCollisionResponse.h + dtk/dtkPhysParticle.cpp + dtk/dtkPhysParticle.h + dtk/dtkPhysParticleSystem.cpp + dtk/dtkPhysParticleSystem.h + dtk/dtkPhysSpring.cpp + dtk/dtkPhysSpring.h + dtk/dtkPhysTetraMassSpring.cpp + dtk/dtkPhysTetraMassSpring.h + dtk/dtkPoints.h + dtk/dtkPointsReader.cpp + dtk/dtkPointsReader.h + dtk/dtkPointsVector.h + dtk/dtkPointsWriter.cpp + dtk/dtkPointsWriter.h + dtk/dtkProperty.h + dtk/dtkRandom.h + dtk/dtkScene.cpp + dtk/dtkScene.h + dtk/dtkSign.cpp + dtk/dtkSign.h + dtk/dtkStaticMeshEliminator.cpp + dtk/dtkStaticMeshEliminator.h + dtk/dtkStaticTetraMesh.cpp + dtk/dtkStaticTetraMesh.h + dtk/dtkStaticTetraMeshReader.cpp + dtk/dtkStaticTetraMeshReader.h + dtk/dtkStaticTetraMeshWriter.cpp + dtk/dtkStaticTetraMeshWriter.h + dtk/dtkStaticTriangleMesh.cpp + dtk/dtkStaticTriangleMesh.h + dtk/dtkStaticTriangleMeshReader.cpp + dtk/dtkStaticTriangleMeshReader.h + dtk/dtkStaticTriangleMeshWriter.cpp + dtk/dtkStaticTriangleMeshWriter.h + dtk/dtkTime.h + dtk/dtkUtility.h - math/dtkMatrix.h - math/dtkMatrixOp.cpp - math/dtkMatrixOP.h - math/dtkTx.h - math/dtkTxIO.h - math/dtkTxOP.h + math/dtkMatrix.h + math/dtkMatrixOp.cpp + math/dtkMatrixOP.h + math/dtkTx.h + math/dtkTxIO.h + math/dtkTxOP.h - physics/dtkJoint.cpp - physics/dtkJoint.h - physics/dtkRigidBody.cpp - physics/dtkRigidBody.h - - ${all_files} + physics/dtkJoint.cpp + physics/dtkJoint.h + physics/dtkRigidBody.cpp + physics/dtkRigidBody.h + + ${all_files} ) target_include_directories(dtk PRIVATE - dtk - math - physics -) + dtk + math + physics +) target_link_libraries(dtk PRIVATE - Boost - CGAL - GLUT - glfw - glm + Boost::headers + CGAL + glfw + glm ) #[[install( From ec47c77a1394da2371dadfc8a1a9b006ddd3a3a9 Mon Sep 17 00:00:00 2001 From: "Zone.N" Date: Mon, 30 Oct 2023 22:30:16 +0800 Subject: [PATCH 2/2] fix: run demo3d Signed-off-by: Zone.N --- .github/workflows/workflow.yml | 4 +- CMakePresets.json | 4 ++ cmake/3rd.cmake | 6 +++ deps.md | 2 +- src/CMakeLists.txt | 2 +- src/demo2d/CMakeLists.txt | 2 - src/demo3d/CMakeLists.txt | 94 ++++++++++++++------------------- src/demo3d/dtkFemSimulation.cpp | 2 +- 8 files changed, 54 insertions(+), 62 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a6f5ff6..265e7ed 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,7 +26,7 @@ jobs: run: | sudo apt update sudo apt install --fix-missing -y doxygen graphviz clang-format clang-tidy cppcheck lcov - sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev + sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev libvtk9-dev qtbase5-dev - name: Build run: | @@ -48,7 +48,7 @@ jobs: run: | sudo apt update sudo apt install --fix-missing -y doxygen graphviz clang-format clang-tidy cppcheck lcov - sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev + sudo apt install --fix-missing -y gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev libvtk9-dev qtbase5-dev - name: Build run: | diff --git a/CMakePresets.json b/CMakePresets.json index 3317367..fd52fe8 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -44,6 +44,10 @@ "COVERAGE_OUTPUT_DIR": { "type": "STRING", "value": "${sourceDir}/build/coverage" + }, + "VTK_OPT": { + "type": "BOOL", + "value": "FALSE" } } }, diff --git a/cmake/3rd.cmake b/cmake/3rd.cmake index 4573744..d2fcec7 100644 --- a/cmake/3rd.cmake +++ b/cmake/3rd.cmake @@ -220,3 +220,9 @@ if (NOT OpenGL_FOUND) message(FATAL_ERROR "OpenGL not found.\n" "Following https://www.opengl.org/ to install.") endif () + +find_package(VTK REQUIRED) +if (NOT VTK_FOUND) + message(FATAL_ERROR "VTK not found.\n" + "Following https://vtk.org/ to install.") +endif () diff --git a/deps.md b/deps.md index 346f970..690d1cf 100644 --- a/deps.md +++ b/deps.md @@ -1,5 +1,5 @@ ubuntu ```shell -sudo apt install -y doxygen graphviz clang-format clang-tidy cppcheck lcov gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev +sudo apt install -y doxygen graphviz clang-format clang-tidy cppcheck lcov gcc g++ libspdlog-dev libcgal-dev freeglut3-dev libboost-all-dev libvtk9-dev qtbase5-dev ``` diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2fc6cb4..18bdb7b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,4 +6,4 @@ add_subdirectory(engine) add_subdirectory(demo2d) -# add_subdirectory(demo3d) +add_subdirectory(demo3d) diff --git a/src/demo2d/CMakeLists.txt b/src/demo2d/CMakeLists.txt index d77bf0c..e17783b 100644 --- a/src/demo2d/CMakeLists.txt +++ b/src/demo2d/CMakeLists.txt @@ -4,8 +4,6 @@ # # CMakeLists.txt for Simple-XX/SimplePhysicsEngine. -cmake_minimum_required(VERSION 2.6) - project(demo2d) file(GLOB_RECURSE demo2d_FILES diff --git a/src/demo3d/CMakeLists.txt b/src/demo3d/CMakeLists.txt index 689c821..9dee88b 100644 --- a/src/demo3d/CMakeLists.txt +++ b/src/demo3d/CMakeLists.txt @@ -4,53 +4,7 @@ # # CMakeLists.txt for Simple-XX/SimplePhysicsEngine. -cmake_minimum_required(VERSION 3.0) project(demo3d) -set(CMAKE_CXX_STANDARD 11) - -aux_source_directory(. dir_source) -file(GLOB dir_headers *.h) - -include_directories({dir_headers}) - -if(WIN32) - set(freeglut_include_dir "${SPE_DEPS}/freeglut/include") - set(freeglut_libraries_dir "${SPE_DEPS}/freeglut/lib") - set(EIGEN_PATH "${SPE_DEPS}/eigen") - if(${VTK_OPT}) - set(vtk_include_dir D:\\Envs\\VTK\\include\\vtk-8.2) - set(vtk_libraries_dir D:\\Envs\\VTK\\lib) - endif() -elseif(UNIX) - set(GLM_INCLUDE_DIR /usr/local/include/glm) - set(freeglut_include_dir /usr/include/GL) - set(freeglut_libraries_dir /usr/lib/x86_64-linux-gnu) - set(EIGEN_PATH /usr/local/include/eigen3/Eigen) - set(Boost_INCLUDE_DIR /usr/include/boost) - set(Boost_LIBRARIES_DIR /usr/lib/x86_64-linux-gnu) - set(DTK_INCLUDE_DIR /usr/local/include) - set(DTK_LIBRARIES_DIR /usr/local/lib) -endif() - -if(${VTK_OPT}) - add_definitions(-DUSE_VTK) -endif() - -include_directories(${GLM_INCLUDE_DIR}) -include_directories(${freeglut_include_dir}) -link_directories(${freeglut_libraries_dir}) -include_directories(${EIGEN_PATH}) -include_directories(${Boost_INCLUDE_DIR}) -link_directories(${Boost_LIBRARIES_DIR}) -include_directories(${DTK_INCLUDE_DIR}) -link_directories(${DTK_LIBRARIES_DIR}) - -if(${VTK_OPT}) - include_directories(${vtk_include_dir}) - link_libraries(${vtk_libraries_dir}/*.lib) -endif() - -#link #single lib #glfw static library include glfw3.lib @@ -60,15 +14,45 @@ endif() #glfw static library include glfw3_mt.lib #glfw dynamic library include glfw3dll.lib glfw3.dll +add_executable(demo3d + main.cpp + dtkFemSimulation.cpp + dtkScene.cpp +) + +target_include_directories(demo3d PRIVATE + ./ + ../ + ../engine/dtk + ../engine/math + ../engine/physics +) + +target_link_libraries(demo3d PRIVATE + dtk + Boost::headers + Boost::dynamic_linking + CGAL + GLUT::GLUT + glfw + glm + Eigen + OpenGL::GL + glut + GLU +) + +target_compile_definitions(demo3d PRIVATE +# $ +) -add_executable(demo3d ${dir_source} ${dir_headers}) #target_link_libraries(FemSimulation ${GLFW_LIBRARIES} glfw3dll.lib glfw3.dll ${Boost_LIBRARIES} CGAL) -if(WIN32) - target_link_libraries(demo3d ${GLFW_LIBRARIES} ${Boost_LIBRARIES} freeglut opengl32 glu32) - if(${VTK_OPT}) - target_link_libraries(demo3d ${vtk_libraries_dir}/*.lib) - endif() -elseif(UNIX) - target_link_libraries(demo3d ${GLFW_LIBRARIES} ${Boost_LIBRARIES} CGAL glut OpenGL GLU dtk) -endif() +#if (WIN32) +# target_link_libraries(demo3d ${GLFW_LIBRARIES} ${Boost_LIBRARIES} freeglut opengl32 glu32) +# if (${VTK_OPT}) +# target_link_libraries(demo3d ${vtk_libraries_dir}/*.lib) +# endif () +#elseif (UNIX) +# target_link_libraries(demo3d ${GLFW_LIBRARIES} ${Boost_LIBRARIES} CGAL glut OpenGL GLU dtk) +#endif () diff --git a/src/demo3d/dtkFemSimulation.cpp b/src/demo3d/dtkFemSimulation.cpp index 783ffbf..d517478 100644 --- a/src/demo3d/dtkFemSimulation.cpp +++ b/src/demo3d/dtkFemSimulation.cpp @@ -51,7 +51,7 @@ float radius = 0.05; int iterate_time = 3; -double M_PI = acos(-1); +//double M_PI = acos(-1); inline int mesh(int i, int j, int k) { return k * (n_node_y * n_node_x) + j * n_node_x + i;