Code Monkey home page Code Monkey logo

occtutorial's Introduction

OccTutorial

WIP: this fork is to migrate to OpenCASCADE 7.5.0 and to use it under Windows 10 (20H2) and macOS

TODO List

  • Migrate to OpenCASCADE 7.5.0
  • Test under Ubuntu most recent LTS
  • Add more content to the tutorials

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.

occtutorial's People

Contributors

lvk88 avatar krontzo avatar tonibig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.