From Russia with CAD
 
All articles     
Articles

24 May 2013

Russian 3D-kernel RGK: Functionality, Advantages, and Integration

Leonid Baranov, Sergey Kozlov, Dmitry Semin, Nikolay Snytnikov

Ëåîíèä Áàðàíîâ Ñåðãåé Êîçëîâ Äìèòðèé Ѹìèí Íèêîëàé Ñíûòíèêîâ

Geometric 3D kernels are software components designed to represent and precisely model physical objects in 3D on computers. From kernels, end user applications are developed, such as CAD (computer aided design), CAM (computer aided manufacturing), and CAE (computer aided engineering), as well as many other products in the field of engineering. All these systems require precise, highly efficient tools for working with software models to create, store, and analyze 3D data, perform specialized computations, and much more.

As is clear from the history of software, creating an industrial-grade geometric modeling kernel is one of the most difficult tasks in developing engineering software. Finding the right solution combines top-level competencies in mathematics, computer system architecture, software design, and CAD expertise. As is seen from a review [1], only a few kernel vendors are currently represented in the global market; a huge segment of the CAD market and related products depend on them, commercially and technologically.

This paper describes RGK (Russian geometric kernel) as part of a project funded by the Russian Federation's Ministry of Industry and Trade to build up a foundation of independent components important to Russian's high technology sector. This project is being supervised by STANKIN Moscow (State Technology University) and is being executed by an integrated team of several Russian groups of developers and specialists. Additional information about the project and its participants can be found in the following publications [2, 3]. The work on RGK kernel began in 2011; the product is currently at a stage of active internal testing. Simultaneously, the customer (Ministry of Industry and Trade) is considering the issues of support, implementation, licensing, development and application building.

Here is a brief description of the paper.

All kernels most popular today were created 15-30 years ago. Over this time, they have been developed, enhanced, and adjusted, their program architecture and implementation cannot fully support the new software capabilities and hardware technologies that have been continuously emerging. Development of RGK kernel started at the end of 2011; when working on the project, we tried to use the modern, effective solutions as well as some new mechanisms and possibilities, which are described in the first section of the paper.

Geometric kernels by their nature are a technological component, and so numerous and diverse applications are built on it, through integration. Section II outlines the principles and delivery of an integrated RGK kernel with applications.

The foundation of a modern geometric kernel integrates stable functionality as determined by the requirements of typical applications. Section III presents the functions in RGK that any modern geometric kernel must support.

The border between the basic kernel functions (sought after by most applications) and the kernel shell, which supports several specialized but stable classes of applications and procedures, is tentative. Some kernel vendors insist that such shells (for instance a geometric solver or a data converter) are an integral part of the kernel, while others believe that configurability is the advantage of their solution. One way or the other, support for popular classes of applications for standard technological operations must be associated with a modern geometric kernel. Section IV describes the capabilities of RGK.

As mentioned, users of geometric kernels are developers of system applications, and not end users. Therefore, kernels have specific packaging. Section V describes RGK's packaging.

References to publications useful for understanding this paper are given in the final section, Section VI.

I. Modern Architecture, Innovative Solutions

In the RGK kernel, a 3D model is described using boundary representation (B-rep). But other descriptions are used when necessary. For instance, to optimize the speed of kernel's functions, and to ensure precise storage and computation of the model, canonical objects and NURBS curves and surfaces are used. To solve tasks associated with complex operations (such as hole-covering surfaces, N-side patches, and blending surfaces in complex cases), special types of curves and surfaces are used by the kernel. In many situations, combining these solutions accelerates kernel functions and makes them more precise.

To develop the architecture, a complete set of advanced tools and modern techniques of coding, debugging, code optimization, and reliable methods of describing model objects interactions were used. Let’s give a more detailed description of some solutions that are for the first time fully implemented in the RGK project and so are considered the best practices.

Multithreading

The modern trend in computer architecture naturally has affected the software architecture of the kernel. Parallel computations on multi-core computers were chosen as one of the main methods of increasing computation speed. When many operations with geometric and topological data take place, there is a considerable room for parallel computations, which require precise and well-thought software implementation. Our kernel's software architecture was developed in view of these requirements, which automatically increases productivity with use of today's hardware devices.

Parallel operations on several computers can be completed at different levels and in different modes. Parallelism can be forcedly disabled for the entire geometric kernel for a single session (document). It is possible to set a number of parallel computational flows, and to launch operations with bodies in parallel. Special attention was paid to developing scalable parallel computational algorithms.

 

