Opis biblioteki OCCT

Open CASCADE Technology jest obiektową biblioteką klas napisaną w języku C++ stworzoną do szybkiego tworzenia specjalizowanych aplikacji wykorzystywanych do projektowania graficznego. Typowe aplikacje tworzone z wykorzystaniem OCCT umożliwiają dwu- lub trzy-wymiarowe (2D lub 3D) modelowanie geometryczne w ogólnych lub specjalizowanych systemach wspomagania projektowania CAD (Computer Aided Design), wytwarzania lub aplikacjach do analizy, symulacji lub wizualizacji. Obiektowa biblioteka OCCT pozwala na znaczne przyspieszenie projektowania tego typu aplikacji.

Biblioteka OCCT posiada następujące funkcjonalności:

• modelowanie geometryczne 2D i 3D, pozwalajace na tworzenie obiektów w różny sposób: • z wykorzystaniem podstawowych obiektów typu: prism, , cone i , • wykorzystując operacje logiczne Boolean operations (addition, subtraction and intersection) • modyfikując obiekty za pomocą operacji fillets, chamfers i drafts, • modyfikując obiekty z wykorzystaniem funkcji offsets, shelling, hollowing i sweeps, • obliczać własności takich jak surface, volume, center of gravity, curvature, • obliczać geometrię wykorzystując projection, interpolation, approximation. • Funkcje do wizualizacji umożliwiająca zarządzanie wyświetlanymi obiektami i manipulowanie widokami, np.: • rotacja 3D, • powiększanie, • cieniowanie. • Szkielety aplikacji (application framework) pozwalające na: • powiązanie pomiedzy nie-geometrycznymi danymi aplikacji i geometrią, • parametryzację modeli, • Java Application Desktop (JAD), szkielet (framework) do tworzenia graficznego interfejsu użytkownika (GUI) • wymianę danych umożliwiającą import i export za pomocą funkcji OCCT wykorzystujących standardowe formaty takie jak IGES i STEP.

Biblioteka OCCT jest tworzona przez firmę OPEN CASCADE, która zapewnia także komercyjne wsparcie dla użytkowników. Biblioteka jest tworzona w sposób modułowy i łatwy do rozszerzania. Przykładowo udostępnia oddzielne klasy C++ : • definiujące struktury danych (geometric modeling, display and graphic selection), • implementujące złożone algorytmy, • zapewniające interfejsy do programowania aplikacji - Application Programming Interfaces (APIs).

Powiązane klasy są pogrupowane w pakiety w celu zapobieżenia konfliktom, nazwy klas poprzedzone są nazwą pakietu. Przykładowo wszystkie klasy definujące obiekty geometryczne 3D należą do pakietu Geompackage. W pakiecie Geom klasa implementująca powierzchnię Beziera jest nazwana BezierSurface, a jej pełna nazwa jest Geom_BezierSurface.

Pakiety są połączone w biblioteki, które są linkowane z aplikacją. Wszystkie biblioteki są pogrupowane w sześć modułów (najmniejszy, Foundation Classes, zawiera dwie biblioteki, a największy , Modeling Algorithms, zawiera osiem).

Foundation Classes - Kernel Classes, Math Utilities Modeling Data - 2D Geometry, 3D Geometry, Geometry Utilities, Topology Modeling Algorithms - Construction of Primitives, Boolean Operations, Fillets and Chamfers, Offsets, Drafts Sewing and Sweeps, Features, Hidden Line Removal, Geometric Tools, Topological Tools Visualization - Services Common to 2D and 3D, 2D Visualization, 3D Visualization Data Exchange – IGES, STEP AP203 AP214, Extended data exchange (XDE) Application Framework - Data Framework, Data Storage, Application Desktop

Dodatkiem do biblioteki jest aplikacja Draw Test Harness (Draw) oferująca narzedzie do testowania dla modułów Visualization, Modeling Algorithms, Application Framework i Data Exchange. Zawiera ona dużą liczbę interpretowanych komend które pozwalaja na interaktywne eksperymentowania z OCCT.

Oprócz języka C++ do testowania funkcji biblioteki i tworzenia aplikacji mozna wykorzystać język Python. Pozwala na to biblioteka pythonocc implementujaca w jezyku Python większość funkcji OCCT.

Testowania funkcjonalności biblioteki OCCT z poziomu języka Python możliwe jest także poprzez wykorzystanie okna komend aplikacji FreeCAD.

