Code Monkey home page Code Monkey logo

ocaf-python's Introduction

Translating OCAF (Open Cascade Application Framework) code from C++ to Python

  • Open CasCade Technology (OCCT) is is a C++ library with pretty good documentation showing you how to use it.
  • pythonOCC provides a python wrapper for the OpenCASCADE C++ technology, extending the OCCT audience (mostly C++ developers) to the Python community.
  • If you are going to use OpenCascade (either C++ or Python) to make your own application, you will very likely need to get familiar with OCAF.
    • Unfortunately, there isn't a lot of online documentation showing the details of how to use OCAF in C++.
    • In PythonOCC the available resources are even scarcer.
    • Hence, the impetus for this repository
    • As an example, consider using the TDF_ChildIterator in C++ vs. Python:

C++ code:

TDF_ChildIterator itchild;
for (itchild.Initialize(Box2Label,Standard_True); itchild.More();itchild.Next()) {
    aChild = itchild.Value();
    // Do something with aChild
  }

Python code:

itchild = TDF_ChildIterator()
while itchild.More():
    a_child = itchild.Value()
    # Do something with a_child
    itchild.Next()

This repository is a collection of various PythonOCC code snipets that I have come across relating to the use of OCAF.

The OCAF section of the official OpenCascade documentation does a nice job of explaining how OCAF works and shows several useful C++ code snippets.

  • Here I have gone through the C++ code examples and converted them to Python

ocaf-python's People

Contributors

dblanding avatar

Stargazers

 avatar

Watchers

 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.