Defeaturing

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
easyw-fc
Posts: 2779
Joined: Thu Jul 09, 2015 9:34 am

Re: Defeaturing

Post by easyw-fc » Tue Jul 03, 2018 2:45 pm

Chris_G wrote:
Tue Jul 03, 2018 1:57 pm
If yes, then this should be simple :
...
but what I miss is the OCC 7.3 part... in which way can I install occ7.3 for a building? And can those coexist with occ.7.2?
thanks for your support :)
User avatar
Chris_G
Posts: 1209
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Defeaturing

Post by Chris_G » Tue Jul 03, 2018 3:00 pm

Here are my notes for building OCCT 7.3 :

Code: Select all

##########################################################
# OpenCascade 7.3.0 build instructions for Kubuntu 18.04 #
##########################################################

# install needed dependencies

sudo apt install cmake build-essential libfreetype6-dev tcl-dev tk-dev libxi-dev libxmu-dev libglu1-mesa-dev mesa-common-dev 

# fix for the "xlocale" bug

sudo ln -s /usr/include/locale.h /usr/include/xlocale.h

# build and install

cd ~/Software/opencascade-7.3.0
mkdir ./build
cd ./build
cmake -INSTALL_DIR=/usr/local/occt-7.3.0 ..
make -j8
# the install step below shouldn't be necessary for building FC
# sudo make install
User avatar
easyw-fc
Posts: 2779
Joined: Thu Jul 09, 2015 9:34 am

Re: Defeaturing

Post by easyw-fc » Tue Jul 03, 2018 3:09 pm

Chris_G wrote:
Tue Jul 03, 2018 3:00 pm
Here are my notes for building OCCT 7.3 :
...
Thanks a lot!
I'm going to do the building ;)

Maurice
User avatar
easyw-fc
Posts: 2779
Joined: Thu Jul 09, 2015 9:34 am

Re: Defeaturing

Post by easyw-fc » Tue Jul 03, 2018 8:14 pm

Chris_G wrote:
Tue Jul 03, 2018 1:57 pm
Can you compile FreeCAD master ?
Hi @Chris_G
I have built correctly OCC 7.3.0
Now I tried to build your branch and I had this errors:

Code: Select all

cmake ..
-- Compiler: GNU, version: 7.3.0
-- prefix: /usr/local
-- datadir: data
-- docdir: doc
-- includedir: include
-- libdir: /usr/local/lib
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   signals
--   system
--   thread
--   chrono
--   date_time
--   atomic
-- Found Xerces-C: /usr/lib/x86_64-linux-gnu/libxerces-c.so
-- PyCXX found:
--   Headers:  /home/user/Documents/FC-ChrisG/src
--   Sources:  /home/user/Documents/FC-ChrisG/src/CXX
--   Version:  6.2.8
CMake Error at /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEConfig.cmake:97 (include):
  include could not find load file:

    /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEFoundationClassesTargets.cmake
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:39 (find_package)
  CMakeLists.txt:644 (find_package)


CMake Error at /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEConfig.cmake:97 (include):
  include could not find load file:

    /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEModelingDataTargets.cmake
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:39 (find_package)
  CMakeLists.txt:644 (find_package)


CMake Error at /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEConfig.cmake:97 (include):
  include could not find load file:

    /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEModelingAlgorithmsTargets.cmake
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:39 (find_package)
  CMakeLists.txt:644 (find_package)


CMake Error at /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEConfig.cmake:97 (include):
  include could not find load file:

    /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEVisualizationTargets.cmake
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:39 (find_package)
  CMakeLists.txt:644 (find_package)


CMake Error at /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEConfig.cmake:97 (include):
  include could not find load file:

    /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEApplicationFrameworkTargets.cmake
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:39 (find_package)
  CMakeLists.txt:644 (find_package)


CMake Error at /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEConfig.cmake:97 (include):
  include could not find load file:

    /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEDataExchangeTargets.cmake
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:39 (find_package)
  CMakeLists.txt:644 (find_package)


CMake Error at /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEConfig.cmake:97 (include):
  include could not find load file:

    /home/user/Documents/opencascade-7.3.0/build/OpenCASCADEDrawTargets.cmake
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:39 (find_package)
  CMakeLists.txt:644 (find_package)


CMake Error at cMake/FindOpenCasCade.cmake:94 (file):
  file STRINGS file
  "/home/user/Documents/opencascade-7.3.0/include/opencascade/Standard_Version.hxx"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:644 (find_package)


CMake Error at cMake/FindOpenCasCade.cmake:97 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:644 (find_package)


CMake Error at cMake/FindOpenCasCade.cmake:98 (file):
  file STRINGS file
  "/home/user/Documents/opencascade-7.3.0/include/opencascade/Standard_Version.hxx"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:644 (find_package)


CMake Error at cMake/FindOpenCasCade.cmake:101 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:644 (find_package)


CMake Error at cMake/FindOpenCasCade.cmake:102 (file):
  file STRINGS file
  "/home/user/Documents/opencascade-7.3.0/include/opencascade/Standard_Version.hxx"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:644 (find_package)


CMake Error at cMake/FindOpenCasCade.cmake:105 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:644 (find_package)