Generating 300,000 various simple objects in single-threaded and multithreaded modes.
Left: single thread completed operation in 40.9 seconds. Right: six simultaneous threads completed operation in 8.5 seconds.

Using Calculations on GPU

Another resource that enhances productivity in modern systems is the use of GPUs (graphics processing unit). Normally, they are meant for displaying graphics, but can today be used for general purpose calculations. As a result of studies, special algorithms with demonstrated efficiency have been developed for use on GPUs. They can handle functions as computing mass-inertia characteristics of bodies, projections, searching model elements upon the given point, and so on. The algorithms are embedded in the geometric kernel, and so can be launched by setting user options. OpenCL is the base library for mass computations.

Multiple platforms

Our geometric kernel supports 32- and 64-bit architecture, and Windows and Linux platforms. It can be compiled with any Ñ++ compiler that implements features of Ñ++11 standard.

The window of a test application started for Linux (Ubuntu)

Multiple Documents

Taking into account requirements for developing applications, the kernel architecture enables control over computational context, and has a special layer to transfer information about the current session to all functions being used. Thus, developers of end user CAD/CAM/CAE applications immediately have a ready infrastructure with which to work in several documents using their own 3D objects (such as bodies), different parameters for computational precision, and other specific settings. Each session keeps its set of objects isolated; this proves to be a convenient way to control object initialization, creation, and deletion. Keeping kernel sessions isolated, together with multithreaded processing, enabled us to create a modern and efficient application system that fully uses computational capabilities of computers.

A multi-document interface of a test application. Each window stores data in a separate session.

Many Solids and Hybrid Modeling

Modern CAD/CAM/CAE systems must support solid, surface, and wireframe modeling. The RGK kernel has the full set of tools to solve tasks in all these areas, and even enables the application to work simultaneously with those objects within the same model. For the convenience of the CAD developer, the same class is used whenever possible for work and for creating different types of bodies. For instance, the class of "lofting" generator can successfully generate models of solid and surface bodies depending on the options provided or the types of data input.

A hybrid model containing solid, sheet and wireframe bodies

The kernel carries out all computation with finite precision. Depending on a type of computations and user settings, different values of linear and angle precision can be set. This enables tradeoffs between fast computation and precise results. The ratio between linear and angle precision is determined by the user’s choice of modeling dimensions, and can be set individually for each session.

When it is not possible to get representation of geometric objects within the limits of the kernel's precision, then users must work with low modeling precision; in this case, tolerant geometry representation is used. It is characterized by a special treatment of undefined values and discontinuities, geometric errors in topology, and it takes into account restrictions in model operations. Tolerant geometry is used to convert data from one representation to another. One example is using IGES and STEP formats to exchange information between CAD/CAM/FEA systems.

II. Getting Ready for Application Development

Identifying Model Objects

In developing application systems, particularly for parametric CAD, there is the task of storing references to topological elements -- vertices, edges, faces -- in a stable manner. This is essential in setting parameters of local editing, or the elements involved in geometric constraints. RGK's geometric kernel has a stable identification and storage mechanism of topological elements based on specially-generated keys. This mechanism allows programmers to halt searches of geometric parameters that become inconvenient after local modifications are made.

Working with System and User Attributes

To store additional information related to topological elements of a model, a mechanism of typified attributes, which are stored and copied together with a body is used. Apart from topological elements, attributes can be stored in session and in user identifiers.

Detailed Errors Diagnostics

The results of functions are returned as error codes. Detailed information about problems is recorded in a report on functions and performance. To assist centralized monitoring of errors, the kernel has a user class – a monitor -- that gives detailed descriptions of errors. It is especially convenient for debugging applications.

The kernel has powerful tools for verification of body correctness. Such verification is necessary for imported models or models obtained by users through low-level editing facilities, such as manual modification topology.

Rollback Operation

"Generator" classes are the main means of controlling and editing models. The result of executing them is the modified geometry and topology of bodies. If an error occurs in the generator (such as because of incorrect output), the state of the model becomes indefinite or incorrect. In this case, the geometric kernel performs an undo operation to the initial generator state; this ensures the correctness of the model and avoids the cost for permanent model copying by the application developer.

Universal Platform-Independent Data Format

