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


Open CASCADEShowroomGet Open CASCADEDeveloper CornerSupportAbout us
Technical overview
Areas of use
Advantages
Public license
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
System requirements
What's new
Download Center
CD-ROM
Documentation
Getting started
Forum
Open Source community
Training and e-learning
A la Carte Support
Value-added software
Client Area
Company Profile
Contacts and Locations
Customers
News
Home / Developer Corner / Getting started / My first application / Body - prism the profile

Body - prism the profile

To compute the main body of the bottle, you need to create a solid shape.

The simplest way is to use the previously created profile and to sweep it along a direction: the Prism Open CASCADE functionality is the most appropriate. It accepts a shape and a direction as input and generates a new shape according to the following rules:

Shape

Generates

Vertex

Edge

Edge

Face

Wire

Shell

Face

Solid

Shell

Compound of Solid




 



Your current profile is a wire. Refering to the Shape/Generates table, you need to compute a face out of its wire to generate a solid.

To create a face, you use the BRepBuilderAPI_MakeFace class. As previously explained, a face is a part of a surface bounded by a closed wire. Generally, BRepBuilderAPI_MakeFace computes a face out of a surface and one or more wires.

When the wire lies on a plane, the surface is automatically computed.


TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);


The BRepPrimAPI package provides all the classes to create topological primitive constructions: boxes, cones, cylinders, spheres, etc. Among them is the BRepPrimAPI_MakePrism class. As specified above, this class is defined by:

- the basis shape to sweep
- a vector for a finite prism or a direction for finite and infinite prisms

You want the solid to be finite, swept along the Z axis and to be myHeight height. The vector, defined with the gp_Vec class on its X, Y and Z coordinates is:


gp_Vec aPrismVec(0 , 0 , myHeight);


All data necessary to create the main body of your bottle is now available. Just apply the BRepPrimAPI_MakePrism class to compute the solid:


TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile , aPrismVec);

next step
previous step


 
 

© Open CASCADE 2000 - 2008  |  Search  |  Contacts