Przykładowe aplikacje wykorzystujące OCCT Foundation Classes

Foundation Classes provide a variety of general-purpose services such as:

• Primitive types, strings and various types of quantities • Automated management of heap memory • Exception handling • Classes for manipulating data collections • Math tools such as vectors, matrices and primitive geometric types • Basic services for saving data in ASCII files

These services are organized into the following libraries:

• Kernel Classes • Math Utilities • Basic Persistence

Kernel Classes Root Classes

Root Classes, primarily implemented in the Standard package, are the classes on which all other classes are built. They provide:

• Primitive types such as Boolean, Character, Integer or Real • A memory manager based on reference counting for optimizing the allocation and deallocation of large numbers of small C++ objects • A base class, Standard_Transient, automating memory management through smart pointers - the OCCT Handle; most of OCCT classes inherit from this base class.

Quantities

Quantity classes provide the following services:

• Definition of primitive types representing most of mathematical and physical quantities • Unit conversion tools • Resources to manage time information such as dates and time periods • Resources to manage color definition

Exceptions

Exception classes list all the exceptions, which can be raised by any OCCT function. Syntaxes compatible with the ANSI C++ standard allow you to handle abnormal conditions.

Each exception inherits from Standard_Failure either directly or by inheriting from another exception.

Strings

String classes provide the following services to manipulate character strings:

• Editing operations on string objects, using a built-in string manager • Handling of dynamically-sized sequences of characters

OCCT supports both ASCII character types (8-bit) and Unicode character types UTF-8 (8-bit) and utf-16 - UCS-2 (16-bit).

Memory management makes string objects easier to use than ordinary character arrays. Strings may also be manipulated by handles and therefore, can be shared.

These classes are implemented in TCollection and NCollection packages.

Collections

Apart from strings, the TCollection package contains classes of dynamically sized aggregates of data. They include a wide range of collections such as:

• Arrays (unidimensional and bidimensional) generally used for quick access to an item. Note that an array is a fixed-sized aggregate • Sequences and lists which are ordered collections of non-unique objects • Maps, which provide rapid access time for member items • Queues and stacks, which are minor structures similar to sequences but with different algorithms to explore them

The TCollection package also offers specific iterators for sequences, maps, and stacks.

It also includes Collection classes. Collection classes are generic (C++ template-like), that is, they can contain a variety of objects which do not necessarily inherit from a unique root class. When you need to use a collection of a given object type, you must instantiate the collection for this specific type. Once the code for this declaration is compiled, all functions available on the generic collection are available on your instantiated class.

If you are not using CDL in your project (CDL compilation under WOK is necessary to instantiate any generic Collection from package TCollection), then you should use the Collections defined in NCollection package. It contains definitions of the same generic collection classes described above, but in a form of C++ templates. Therefore, to instantiate any collection type no additional support is required beyond the ANSI C++ compiler.

Most collections follow value semantics, meaning that an instantiation of a collection is the actual collection, not a handle to it.

Collections of Standard Objects

Tcollection

The collections of standard object classes provide frequently used instantiation of generic classes from the TCollection package with objects from the Standard package, strings from the TCollection package and geometric primitives.

There exists a limitation: OCCT generic classes require compilation of definitions in the CDL language and therefore can only be instantiated in WOK.

Ncollection

The NCollection unit meets the requirements of OCCT community and all end users who do not use WOK development environment in their projects.

The NCollection provides a full replacement of all TCollection generic classes so that any OCCT collection could be instantiated via C++ template definitions. It is used in WOK environment (as nocdlpack development unit) or in any other configuration, since it only uses the standard capabilities of C++ language.

Earlier releases of OCCT offered NCollection classes in the form of macro definitions. Now it is strongly recommended to use C++ template classes instead, as they are more flexible and reliable. The old definitions based on C macros (in the header files NCollection_Define*.hxx) are kept for backward compatibility and no longer supported.

Math Utilities

Vectors and Matrices

The Vector and Matrix classes provide commonly used mathematical algorithms which include:

• Basic calculations involving vectors and matrices • Computation of eigenvalues and eigenvectors of a square matrix • Solvers for a set of linear algebraic equations • Algorithms to find the roots of a set of nonlinear equations • Algorithms to find the minimum function of one or more independent variables

These classes also provide a data structure in order to represent any expression, relation, or function used in mathematics, including the assignment of variables.

Primitive Geometric Types

OCCT primitive geometric types are defined in the basic geometry package gp, which provides descriptions of primitive geometric shapes such as:

• Points • Vectors • Lines • Circles and conics • Planes and elementary surfaces

These types are handled by value only, and never by reference. gp also provides a means of positioning your shapes in space or on a plane using an axis or coordinate system, and defines the following geometric transformations available for these positioned shapes:

• Translations • Rotations • Symmetries • Scaling transformations • Composed transformations

Common Math Algorithms

• The common math algorithms provided in OCCT include: • Algorithms to solve a set of linear algebraic equations, • Algorithms to find the minimum of a function of one or more independent variables, • Algorithms to find roots of one or of a set of non-linear equations, • An algorithm to find the eigenvalues and eigenvectors of a square matrix. Modeling Data

Modeling Data supplies data structures to represent 2D and 3D geometric models.

These services are organized into the following libraries:

• 2D Geometry • 3D Geometry • Geometry Utilities • Topology

2D Geometry

This library provides 2D geometric data structures.

Geom2D geometric package provides 2D geometric data structures handled by reference and complying with STEP specification. These objects are parameterized, and, as a result, are oriented. They include Bezier, BSpline, and offset curves, and provide functions for conversion of Geom2D objects to gp (basic geometry) objects, which are non-oriented and non-parameterized.

Geom2dLProp local geometric properties package allows computing such properties as:

Derivative vectors of a parametric point on a 2D curve;

Tangent vectors of a parametric point on a 2D curve (normal and curvature).

3D Geometry

This library provides 3D geometric data structures.

Geom geometric package provides 3D geometric data structures handled by reference and complying with STEP specification. These objects are parameterized and, as a result, are oriented. They include Bezier, BSpline, and offset curves and surfaces, and provide functions for conversion of Geom objects to gp (basic geometry) objects, which are non-oriented and non-parameterized.

GeomLProp local geometric properties package allows you to compute such properties as:

Derivative vectors of a parametric point on a curve or a surface

Tangent vectors of a parametric point on a curve or a surface

• Normal • Curvature

Geometry Utilities

This library provides standard high-level functions in 2D and 3D geometry such as: • Direct construction of algorithms • Interpolation of a set of points to form a curve • Approximation of curves and surfaces from points • Conversion of more elementary geometry to BSpline curves and surfaces • Calculation of points on a 2D or 3D curve • Calculation of extrema between two geometries

Topology

Topological library allows you to build pure topological data structures..

Topology defines relationships between simple geometric entities. In this way, you can model complex shapes as assemblies of simpler entities. Due to a built-in non-manifold (or mixed- dimensional) feature, you can build models mixing:

• 0D entities such as points • 1D entities such as curves • 2D entities such as surfaces • 3D entities such as volumes

You can, for example, represent a single object made of several distinct bodies containing embedded curves and surfaces connected or non-connected to an outer boundary.

Abstract topological data structure describes a basic entity - a shape, which can be divided into the following component topologies:

• Vertex - a zero-dimensional shape corresponding to a point in geometry • Edge - a shape corresponding to a curve, and bound by a vertex at each extremity • Wire - a sequence of edges connected by their vertices • Face - part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a closed wire • Shell - a collection of faces connected by some edges of their wire boundaries • Solid - a part of 3D space bound by a shell • Compound solid - a collection of solids.

The wire and the solid can be either infinite or closed.

A face with 3D underlying geometry may also refer to a collection of connected triangles that approximate the underlying surface. The surfaces can be undefined leaving the faces represented by triangles only. If so, the model is purely polyhedral.

Along with the above data structures and that for a generalized shape, this library also provides resources to define the location of shapes. Modeling Algorithms

Modeling Algorithms module groups a wide range of topological algorithms used in modeling and geometric algorithms, called by them.

These services are organized into the following libraries:

• Geometric Tools • Topological Tools • Construction of Primitives • Boolean Operations • Fillets and Chamfers • Offsets and Drafts • Features • Hidden Line Removal • Shape Healing

Geometric Tools

This library provides algorithms to:

• Calculate the intersection of two 2D curves, surfaces, or a 3D curve and a surface • Project points onto 2D and 3D curves, points onto surfaces, and 3D curves onto surfaces • Construct lines and circles from constraints • Construct curves and surfaces from constraints • Construct curves and surfaces by interpolation

