Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation


My first application
  • Profile - defining support points
  • Profile - defining the geometry
  • Profile - defining the topology
  • Profile - completing the profile
  • Body - prism the profile
  • Body - applying fillets
  • Body - adding the neck
  • Body - creating a hollowed solid
  • Threading - creating surfaces
  • Threading - defining 2D curves
  • Threading - building edges and wires
  • Threading - creation and building the resulting compound


  • Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
    Technical overview
    Areas of use
    Advantages
    FAQ
    Screenshots
    Shape factory
    Shape gallery
    Demonstrations
    What's new
    System requirements
    Download Center
    Public license
    Documentation
    Getting started
    Forums
    Open Source community
    Training and e-learning
    A-la Carte Support
    Value-added software
    Complementary Components
    Customer Corner
    Company Profile
    Marketing Materials
    Contact Us
    News
    Home / Developer Corner / Getting started / My first application / Profile - defining support points

    Profile - defining support points

    To create the bottle's profile, you first create characteristic points with their coordinates as shown below in the (XOY) plane. These points will be the supports that define the geometry of the profile.


     

    There are two classes to describe a 3D cartesian point from its X, Y and Z coordinates in Open CASCADE Technology:

    - the primitive geometric gp_Pnt class
    - the transient Geom_CartesianPoint class manipulated by a handle

    A handle is a type of smart pointer that provides automatic memory management.

    To choose the best class for this application, consider the following:

    - gp_Pnt is manipulated by value. Like all objects of its kind, it will have a limited life time.
    - Geom_CartesianPoint is manipulated by handle and may have multiple references and a long life time.

    Since all points you will define are used only to create the profile's curves, an object with a limited life time will do. Choose the gp_Pnt class.

    To instantiate a gp_Pnt object, just specify the X, Y, and Z coordinates of the points in the global cartesian coordinate system:


    gp_Pnt aPnt1(-myWidth / 2. , 0 , 0);
    gp_Pnt aPnt2(-myWidth / 2. , -myThickness / 4. , 0);
    gp_Pnt aPnt3(0 , -myThickness / 2. , 0);
    gp_Pnt aPnt4(myWidth / 2. , -myThickness / 4. , 0);
    gp_Pnt aPnt5(myWidth / 2. , 0 , 0);


    If you decide to use the Geom_CartesianPoint class, the syntax would be slightly different. All objects manipulated by handle must use the standard C++ operator new and are built as follows:


    Handle(Geom_CartesianPoint) aPnt1 = new Geom_CartesianPoint(-myWidth /
    2. , 0 , 0);


    Once your objects are instantiated, you may need to apply methods to them. Here again, syntax is the same as in C++. For example, to get the X coordinate of a point:


    gp_Pnt aPnt1(0 , 0 , 0);

    Handle(Geom_CartesianPoint) aPnt2 = new Geom_CartesianPoint(0 , 0 , 0);

    Standard_Real xValue1 = aPnt1.X();
    Standard_Real xValue2 = aPnt2->X();

    next step
    previous step

     
     

    © OPEN CASCADE 2000 - 2013  |  Search  |  Contacts   |  Site map