From: Nabil Ghodbane Date: Sat, 5 Oct 2024 20:29:38 +0000 (+0200) Subject: spns #43020: implement boolean operations on meshes in SALOME X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7f9f1a09a64a6a2ccb2f18af3c8955d0729a1e2a;p=tools%2Fsat_salome.git spns #43020: implement boolean operations on meshes in SALOME --- diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index f514ddf..eed3f42 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -45,12 +45,14 @@ APPLICATION : C3PO: 'v2.3' certifi : 'native' cftime: 'native' + cgal : 'v5.6.1' cgns : '4.2.0' chardet : 'native' click : 'native' cmake : '3.25.2' cppunit : 'native' cminpack: '1.3.6' + cork : '5987de5' cycler : 'native' Cython : 'native' dateutil : 'native' @@ -70,18 +72,22 @@ APPLICATION : hdf5 : '1.10.3' idna : 'native' imagesize : 'native' + irmb : '67d77b4' ispc : '1.15.0' Jinja2 : 'native' kiwisolver : 'native' lapack : 'native' + libigl : 'v2.5.0' libxml2 : 'native' llvm : 'native' markupsafe : 'native' matplotlib : 'native' + mcut : 'b5b0ec6' mdurl : 'native' markdown_it_py : '3.0.0' medfile : '4.1.1' mesa : {tag : '19.0.8-x86_64-'+$VARS.dist, base: 'no', section: 'version_bin'} + meshbooleanplugin : 'main' MeshGems : '2.15-1' meshio: '5.3.5' metis : 'native' @@ -119,11 +125,13 @@ APPLICATION : Pygments : 'native' pyparsing : 'native' PyQt : 'native' + pyqwt: {tag : '0.12.1', base : 'no', section : 'version_0_12_1_no_pip', hpc: 'no'} pyreadline : 'native' pytest : 'native' Python : 'native' pytz : 'native' qt : 'native' + qtpy : {tag : '2.4.1', base : 'no', section : 'version_2_4_1_no_pip', hpc: 'no'} qwt : 'native' requests : 'native' rkCommon : '1.5.1' @@ -289,7 +297,7 @@ __overwrite__ : # - Qt minimal version 5.12 # - xmlpatterns executable __condition__ : "VARS.dist in ['DB10']" - 'APPLICATION.rm_products' : ['nose_py3','assimulo'] # + 'APPLICATION.rm_products' : ['nose_py3','assimulo', 'irmb', 'mcut'] 'APPLICATION.products.nlopt' : '2.4.2' 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.cminpack' : 'native' diff --git a/applications/SALOME-master-windows.pyconf b/applications/SALOME-master-windows.pyconf index 24aca7e..0059666 100644 --- a/applications/SALOME-master-windows.pyconf +++ b/applications/SALOME-master-windows.pyconf @@ -48,12 +48,14 @@ APPLICATION : CAS : {tag:'CR780-SALOME-PATCH', section:'version_CR780_SALOME_PATCH_win', base: 'no'} certifi : '2019.6.16' cftime : '1.6.3' + cgal : 'v5.6.1' cgns : '4.2.0' chardet : '3.0.4' click : '7.0' cmake : '3.24.2' cminpack: '1.3.6' colorama: '0.4.1' + cork : '5987de5' cppunit : '1.13.2' cycler : '0.10.0' Cython : '0.29.37' @@ -78,10 +80,12 @@ APPLICATION : idna : '2.8' imagesize : '1.1.0' iniconfig : '2.0.0' + #irmb : '67d77b4' ispc : '1.15.0' Jinja2 : '2.10.1' kiwisolver : '1.4.5' lapack : '3.8.0' + libigl : 'v2.5.0' libjpeg: '9c' libpng: '1.5.10' libxml2 : '2.9.1' @@ -90,13 +94,16 @@ APPLICATION : markdown_it_py : '3.0.0' markupsafe : '1.1.1' matplotlib : '3.3.4' + mcut : 'b5b0ec6' medfile : '4.1.1' mesa : '19.2.3' + meshbooleanplugin : 'main' MeshGems : '2.15-1' meshio: '5.3.5' metis : '5.1.0' mmg : '5.6.0' mmgplugin: 'main' + mpir: '855491e' msvc : '2017' netcdf : '4.6.2' netCDF4: '1.6.5' @@ -129,10 +136,12 @@ APPLICATION : Pygments : '2.13.0' pyparsing : '2.4.0' PyQt : '5.15.3' + pyqwt: {tag : '0.12.1', base : 'no', section : 'version_0_12_1_no_pip'} pyreadline : '3.4.1' Python : '3.9.14' pytz : '2020.1' qt : '5.15.2' + qtpy : {tag : '2.4.1', base : 'no', section : 'version_2_4_1_no_pip'} qwt : '6.1.6' requests : '2.22.0' rich : '13.7.1' @@ -161,6 +170,7 @@ APPLICATION : tomli : '2.0.1' tcltk : '8.6.9' urllib3 : '1.25.3' + wheel : {tag : '0.44.0', base : 'no', section : 'version_0_44_0_no_pip'} zlib : '1.2.5' # SALOME MODULES : diff --git a/applications/SALOME-master.pyconf b/applications/SALOME-master.pyconf index 2a2e979..148f8de 100644 --- a/applications/SALOME-master.pyconf +++ b/applications/SALOME-master.pyconf @@ -44,6 +44,7 @@ APPLICATION : C3PO: 'v2.3' certifi : '2018.8.24' cftime: '1.6.3' + cgal : 'v5.6.1' cgns : '4.2.0' chardet : '3.0.4' charset_normalizer : '3.3.2' @@ -51,6 +52,7 @@ APPLICATION : cmake : '3.25.2' cminpack: '1.3.6' contourpy : '1.2.0' + cork : '5987de5' cppunit : '1.13.2' cycler : '0.10.0' Cython : '0.29.37' @@ -64,6 +66,7 @@ APPLICATION : freeimage : '3.16.0' freetype : '2.9.1' gcc : '8.5.0' + libigl : 'v2.5.0' mpc : 'native' gmp : 'native' mmg : '5.6.0' @@ -90,6 +93,7 @@ APPLICATION : mdurl: '0.1.2' medfile : '4.1.1' mesa : '19.0.8' + meshbooleanplugin : {tag:'main', base:'no', section:'version_no_irmb_mcut'} MeshGems : '2.15-1' meshio : {tag: '5.3.5' , base: 'no', section : 'version_5_3_5_no_pip'} mpi4py : {tag: '3.1.0', base: 'no', section : 'version_3_1_0_no_pip'} @@ -125,11 +129,13 @@ APPLICATION : Pygments : '2.17.2' pyparsing : '3.1.1' PyQt : '5.15.3' + pyqwt: {tag : '0.12.1', base : 'no', section : 'version_0_12_1_no_pip', hpc: 'no'} pyreadline : '2.0' pytest : '8.1.1' Python : '3.9.14' pytz : '2017.2' qt : '5.15.2' + qtpy : {tag : '2.4.1', base : 'no', section : 'version_2_4_1_no_pip', hpc: 'no'} qwt : '6.1.6' requests : '2.31.0' rich : '13.7.1' diff --git a/products/PyQt.pyconf b/products/PyQt.pyconf index 49c7e9f..a645fd2 100644 --- a/products/PyQt.pyconf +++ b/products/PyQt.pyconf @@ -6,9 +6,9 @@ default : get_source : "archive" system_info : { - rpm : ["python3-qt5"] + rpm : ["python3-qt5", "python3-pyqt5.qtsvg"] rpm_dev : ["python3-qt5-devel"] - apt : ["python3-pyqt5"] + apt : ["python3-pyqt5", "python3-pyqt5.qtsvg"] apt_dev : ["pyqt5-dev", "pyqt5-dev-tools"] } environ : diff --git a/products/cgal.pyconf b/products/cgal.pyconf new file mode 100644 index 0000000..8d1997e --- /dev/null +++ b/products/cgal.pyconf @@ -0,0 +1,49 @@ +default : +{ + name : "cgal" + build_source : "cmake" + cmake_options : "-DCMAKE_INSTALL_LIBDIR:STRING=lib -DWITH_examples=ON -DWITH_tests=ON -DWITH_demos=ON -DCGAL_ENABLE_TESTING=ON" + get_source : "git" + git_info: + { + repositories : + { + github : "https://github.com/CGAL/cgal.git" + } + } + patches : [] + system_info : + { + rpm : [] + rpm_dev : ['CGAL-devel'] + apt : [] + apt_dev : ['cgal-dev'] + } + environ : + { + env_script : $name + ".py" + } + depend : ["SMESH", + "mmg", + "PyQt", + "Python", + "numpy" + ] + build_depend : ["cmake", "cppunit"] + opt_depend : [] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "no" + } +} + +version_v5_6_1: +{ + build_source : "script" + compil_script : "cgal-v5.6.1" + $VARS.scriptExtension + patches : ["cgal-p01.patch"] +} diff --git a/products/compil_scripts/cgal-v5.6.1.bat b/products/compil_scripts/cgal-v5.6.1.bat new file mode 100644 index 0000000..31531b7 --- /dev/null +++ b/products/compil_scripts/cgal-v5.6.1.bat @@ -0,0 +1,136 @@ +@echo off + +echo ########################################################################## +echo cgal %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017" +) + +SET PRODUCT_BUILD_TYPE=release +IF DEFINED SAT_CMAKE_BUILD_TYPE ( + SET PRODUCT_BUILD_TYPE=%SAT_CMAKE_BUILD_TYPE% +) + +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +SET CGAL_DISABLE_GMP=1 +cd %BUILD_DIR% +set CMAKE_OPTIONS= +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -G %CMAKE_GENERATOR% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -A x64 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DWITH_examples=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DWITH_tests=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DWITH_demos=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGAL_ENABLE_TESTING=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGAL_USE_GMP=OFF + +set MSBUILDDISABLENODEREUSE=1 + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cmake + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +echo ******************************************************************** +echo Building cgal_test +echo ******************************************************************** + +REM clean BUILD directory +mkdir %BUILD_DIR%\cgal_test +cd %BUILD_DIR%\cgal_test + +set CMAKE_OPTIONS= +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -G %CMAKE_GENERATOR% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -A x64 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGAL_DIR=%PRODUCT_INSTALL:\=/%/lib/cmake +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DEXECUTABLE_OUTPUT_PATH=%PRODUCT_INSTALL:\=/%/bin +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGAL_DISABLE_GMP=OFF + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR%\cgal_test +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cmake cgal_test + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +echo +echo ########## END diff --git a/products/compil_scripts/cgal-v5.6.1.sh b/products/compil_scripts/cgal-v5.6.1.sh new file mode 100755 index 0000000..ad4972d --- /dev/null +++ b/products/compil_scripts/cgal-v5.6.1.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +echo "##########################################################################" +echo "cgal" $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR + +CMAKE_OPTIONS= +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" +CMAKE_OPTIONS+=" -DWITH_examples=ON" +CMAKE_OPTIONS+=" -DWITH_tests=ON" +CMAKE_OPTIONS+=" -DWITH_demos=ON" +CMAKE_OPTIONS+=" -DCGAL_ENABLE_TESTING=ON" + +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi + +echo "##########################################################################" +echo "Building cgal_test" +echo "##########################################################################" + +mkdir $BUILD_DIR/cgal_test +cd $BUILD_DIR/cgal_test +CMAKE_OPTIONS= +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi +CMAKE_OPTIONS+=" -DCGAL_DIR=${PRODUCT_INSTALL}/lib/cmake" +CMAKE_OPTIONS+=" -DEXECUTABLE_OUTPUT_PATH=${PRODUCT_INSTALL}/bin" +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR/cgal_test +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/cork-5987de5.bat b/products/compil_scripts/cork-5987de5.bat new file mode 100644 index 0000000..a57f6e8 --- /dev/null +++ b/products/compil_scripts/cork-5987de5.bat @@ -0,0 +1,21 @@ +@echo off + +echo ########################################################################## +echo Cork %VERSION% +echo ########################################################################## + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +cd %SOURCE_DIR% +xcopy * %PRODUCT_INSTALL% /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 1 +) + +echo. +echo ########## END diff --git a/products/compil_scripts/cork.bat b/products/compil_scripts/cork.bat new file mode 100644 index 0000000..50c5625 --- /dev/null +++ b/products/compil_scripts/cork.bat @@ -0,0 +1,51 @@ +@echo off + +echo ########################################################################## +echo cork %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017" +) + +SET PRODUCT_BUILD_TYPE=release +IF DEFINED SAT_CMAKE_BUILD_TYPE ( + SET PRODUCT_BUILD_TYPE=%SAT_CMAKE_BUILD_TYPE% +) + +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% +cd %SOURCE_DIR% +xcopy * %BUILD_DIR%\ /E /I /Q +cd %BUILD_DIR%\\win\wincork +REM Upgrade to current version of MSVC +echo. +echo *** devenv wincork.vcxproj /upgrade +devenv wincork.vcxproj /upgrade +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on devenv + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 wincork.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 wincork.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild wincork.vcxproj + exit 2 +) diff --git a/products/compil_scripts/cork.sh b/products/compil_scripts/cork.sh new file mode 100755 index 0000000..2e9e79a --- /dev/null +++ b/products/compil_scripts/cork.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +echo "##########################################################################" +echo "cork" $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR +cp -r $SOURCE_DIR/* . +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 1 +fi + +echo +echo "*** make install" +mkdir -p ${PRODUCT_INSTALL}/bin +for f in $(ls $BUILD_DIR/bin); do + echo "INFO: next file: $f" + F=${PRODUCT_INSTALL}/bin/$(basename $f) + mv $BUILD_DIR/bin/$f $F + if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 2 + fi + if [ ! -L "$F" ]; then + chmod 755 $F + fi +done + +cd $PRODUCT_INSTALL/bin +mv cork cork_bin +if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 3 +fi + +cp -r ${BUILD_DIR}/include ${PRODUCT_INSTALL}/include +if [ $? -ne 0 ]; then + echo "ERROR on make install: could not copy include directory..." + exit 4 +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/irmb.bat b/products/compil_scripts/irmb.bat new file mode 100644 index 0000000..283e670 --- /dev/null +++ b/products/compil_scripts/irmb.bat @@ -0,0 +1,79 @@ +@echo off + +echo ########################################################################## +echo irmb %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017" +) + +SET PRODUCT_BUILD_TYPE=release +IF DEFINED SAT_CMAKE_BUILD_TYPE ( + SET PRODUCT_BUILD_TYPE=%SAT_CMAKE_BUILD_TYPE% +) + +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +cd %BUILD_DIR% +set CMAKE_OPTIONS= +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -G %CMAKE_GENERATOR% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -A x64 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib + +set MSBUILDDISABLENODEREUSE=1 + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cmake + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +set MSBUILDDISABLENODEREUSE=1 + +echo +echo ########## END diff --git a/products/compil_scripts/irmb.sh b/products/compil_scripts/irmb.sh new file mode 100755 index 0000000..55dc7c7 --- /dev/null +++ b/products/compil_scripts/irmb.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +echo "##########################################################################" +echo "irm" $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR + +CMAKE_OPTIONS= +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" + +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi + +echo +echo "*** make install" +mkdir -p ${PRODUCT_INSTALL}/bin +for f in $(ls |grep mesh_booleans); do + echo "INFO: next file: $f" + F=${PRODUCT_INSTALL}/bin/$f + mv ${BUILD_DIR}/$f $F + if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 4 + fi + if [ ! -L "$F" ]; then + chmod 755 $F + fi +done + +echo +echo "########## END" + diff --git a/products/compil_scripts/libigl-v2.5.0.bat b/products/compil_scripts/libigl-v2.5.0.bat new file mode 100644 index 0000000..855b1b3 --- /dev/null +++ b/products/compil_scripts/libigl-v2.5.0.bat @@ -0,0 +1,98 @@ +@echo off + +echo ########################################################################## +echo libigl %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017" +) + +SET PRODUCT_BUILD_TYPE=release +IF DEFINED SAT_CMAKE_BUILD_TYPE ( + SET PRODUCT_BUILD_TYPE=%SAT_CMAKE_BUILD_TYPE% +) + +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +cd %BUILD_DIR% +set CMAKE_OPTIONS= +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -G %CMAKE_GENERATOR% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -A x64 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBIGL_PARENT_DIR=ON +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGAL_DIR=%CGAL_DIR:\=/% + +REM Boost settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBOOST_ROOT:PATH=%BOOST_ROOT_DIR:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_ADDITIONAL_VERSIONS="%BOOST_VERSION% %BOOST_VERSION_MajorMinor%" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBOOST_INCLUDEDIR=%Boost_INCLUDE_DIR:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_INCLUDE_DIR=%Boost_INCLUDE_DIR:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_NO_BOOST_CMAKE:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_NO_SYSTEM_PATHS:BOOL=ON + +REM libxml2 settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_INCLUDE_DIR:STRING=%LIBXML2_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_LIBRARIES:STRING=%LIBXML2_ROOT_DIR:\=/%/lib/libxml2.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_XMLLINT_EXECUTABLE=%LIBXML2_ROOT_DIR:\=/%/bin/xmllint.exe + +set MSBUILDDISABLENODEREUSE=1 + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cmake + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 609_Boolean.vcxproj +echo ********************************************************************* +echo. + +cd %BUILD_DIR%\tutorial +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 609_Boolean.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild 609_Boolean.vcxproj + exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +mkdir %PRODUCT_INSTALL%\bin + +copy /Y /B %BUILD_DIR%\bin\%PRODUCT_BUILD_TYPE%\* %PRODUCT_INSTALL%\bin\ +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +set MSBUILDDISABLENODEREUSE=1 + +echo +echo ########## END diff --git a/products/compil_scripts/libigl-v2.5.0.sh b/products/compil_scripts/libigl-v2.5.0.sh new file mode 100755 index 0000000..c0148ff --- /dev/null +++ b/products/compil_scripts/libigl-v2.5.0.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +echo "##########################################################################" +echo "libigl" $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR + +CMAKE_OPTIONS= +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" + +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR + +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +cd tutorial +make $MAKE_OPTIONS tutorial/CMakeFiles/609_Boolean.dir/rule +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +mkdir -p ${PRODUCT_INSTALL}/bin +cp $BUILD_DIR/bin/609_Boolean ${PRODUCT_INSTALL}/bin +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi +chmod 755 ${PRODUCT_INSTALL}/bin/609_Boolean + +cp -r ${SOURCE_DIR}/include ${PRODUCT_INSTALL}/include +if [ $? -ne 0 ]; then + echo "ERROR on make install: could not copy include directory..." + exit 4 +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/mcut.bat b/products/compil_scripts/mcut.bat new file mode 100644 index 0000000..ab66a59 --- /dev/null +++ b/products/compil_scripts/mcut.bat @@ -0,0 +1,80 @@ +@echo off + +echo ########################################################################## +echo mcut %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017" +) + +SET PRODUCT_BUILD_TYPE=release +IF DEFINED SAT_CMAKE_BUILD_TYPE ( + SET PRODUCT_BUILD_TYPE=%SAT_CMAKE_BUILD_TYPE% +) + +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +cd %BUILD_DIR% +set CMAKE_OPTIONS= +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -G %CMAKE_GENERATOR% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -A x64 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBIGL_INCLUDE_DIR=%LIBIGL_INCLUDE_DIR:\=/% + + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cmake + exit 1 +) + +set MSBUILDDISABLENODEREUSE=1 + + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +echo +echo ########## END diff --git a/products/compil_scripts/mcut.sh b/products/compil_scripts/mcut.sh new file mode 100755 index 0000000..a569965 --- /dev/null +++ b/products/compil_scripts/mcut.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "##########################################################################" +echo "cgal" $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR + +CMAKE_OPTIONS= +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" +CMAKE_OPTIONS+=" -DLIBIGL_INCLUDE_DIR=${LIBIGL_INCLUDE_DIR}" + +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR + +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi + +echo +echo "*** make install" +mkdir -p ${PRODUCT_INSTALL}/bin +for f in $(ls ${BUILD_DIR}/bin); do + echo "INFO: next file: $f" + F=${PRODUCT_INSTALL}/bin/$f + mv ${BUILD_DIR}/bin/$f $F + if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 4 + fi + if [ ! -L "$F" ]; then + chmod 755 $F + fi +done + +echo +echo "########## END" diff --git a/products/compil_scripts/meshboolean.sh b/products/compil_scripts/meshboolean.sh new file mode 100755 index 0000000..0d79cf0 --- /dev/null +++ b/products/compil_scripts/meshboolean.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +echo "##########################################################################" +echo "meshboolean" $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR + +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + +echo "##########################################################################" +echo "cgal" $VERSION +echo "##########################################################################" + +mkdir $BUILD_DIR/cgal +cd $BUILD_DIR/cgal + +CMAKE_OPTIONS= +# common settings +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" +CMAKE_OPTIONS+=" -DWITH_examples=ON" +CMAKE_OPTIONS+=" -DWITH_tests=ON" +CMAKE_OPTIONS+=" -DWITH_demos=ON" +CMAKE_OPTIONS+=" -DCGAL_ENABLE_TESTING=ON" + +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR + +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi + +echo "##########################################################################" +echo "libigl" $VERSION +echo "##########################################################################" + +mkdir $BUILD_DIR/libigl +cd $BUILD_DIR/libigl + +CMAKE_OPTIONS= +# common settings +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" + +# overwrite the main.cpp +cp -f $SOURCE_DIR/libigl/main.cpp $SOURCE_DIR/libigl/libigl/tutorial/609_Boolean/main.cpp + +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR/libigl/libigl + +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +cd $BUILD_DIR/libigl/tutorial +make $MAKE_OPTIONS tutorial/CMakeFiles/609_Boolean.dir/rule +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +mkdir -p ${PRODUCT_INSTALL}/bin +cp $BUILD_DIR/libigl/bin/609_Boolean ${PRODUCT_INSTALL}/bin +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi +chmod 755 ${PRODUCT_INSTALL}/bin/609_Boolean + +echo +echo "########## END" diff --git a/products/compil_scripts/meshbooleanplugin.bat b/products/compil_scripts/meshbooleanplugin.bat new file mode 100644 index 0000000..790ef60 --- /dev/null +++ b/products/compil_scripts/meshbooleanplugin.bat @@ -0,0 +1,79 @@ +@echo off + +echo ########################################################################## +echo Meshbooleanplugin %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017" +) + +SET PRODUCT_BUILD_TYPE=release +IF DEFINED SAT_CMAKE_BUILD_TYPE ( + SET PRODUCT_BUILD_TYPE=%SAT_CMAKE_BUILD_TYPE% +) + +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% +cd %BUILD_DIR% +set CMAKE_OPTIONS= +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -G %CMAKE_GENERATOR% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -A x64 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_SAT=ON + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cmake + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +cd %PRODUCT_INSTALL%\plugins\meshbooleanplugin +powershell -Command "(Get-Content MyPlugDialog_ui.py).replace('from qwt_plot import QwtPlot', 'from qwt import QwtPlot') |Set-Content MyPlugDialog_ui.py" +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on patching plugin... + exit 4 +) diff --git a/products/compil_scripts/meshbooleanplugin.sh b/products/compil_scripts/meshbooleanplugin.sh new file mode 100755 index 0000000..67c32ce --- /dev/null +++ b/products/compil_scripts/meshbooleanplugin.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +echo "##########################################################################" +echo "meshboolean" $VERSION +echo "##########################################################################" + +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR + +CMAKE_OPTIONS= +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" +CMAKE_OPTIONS+=" -DUSE_SAT=ON" + +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi + +if [ -f ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py ]; then + sed '$d' ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py > ${BUILD_DIR}/MyPlugDialog_ui.py + echo "from qwt import QwtPlot" >> ${BUILD_DIR}/MyPlugDialog_ui.py + echo >> ${BUILD_DIR}/MyPlugDialog_ui.py + mv ${BUILD_DIR}/MyPlugDialog_ui.py ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py + if [ $? -ne 0 ]; then + echo "could not overwrite MyPlugDialog_ui.py" + exit 1 + fi +else + echo "ERROR: could not find MyPlugDialog_ui.py" + exit 1 +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/mpir.bat b/products/compil_scripts/mpir.bat new file mode 100644 index 0000000..d37a757 --- /dev/null +++ b/products/compil_scripts/mpir.bat @@ -0,0 +1,63 @@ +@echo off + +echo ########################################################################## +echo mpir %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017" +) + +SET PRODUCT_BUILD_TYPE=release +IF DEFINED SAT_CMAKE_BUILD_TYPE ( + SET PRODUCT_BUILD_TYPE=%SAT_CMAKE_BUILD_TYPE% +) + +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% +if NOT exist "%PRODUCT_INSTALL%\include" mkdir %PRODUCT_INSTALL%\include +if NOT exist "%PRODUCT_INSTALL%\lib" mkdir %PRODUCT_INSTALL%\lib + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% +cd %SOURCE_DIR% +xcopy * %BUILD_DIR%\ /E /I /Q + +cd %BUILD_DIR%\build.vc15\lib_mpir_gc + +REM Upgrade to current version of MSVC +echo. +echo *** devenv lib_mpir_gc.vcxproj /upgrade +devenv lib_mpir_gc.vcxproj /upgrade +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on devenv + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 lib_mpir_gc.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 lib_mpir_gc.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild lib_mpir_gc.vcxproj + exit 2 +) + +copy /Y x64\%PRODUCT_BUILD_TYPE%\mpir.h %PRODUCT_INSTALL%\include\mpir.h +copy /Y x64\%PRODUCT_BUILD_TYPE%\mpirxx.h %PRODUCT_INSTALL%\include\mpirxx.h +copy /Y /B x64\%PRODUCT_BUILD_TYPE%\mpir_a.lib %PRODUCT_INSTALL%\lib\mpir.lib +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on copy mpir.lib + exit 2 +) diff --git a/products/compil_scripts/pyqwt-0.12.1.bat b/products/compil_scripts/pyqwt-0.12.1.bat new file mode 100644 index 0000000..6e2803f --- /dev/null +++ b/products/compil_scripts/pyqwt-0.12.1.bat @@ -0,0 +1,31 @@ +@echo off + +echo ########################################################################## +echo pyqwt %VERSION% +echo ########################################################################## + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR%\cache\pip + +cd %SOURCE_DIR% +xcopy * %BUILD_DIR%\ /E /I /Q +cd %BUILD_DIR% + +REM Ensure that meshio is not present. +%PYTHON_ROOT_DIR%\python.exe -m pip uninstall -y pyqwt + +%PYTHON_ROOT_DIR%\python.exe -m pip install . --cache-dir=%BUILD_DIR%\cache\pip --no-deps --no-build-isolation +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python -m pip install + exit 3 +) + +echo. +echo Product %PRODUCT_NAME% version: %VERSION%> %PRODUCT_INSTALL%\README.txt +echo Installation folder: %PYTHON_ROOT_DIR%>> %PRODUCT_INSTALL%\README.txt + +echo. +echo ########## END diff --git a/products/compil_scripts/pyqwt-0.12.1.sh b/products/compil_scripts/pyqwt-0.12.1.sh new file mode 100755 index 0000000..c47d43e --- /dev/null +++ b/products/compil_scripts/pyqwt-0.12.1.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +echo "##########################################################################" +echo "pyqwt" $VERSION +echo "##########################################################################" + +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + +rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR/cache/pip + +mkdir -p $PRODUCT_INSTALL + +cd $BUILD_DIR + +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH +export PATH=${PRODUCT_INSTALL}/bin:$PATH + +${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR --no-deps --target=$PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages +if [ $? -ne 0 ]; then + echo "ERROR: could not install" + exit 1 +fi + +if [ -d ${PRODUCT_INSTALL}/lib64 ]; then + mv ${PRODUCT_INSTALL}/lib64 ${PRODUCT_INSTALL}/lib +fi + +# strangely on some nodes (e.g DB10, FD36), pip fails to retrieve version - would require to upgrade pip +# In that case, simply copy the qwt, given there is no real compilation involved here. +F=$(ls ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages|grep UNKNOWN) +if [ $? -eq 0 ]; then + cd ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages + rm -rf *UNKNOWN* + cp -r $SOURCE_DIR/qwt $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/qwt + if [ $? -ne 0 ]; then + echo "ERROR: could not install" + exit 1 + fi +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/pyqwt-0.12.7.bat b/products/compil_scripts/pyqwt-0.12.7.bat new file mode 100644 index 0000000..7f35023 --- /dev/null +++ b/products/compil_scripts/pyqwt-0.12.7.bat @@ -0,0 +1,31 @@ +@echo off + +echo ########################################################################## +echo pyqwt %VERSION% +echo ########################################################################## + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR%\cache\pip + +cd %SOURCE_DIR% +xcopy * %BUILD_DIR%\ /E /I /Q +cd %BUILD_DIR% + +REM Ensure that meshio is not present. +%PYTHON_ROOT_DIR%\python.exe -m pip uninstall -y pyqwt + +%PYTHON_ROOT_DIR%\python.exe setup.py install +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo. +echo Product %PRODUCT_NAME% version: %VERSION%> %PRODUCT_INSTALL%\README.txt +echo Installation folder: %PYTHON_ROOT_DIR%>> %PRODUCT_INSTALL%\README.txt + +echo. +echo ########## END diff --git a/products/compil_scripts/qtpy-2.4.1.bat b/products/compil_scripts/qtpy-2.4.1.bat new file mode 100644 index 0000000..3f3270b --- /dev/null +++ b/products/compil_scripts/qtpy-2.4.1.bat @@ -0,0 +1,31 @@ +@echo off + +echo ########################################################################## +echo qtpy %VERSION% +echo ########################################################################## + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR%\cache\pip + +cd %SOURCE_DIR% +xcopy * %BUILD_DIR%\ /E /I /Q +cd %BUILD_DIR% + +REM Ensure that meshio is not present. +%PYTHON_ROOT_DIR%\python.exe -m pip uninstall -y qtpy + +%PYTHON_ROOT_DIR%\python.exe setup.py install +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo. +echo Product %PRODUCT_NAME% version: %VERSION%> %PRODUCT_INSTALL%\README.txt +echo Installation folder: %PYTHON_ROOT_DIR%>> %PRODUCT_INSTALL%\README.txt + +echo. +echo ########## END diff --git a/products/compil_scripts/qtpy-2.4.1.sh b/products/compil_scripts/qtpy-2.4.1.sh new file mode 100755 index 0000000..676250c --- /dev/null +++ b/products/compil_scripts/qtpy-2.4.1.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +echo "##########################################################################" +echo "qtpy" $VERSION +echo "##########################################################################" + +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + +rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR/cache/pip + +mkdir -p $PRODUCT_INSTALL + +cd $BUILD_DIR + +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH +export PATH=${PRODUCT_INSTALL}/bin:$PATH + +${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR --no-deps --target=$PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages +if [ $? -ne 0 ]; then + echo "ERROR: could not install" + exit 1 +fi +if [ -d ${PRODUCT_INSTALL}/lib64 ]; then + mv ${PRODUCT_INSTALL}/lib64 ${PRODUCT_INSTALL}/lib +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/wheel-0.44.0.bat b/products/compil_scripts/wheel-0.44.0.bat new file mode 100644 index 0000000..636f830 --- /dev/null +++ b/products/compil_scripts/wheel-0.44.0.bat @@ -0,0 +1,31 @@ +@echo off + +echo ########################################################################## +echo wheel %VERSION% +echo ########################################################################## + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR%\cache\pip + +cd %SOURCE_DIR% +xcopy * %BUILD_DIR%\ /E /I /Q +cd %BUILD_DIR% + +REM Ensure that meshio is not present. +%PYTHON_ROOT_DIR%\python.exe -m pip uninstall -y wheel + +%PYTHON_ROOT_DIR%\python.exe setup.py install +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo. +echo Product %PRODUCT_NAME% version: %VERSION%> %PRODUCT_INSTALL%\README.txt +echo Installation folder: %PYTHON_ROOT_DIR%>> %PRODUCT_INSTALL%\README.txt + +echo. +echo ########## END diff --git a/products/cork.pyconf b/products/cork.pyconf new file mode 100644 index 0000000..dc45ae1 --- /dev/null +++ b/products/cork.pyconf @@ -0,0 +1,64 @@ +default : +{ + name : "cork" + build_source : "script" + compil_script : "cork" + $VARS.scriptExtension + get_source : "git" + git_info: + { + repositories : + { + github : "https://github.com/gilbo/cork.git" + } + } + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ["SMESH", + "mmg", + "PyQt", + "Python", + "numpy" + ] + build_depend : ["cmake", "cppunit"] + opt_depend : [ + "cgal", + "libigl", + "mpir" + ] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "no" + } +} + +version_5987de5: +{ + patches : ['cork-5987de5_off.patch'] +} + +version_5987de5_win: +{ + patches : ['cork-5987de5_off.patch', 'cork-5987de5_msvc.patch'] +} + +version_5987de5_msys : +{ + get_source : "archive" + patches : [] + archive_info : {archive_name : "cork-5987de5-mingw-w64-x86_64.tar.gz"} + compil_script : "cork-5987de5.bat" +} diff --git a/products/env_scripts/cgal.py b/products/env_scripts/cgal.py new file mode 100644 index 0000000..f657252 --- /dev/null +++ b/products/env_scripts/cgal.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('CGAL_ROOT_DIR', prereq_dir) + env.set('CGAL_VERSION', version) + env.set('CGAL_DIR', os.path.join(prereq_dir, 'lib', 'cmake')) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/cork.py b/products/env_scripts/cork.py new file mode 100644 index 0000000..415787f --- /dev/null +++ b/products/env_scripts/cork.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('CORK_ROOT_DIR', prereq_dir) + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.set('CORK_VERSION', version) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/irmb.py b/products/env_scripts/irmb.py new file mode 100644 index 0000000..5a65f4c --- /dev/null +++ b/products/env_scripts/irmb.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('IRMB_ROOT_DIR', prereq_dir) + env.set('IRMB_DIR', os.path.join(prereq_dir, 'lib', 'cmake')) + env.set('IRMB_VERSION', version) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/libigl.py b/products/env_scripts/libigl.py new file mode 100644 index 0000000..e8993ae --- /dev/null +++ b/products/env_scripts/libigl.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('LIBIGL_ROOT_DIR', prereq_dir) + env.set('LIBIGL_VERSION', version) + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.set('LIBIGL_INCLUDE_DIR', os.path.join(prereq_dir, 'include')) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/mcut.py b/products/env_scripts/mcut.py new file mode 100644 index 0000000..859e1a3 --- /dev/null +++ b/products/env_scripts/mcut.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('MCUT_ROOT_DIR', prereq_dir) + env.set('MCUT_VERSION', version) + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/meshbooleanplugin.py b/products/env_scripts/meshbooleanplugin.py new file mode 100644 index 0000000..c061635 --- /dev/null +++ b/products/env_scripts/meshbooleanplugin.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('MESHBOOLEANGPLUGIN_ROOT_DIR', prereq_dir) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'plugins')) + env.append('PATH',os.path.join(prereq_dir,'bin')) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/mpir.py b/products/env_scripts/mpir.py new file mode 100644 index 0000000..803f738 --- /dev/null +++ b/products/env_scripts/mpir.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('MPIR_ROOT_DIR', prereq_dir) + env.set('MPIR_VERSION', version) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/pyqwt.py b/products/env_scripts/pyqwt.py new file mode 100644 index 0000000..c438125 --- /dev/null +++ b/products/env_scripts/pyqwt.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + pyver = 'python' + env.get('PYTHON_VERSION') + env.set('PYQWT_ROOT_DIR',prereq_dir) + env.set("PYQWT_VERSION",version) + if not platform.system() == "Windows" : + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + else: + pass + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/qtpy.py b/products/env_scripts/qtpy.py new file mode 100644 index 0000000..9304951 --- /dev/null +++ b/products/env_scripts/qtpy.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + pyver = 'python' + env.get('PYTHON_VERSION') + env.set('QTPY_ROOT_DIR',prereq_dir) + env.set("QTPY_VERSION",version) + if not platform.system() == "Windows" : + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + else: + pass + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/wheel.py b/products/env_scripts/wheel.py new file mode 100644 index 0000000..56e4a79 --- /dev/null +++ b/products/env_scripts/wheel.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + pyver = 'python' + env.get('PYTHON_VERSION') + env.set('WHEEL_ROOT_DIR',prereq_dir) + env.set("WHEEL_VERSION",version) + if not platform.system() == "Windows" : + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + else: + pass + +def set_nativ_env(env): + pass diff --git a/products/irmb.pyconf b/products/irmb.pyconf new file mode 100644 index 0000000..d07c4dc --- /dev/null +++ b/products/irmb.pyconf @@ -0,0 +1,45 @@ +default : +{ + name : "irmb" + build_source: "script" + compil_script: "irmb" + $VARS.scriptExtension + get_source : "git" + git_info: + { + repositories : + { + github : "https://github.com/gcherchi/InteractiveAndRobustMeshBooleans.git" + } + } + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ["SMESH", + "mmg", + "PyQt", + "Python", + "numpy" + ] + build_depend : ["cmake", "cppunit"] + opt_depend : ["cgal", + "libigl", + "cork" + ] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "no" + } +} diff --git a/products/libigl.pyconf b/products/libigl.pyconf new file mode 100644 index 0000000..7d62753 --- /dev/null +++ b/products/libigl.pyconf @@ -0,0 +1,58 @@ +default : +{ + name : "libigl" + build_source : "cmake" + cmake_options : "-DCMAKE_INSTALL_LIBDIR:STRING=lib" + get_source : "git" + git_info: + { + repositories : + { + github : "https://github.com/libigl/libigl.git" + } + } + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ["SMESH", + "mmg", + "PyQt", + "Python", + "numpy" + ] + build_depend : ["cmake", "cppunit"] + opt_depend : ["cgal"] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "no" + } +} + +version_v2_5_0: +{ + build_source : "script" + compil_script : "libigl-v2.5.0" + $VARS.scriptExtension + patches: ['libigl-v2.5.0-p01_609_Boolean.patch'] + depend : ["SMESH", + "mmg", + "PyQt", + "Python", + "numpy", + "boost", + "libxml2", + "eigen" + ] +} diff --git a/products/mcut.pyconf b/products/mcut.pyconf new file mode 100644 index 0000000..1df6ac1 --- /dev/null +++ b/products/mcut.pyconf @@ -0,0 +1,59 @@ +default : +{ + name : "mcut" + build_source : "cmake" + cmake_options : "-DCMAKE_INSTALL_LIBDIR:STRING=lib" + get_source : "git" + git_info: + { + repositories : + { + github : "https://github.com/cutdigital/mcut.git" + } + } + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ["SMESH", + "mmg", + "PyQt", + "Python", + "numpy", + "eigen" + ] + build_depend : ["cmake", "cppunit"] + opt_depend : [ + "cgal", + "cork", + "irmb", + "libigl" + ] + + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "no" + } +} + +version_b5b0ec6: +{ + build_source: "script" + compil_script: "mcut" + $VARS.scriptExtension + patches : [ + 'mcut-b5b0ec6-p01_cgsboolean.patch', + 'mcut-b5b0ec6-p02_cgsboolean.patch' + ] +} diff --git a/products/meshbooleanplugin.pyconf b/products/meshbooleanplugin.pyconf new file mode 100644 index 0000000..6c81dbb --- /dev/null +++ b/products/meshbooleanplugin.pyconf @@ -0,0 +1,55 @@ +default : +{ + name : "meshbooleanplugin" + build_source : "script" + compil_script : $name + $VARS.scriptExtension + get_source : "git" + git_info: + { + repositories : + { +# github : $PROJECTS.projects.salome.git_info.git_server.github.url + "meshbooleanplugin.git" + github : "https://github.com/nitawa/meshbooleanplugin.git" + } + } + patches: [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ["CONFIGURATION", + "SMESH", + "PyQt", + "Python", + "numpy", + "pyqwt", + "qtpy" + ] + build_depend : ["cmake", "cppunit"] + opt_depend : ["cgal", "libigl", "mcut", "irmb", "cork"] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "no" + } +} + +default_win : +{ + opt_depend : ["cgal", "libigl", "cork"] +} + +version_no_irmb_mcut : +{ + patches: ['meshbooleanplugin-p01.irmb-mcut.patch'] # remove irmb and mcut since requires c++20 +} diff --git a/products/mpir.pyconf b/products/mpir.pyconf new file mode 100644 index 0000000..72d7b11 --- /dev/null +++ b/products/mpir.pyconf @@ -0,0 +1,45 @@ +default : +{ + name : "mpir" + build_source : "script" + compil_script : "mpir" + $VARS.scriptExtension + get_source : "git" + git_info: + { + repositories : + { + github : "https://github.com/winlibs/mpir.git" + } + } + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ["SMESH", + "mmg", + "PyQt", + "Python", + "numpy" + ] + build_depend : ["cmake", "cppunit"] + opt_depend : [ + "cgal", + "libigl" + ] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "no" + } +} diff --git a/products/patches/cgal-p01.patch b/products/patches/cgal-p01.patch new file mode 100644 index 0000000..79bdd64 --- /dev/null +++ b/products/patches/cgal-p01.patch @@ -0,0 +1,79 @@ +diff --git a/cgal_test/CMakeLists.txt b/cgal_test/CMakeLists.txt +new file mode 100644 +index 00000000000..13be5cfe196 +--- /dev/null ++++ b/cgal_test/CMakeLists.txt +@@ -0,0 +1,21 @@ ++cmake_minimum_required(VERSION 3.12) ++project(cgal) ++ ++option(CGAL_DIR "Path to CGAL installation" ${CMAKE_CURRENT_SOURCE_DIR}/cgal) ++option(EXECUTABLE_OUTPUT_PATH "Installation directory" ${CMAKE_CURRENT_SOURCE_DIR}) ++ ++# Find CGAL package ++IF(CGAL_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${CGAL_DIR}") ++ENDIF(CGAL_DIR) ++find_package(CGAL REQUIRED COMPONENTS Core) ++ ++# Add executable ++add_executable(exec_cgal exec_cgal.cc) ++ ++# Link CGAL libraries ++target_link_libraries(exec_cgal PRIVATE CGAL::CGAL) ++ ++# Enable C++11 features ++target_compile_features(exec_cgal PRIVATE cxx_std_11) ++INSTALL (TARGETS exec_cgal RUNTIME DESTINATION ${EXECUTABLE_OUTPUT_PATH}) +diff --git a/cgal_test/exec_cgal.cc b/cgal_test/exec_cgal.cc +new file mode 100644 +index 00000000000..b46213e4bb3 +--- /dev/null ++++ b/cgal_test/exec_cgal.cc +@@ -0,0 +1,46 @@ ++#include ++#include ++#include ++#include ++ ++#include ++ ++typedef CGAL::Exact_predicates_exact_constructions_kernel K; ++typedef CGAL::Surface_mesh Mesh; ++ ++namespace PMP = CGAL::Polygon_mesh_processing; ++ ++int main(int argc, const char** argv) ++{ ++ const std::string filename1 = argv[2]; ++ const std::string filename2 = argv[3]; ++ ++ Mesh mesh1, mesh2; ++ ++ if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) ++ { ++ std::cerr << "Invalid input." << std::endl; ++ return 1; ++ } ++ ++ bool valid_op; ++ Mesh result; ++ ++ if (!strcmp(argv[1], "union")) { ++ valid_op = PMP::corefine_and_compute_union(mesh1, mesh2, result); ++ } else if (!strcmp(argv[1], "intersection")) { ++ valid_op = PMP::corefine_and_compute_intersection(mesh1, mesh2, result); ++ } else { ++ valid_op = PMP::corefine_and_compute_difference(mesh1, mesh2, result); ++ } ++ ++ if(valid_op) ++ { ++ std::cout << "Union was successfully computed\n"; ++ CGAL::IO::write_polygon_mesh(argv[4], result, CGAL::parameters::stream_precision(17)); ++ return 0; ++ } ++ ++ std::cout << "Union could not be computed\n"; ++ return 1; ++} diff --git a/products/patches/cork-5987de5_mingw-w64-x86_64.patch b/products/patches/cork-5987de5_mingw-w64-x86_64.patch new file mode 100644 index 0000000..0f234e2 --- /dev/null +++ b/products/patches/cork-5987de5_mingw-w64-x86_64.patch @@ -0,0 +1,101 @@ +diff --git a/src/file_formats/off.cpp b/src/file_formats/off.cpp +index 3b12571..2a52bf4 100644 +--- a/src/file_formats/off.cpp ++++ b/src/file_formats/off.cpp +@@ -50,6 +50,7 @@ int readOFF(string filename, FileMesh *data) + in >> filetype; + if(filetype != "OFF") return 1; + ++ in >> filetype >> filetype >> filetype >> filetype; // Skip meshio stamp + // counts of things + int numvertices, numfaces, numedges; + in >> numvertices >> numfaces >> numedges; +diff --git a/src/isct/fixint.h b/src/isct/fixint.h +index 37465a1..ccc2074 100644 +--- a/src/isct/fixint.h ++++ b/src/isct/fixint.h +@@ -45,7 +45,7 @@ + + + +-#ifdef _WIN32 ++#ifdef _MSC_VER + #include + #else + #include +diff --git a/src/isct/gmpext4.h b/src/isct/gmpext4.h +index 1a5541c..fb76fab 100644 +--- a/src/isct/gmpext4.h ++++ b/src/isct/gmpext4.h +@@ -25,7 +25,7 @@ + // +------------------------------------------------------------------------- + #pragma once + +-#ifdef _WIN32 ++#ifdef _MSC_VER + #pragma warning(disable: 4800) + #pragma warning(disable: 4244) + #include +diff --git a/src/mesh/mesh.isct.tpp b/src/mesh/mesh.isct.tpp +index 6c48930..9c2b16d 100644 +--- a/src/mesh/mesh.isct.tpp ++++ b/src/mesh/mesh.isct.tpp +@@ -632,7 +632,7 @@ public: + quantized_coords.resize(N); + uint write = 0; + TopoCache::verts.for_each([&](Vptr v) { +-#ifdef _WIN32 ++#ifdef _MSC_VER + Vec3d raw = mesh->verts[v->ref].pos; + #else + Vec3d raw = TopoCache::mesh->verts[v->ref].pos; +diff --git a/src/mesh/mesh.tpp b/src/mesh/mesh.tpp +index 9da1614..bc63204 100644 +--- a/src/mesh/mesh.tpp ++++ b/src/mesh/mesh.tpp +@@ -250,7 +250,7 @@ typename Mesh::NeighborCache + } + + // This function signature is an amazing disaster... +-#ifdef _WIN32 ++#ifdef _MSC_VER + template + template + typename Mesh::EGraphCache +diff --git a/src/util/prelude.h b/src/util/prelude.h +index 00329aa..2eaadaf 100644 +--- a/src/util/prelude.h ++++ b/src/util/prelude.h +@@ -30,7 +30,9 @@ + #include + #include + #include +- ++#ifndef M_PI ++ #define M_PI 3.14159265358979323846 ++#endif + #ifndef uint + typedef unsigned int uint; + #endif +@@ -113,7 +115,7 @@ inline double rad2deg(double rad) { + // ********** + // * Timing + +-#ifdef _WIN32 ++#ifdef _MSC_VER + #include + #endif + +diff --git a/src/util/timer.cpp b/src/util/timer.cpp +index 3bc710a..bd06dcf 100644 +--- a/src/util/timer.cpp ++++ b/src/util/timer.cpp +@@ -25,7 +25,7 @@ + // +------------------------------------------------------------------------- + #include "prelude.h" + +-#ifdef _WIN32 ++#ifdef _MSC_VER + #include + #include + void gettimeofday(struct timeval* t,void* timezone) diff --git a/products/patches/cork-5987de5_msvc.patch b/products/patches/cork-5987de5_msvc.patch new file mode 100644 index 0000000..99d72e6 --- /dev/null +++ b/products/patches/cork-5987de5_msvc.patch @@ -0,0 +1,197 @@ +diff --git a/win/wincork/wincork.sln b/win/wincork/wincork.sln +index 46a4177..db1e8eb 100644 +--- a/win/wincork/wincork.sln ++++ b/win/wincork/wincork.sln +@@ -1,20 +1,31 @@ +- ++ + Microsoft Visual Studio Solution File, Format Version 12.00 +-# Visual Studio Express 2012 for Windows Desktop ++# Visual Studio 15 ++VisualStudioVersion = 15.0.35319.79 ++MinimumVisualStudioVersion = 10.0.40219.1 + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wincork", "wincork.vcxproj", "{AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}" + EndProject + Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 ++ Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 ++ Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Debug|Win32.Build.0 = Debug|Win32 +- {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Release|Win32.ActiveCfg = Release|Win32 +- {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Release|Win32.Build.0 = Release|Win32 ++ {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Debug|x64.ActiveCfg = Debug|Win32 ++ {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Debug|x64.Build.0 = Debug|Win32 ++ {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Release|Win32.ActiveCfg = Release|x64 ++ {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Release|Win32.Build.0 = Release|x64 ++ {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Release|x64.ActiveCfg = Release|Win32 ++ {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E}.Release|x64.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection ++ GlobalSection(ExtensibilityGlobals) = postSolution ++ SolutionGuid = {03B5EC15-EDF5-46E1-AEB0-F97AE8B731A9} ++ EndGlobalSection + EndGlobal +diff --git a/win/wincork/wincork.vcxproj b/win/wincork/wincork.vcxproj +index 92a3fae..638e9d0 100644 +--- a/win/wincork/wincork.vcxproj ++++ b/win/wincork/wincork.vcxproj +@@ -1,30 +1,52 @@ +- +- ++ ++ + + + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + + {AD6B1A8B-6983-40ED-9EF2-A7FFC457517E} + wincork ++ 10.0.22621.0 + + + + Application + true +- v110 ++ v141 ++ MultiByte ++ ++ ++ Application ++ true ++ v141 + MultiByte + + + Application + false +- v110 ++ v141 ++ true ++ MultiByte ++ ++ ++ Application ++ false ++ v141 + true + MultiByte + +@@ -34,22 +56,41 @@ + + + ++ ++ ++ + + + ++ ++ ++ + + + + + Level3 + Disabled +- C:\Users\Gilbert\Documents\GitHub\cork\src;C:\Users\Gilbert\Documents\GitHub\cork\src\accel;C:\Users\Gilbert\Documents\GitHub\cork\src\file_formats;C:\Users\Gilbert\Documents\GitHub\cork\src\isct;C:\Users\Gilbert\Documents\GitHub\cork\src\math;C:\Users\Gilbert\Documents\GitHub\cork\src\mesh;C:\Users\Gilbert\Documents\GitHub\cork\src\rawmesh;C:\Users\Gilbert\Documents\GitHub\cork\src\util;%(AdditionalIncludeDirectories) ++ ..\..\src;..\..\src\accel;..\..\src\file_formats;..\..\src\isct;..\..\src\math;..\..\src\mesh;..\..\src\rawmesh;..\..\src\util;$(MPIR_ROOT_DIR)\include;%(AdditionalIncludeDirectories) ++ _USE_MATH_DEFINES;NOMINMAX;%(PreprocessorDefinitions) ++ MultiThreadedDebugDLL ++ ++ ++ true ++ $(MPIR_ROOT_DIR)\lib\mpir.lib %(AdditionalOptions) ++ ++ ++ ++ ++ Level3 ++ Disabled ++ ..\..\src;..\..\src\accel;..\..\src\file_formats;..\..\src\isct;..\..\src\math;..\..\src\mesh;..\..\src\rawmesh;..\..\src\util;$(MPIR_ROOT_DIR)\include;%(AdditionalIncludeDirectories) + _USE_MATH_DEFINES;NOMINMAX;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + true +- mpir.lib %(AdditionalOptions) ++ $(MPIR_ROOT_DIR)\lib\mpir.lib %(AdditionalOptions) + + + +@@ -58,13 +99,30 @@ + MaxSpeed + true + true +- C:\Users\Gilbert\Documents\GitHub\cork\src;C:\Users\Gilbert\Documents\GitHub\cork\src\accel;C:\Users\Gilbert\Documents\GitHub\cork\src\file_formats;C:\Users\Gilbert\Documents\GitHub\cork\src\isct;C:\Users\Gilbert\Documents\GitHub\cork\src\math;C:\Users\Gilbert\Documents\GitHub\cork\src\mesh;C:\Users\Gilbert\Documents\GitHub\cork\src\rawmesh;C:\Users\Gilbert\Documents\GitHub\cork\src\util;%(AdditionalIncludeDirectories) ++ ..\..\src;..\..\src\accel;..\..\src\file_formats;..\..\src\isct;..\..\src\math;..\..\src\mesh;..\..\src\rawmesh;..\..\src\util;$(MPIR_ROOT_DIR)\include;%(AdditionalIncludeDirectories) ++ _USE_MATH_DEFINES;NOMINMAX;%(PreprocessorDefinitions) ++ ++ ++ true ++ true ++ true ++ $(MPIR_ROOT_DIR)\lib\mpir.lib;%(AdditionalDependencies) ++ ++ ++ ++ ++ Level3 ++ MaxSpeed ++ true ++ true ++ ..\..\src;..\..\src\accel;..\..\src\file_formats;..\..\src\isct;..\..\src\math;..\..\src\mesh;..\..\src\rawmesh;..\..\src\util;$(MPIR_ROOT_DIR)\include;%(AdditionalIncludeDirectories) + _USE_MATH_DEFINES;NOMINMAX;%(PreprocessorDefinitions) + + + true + true + true ++ $(MPIR_ROOT_DIR)\lib\mpir.lib;%(AdditionalDependencies) + + + +@@ -109,7 +167,9 @@ + + + NO_TIMER;REDUCED;CDT_ONLY;TRILIBRARY;ANSI_DECLARATORS;%(PreprocessorDefinitions) ++ NO_TIMER;REDUCED;CDT_ONLY;TRILIBRARY;ANSI_DECLARATORS;%(PreprocessorDefinitions) + NO_TIMER;REDUCED;CDT_ONLY;TRILIBRARY;ANSI_DECLARATORS;%(PreprocessorDefinitions) ++ NO_TIMER;REDUCED;CDT_ONLY;TRILIBRARY;ANSI_DECLARATORS;%(PreprocessorDefinitions) + + + +diff --git a/win/wincork/wincork.vcxproj.filters b/win/wincork/wincork.vcxproj.filters +index 792818b..d689e83 100644 +--- a/win/wincork/wincork.vcxproj.filters ++++ b/win/wincork/wincork.vcxproj.filters +@@ -1,4 +1,4 @@ +- ++ + + + diff --git a/products/patches/cork-5987de5_off.patch b/products/patches/cork-5987de5_off.patch new file mode 100644 index 0000000..6fd0c33 --- /dev/null +++ b/products/patches/cork-5987de5_off.patch @@ -0,0 +1,12 @@ +diff --git a/src/file_formats/off.cpp b/src/file_formats/off.cpp +index 3b12571..2a52bf4 100644 +--- a/src/file_formats/off.cpp ++++ b/src/file_formats/off.cpp +@@ -50,6 +50,7 @@ int readOFF(string filename, FileMesh *data) + in >> filetype; + if(filetype != "OFF") return 1; + ++ in >> filetype >> filetype >> filetype >> filetype; // Skip meshio stamp + // counts of things + int numvertices, numfaces, numedges; + in >> numvertices >> numfaces >> numedges; diff --git a/products/patches/libigl-v2.5.0-p01_609_Boolean.patch b/products/patches/libigl-v2.5.0-p01_609_Boolean.patch new file mode 100644 index 0000000..256ca45 --- /dev/null +++ b/products/patches/libigl-v2.5.0-p01_609_Boolean.patch @@ -0,0 +1,118 @@ +--- libigl-v2.5.0_ref/tutorial/609_Boolean/main.cpp 2024-05-24 17:16:22.793731575 +0200 ++++ libigl-v2.5.0_dev/tutorial/609_Boolean/main.cpp 2024-05-24 17:17:14.666323894 +0200 +@@ -1,4 +1,5 @@ +-#include ++#include ++#include + //#undef IGL_STATIC_LIBRARY + #include + #include +@@ -7,9 +8,9 @@ + #include + + +-Eigen::MatrixXd VA,VB,VC; ++Eigen::MatrixXd VA,VB,VC; // Vertices + Eigen::VectorXi J,I; +-Eigen::MatrixXi FA,FB,FC; ++Eigen::MatrixXi FA,FB,FC; // Faces + igl::MeshBooleanType boolean_type( + igl::MESH_BOOLEAN_TYPE_UNION); + +@@ -18,11 +19,9 @@ + "Union", + "Intersect", + "Minus", +- "XOR", +- "Resolve", + }; + +-void update(igl::opengl::glfw::Viewer &viewer) ++void boolean(std::string out_path) + { + igl::copyleft::cgal::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC,J); + Eigen::MatrixXd C(FC.rows(),3); +@@ -36,60 +35,34 @@ + C.row(f) = Eigen::RowVector3d(0,1,0); + } + } +- viewer.data().clear(); +- viewer.data().set_mesh(VC,FC); +- viewer.data().set_colors(C); +- std::cout<<"A "<( +- (boolean_type+1)% igl::NUM_MESH_BOOLEAN_TYPES); +- break; +- case ',': ++ static_cast( ++ (boolean_type+1)% igl::NUM_MESH_BOOLEAN_TYPES); ++ } else if (operation == "difference") ++ { + boolean_type = +- static_cast( +- (boolean_type+igl::NUM_MESH_BOOLEAN_TYPES-1)% +- igl::NUM_MESH_BOOLEAN_TYPES); +- break; +- case '[': +- viewer.core().camera_dnear -= 0.1; +- return true; +- case ']': +- viewer.core().camera_dnear += 0.1; +- return true; ++ static_cast( ++ (boolean_type+2)% igl::NUM_MESH_BOOLEAN_TYPES); + } +- update(viewer); +- return true; +-} +- +-int main(int argc, char *argv[]) +-{ +- using namespace Eigen; +- using namespace std; +- igl::readOFF(TUTORIAL_SHARED_PATH "/cheburashka.off",VA,FA); +- igl::readOFF(TUTORIAL_SHARED_PATH "/decimated-knight.off",VB,FB); +- // Plot the mesh with pseudocolors +- igl::opengl::glfw::Viewer viewer; +- +- // Initialize +- update(viewer); +- +- viewer.data().show_lines = true; +- viewer.callback_key_down = &key_down; +- viewer.core().camera_dnear = 3.9; +- cout<< +- "Press '.' to switch to next boolean operation type."< for further information. ++/** ++ * Copyright (c) 2021-2022 Floyd M. Chitalu. ++ * All rights reserved. + * +- * You may not use this file except in compliance with the License. A copy of +- * the Open Source license can be obtained from ++ * NOTE: This file is licensed under GPL-3.0-or-later (default). ++ * A commercial license can be purchased from Floyd M. Chitalu. + * +- * https://www.gnu.org/licenses/lgpl-3.0.en.html. ++ * License details: + * +- * For your convenience, a copy of this License has been included in this +- * repository. ++ * (A) GNU General Public License ("GPL"); a copy of which you should have ++ * recieved with this file. ++ * - see also: ++ * (B) Commercial license. ++ * - email: floyd.m.chitalu@gmail.com + * +- * MCUT is distributed in the hope that it will be useful, but THE SOFTWARE IS +- * PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR +- * A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * The commercial license options is for users that wish to use MCUT in ++ * their products for comercial purposes but do not wish to release their ++ * software products under the GPL license. + * +- * CSGBoolean.cpp +- * +- * \brief: +- * This tutorial shows how to compute Boolean operations between two meshes +- * that represent solids with MCUT (Constructive Solid Geometry). +- * +- * Author(s): +- * +- * Floyd M. Chitalu CutDigital Enterprise Ltd. +- * +- **************************************************************************/ +- +-#include "mcut/mcut.h" +-#include "mio/mio.h" ++ * Author(s) : Floyd M. Chitalu ++ */ + +-#include +-#include +-#include +-#include +-#include +-#include +-#include + #if defined(_WIN32) + #define _CRT_SECURE_NO_WARNINGS 1 + +@@ -63,36 +34,44 @@ + std::exit(1); \ + } + +-void MCAPI_PTR mcDebugOutput(McDebugSource source, +- McDebugType type, +- McUint32 id, +- McDebugSeverity severity, +- size_t length, +- const char* message, +- const void* userParam); ++/* ++This tutorial shows how to compute boolean operations using MCUT. ++*/ ++ ++#include "mcut/mcut.h" ++ ++#include ++#include ++#include ++#include ++// libigl dependencies ++#include ++#include ++#include ++#include ++#include ++ ++struct InputMesh { ++ // variables for reading .obj file data with libigl ++ std::vector> V; ++ std::vector> F; ++ ++ // variables for mesh data in a format suited for MCUT ++ std::string fpath; // path to mesh file ++ std::vector faceSizesArray; // vertices per face ++ std::vector faceIndicesArray; // face indices ++ std::vector vertexCoordsArray; // vertex coords ++}; + + int main(int argc, const char* argv[]) + { +- MioMesh srcMesh = { +- nullptr, // pVertices +- nullptr, // pNormals +- nullptr, // pTexCoords +- nullptr, // pFaceSizes +- nullptr, // pFaceVertexIndices +- nullptr, // pFaceVertexTexCoordIndices +- nullptr, // pFaceVertexNormalIndices +- 0, // numVertices +- 0, // numNormals +- 0, // numTexCoords +- 0, // numFaces +- }; +- +- MioMesh cutMesh = srcMesh; ++ // load meshes. ++ // ----------------- ++ InputMesh srcMesh; + + const bool user_provided_meshes = argc > 1; +- +- if (user_provided_meshes && argc < 3) { +- fprintf(stderr, "usage: \n" ++ if (user_provided_meshes && argc < 4) { ++ fprintf(stderr, "usage: \n" + "The possible values for the arguments are:\n" + "\t-u (for union)\n" + "\t-i (for intersection)\n" +@@ -106,46 +85,68 @@ int main(int argc, const char* argv[]) + printf("NOTE: using default meshes\n"); + } + +- const char* srcMeshFilePath = user_provided_meshes ? argv[1] : DATA_DIR "/cube.obj"; +- +- // +- // read-in the source-mesh from file +- // +- mioReadOBJ(srcMeshFilePath, +- &srcMesh.pVertices, +- &srcMesh.pNormals, +- &srcMesh.pTexCoords, +- &srcMesh.pFaceSizes, +- &srcMesh.pFaceVertexIndices, +- &srcMesh.pFaceVertexTexCoordIndices, +- &srcMesh.pFaceVertexNormalIndices, +- &srcMesh.numVertices, +- &srcMesh.numNormals, +- &srcMesh.numTexCoords, +- &srcMesh.numFaces); +- +- const char* cutMeshFilePath = user_provided_meshes ? argv[2] : DATA_DIR "/torus.obj"; +- +- // +- // read-in the cut-mesh from file +- // +- +- mioReadOBJ(cutMeshFilePath, +- &cutMesh.pVertices, +- &cutMesh.pNormals, +- &cutMesh.pTexCoords, +- &cutMesh.pFaceSizes, +- &cutMesh.pFaceVertexIndices, +- &cutMesh.pFaceVertexTexCoordIndices, +- &cutMesh.pFaceVertexNormalIndices, +- &cutMesh.numVertices, +- &cutMesh.numNormals, +- &cutMesh.numTexCoords, +- &cutMesh.numFaces); ++ srcMesh.fpath = user_provided_meshes ? argv[1] : DATA_DIR "/cube.obj"; ++ bool srcMeshLoaded = igl::read_triangle_mesh(srcMesh.fpath, srcMesh.V, srcMesh.F); ++ ++ if (!srcMeshLoaded) { ++ std::fprintf(stderr, "error: could not load source mesh --> %s\n", srcMesh.fpath.c_str()); ++ std::exit(1); ++ } ++ ++ // copy vertices ++ for (int i = 0; i < (int)srcMesh.V.size(); ++i) { ++ const std::vector& v = srcMesh.V[i]; ++ my_assert(v.size() == 3); ++ srcMesh.vertexCoordsArray.push_back(v[0]); ++ srcMesh.vertexCoordsArray.push_back(v[1]); ++ srcMesh.vertexCoordsArray.push_back(v[2]); ++ } ++ ++ // copy faces ++ for (int i = 0; i < (int)srcMesh.F.size(); ++i) { ++ const std::vector& f = srcMesh.F[i]; ++ for (int j = 0; j < (int)f.size(); ++j) { ++ srcMesh.faceIndicesArray.push_back(f[j]); ++ } ++ ++ srcMesh.faceSizesArray.push_back((uint32_t)f.size()); ++ } ++ ++ printf("source mesh:\n\tvertices=%d\n\tfaces=%d\n", (int)srcMesh.V.size(), (int)srcMesh.F.size()); ++ ++ InputMesh cutMesh; ++ cutMesh.fpath = user_provided_meshes ? argv[2] : DATA_DIR "/torus.obj"; ++ bool cutMeshLoaded = igl::read_triangle_mesh(cutMesh.fpath, cutMesh.V, cutMesh.F); ++ ++ if (!cutMeshLoaded) { ++ std::fprintf(stderr, "error: could not load source mesh --> %s\n", cutMesh.fpath.c_str()); ++ std::exit(1); ++ } ++ ++ // copy vertices ++ for (int i = 0; i < (int)cutMesh.V.size(); ++i) { ++ const std::vector& v = cutMesh.V[i]; ++ my_assert(v.size() == 3); ++ cutMesh.vertexCoordsArray.push_back(v[0]); ++ cutMesh.vertexCoordsArray.push_back(v[1]); ++ cutMesh.vertexCoordsArray.push_back(v[2]); ++ } ++ ++ // copy faces ++ for (int i = 0; i < (int)cutMesh.F.size(); ++i) { ++ const std::vector& f = cutMesh.F[i]; ++ for (int j = 0; j < (int)f.size(); ++j) { ++ cutMesh.faceIndicesArray.push_back(f[j]); ++ } ++ ++ cutMesh.faceSizesArray.push_back((uint32_t)f.size()); ++ } ++ ++ printf("cut mesh:\n\tvertices=%d\n\tfaces=%d\n", (int)cutMesh.V.size(), (int)cutMesh.F.size()); + + std::string boolOpStr = "*"; + +- if (argc == 4) { ++ if (argc == 5) { + if (strcmp(argv[3], "-u") == 0) { + boolOpStr = "UNION"; + } else if (strcmp(argv[3], "-i") == 0) { +@@ -162,49 +163,19 @@ int main(int argc, const char* argv[]) + else{ + printf("NOTE: computing all boolean ops.\n"); + } +- +- // + // create a context +- // ++ // ------------------- + McContext context = MC_NULL_HANDLE; ++ McResult err = mcCreateContext(&context, MC_DEBUG); ++ my_assert(err == MC_NO_ERROR); + +- // a debug context is created in case you load your own (possibly faulty) meshes +- McResult status = mcCreateContext(&context, MC_DEBUG); +- +- my_assert(status == MC_NO_ERROR); +- +- // +- // config debug output +- // +- +- McSize numBytes = 0; +- McFlags contextFlags; +- +- status = mcGetInfo(context, MC_CONTEXT_FLAGS, 0, nullptr, &numBytes); +- +- my_assert(status == MC_NO_ERROR); +- +- my_assert(sizeof(McFlags) == numBytes); +- +- status = mcGetInfo(context, MC_CONTEXT_FLAGS, numBytes, &contextFlags, nullptr); +- +- my_assert(status == MC_NO_ERROR); +- +- if (contextFlags & MC_DEBUG) { // did the user enable debugging mode? +- mcDebugMessageCallback(context, mcDebugOutput, nullptr); +- mcDebugMessageControl(context, McDebugSource::MC_DEBUG_SOURCE_ALL, McDebugType::MC_DEBUG_TYPE_ALL, McDebugSeverity::MC_DEBUG_SEVERITY_ALL, true); +- } +- +- // + // do the cutting (boolean ops) +- // +- +- printf("\nInputs: \n\tSolid-A = %s'.\n\tSolid-B = '%s'\n\n", srcMeshFilePath, cutMeshFilePath); ++ // ----------------------------- ++ printf("\nInputs: \n\tShape A = %s'.\n\tShape B = '%s'\n\n", srcMesh.fpath.c_str(), cutMesh.fpath.c_str()); + + // We can either let MCUT compute all possible meshes (including patches etc.), or we can +- // constrain the library runtime to compute exactly the boolean op mesh we want. This 'constrained' +- // case is done with the flags that follow below. +- // ++ // constrain the library to compute exactly the boolean op mesh we want. This 'constrained' case ++ // is done with the following flags. + // NOTE: you can extend these flags by bitwise ORing with additional flags (see `McDispatchFlags' in mcut.h) + const std::map booleanOps = { + { "A_NOT_B", MC_DISPATCH_FILTER_FRAGMENT_SEALING_INSIDE | MC_DISPATCH_FILTER_FRAGMENT_LOCATION_ABOVE }, +@@ -213,9 +184,7 @@ int main(int argc, const char* argv[]) + { "INTERSECTION", MC_DISPATCH_FILTER_FRAGMENT_SEALING_INSIDE | MC_DISPATCH_FILTER_FRAGMENT_LOCATION_BELOW } + }; + +- // for each supported type of boolean operation + for (std::map::const_iterator boolOpIter = booleanOps.cbegin(); boolOpIter != booleanOps.cend(); ++boolOpIter) { +- + if (boolOpIter->first != boolOpStr && boolOpStr != "*") { + continue; + } +@@ -223,244 +192,159 @@ int main(int argc, const char* argv[]) + const McFlags boolOpFlags = boolOpIter->second; + const std::string boolOpName = boolOpIter->first; + +- printf("operation %s\n", boolOpName.c_str()); ++ printf("compute %s\n", boolOpName.c_str()); + +- status = mcDispatch( ++ err = mcDispatch( + context, + MC_DISPATCH_VERTEX_ARRAY_DOUBLE | // vertices are in array of doubles + MC_DISPATCH_ENFORCE_GENERAL_POSITION | // perturb if necessary + boolOpFlags, // filter flags which specify the type of output we want + // source mesh +- srcMesh.pVertices, +- srcMesh.pFaceVertexIndices, +- srcMesh.pFaceSizes, +- srcMesh.numVertices, +- srcMesh.numFaces, ++ reinterpret_cast(srcMesh.vertexCoordsArray.data()), ++ reinterpret_cast(srcMesh.faceIndicesArray.data()), ++ srcMesh.faceSizesArray.data(), ++ static_cast(srcMesh.vertexCoordsArray.size() / 3), ++ static_cast(srcMesh.faceSizesArray.size()), + // cut mesh +- cutMesh.pVertices, +- cutMesh.pFaceVertexIndices, +- cutMesh.pFaceSizes, +- cutMesh.numVertices, +- cutMesh.numFaces); ++ reinterpret_cast(cutMesh.vertexCoordsArray.data()), ++ cutMesh.faceIndicesArray.data(), ++ cutMesh.faceSizesArray.data(), ++ static_cast(cutMesh.vertexCoordsArray.size() / 3), ++ static_cast(cutMesh.faceSizesArray.size())); + +- my_assert(status == MC_NO_ERROR); ++ my_assert(err == MC_NO_ERROR); + +- // +- // query the number of available fragments +- // NOTE: a boolean operation shall always give fragments as output +- // ++ // query the number of available connected component ++ // -------------------------------------------------- ++ uint32_t numConnComps; ++ err = mcGetConnectedComponents(context, MC_CONNECTED_COMPONENT_TYPE_FRAGMENT, 0, NULL, &numConnComps); ++ my_assert(err == MC_NO_ERROR); + +- McUint32 connectedComponentCount = 0; +- status = mcGetConnectedComponents(context, MC_CONNECTED_COMPONENT_TYPE_FRAGMENT, 0, NULL, &connectedComponentCount); +- my_assert(status == MC_NO_ERROR); ++ printf("connected components: %d\n", (int)numConnComps); + +- if (connectedComponentCount == 0) { ++ if (numConnComps == 0) { + fprintf(stdout, "no connected components found\n"); + exit(0); + } + +- std::vector connectedComponents(connectedComponentCount, MC_NULL_HANDLE); +- +- status = mcGetConnectedComponents(context, MC_CONNECTED_COMPONENT_TYPE_FRAGMENT, (McUint32)connectedComponents.size(), connectedComponents.data(), NULL); +- +- my_assert(status == MC_NO_ERROR); ++ // my_assert(numConnComps == 1); // exactly 1 result (for this example) + +- // +- // query the data of the output connected component from MCUT +- // ++ std::vector connectedComponents(numConnComps, MC_NULL_HANDLE); ++ connectedComponents.resize(numConnComps); ++ err = mcGetConnectedComponents(context, MC_CONNECTED_COMPONENT_TYPE_FRAGMENT, (uint32_t)connectedComponents.size(), connectedComponents.data(), NULL); + +- McConnectedComponent cc = connectedComponents[0]; ++ my_assert(err == MC_NO_ERROR); + +- // +- // vertices +- // +- +- McSize numBytes = 0; +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_VERTEX_DOUBLE, 0, NULL, &numBytes); ++ // query the data of each connected component from MCUT ++ // ------------------------------------------------------- + +- my_assert(status == MC_NO_ERROR); ++ McConnectedComponent connComp = connectedComponents[0]; + +- McUint32 ccVertexCount = (McUint32)(numBytes / (sizeof(McDouble) * 3)); +- std::vector ccVertices((McSize)ccVertexCount * 3u, 0); +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_VERTEX_DOUBLE, numBytes, (void*)ccVertices.data(), NULL); ++ // query the vertices ++ // ---------------------- + +- my_assert(status == MC_NO_ERROR); +- +- // +- // faces +- // ++ McSize numBytes = 0; ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_VERTEX_DOUBLE, 0, NULL, &numBytes); ++ my_assert(err == MC_NO_ERROR); ++ uint32_t ccVertexCount = (uint32_t)(numBytes / (sizeof(double) * 3)); ++ std::vector ccVertices((McSize)ccVertexCount * 3u, 0); ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_VERTEX_DOUBLE, numBytes, (void*)ccVertices.data(), NULL); ++ my_assert(err == MC_NO_ERROR); ++ ++ // query the faces ++ // ------------------- + numBytes = 0; + + #if 1 // triangulated faces + +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_FACE_TRIANGULATION, 0, NULL, &numBytes); +- +- my_assert(status == MC_NO_ERROR); +- +- std::vector ccFaceIndices(numBytes / sizeof(McUint32), 0); +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_FACE_TRIANGULATION, numBytes, ccFaceIndices.data(), NULL); ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_FACE_TRIANGULATION, 0, NULL, &numBytes); ++ my_assert(err == MC_NO_ERROR); ++ std::vector ccFaceIndices(numBytes / sizeof(uint32_t), 0); ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_FACE_TRIANGULATION, numBytes, ccFaceIndices.data(), NULL); ++ my_assert(err == MC_NO_ERROR); + +- my_assert(status == MC_NO_ERROR); +- +- std::vector ccFaceSizes(ccFaceIndices.size() / 3, 3); ++ std::vector faceSizes(ccFaceIndices.size() / 3, 3); + + #else // non-triangulated faces (i.e. N-gons) + +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_FACE, 0, NULL, &numBytes); +- +- my_assert(status == MC_NO_ERROR); +- +- std::vector ccFaceIndices(numBytes / sizeof(McUint32), 0); +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_FACE, numBytes, ccFaceIndices.data(), NULL); +- +- my_assert(status == MC_NO_ERROR); +- +- // +- // face sizes +- // ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_FACE, 0, NULL, &numBytes); ++ my_assert(err == MC_NO_ERROR); ++ std::vector ccFaceIndices(numBytes / sizeof(uint32_t), 0); ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_FACE, numBytes, ccFaceIndices.data(), NULL); ++ my_assert(err == MC_NO_ERROR); + ++ // query the face sizes ++ // ------------------------ + numBytes = 0; +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_FACE_SIZE, 0, NULL, &numBytes); +- +- my_assert(status == MC_NO_ERROR); ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_FACE_SIZE, 0, NULL, &numBytes); ++ my_assert(err == MC_NO_ERROR); ++ std::vector faceSizes(numBytes / sizeof(uint32_t), 0); ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_FACE_SIZE, numBytes, faceSizes.data(), NULL); ++ my_assert(err == MC_NO_ERROR); ++#endif + +- std::vector ccFaceSizes(numBytes / sizeof(McUint32), 0); +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_FACE_SIZE, numBytes, ccFaceSizes.data(), NULL); ++ const uint32_t ccFaceCount = static_cast(faceSizes.size()); + +- my_assert(status == MC_NO_ERROR); +-#endif + /// ------------------------------------------------------------------------------------ + +- // Here we show, how to know when connected components pertain particular boolean operations. ++ // Here we show, how to know when connected components, pertain particular boolean operations. + + McPatchLocation patchLocation = (McPatchLocation)0; + +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_PATCH_LOCATION, sizeof(McPatchLocation), &patchLocation, NULL); +- my_assert(status == MC_NO_ERROR); ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_PATCH_LOCATION, sizeof(McPatchLocation), &patchLocation, NULL); ++ my_assert(err == MC_NO_ERROR); + + McFragmentLocation fragmentLocation = (McFragmentLocation)0; +- status = mcGetConnectedComponentData(context, cc, MC_CONNECTED_COMPONENT_DATA_FRAGMENT_LOCATION, sizeof(McFragmentLocation), &fragmentLocation, NULL); +- my_assert(status == MC_NO_ERROR); +- +- // +- // reverse the vertex winding order, if required +- // +- if((fragmentLocation == MC_FRAGMENT_LOCATION_BELOW) && (patchLocation == MC_PATCH_LOCATION_OUTSIDE)) +- { +- std::reverse(ccFaceIndices.begin(), ccFaceIndices.end()); +- } ++ err = mcGetConnectedComponentData(context, connComp, MC_CONNECTED_COMPONENT_DATA_FRAGMENT_LOCATION, sizeof(McFragmentLocation), &fragmentLocation, NULL); ++ my_assert(err == MC_NO_ERROR); + +- // +- // save connected component (mesh) to an .obj file +- // +- +- auto extract_fname = [](const std::string& full_path) { +- // get filename +- std::string base_filename = full_path.substr(full_path.find_last_of("/\\") + 1); +- // remove extension from filename +- std::string::size_type const p(base_filename.find_last_of('.')); +- std::string file_without_extension = base_filename.substr(0, p); +- return file_without_extension; +- }; +- +- const std::string fpath(OUTPUT_DIR "/" + extract_fname(srcMeshFilePath) + "_" + extract_fname(cutMeshFilePath) + "_" + boolOpName + ".obj"); +- +- mioWriteOBJ( +- fpath.c_str(), +- ccVertices.data(), +- nullptr, // pNormals +- nullptr, // pTexCoords +- ccFaceSizes.data(), +- ccFaceIndices.data(), +- nullptr, // pFaceVertexTexCoordIndices +- nullptr, // pFaceVertexNormalIndices +- ccVertexCount, +- 0, //numNormals +- 0, // numTexCoords +- (McUint32)ccFaceSizes.size()); +- +- // +- // free connected component data +- // +- status = mcReleaseConnectedComponents(context, (McUint32)connectedComponents.size(), connectedComponents.data()); +- +- my_assert(status == MC_NO_ERROR); +- } ++ // save cc mesh to .obj file ++ // ------------------------- + +- // +- // We no longer need the mem of input meshes, so we can free it! +- // +- mioFreeMesh(&srcMesh); +- mioFreeMesh(&cutMesh); ++ std::string fpath(argv[4]); + +- // +- // destroy context +- // +- status = mcReleaseContext(context); ++ printf("write file: %s\n", fpath.c_str()); + +- my_assert(status == MC_NO_ERROR); ++ std::ofstream file(fpath); + +- return 0; +-} ++ // write vertices and normals ++ for (uint32_t i = 0; i < ccVertexCount; ++i) { ++ double x = ccVertices[(McSize)i * 3 + 0]; ++ double y = ccVertices[(McSize)i * 3 + 1]; ++ double z = ccVertices[(McSize)i * 3 + 2]; ++ file << "v " << std::setprecision(std::numeric_limits::digits10 + 1) << x << " " << y << " " << z << std::endl; ++ } + ++ int faceVertexOffsetBase = 0; ++ ++ // for each face in CC ++ for (uint32_t f = 0; f < ccFaceCount; ++f) { ++ bool reverseWindingOrder = (fragmentLocation == MC_FRAGMENT_LOCATION_BELOW) && (patchLocation == MC_PATCH_LOCATION_OUTSIDE); ++ int faceSize = faceSizes.at(f); ++ file << "f "; ++ // for each vertex in face ++ for (int v = (reverseWindingOrder ? (faceSize - 1) : 0); ++ (reverseWindingOrder ? (v >= 0) : (v < faceSize)); ++ v += (reverseWindingOrder ? -1 : 1)) { ++ const int ccVertexIdx = ccFaceIndices[(McSize)faceVertexOffsetBase + v]; ++ file << (ccVertexIdx + 1) << " "; ++ } // for (int v = 0; v < faceSize; ++v) { ++ file << std::endl; ++ ++ faceVertexOffsetBase += faceSize; ++ } + +-void MCAPI_PTR mcDebugOutput(McDebugSource source, +- McDebugType type, +- McUint32 id, +- McDebugSeverity severity, +- size_t length, +- const char* message, +- const void* userParam) +-{ +- std::string debug_src; +- switch (source) { +- case MC_DEBUG_SOURCE_API: +- debug_src = "API"; +- break; +- case MC_DEBUG_SOURCE_KERNEL: +- debug_src = "KERNEL"; +- break; +- case MC_DEBUG_SOURCE_FRONTEND: +- debug_src = "FRONTEND"; +- case MC_DEBUG_SOURCE_ALL:case MC_DEBUG_SOURCE_IGNORE: +- break; ++ // 6. free connected component data ++ // -------------------------------- ++ err = mcReleaseConnectedComponents(context, (uint32_t)connectedComponents.size(), connectedComponents.data()); ++ my_assert(err == MC_NO_ERROR); + } + +- std::string debug_type; +- switch (type) { +- case MC_DEBUG_TYPE_ERROR: +- debug_type = "ERROR"; +- break; +- case MC_DEBUG_TYPE_DEPRECATED_BEHAVIOR: +- debug_type = "DEPRECATION"; +- break; +- case MC_DEBUG_TYPE_OTHER: +- //printf("Type: Other"); +- debug_type = "OTHER"; +- break; +- case MC_DEBUG_TYPE_ALL:case MC_DEBUG_TYPE_IGNORE: +- break; +- +- } ++ // 7. destroy context ++ // ------------------ ++ err = mcReleaseContext(context); + +- std::string severity_str; +- +- switch (severity) { +- case MC_DEBUG_SEVERITY_HIGH: +- severity_str = "HIGH"; +- break; +- case MC_DEBUG_SEVERITY_MEDIUM: +- severity_str = "MEDIUM"; +- break; +- case MC_DEBUG_SEVERITY_LOW: +- severity_str = "LOW"; +- break; +- case MC_DEBUG_SEVERITY_NOTIFICATION: +- severity_str = "NOTIFICATION"; +- break; +- case MC_DEBUG_SEVERITY_ALL: +- break; +- } ++ my_assert(err == MC_NO_ERROR); + +- printf("MCUT[%d:%p,%s:%s:%s:%zu] %s\n", id, userParam, debug_src.c_str(), debug_type.c_str(),severity_str.c_str(), length, message); ++ return 0; + } diff --git a/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch b/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch new file mode 100644 index 0000000..b30b60a --- /dev/null +++ b/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch @@ -0,0 +1,48 @@ +--- a/CMakeLists.txt 2024-10-08 22:04:07.763300956 +0200 ++++ b/CMakeLists.txt 2024-10-07 15:25:44.107901112 +0200 +@@ -42,7 +42,8 @@ + set(MCUT_MAJOR 1) + set(MCUT_MINOR 2) + set(MCUT_PATCH 0) +- ++find_package( Eigen3 REQUIRED ) ++include_directories( ${EIGEN3_INCLUDE_DIR} ) + set( MCUT_VERSION "${MCUT_MAJOR}.${MCUT_MINOR}.${MCUT_PATCH}" ) + + message(STATUS "[MCUT] version: ${MCUT_VERSION}") +@@ -98,6 +99,8 @@ + endif() + option(MCUT_BUILD_WITH_API_EVENT_LOGGING "Configure to build MCUT with event logging to console" OFF) + ++option(LIBIGL_INCLUDE_DIR "libigl include directory") ++ + # + # machine-precision-numbers library targets + # +@@ -111,6 +114,7 @@ + message(STATUS "[MCUT] MCUT_INCLUDE_DIR=${MCUT_INCLUDE_DIR}") + + list(APPEND include_dirs ${MCUT_INCLUDE_DIR}) ++list(APPEND include_dirs ${LIBIGL_INCLUDE_DIR}) + list(APPEND compilation_flags "") + if(MCUT_BUILD_AS_SHARED_LIB) + list(APPEND preprocessor_defs -DMCUT_SHARED_LIB=1) +@@ -217,7 +221,6 @@ + ) + + set(mio_include_dir ${mio_SOURCE_DIR}/include) +- + add_subdirectory(${mio_SOURCE_DIR} build) + + # +--- a/tutorials/CMakeLists.txt 2024-10-08 22:04:07.775300917 +0200 ++++ b/tutorials/CMakeLists.txt 2024-10-07 12:57:28.643032926 +0200 +@@ -3,7 +3,7 @@ + function(create_tutorial_target tutorial_name) + add_executable(${tutorial_name} "${CMAKE_CURRENT_SOURCE_DIR}/${tutorial_name}/${tutorial_name}.cpp") + target_link_libraries(${tutorial_name} mcut mio) +- target_include_directories(${tutorial_name} PRIVATE ${MCUT_INCLUDE_DIR} ${mio_include_dir}) ++ target_include_directories(${tutorial_name} PRIVATE ${MCUT_INCLUDE_DIR} ${mio_include_dir} ${LIBIGL_INCLUDE_DIR}) + target_compile_definitions(${tutorial_name} PRIVATE -DDATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/${tutorial_name}/data" -DOUTPUT_DIR="${CMAKE_CURRENT_BINARY_DIR}") + target_compile_options(${tutorial_name} PRIVATE ${compilation_flags}) + target_compile_definitions(${tutorial_name} PRIVATE ${preprocessor_defs}) diff --git a/products/patches/meshbooleanplugin-p01.irmb-mcut.patch b/products/patches/meshbooleanplugin-p01.irmb-mcut.patch new file mode 100644 index 0000000..e97dca5 --- /dev/null +++ b/products/patches/meshbooleanplugin-p01.irmb-mcut.patch @@ -0,0 +1,26 @@ +diff --git a/MyPlugDialog.ui b/MyPlugDialog.ui +index cd8875a..115e0a5 100644 +--- a/MyPlugDialog.ui ++++ b/MyPlugDialog.ui +@@ -158,21 +158,11 @@ + vtk + + +- +- +- irmb +- +- + + + Cork + + +- +- +- mcut +- +- + + + diff --git a/products/pyqwt.pyconf b/products/pyqwt.pyconf new file mode 100644 index 0000000..1798ef3 --- /dev/null +++ b/products/pyqwt.pyconf @@ -0,0 +1,44 @@ +default : +{ + name : "pyqwt" + build_source : "script" + compil_script : 'pip_install' + $VARS.scriptExtension + get_source : "archive" + archive_info : + { + archive_prefix : "PythonQwt" + } + + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : ['python3-qwt'] + apt_dev : [] + } + environ : + { + env_script : "pyqwt.py" + } + depend : ['Python','setuptools','numpy', 'qwt', 'PyQt'] + opt_depend: [] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + pip : "yes" + } +} + +version_0_12_1_no_pip : +{ + compil_script: "pyqwt-0.12.1" + $VARS.scriptExtension + properties : + { + incremental : "yes" + pip : "no" + } +} diff --git a/products/qtpy.pyconf b/products/qtpy.pyconf new file mode 100644 index 0000000..9fff776 --- /dev/null +++ b/products/qtpy.pyconf @@ -0,0 +1,44 @@ +default : +{ + name : "qtpy" + build_source : "script" + compil_script : 'pip_install' + $VARS.scriptExtension + get_source : "archive" + archive_info : + { + archive_prefix : "QtPy" + } + + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : ['python3-qtpy'] + apt_dev : [] + } + environ : + { + env_script : "qtpy.py" + } + depend : ['Python','setuptools','numpy', 'qwt', 'PyQt'] + opt_depend: [] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + pip : "yes" + } +} + +version_2_4_1_no_pip : +{ + compil_script: "qtpy-2.4.1" + $VARS.scriptExtension + properties : + { + incremental : "yes" + pip : "no" + } +} diff --git a/products/salome_system.pyconf b/products/salome_system.pyconf index d5e5477..221ceb3 100644 --- a/products/salome_system.pyconf +++ b/products/salome_system.pyconf @@ -15,11 +15,11 @@ default : "libXi", "libXinerama", "libXmu", "libXpm", "libXrandr", "libXrender", "libXt", "libXtst", "lua", "mesa-libGLU", "ncurses-libs", "nspr", "nss", "nss-softokn-freebl", "nss-util", "openldap", "pango", "pcre", "pixman", "pulseaudio-libs", "pulseaudio-libs-glib2", "readline", "sqlite", "systemd-libs", "tbb", "xz-libs", - "zlib", "tbb"] + "zlib", "tbb", "libXinerama"] rpm_dev : ["openssl-devel", "tbb-devel", "gcc", "make", "sed", "gcc-c++", "expat-devel", "fontconfig-devel", "flex", "bison", "mesa-libGLU-devel", "libxcb-devel", "xcb-util-devel", "libxkbcommon-devel", "libxkbcommon-x11-devel", "bzip2-devel", "libXi-devel", "libXmu-devel", "automake", "libtool", "libjpeg-turbo-devel", "cmake", - "libXpm-devel", "libXft-devel", "sqlite-devel", "libcurl-devel", "libXt-devel", "libXcursor-devel", "tbb-devel"] + "libXpm-devel", "libXft-devel", "sqlite-devel", "libcurl-devel", "libXt-devel", "libXcursor-devel", "tbb-devel", "libXinerama-devel"] apt : ["libbsd0", "libbz2-1.0", "libc6", "libdrm2", "libegl1", "libexif12", "libexpat1", "libfftw3-double3", "libfontconfig1", "libgl1", "libglu1-mesa", "libgomp1", "libgphoto2-6", "libice6", "libjbig0", "libltdl7", "liblzma5", "libnuma1", "libpcre3", "libquadmath0", @@ -110,7 +110,7 @@ default : "libxcb-shape0-dev", "libxcb-shm0-dev", "libxcb-sync-dev", "libxcb-xf86dri0-dev", "libxcb-xfixes0-dev", "libxcb-xinerama0-dev", "libxcb-xinput-dev", "libxcb-xkb-dev", "libxcb-xtest0-dev", "libxcb-xv0-dev", "libxcb-xvmc0-dev", "libxcb-imdkit-dev", "libxcb-image0-dev", "libxcb-keysyms1-dev", "libxcb-render-util0-dev", "libxcb-ewmh-dev", - "libxcb-icccm4-dev", "libxcb-xrm-dev", "libfreetype6-dev"] + "libxcb-icccm4-dev", "libxcb-xrm-dev", "libfreetype6-dev", "libxinerama-dev"] } "DB11" : { @@ -120,17 +120,17 @@ default : apt_dev : ["libtbb-dev", "cython3", "libfftw3-dev", "libopenblas-dev", "qttools5-dev", "libqt5svg5-dev", "libqt5x11extras5-dev", "qtxmlpatterns5-dev-tools", "libopenmpi-dev", "libpng-dev", "libtiff5-dev", "libgeotiff-dev", "libjpeg-dev", "libgif-dev", "libgeos-dev", "libsqlite3-dev", "libnetcdf-dev", "libgdal-dev", - "texlive-latex-base", "texlive-latex-extra", "dvipng", "libxml++2.6-dev", "libfreetype6-dev"] + "texlive-latex-base", "texlive-latex-extra", "dvipng", "libxml++2.6-dev", "libfreetype6-dev", "libxinerama-dev"] } "DB12" : { apt : ["libdc1394-25", "libopenexr-3-1-30", "libwebp7", "libgfortran5", "libevent-2.1-7", "libpng16-16", "libgcc", "libffi8", "libtinfo6", "libgphoto2-port12", "libglx0", "libopengl0", "libzstd1", "libglvnd0", "libjsoncpp25", - "openmpi-bin", "libnetcdf19", "libgdal32", "libtbb12", "python3-setuptools", "libxml++2.6-2v5", "liblzf1", "libfreetype6", "libncurses5"] + "openmpi-bin", "libnetcdf19", "libgdal32", "libtbb12", "python3-setuptools", "libxml++2.6-2v5", "liblzf1", "libfreetype6", "libncurses5", "libgmp10", "libmpfr6"] apt_dev : ["libtbb-dev", "cython3", "libfftw3-dev", "libopenblas-dev", "qttools5-dev", "libqt5svg5-dev", "libqt5x11extras5-dev", "qtxmlpatterns5-dev-tools", "libopenmpi-dev", "libpng-dev", "libtiff5-dev", "libgeotiff-dev", "libjpeg-dev", "libgif-dev", "libgeos-dev", "libsqlite3-dev", "libnetcdf-dev", "libgdal-dev", - "texlive-latex-base", "texlive-latex-extra", "dvipng", "libxml++2.6-dev", "libfreetype6-dev"] + "texlive-latex-base", "texlive-latex-extra", "dvipng", "libxml++2.6-dev", "libfreetype6-dev", "libgmp-dev","libmpfr-dev", "libxinerama-dev"] } "UB16.04" : { @@ -165,10 +165,11 @@ default : { apt : ["libdc1394-25", "libopenexr25", "libwebp7", "gfortran-11", "libilmbase25", "libevent-2.1-7", "libpng16-16", "libgcc-11-dev", "libffi7", "libtinfo6", "libgphoto2-port12", "libglx0", "libopengl0", "libzstd1", "libglvnd0", "openmpi-bin", "libgdal30", "libopenblas0-serial", "libtbb12", - "libxml++2.6-2v5", "libfreetype6", "libncurses5"] + "libxml++2.6-2v5", "libfreetype6", "libncurses5", "libgmp10", "libmpfr6"] apt_dev : ["libtbb-dev", "cython3", "libfftw3-dev", "libopenblas-dev", "qttools5-dev", "libqt5svg5-dev", "libqt5x11extras5-dev", "qtxmlpatterns5-dev-tools", "libopenmpi-dev", - "libpng-dev", "libtiff5-dev", "libgeotiff-dev", "libjpeg-dev", "libgif-dev", "libgeos-dev", "libsqlite3-dev", "libgdal-dev", "dvipng", "libxml++2.6-dev", "libfreetype6-dev"] + "libpng-dev", "libtiff5-dev", "libgeotiff-dev", "libjpeg-dev", "libgif-dev", "libgeos-dev", "libsqlite3-dev", "libgdal-dev", "dvipng", "libxml++2.6-dev", "libfreetype6-dev", + "libgmp-dev", "libmpfr-dev"] } "UB24.04" : { diff --git a/products/wheel.pyconf b/products/wheel.pyconf new file mode 100644 index 0000000..1efcea0 --- /dev/null +++ b/products/wheel.pyconf @@ -0,0 +1,39 @@ +default : +{ + name : "wheel" + build_source : "script" + compil_script : 'pip_install' + $VARS.scriptExtension + get_source : "archive" + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : ['python3-wheel'] + apt_dev : [] + } + environ : + { + env_script : "wheel.py" + } + depend : ['Python','setuptools','numpy', 'qwt', 'PyQt', 'qtpy'] + opt_depend: [] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + pip : "yes" + } +} + +version_0_44_0_no_pip : +{ + compil_script: "wheel-0.44.0" + $VARS.scriptExtension + properties : + { + incremental : "yes" + pip : "no" + } +}