OPEN CASCADE company also provides a product known as Surfaces from Scattered Points (SSP), which allows constructing surfaces from scattered points. This algorithm accepts or constructs an initial B-Spline surface and looks for its deformation (finite elements method) which would satisfy the constraints. Using optimized computation methods, this algorithm is able to construct a surface from more than 500 000 points.

SSP product is not supplied with Open CASCADE Technology, but can be purchased separately.

Topological Tools

This library provides algorithms to:

• Tessellate shapes • Validate shapes • Determine the local properties of shapes • Determine the global properties of shapes • Perform geometric transformations • Find planes in which edges are located • Convert shapes to NURBS geometry. It also furnishes a complete brep data structure for topological data structures defined in the Topology library of the Modeling Data module.

Construction of Primitives

This library provides algorithms to build topological primitives such as:

• Prisms • • Cones • Tor

Boolean Operations

This library provides high-level algorithms to perform Boolean operations to create new shapes from old ones by using:

• Common • Cut • Fuse • Section

Fillets and Chamfers

This library provides algorithms to make fillets and chamfers on shape edges.

In OCCT, solutions for common finishing problems are offered. The following cases are addressed:

• Corners and apexes with different radii • Corners and apexes with different concavity

If there is a concavity, both surfaces that need to be extended and those, which do not, are treated.

Offsets, Drafts, Sewing and Sweeps

These classes provide the following services:

• Creation of offset shapes and their variants such as: • Hollowing • Shelling • Lofting • Creation of tapered shapes using draft angles • Sewing • Creation of sweeps

Features

This library provides algorithms to build both form and mechanical features on shapes.

Form features include: • Cylinders • Draft prisms • Prisms • Revolved features • Pipes

Mechanical features include:

• Ribs • Grooves

Hidden Line Removal

This library provides algorithms to define the lines of a shape hidden in a given projection. These lines can be shown or hidden.

Services in this library allow you to work with the shape itself or a polyhedral simplification of it. With a polyhedral simplification, you reduce calculation time but obtain polygonal segments instead of an exact result.

Shape Healing

This library provides algorithms to modify the geometry and topology of OCCT shapes.

Shape Healing adapts shapes to make them maximally appropriate for use by OCCT, for example:

• analyze shape characteristics and, in particular, identify the shapes that do not comply with OCCT validity rules; • fix incorrect or problem shapes; • upgrade and change shape characteristics if needed, for example a C0 supporting surface can become C1 continuous. Visualization

Visualization in Open CASCADE Technology is based on the separation of modeling data you want to display and select, and on the graphical presentation of that data structure.

For visualizing data structures, OCCT provides ready-to-use algorithms, which create graphic presentations from geometric models. These data structures may be used with the viewers supplied, and can be customized to take the specificity of your application into account.

Displaying is managed through presentation services, and selection in its turn is managed through selection services. With these services, data structures and algorithms are provided to display objects of an application, and to support graphical selection of these objects.

Application Interactive Services (AIS) are provided to manage displaying, detection and selection of graphical presentations.

These services associate data structures and interactive objects.

Services Common to 2D and 3D

This is a set of libraries providing data structures and interfaces common to both 2D and 3D and processed by the 2D and 3D viewers respectively.

3D Graphics & Visualization

3D Graphics

3D Graphics (Graphic3d package) supports three-dimensional manipulation of graphic primitives such as polylines, planar polygons with or without holes, text, and markers by controlling attributes such as color, transparency, reflection, line type, line width, and text font. These primitives can be displayed, zoomed, panned and rotated in a 3D viewer.

It runs on OpenGL graphic library for all platforms. Text is rendered in 3D with help of texture- mapped fonts implementation provided by FTGL library. It is possible to use any True Type font installed in the system for text output,

Most types of primitives supported by Graphic3d can be dumped to a vector file format such as PDF and PostScript. Export to vector formats is implemented with help of GL2PS library.

3D Visualization

This library provides services for: • Selection of 3D data structures • Presentation of 3D data structures

Access to 3D presentation and selection is provided through AIS (Application Interactive Services). This package is a high-level interface that offers access to the lower-level presentation and selection services. AIS expand this underlying functionality with standard 3D selection attributes, presentation management, and standard 3D presentation attributes, and manages it in the definition of GUI viewers. To implement these services, AIS package includes the following:

• Interactive context • Interactive objects • A graphic attributes manager • Selection filters

The Interactive Context

The interactive context pilots 3D visualizations and selections. The interactive context allows you to manage, in a transparent way, graphic and "selectable" behavior of interactive objects which is not yet defined in the predefined types of these objects.

AIS have two operating context types. The default neutral point type allows you to easily visualize and select entire interactive objects, which have been loaded into the context. Opening a local context allows you to prepare and use a temporary selection environment to select a part of an interactive object.

Interactive Objects

Entities which are visualized and selected in the AIS viewer are objects. They connect the underlying reference geometry of a model to its graphic representation in AIS. You can use predefined OCCT classes of standard interactive objects for which all necessary functions have already been programmed, or, in case you are an advanced user, you can implement your own classes of interactive objects.

Graphic Attributes Manager

Graphic attributes manager, or AIS Drawer, stores graphic attributes for specific interactive objects and for interactive objects controlled by interactive context.

Initially, all drawer’s attributes are filled out with the predefined values which will define the default 3D object appearance.

When an interactive object is visualized, the required graphic attributes are first taken from its own drawer if one exists, or from the context drawer if no specific drawer for that type of object exists.

Selection Filters

An important aspect in selection is the filtering of entities you to select. Selection filters allow you to refine the dynamic detection context, which you want to put into effect. Some of these filters can be used at the Neutral Point, others in an open local context only. You can also program your own filters and load them into the context. 2D Graphics & Visualization

2D Graphics

2D Graphics (Graphic2d package) is based on native services provided by the underlying window system (Win32 GDI under Windows, Xlib API under Unix and ), unlike OpenGL-based 3D Graphics.

It supports two-dimensional manipulation of graphic primitives such as straight lines, segments, polylines, curves, text, and markers by controlling attributes such as color, line type, line width, and text font. These primitives can be displayed, zoomed, panned, and rotated in a 2D viewer.

Plotter output is provided in PostScript, HPGL2, and CGM. Importation of bitmap images from xwd, gif, and bmp format is also supported.

Note that in 2D, Open CASCADE provides full internationalization. Text in Chinese and Japanese characters can be input and printed in plotter output.

2D Visualization

This library provides services for:

• Presentation of 2D data structures • Selection of 2D data structures

2D presentation is handled by presentation algorithms, which compute and display a graphic data structure from a shape. You can also write your own presentation algorithms. In OCCT, display services are separated from the data they represent. This separation allows you to modify a geometric or topological model without modifying the services by means of which it is displayed.

The concept of selection consists in defining 2D bounding boxes capable to return an owner of any object presentation found within them. When an owner is found, presentation of a shape is highlighted according to display attributes for the shapes of that type. 2D selection is supported by an internal algorithm which allows selection of an object when the mouse cursor is positioned on that object. Data Exchange

Data Exchange is a key factor in using Open CASCADE Technology (as well as applications based thereon) concurrently with other software such as CAD systems. It provides the openness of OCCT in a multi-software environment, by allowing it to process external data and providing a good level of integration.

This means obtaining results of good quality, and covering the needs of exchanges from OCCT- based applications regardless of external data quality or requirements, in particular in respect of allowed data types and arrangements between them, accepted gaps between geometries.

This matter is addressed by Data Exchange Module, which is organized in a modular way, as explained below.

What OPEN CASCADE provides for Data Exchange:

Data Exchange interfaces in OCCT allow software based on OCCT to exchange data with various CAD software, thus ensuring a good level of interoperability.;

Data Exchange interfaces function either in accordance with the standards (IGES, STEP), which can be used by various software packages for CAD, PDM etc., or as direct connectors to proprietary formats.

Standardized Data Exchange

STANDARDS

Standardized data covers:

• STEP (AP203 : Mechanical Design, this covers General 3D CAD; AP214: Automotive Design) • IGES (up to 5.3) • STL • VRML

Data Exchange interfaces (STEP, IGES) allow to query and examine a file, results of conversion and its validity. They are designed to support extensions (like new standards) in a common modular architecture.

Extended data exchange

Extended data exchange (XDE) allows you to extend the scope of exchange by translating additional data attached to geometric ("BREP") data, thereby improving the interoperability with external software. Data types such as colors, assembly descriptions and validation properties (i.e. center of gravity etc.) are supported. These data are stored together with shapes in an OCAF (XCAF) document.

