OdGe classes provide a general representation for 2D and 3D geometric objects, such as points, lines, curves and surfaces.
The set of classes is logically divided into classes for 3D and 2D geometry. For example, there are two classes for representation of a point entity: the OdGePoint2d class for 2D space and the OdGePoint3d for 3D space. This approach allows you to avoid mixing geometrical objects of different spaces in the same operation.
The Ge library has classes for simple geometry objects as well as complex objects. Simple objects are formed using simple linear algebra: 2D and 3D points, vectors, 2D and 3D lines, matrices, and planar entities. Complex classes are for curves and surface objects.
Type checking functionality and logical equal-to operations are provided for all classes derived from the OdGeEntity2d or OdGeEntity3d classes. Each such class has the type() method, which returns the type of the object and the isKindOf() method, which checks whether the object is of a specific class or of a class derived from it. Two entities are considered equal if they are of the same type, have the same point set within the specified tolerance, and have the same parameterization (for curves and surfaces).
Any 2D entity and 3D entity can be transformed using transformation matrices or specific methods for translating, scaling and rotating.
Planar objects represented by the OdGePlanarEnt class has a set of methods for working with planes including checking if the plane is perpendicular or parallel to a specified plane or linear entity using isParallelTo() and isPerpendicularTo() methods, calculating the distance from the plane to the specified point using the distanceTo() method, etc.
All curve entities are inherited from the OdGeCurve2d and OdGeCurve3d classes and include curves such as linear entities (lines, line segments, rays), elliptical and circular arcs, splines etc.
Curve objects contain the general set of methods for working with all types of curves:
Surfaces are parametric entities and defined by a continuous function that maps some connected subset of the uv plane (possibly the entire uv plane) into 3D space.
The point on a parametric curve or surface that corresponds to a particular parameter value can be obtained by evaluating the function at that parameter value. For curves the parameter value is a scalar, and for surfaces the parameter value is a 2D point. Surface objects contain the evalPoint() method – a special method-evaluator for calculating the point corresponding to the parameter pair, as well as the derivatives and the normal at that point. Also, for every surface class, the OdGe library contains the evaluator class OdGePointOnSurface, through which the surface evaluators can be accessed.
Conversely, to get the pair of u,v parameters by the specific point on the surface, the paramOf() method is used.
The normal of the surface in a specific point can be obtained as a cross product of the u-tangent vector and the v-tangent vector at this same point. You can reverse the orientation of the normal using the reverseNormal() method.
For more information, see the following topics:
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|