-- -- Found OCE/OpenCASCADE version: ..
-- -- OCE/OpenCASCADE include directory: /home/user/Documents/opencascade-7.3.0/include/opencascade
-- -- OCE/OpenCASCADE shared libraries directory: /home/user/Documents/opencascade-7.3.0/lib
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkIOMPIParallel;vtkParallelMPI;vtkhdf5;vtkRenderingCore;vtkInteractionStyle;vtkRenderingFreeType
-- Check for medfile (libmed and libmedc) ...
-- Checking for module 'Coin'
--   No package 'Coin' found
-- libshiboken built for Release
-- Found PySide Tools: /usr/bin/pyside-uic, /usr/bin/pyside-rcc
-- -- matplotlib-2.1.1 has been found.
-- Platform is 64-bit, set -D_OCC64
-- Build type: 
git
/home/user/Documents/FC-ChrisG/build/src/Build/Version.h written
-- setting gcc options: -Wall -Werror -Wno-deprecated -pedantic-errors
CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1626 (message):
  No header defined for python27; skipping header check
Call Stack (most recent call first):
  src/Mod/Path/libarea/CMakeLists.txt:20 (find_package)


-- Could NOT find Boost
CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1626 (message):
  No header defined for python2; skipping header check
Call Stack (most recent call first):
  src/Mod/Path/libarea/CMakeLists.txt:23 (find_package)


-- Could NOT find Boost
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   python
-- found Boost: 1_65_1
-- boost-incude dirs are: /usr/include
-- boost-python lib is: /usr/lib/x86_64-linux-gnu/libboost_python.so
-- boost_LIBRARY_DIRS is: /usr/lib/x86_64-linux-gnu
-- Boost_LIBRARIES is: /usr/lib/x86_64-linux-gnu/libboost_python.so
-- area module (for Path Workbench) will be installed to: /usr/local/lib
-- Coin3D doc is not installed
=======================================
Now run 'make' to build FreeCAD
=======================================

-- Configuring incomplete, errors occurred!
See also "/home/user/Documents/FC-ChrisG/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/Documents/FC-ChrisG/build/CMakeFiles/CMakeError.log".
user@ubi18:~/Documents/FC-ChrisG/build$ 
Would you please have a look at?

Thx again
Maurice
User avatar
Chris_G
Posts: 1209
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Defeaturing

Post by Chris_G » Tue Jul 03, 2018 8:36 pm

it seems that Cmake doesn't find OCC.
Contrary to what is written in my previous notes, it seems that I did install OCC in /home/tomate/Software/opencascade-7.3.0_install, and I have set these cmake variables for FreeCAD build :

Code: Select all

OCC_INCLUDE_DIR			/home/tomate/Software/opencascade-7.3.0_install/include/opencascade
OCC_LIBRARY			/home/tomate/Software/opencascade-7.3.0_install/lib/libTKernel.so
OpenCASCADE_DIR			/home/tomate/Software/opencascade-7.3.0/build
User avatar
easyw-fc
Posts: 2779
Joined: Thu Jul 09, 2015 9:34 am

Re: Defeaturing

Post by easyw-fc » Wed Jul 04, 2018 10:54 am

Chris_G wrote:
Tue Jul 03, 2018 8:36 pm
it seems that Cmake doesn't find OCC.
Contrary to what is written in my previous notes, it seems that I did install OCC
thx! finally I got it built!
Just a great addition and as easy as just selecting the faces to be defeatured!
Fillet and Chamfer easy to go away too :D
Looking forward to see it in the main branch :D
sgrogan wrote:
Mon Jul 02, 2018 9:48 pm
.. ping
PS @sgrogan do you think it would be possible to have a Windows daily build with OCC 7.3?
PPS my defeaturing tools will be still useful for stable and legacy FC builds ;)
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: Defeaturing

Post by efyx » Wed Jul 04, 2018 11:19 am

This looks really cool, maybe it could be enter to direct modeling and could contain also standard holes/cutouts. See example https://youtu.be/Idu7P5C1QIs?t=8m15s (I reccomend to see all, because IronCAD have very good direct modeling).
User avatar
Chris_G
Posts: 1209
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Defeaturing

Post by Chris_G » Wed Jul 04, 2018 4:03 pm

Oh no, it looks like Mr. Silly made a mistake with "git rebase" ... :oops:
Now, my commits are duplicated : https://github.com/tomate44/FreeCAD/com ... featuring3
I don't dare to try any "rescue" on the repo, because I know I am able to destroy it MUCH more :lol:
Help, please ?
User avatar
tanderson69
Posts: 1516
Joined: Thu Feb 18, 2010 1:07 am

Re: Defeaturing

Post by tanderson69 » Thu Jul 05, 2018 1:16 am

Chris_G wrote:
Wed Jul 04, 2018 4:03 pm
Oh no, it looks like Mr. Silly made a mistake with "git rebase" ... :oops:
Now, my commits are duplicated : https://github.com/tomate44/FreeCAD/com ... featuring3
I don't dare to try any "rescue" on the repo, because I know I am able to destroy it MUCH more :lol:
Help, please ?

Code: Select all

git checkout -b defeaturing4 defeaturing3
git reset --hard 5129f8fccc
If this isn't what you want:

Code: Select all

git checkout defeaturing3
git branch -d defeaturing4
Now you will be right where you started
User avatar
Chris_G
Posts: 1209
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Defeaturing

Post by Chris_G » Thu Jul 05, 2018 9:23 am

tanderson69 wrote:
Thu Jul 05, 2018 1:16 am
...
Thanks tanderson,
The git reset failed.
But I "think" I managed to fix the problem with the branch-copy trick.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests