|With the help of the previously defined points, you can compute a part of the bottle's profile geometry.|
|As shown in the figure below, it will consist of two segments and one arc.|
To create such entities, you need a specific data structure which implements 3D geometric objects. This can be found in the Open CASCADE Technology Geom package.
An Open CASCADE Technology package is defined as a group of classes which have the same behavior or belong to the same structure. Open CASCADE Technology classes have names that start with the name of the package they belong to. For example, Geom_Line and Geom_Circle classes belong to the Geom package. The Geom package implements 3D geometric objects compliant with STEP: elementary curves and surfaces are provided as well as more complex ones (such as Bezier and BSpline).
However, the Geom package provides only the data structure of the geometric entities. You can instantiate directly classes belonging to Geom, but it is easier to compute elementary curves and surfaces by using the GC package. This is because the GC provides two algorithm classes which are exactly what is required for our profile:
Class GC_MakeSegment to create a segment. One of its constructors allows you to define a segment out of two points P1 and P2.
Class GC_MakeArcOfCircle to create an arc of a circle. A very useful constructor specifies that an arc can be built from two points P1 and P3 and going through P2.
Both of these classes return a Geom_TrimmedCurve manipulated by a handle. This entity represents a base curve which is limited between two of its parameter values. For example, a circle C is parameterized between 0 and 2PI. If you need to create a quarter of a circle, you create a Geom_TrimmedCurve on C limited between 0 and PI/2.
Handle(Geom_TrimmedCurve) aArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3 ,aPnt4);
Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1 , aPnt2);
Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4 , aPnt5);
All GC classes provide a casting method to obtain the result automatically with a function-like call. You may use these classes more safely by using the IsDone and Value methods. For example:
GC_MakeSegment mkSeg (aPnt1 , aPnt2);
aSegment1 = mkSeg.Value();