To store 3D model data, we developed our own exchange format. It is an XML-document, and data can be stored in standalone files, as well as be part of application data. The choice of the XML data structure was determined by its advantages in being a universal data format, having platform independence, being easy to scale, and is open. The format is used also for debugging purposes by recording sequences of calls made to kernel functions.

Quality Assurance and Test Infrastructure

As a 3D geometric kernel, the complex software has strict quality requirements. We reached the following quality assurance goals in developing and designing kernel's architecture:
  • Creating a convenient test infrastructure for developers, including continuous integration, test driven development, daily automatic builds, and runs of several thousand tests on all supported platforms and configurations
  • Continuous extension of the test database with new user scenarios, exactly emulating the calling sequence of the kernel's functions
  • Supporting backward compatibility in further development, improvements and modifications of geometric kernel

III. Full Set of Tools for Geometric Modeling

Standard and Advanced Functionalities

The kernel provides functions for solving a wide range of geometric modeling tasks. These can be divided into “standard” and “advanced” tasks. The standard set of functions and options comprise the backbone of general purpose capabilities found in CAD. These include operations for generating base bodies, and local and global modifications of solid bodies and surfaces. Advanced functions include the creation of complex forms, building up multi-dimensional deformations, and so on.

To create the surfaces of complex shapes, the kernel fully supports methods, such as sweeping profiles along 2D or 3D curves with settings for bending and scaling, and rules for treating discontinuities on sweeping trajectories. There are generators optimized for the special cases of helixes and springs, with user-defined options, such as changing the radius or screw pitch. These make them powerful instruments of creating models of complex shapes.

Bodies created by a sweep generator using various laws of profile changing

A pipeline created by a sweep generator

The lofting generator supports sections with multiple contours, tangency conditions, axis curve definitions, and so on. When sections have different topology, the generator's algorithms can automatically coordinate them by taking into account the number of discontinuities and the number of segments in each G1-continuous interval of a segment. Or else application developers can set correlations between section points.

Generation of bodies by the lofting operation using different ways of setting correlations between section points.

Another important method of free-form modeling is the deformation of solid and sheet bodies under various rules, such as bending, translation, freeform and sculptural deformation, and deformation by curve and surface. In the course of deformation transformation, many body surfaces can change their type, changing from analytical surfaces into NURBS.

Applying “sculptural deformation” operation to a model of a machine stand

The geometric kernel includes a full set of functions for solving the task of blending of two and three surfaces, and of covering the holes with irregular shapes. Blending can be applied with continuous or variable radii and sections; special surface functions are used for its representation in the form of a surface, enabling it to represent the results precisely, and, if necessary, to convert it into NURBS. Algorithms include rolling ball and disk blending with a given or computed axis curve. The task of n-sided patch coverings can be solved for an arbitrary number of boundaries segments, with the requirement of joining through G1 patches.
 

Using special surfaces for solving the tasks of blending and holes covering

The kernel provides a set of classes and functions for solving basic geometric and mathematical tasks. These include operations of vector and matrix algebra, computation of geometric objects (derivatives, normals, curvatures, and so on), computation of bounding boxes, distances between objects, tessellation, and functions to access the geometric and topological elements of models.

Additional modules included in kernel are the geometric constraint solver for positioning solid bodies in assemblies or for simulating kinematic joints, and a converter that handles STEP import and export.

Low-Level and High-Level Operations

Kernel functions can be grouped under another criterion: low-level and high-level ones. The low-level operations include constructing curves and surfaces (canonical objects, NURBS, offset curves and surfaces, and so on), projecting points and curves on surfaces, intersecting and extending curves and surfaces, modifying topology (including Euler operations), and so on. Low-level operations enable application developers to modify kernel data in a most flexible manner, practically operating in manual mode.

High-level operations include operations that are standard for body generation, and Boolean operations on bodies (union, subtract, and intersect). It can be used with solid and surface bodies, and with combinations of the two.

Using a Boolean operation of subtracting a cylinder body from a "screw" body

The result of applying a sequence of Boolean operations to generate a gear. Left: the primary part and a tool body. Centre: the result of the subtracting operation. Right: the resulting body.

High-Level Generators for Solid Body Modeling

