OpenCascade is a foundation library for geometric modeling. It provides root classes like handles and memory management. It also includes collections, vectors/matrices, primitive geometric types, and math algorithms. Specific features include auto reference counting, an optimized memory manager, runtime type information, and exceptions handling. Geometric entities can be manipulated by value. The library supports units conversion, internationalization, and progress reporting.
10. NCollections
• NCollections component implements TCollections with
additional features.
• Array1, Array2, List, Sequence, Map, IndexedMap, DataMap, …
• Other types: Vector, UBTree(unbalanced binary tree),
SparseArray, CellFilter(for sorting geometries).
• Features:
• Iterator: Init(), More(), Next(), Value(), ChangeValue().
• BaseCollection class: abstract collection of item with base class. API:
CreateIterator(), Size(), Assign().
• Heterogeneous Assign: accept assignment via other collection
type.
• Allocator: 預設allocator實現Standard::Allocate()與Standard::Free().
NCollection_IncAllocator是另一個allocator實作選項.
11. Vectors and Matrices
• 矩陣運算. Calculations involving vectors and matrices.
• Eigenvalues and Eigenvectors of a squared matrix.
• Solvers for linear algebraic equations.
• Find roots of a set of non-linear equations.
• Find minimum function of independent variables.
12. Primitive Geometric Types
• STEP-compliant implementation:
• Geometric shapes: points, vectors, lines, circles, conics,
planes and elementary surfaces.
• Geometric transformations: translation, rotation, symmetry,
scaling, composed transformations.
• Geometric processor package “gp”.
• Objects are manipulated by value.
• gp curves/surfaces are analytic (no parameterization and
orientation). Use Geom entities for parameterization.
• EICLib package: point parameter on gp curves.
• EISLib package: point parameter on gp surfaces.
13. Math Algorithms
• Solvers for linear algebraic (前面提過).
• Ex: Bissec + Newton.
• Find root of F(x)=x^2 – 4,in [1.5, 2.5]
14. Precision
• 每個物件擁有自己個別的精確度資訊.
• 判斷數值相等: if( abs(x2 – x1) < precision ) …
• Parametric space, 精準度常被要求在參數空間與真實座
標空間結果一致.
• Precision package:
• Angular: compare angles.
• Confusion: compare distances.
• Intersection: used by intersection algorithms.
• Approximation: used by approximation algorithms.
• Parametric: derived from 3D space precision.