Using the Ge library you can create and modify spheres.
A sphere is defined by the following parameters: radius, center, north axis, and reference axis. The north axis is a normalized vector that defines the direction from the center to the north pole. The reference axis is a vector orthogonal to the north axis that defines the direction to the prime meridian.
Since a sphere is a 3D parametric surface, there is a subset of the parameters that is mapped to the surface.
Parameter U defines latitude and defaults to [-OdaPI/2, OdaPI/2] for closed spheres. The lower bound maps to the south pole, zero maps to the equator, and the upper bound maps to the north pole.
Longitude is defined by the V parameter, which defaults to [-OdaPI, OdaPI) for closed spheres. Zero corresponds to the meridian defined by the reference axis of this sphere — the prime meridian. Applying the right hand rule along the northAxis defines the increasing direction for V if isReverseV() is false, and decreasing direction for V otherwise.
Spheres are represented by the OdGeSphere class. To create a sphere, use OdGeSphere() constructors:
An OdGeSphere object contains the following methods for returning sphere properties:
To set sphere properties, use the corresponding methods: setAnglesInU(), setAnglesInV(), and setRadius(). To define a set of properties, use the specific set() method.
For example:
OdGeSphere sphere1;
sphere1.set(3.0, OdGePoint3d(5.0, 0.0, 0.0));
sphere1.setRadius(1.5);
OdGeSphere sphere2(2.0, OdGePoint3d(0.0, 0.0, 0.0));
sphere2.setRadius(sphere1.radius()+1);
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|