Skip to content

Latest commit

 

History

History
77 lines (68 loc) · 3.92 KB

README.md

File metadata and controls

77 lines (68 loc) · 3.92 KB

OccTutorial

Build Status

This repository contains a set of tutorials for OpenCASCADE, the open source geometry kernel. You can read more about OpenCASCADE at http://www.opencascade.org. This series consists of chapters, each chapter demonstrating a small set of features offered by OpenCASCADE. Make sure you also follow the blog where the discussions of each example is published.

Where to start.

If you are familiar with using CMAKE, GIT, and generally with building and compiling, proceed to the "Quick start" section. If you need a detailed explanation on how to check out the code, set up an IDE and build the first example, please go to the setup section in the Wiki.

Quick start

The tutorials are being written and tested in Ubuntu 15.10. For the quickest start, it is therefore recommended to follow the tutorials using Ubuntu.

What if I am a Windows user?

The quick and easy way would be to install an Ubuntu OS inside a Virtualbox on your Windows, e.g. following this guide. This would give you access to a fully functioning Ubuntu operating system. Make sure you also install the guest additions, so that you will have access to 3D acceleration.

Install OpenCASCADE

Install OpenCASCADE using your the package manager of your Linux distribution. For example, on Ubuntu:

sudo apt-get install liboce-*

To be able to visualize the geometric models in the earlier chapters, it is also recommended to install FreeCAD:

sudo apt-get install freecad

Download the tutorial sources

Make a folder for the tutorial sources, e.g. in your home folder

cd ~
mkdir occtutorial
mkdir occtutorial/sources

Then, clone the repository from GIT:

cd ~/occtutorial/sources
git clone https://github.com/lvk88/OccTutorial.git

This will create ~/occtutorial/sources/OccTutorial.

##Build the tutorial The build system is based on CMAKE, and we are aiming for an out-of-source build. Therefore, we make a build folder:

mkdir ~/occtutorial/build

Next, we run CMAKE to generate us the Makefiles:

cd ~/occtutorial/build/
cmake ~/occtutorial/sources/OccTutorial

If everything went without error, we can build the tutorials:

cd ~/occtutorial/build
make

This will build the tutorials into build/bin directory. Each executable represents a small example of OpenCASCADE functionality. ##Run the first demonstrative example Now that the tutorials are built, you can run the first demonstrative example.

cd ~/occtutorial/build/bin
./chapter0

This will create a simple box with a cylindrical hole, and print out some of its physical properties. The source of this can be found in source/OccTutorial/Chapter0_Test/chapter0.cpp. It also creates an output file of the geometry in STEP format. You can open and examine it using FreeCad for example. The file is located in build/bin/boxWitHole.stp

##How are the tutorials organized The series is organized into Chapters, with each chapter focusing on one or two packages of OpenCASCADE. With the exception of Chapter0, every chapter consists of an "inc", "src", and "runners" folder. Obviously, inc contains the headers for the given chapter, src the source files. Runners is a special folder, which contains a set of driver files, each having its own main function. When building OccTutorials, the executable output will be compiled into @build/bin@

Where to go now?

The tutorials are strongly under construction right now, but a detailed explanation of each source will be available at the blog soon. Until then, the comments in the files explain more or less what each example is doing.