Proprietary Data Exchange

In addition to standard Data Exchange interfaces, separate components are available to provide direct mapping and data adaptation (using Shape Healing) with CAD software supporting the following formats:

• ACIS SAT • X_T • DXF

These components are based on the same architecture as interfaces with STEP and IGES.

Translating a shape to STL Format

OCCT includes a module for translating OCCT shapes to STL (Stereolithography) format. STL is a format designed for rapid prototyping. It is intended to send geometric data (volumic) to stereolithography machines, which can read and interpret such data. These machines can transform a volumic model to a physical prototype made of plastic, by using laser to coagulate material, which corresponds to the volume, and set free the material around. STL defines these surfaces by triangles. Thus, no machining is required to switch from a virtual model to a physical one.

Since STL files can only include solids described by their mesh structures, OCCT shapes, which are intended to be written, must be solids, components of solids or closed shells with a correct orientation.

When translating shapes to STL format, remember that all references to shapes mean references to OCCT shapes unless otherwise explicitly defined. In addition, sets of faces or unclosed shells may also be translated but visualization in foreign viewers may be incorrect.

Translating a shape to VRML Format

The Virtual Reality Modeling Language (VRML) is a language for describing multi-participant interactive simulations - virtual worlds networked via the Internet and hyperlinked with the World Wide Web. VRML is a format designed for animated visualization of solids.

OCCT includes a module for translating OCCT shapes to VRML (Virtual Reality Modeling Language). OCCT shapes may be translated in two representations (states): shaded or wireframe. Since shaded VRML format files include only solids described by their mesh structures, the OCCT shapes intended to be written must be solids, components of solids or closed shells with a correct orientation. Application Framework

The Application Framework uses an associativity engine to simplify the development of your CAD application.

Based on application/document architecture, it does this due to the following features:

• Application data is handled by the mechanism of attributes • Attributes may be organized according to your development needs • Multiple documents can be managed by an application • Ready-to-use modeling data attributes common to CAD/CAM applications • Document modification and recomputation • Data storage services • A ready-to-use Undo-Redo and Copy-Paste functions

Since OCAF handles your application structure, your only major development task is the creation of application-specific data and GUIs. It is the organization of application data due to which OCAF differs from any other CAD framework. In OCAF, data structures are not shape-driven, but reference-key driven. In this respect, attributes such as shape data, color, material, are attached to a deeper invariant structure of a model than the shapes themselves. Then OCAF organizes and embeds these attributes in a document. For example, a geometry becomes the value of the Shape attribute, in the same way as a number is the value of the Integer attribute and a string is the value of the Name attribute.

OCAF documents are in their turn managed by an OCAF application.

Please, refer for more details to OCAF User's guide and the OCAF white papers

Application Framework Distribution of Data through OCAF Tree Application Framework Function Mechanism

Wykorzystanie bibliotek PyQt, wxPython, python-xlib i pythonOCC

Do budowy interfejsu użytkownika dla biblioteki pythonOCC można wykorzystać bibliotek PyQt, wxPython lub python-xlib.

Moduł SimpleGui dostarcza prosty interfejs GUI dla aplikacji, wykorzystuje on biblioteki PyQt, wxPython lub python-xlib.

W celu wywołania modułu należy go zaimportować z biblioteki OCC.Display from OCC.Display.SimpleGui import *

Dla wxPython należy ustawić odpowiedni backend: set_backend('wx')

W celu wykorzystania PyQt należy zmienić wywołanie na set_backend('qt') a dla python-xlib: set_backend('X')

Następnie należy dokonać inicjacji funkcji wyświetlających: display, start_display, add_menu, add_function_to_menu = init_display()

W kolejnym kroku definiowane są funkcje tworzące box i cylinder def simple_test(event=None): display.Test() def simple_cylinder(event=None): from OCC.BRepPrimAPI import BrepPrimAPI_MakeCylinder s = BRepPrimAPI_MakeCylinder(60, 200) display.DisplayShape(s.Shape())

Następnie tworzone jest menu ‘simple test’ i dodawane dwie funkcje do submenu: add_menu('simple test') add_function_to_menu('simple test',simple_test) add_function_to_menu('simple test',simple_cylinder)

Na końcu nalęzy uaktywnić wyświetlanie: display.View_Iso() display.FitAll()# display loopstart_display()