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 / Threading - creation and building the resulting compound

Threading - creation and building the resulting compound

You have computed the threading's wires. The threading will be a solid shape, so you must now compute the faces of the wires, the faces allowing you to join the wires, the shell out of these faces and then the solid itself. This can be a lengthy operation.

There are always faster ways to build a solid when the base topology is defined. You would like to create a solid out of two wires. Open CASCADE provides a quick way to do this by building a loft: a shell or a solid passing through a set of wires in a given sequence.


 



The loft function is implemented in the BRepOffsetAPI_ThruSections class, which you use as follows:

- Initialize the algorithm by creating an instance of the class. The first parameter of this constructor must be specified if you want to create a solid. By default, BRepOffsetAPI_ThruSections builds a shell.
- Add the successive wires using the AddWire method.
- Use the CheckCompatibility method to activate (or deactivate) the option that checks if the
wires have same number of edges. In this case, wires have two edges each, so you can deactivate this option.
- Ask for the resulting loft shape with the Shape method.


BRepOffsetAPI_ThruSections aTool(Standard_True);

aTool.AddWire(threadingWire1);
aTool.AddWire(threadingWire2);
aTool.CheckCompatibility(Standard_False);

TopoDS_Shape myThreading = aTool.Shape();


You are almost done building the bottle. Use the TopoDS_Compound and BRep_Builder classes to
build single shape from myBody and myThreading:

TopoDS_Compound aRes;
BRep_Builder aBuilder;
aBuilder.MakeCompound (aRes);
aBuilder.Add (aRes, myBody);
aBuilder.Add (aRes, myThreading);



 




Congratulations! your bottle is complete. We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE.

previous step





 
 

© Open CASCADE 2000 - 2008  |  Search  |  Contacts