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 / Body - adding the neck

    Body - adding the neck

    To add a neck to the bottle, you will create a cylinder and fuse it to the body.

    The cylinder is to be positioned on the top face of the body with a radius of myThickness / 4. and a height of myHeight / 10.

    To position the cylinder, you need to define a coordinate system with the gp_Ax2 class defining a right-handed coordinate system from a point and two directions - the normal and the X direction (the Y direction is computed from these two).

    The center of the top face being, in the global coordinate system, (0 , 0 , myHeight) and its normal on the Z axis, your local coordinate system can be defined as follows:


    gp_Pnt neckLocation(0 , 0 , myHeight);
    gp_Dir neckNormal = gp::DZ();
    gp_Ax2 neckAx2(neckLocation , neckNormal);


    To create a cylinder, use another class from the primitives construction package: the BRepPrimAPI_MakeCylinder class. The information you must provide is:

    - the coordinate system where the cylinder will be located
    - the radius and height



    Standard_Real myNeckRadius = myThickness / 4.;
    Standard_Real myNeckHeight = myHeight / 10;

    BRepPrimAPI_MakeCylinder MKCylinder(neckAx2 , myNeckRadius , myNeckHeight);
    TopoDS_Shape myNeck = MKCylinder.Shape();


    You now have two separate parts: a main body and a neck that you need to fuse together.

    The BRepAlgoAPI package provides services to perform boolean operations between shapes, and especially: common (boolean intersection), cut (boolean substraction) and fuse (boolean union).

    Use BRepAlgoAPI_Fuse to fuse the two shapes:


    myBody = BRepAlgoAPI_Fuse(myBody , myNeck);

    next step
    previous step


     
     

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