High-level operations of body generation can be classified according to their use:
  • Generating primitives: planes, spheres, cylinders, tori, cones, NURBS, and so on
  • Generating kinematic operations: extrusions, revolves, sweeps of wireframes or surface bodies along 2D or 3D curves, springs, helixes with the option of setting linear and non-linear rules for changing radius and step, and so on
  • Lofting and skinning: input sections can be both one- and two-parameter families, with requirements on their differential properties
  • Global body modification: Boolean operations, bend deformations, rotation, scaling with different coefficients, and so on
  • Local body modification: blends with continuous and variable radii, faceting, tapering, hollows, offsets, arrays of elements, face replacing, sheet sewing, surface extensions, covering of n-sided patches, and so on
  • Projecting bodies on surfaces with hidden-line classification and removal
  • A mechanism of grouping local operations to support development of the functions needed for direct modeling systems. As a result of them, a new body is generated using combined transformations, rather than a sequence of standalone local operations

IV. Solution for a Standard CAD Tasks

Assembly Managing

Assembly modeling is a key functionality of CAD. Representing information about multi-level structures of assembled products directly in the kernel enables more efficient solutions of the tasks typical for assemblies. Such tasks include calculating mass-inertia characteristics, solving geometric constraints between elements, verifying assemblies, and selecting parts by ray casting. In RGK, every assembly is represented by a set of parts (of a body of a sub-assembly) with additional transformations, setting the position of the part in the assembly. The kernel's functions enable the creation of new assemblies, changing the structure and removing their components. In all cases of editing, the correctness of the model is under control.

Geometric Constraints in Assembly and Kinematics Simulation

There are two main approaches for setting the positions of parts in assemblies: explicitly, or by imposing geometric constraints (such as coincidence, parallelism, tangency, and distance) or by kinematic joints (such as different types of gears) between geometric elements. The task of satisfying geometric constraints is solved with a special module embedded in the kernel – a geometric solver. In RGK, however, the interface definition is unrelated to a solver; therefore, instead of an embedded solver, it is possible to connect alternative solvers available on the market.

Moving pieces of mechanisms

Projection Generation

The projection generator makes drafting views and sketches of 3D models. A projection image consists of a set of 2D segments, each of which conforms to a part of edge or an isocline curve of face. A projection image is determined, first of all, by the set of projected elements (assemblies, bodies, facets, edges) and the projection transformation. Additional parameters control the process of developing a projection image; these includes choosing an algorithm for constructing an isocline curve, options of hidden lines removal, and constructing segments for inner edges.

3D machine model and projections with removal of the hidden lines generated on its basis

Model Inquiries

Obtaining information about a model is important function required by users. In particular, such information includes calculating model extremities in a given direction, and measuring distances (maximums and minimums) between topological and geometric model elements.

An integral part of modern CAD systems is clash detection, which detects and eliminates errors in designing assemblies and constructions at early stages. Our geometric kernel determines clashes between any combination of solid bodies, surfaces, and curves. This functionality accepts two sets of topological objects as input, and then returns all objects that are in a state of clashing, as well as they type of each clash – interference, touching, or containment.

Data Exchange

The kernel includes a ready-to-use function for exchanging data in a STEP format, which is a current standard (N. 203 and 214 applied protocols). It supports data import / export in today’s most popular formats for exchanging data between CAD/CAM/CAE systems. Information is transferred about models, of particular bodies, and of the structure of assembly models.

Examples of models imported in the STEP format from Creo (Pro/E), Autodesk Inventor, SolidWorks

Preparing Data for Visualization

To display models using graphics accelerators, the kernel includes model tessellation and mesh generator functions. The tessellation is of a high standard, and through options ensures data is in a format that suitable for graphic accelerators.

Tools for Searching and Selecting Objects

RGK has tools for multiple selections of elements through ray casting. It can be used in the user interface of CAD systems to determine the visibility of elements, construct photo-realistic images, and determine clashes in problem of dynamics simulation.

V. Packaging

Technically, the kernel is a library of classes in C++ in the form of a dynamically loaded module (DLL or so) and header files. Apart from this, packaging includes an additional set of project makefiles, user (developer) manual, documentation, a set of examples, and “RGK Workshop” demo and test application for interactive using and testing the entire kernel functionality without the need to develop a CAD application.

VI. References

  1. Russian National 3D Kernel
  2. LEDAS Experts: How our Company is Involved in Developing Russian Geometric Kernel
  3. RGK Russian Geometric Kernel Celebrates First Full-Featured Version

See also:



Permanent link :: http://isicad.net/articles.php?article_num=16135


PDM outsourcing
31st of October, 2024

News

All news


Articles

All articles

© 2004-2024 LEDAS Ltd. All rights reserved.