Geometric Modeler

Topology

Creating Fillets

How to create constant and variable radius fillets
Use Case

Abstract

This use case explains how to create constant fillets, variable fillets and fillets with rolling edges.


What You Will Learn With This Use Case

This use case is intended to help you use fillets in geometric modeler applications.

[Top]

The CAATopAllFillets Use Case

CAATopAllFillets is a use case of the CAATopologicalOperators.edu framework that illustrates TopologicalOperators framework capabilities.

[Top]

What Does CAATopAllFillets Do?

CAATopAllFillets creates two solid cuboids, performs a boolean union of the cubes, then creates fillets on the resulting solid.

The CAATopConstantFillets function which is defined in the CAATopConstantFillets.cpp folder creates a constant fillet along the edges common to both cubes.
The CAATopRollingEdges function which is defined in the  CAATopRollingEdges.cpp folder creates a fillet along the common edges and specifies rolling edges.
The CAATopVariableFillets function which is defined in the CAATopVariableFillets.cpp folder creates a variable radius fillet on one edge of the solid.

[Top]

How to Launch CAATopAllFillets

To launch CAATopAllFillets, you will need to set up the build time environment, then compile CAATopAllFillets.m along with its prerequisites, set up the run time environment, and then execute the use case [1].

If you simply type CAATopAllFillets with no argument, the use case executes, but doesn't save the result in an NCGM file. If you want to save this result, provide the full pathname of the NCGM file to create. For example:

With Windows CAATopAllFillets e:\Fillets.NCGM

With UNIX CAATopAllFillets /u/Fillets.NCGM

This NCGM file can be displayed using the CAAGemBrowser use case.

[Top]

Where to Find the CAATopAllFillets Code

The CAATopAllFillets use case is made of a main named CAATopAllFillets.cpp located in the CAATopAllFillets.m module of the CAATopologicalOperators.edu framework:

Windows InstallRootDirectory\CAATopologicalOperators.edu\CAATopAllFillets.m\
Unix InstallRootDirectory/CAATopologicalOperators.edu/CAATopAllFillets.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Step-by-Step

There are six steps in CAATopAllFillets.cpp:

  1. Creating the geometry factory
  2. Creating the solid cuboids
  3. Performing a boolean union on the cuboids
  4. Creating a constant fillet around the edges common to both cubes
  5. Creating a constant fillet by specifying rolling edges
  6. Creating a variable radius fillet.
  7. Writing the model and closing the Container

[Top]

Creating the Geometry Factory

The geometry factory (CATGeoFactory) creates and manages all the CATICGMObject. This creation is done by the global function ::CATCreateCGMContainer. Notice that the factory can be defined by reading a NCGM file that was previously stored. In that case, the global function ::CATLoadCGMContainer must be used.

CATGeoFactory* piGeomFactory = ::CATCreateCGMContainer() ;
if (NULL==piGeomFactory) return (1);

[Top]

Creating the solid cuboids

See [2] which illustrates how to create a solid cuboid.

[Top]

Performing a boolean union on the cuboids

See also [2].

[Top]

Creating a constant radius fillet

To create a constant radius fillet, you must:

  1. define your CATDynFilletRadius.
    double * ratio= NULL;
    CATDynFilletRadius * pRadius = new CATDynFilletRadius(3.,    // radius value
                NULL,  
                ratio,  
                NULL);  

    The arguments two, three and four of the constructor are only to be specified when the fillet to be created is of variable radius. The cells to be filleted with a constant radius are specified in the CATDynEdgeFilletRibbon constructor.

  2. define the CATDynEdgeFilletRibbon object whereby you specify what cells are to be filleted. If you create a constant radius fillet, the list to be passed as the second argument of the CATDynEdgeFilletRibbon is a single item list.
    CATLISTP(CATDynFilletRadius) listRadius;		
    listRadius.Append(pRadius);		
    CATDynEdgeFilletRibbon * pRibbon = new CATDynEdgeFilletRibbon(listEdges, listRadius);
  3. if need be, set the parameters of the CATDynFilletRibbon
    pRibbon ->SetSegmentationMode(CATDynTrim);
  4. create the CATDynFillet operator by using the CATCreateDynFillet operator
    CATDynFillet * pFilletOp1 = CATCreateDynFillet(iFactory,iTopData,iBody);
  5. append the CATDynEdgeFilletRibbon to the operator instance
    pFilletOp1 ->Append(pRibbon);

[Top]

Creating a constant radius fillet with rolling edges

To create a variable radius fillet, you must:

  1. proceed as you would do for a constant radius fillet.
  2. in the CATDynEdgeFilletRibbon constructor, specify the list of rolling edges as well as the fillet behavior (CATDynRolling).
    CATDynEdgeFilletRibbon * pRibbon = new CATDynEdgeFilletRibbon(listEdges, listRadius,
                CATBody::CATEdgePropagAuto,
                listRollingEdges,   // the rolling edges
                CATDynRolling);

[Top]

 

Creating a variable radius fillet

To create a variable radius fillet, you must:

  1. define the CATDynFilletRadius necessary to define the fillet shape. You must specify:
    double * ratio0= new double(0.0);
    CATDynFilletRadius * pRadius0 = new CATDynFilletRadius(4.,  // radius value
                listCells[2],  
                ratio0,  
                NULL);  // "free" tangency at this extremity
    ...
    double * ratio1= new double(0.25);
    CATDynFilletRadius * pRadius1 = new CATDynFilletRadius(0.2,  // radius value
                listCells[2],  
                ratio1,  
                NULL);  // "free" tangency for this location

    The second and third arguments of the constructor must be specified when the fillet to be created is of variable radius.

  2. define the CATDynEdgeFilletRibbon object whereby you specify the list of radii to be applied along the edge to be filleted. The list of edges to be filleted is to be set to NULL.
    CATLISTP(CATDynFilletRadius) listRadius;		
    listRadius.Append(pRadius0);
    listRadius.Append(pRadius1);
    listRadius.Append(pRadius2);
    listRadius.Append(pRadius3);
             
    // Create the CATDynEdgeFilletRibbon
    //
    CATDynEdgeFilletRibbon * pRibbon = new CATDynEdgeFilletRibbon(NULL, listRadius);
  3. if need be, set the parameters of the CATDynFilletRibbon
    pRibbon ->SetSegmentationMode(CATDynTrim);
  4. create the CATDynFillet operator by using the CATCreateDynFillet operator
    CATDynFillet * pFilletOp1 = CATCreateDynFillet(iFactory,iTopData,iBody);
  5. append the CATDynEdgeFilletRibbon to the operator instance
    pFilletOp1 ->Append(pRibbon);

[Top]

Writing the Model and Closing the Factory

To save the model in a file, the ::CATSaveCGMContainer global function is used. Notice that in the use case, the save is conditioned by an input parameter representing the file inside which the model must be saved.

The use case ends with the closure of the geometry factory, done by the ::CATCloseCGMContainer global function.

 if(1==toStore)
 {
#ifdef _WINDOWS_SOURCE
   ofstream filetowrite(pfileName, ios::binary ) ;
#else
   ofstream filetowrite(pfileName,ios::out,filebuf::openprot) ;
#endif

   ::CATSaveCGMContainer(piGeomFactory,filetowrite);
   filetowrite.close();
 }	

 //
 // Closes the container
 //	
 ::CATCloseCGMContainer(piGeomFactory);

[Top]


In Short

To create fillets, you must specify a list of radii as well as a list of edges to be filleted. For a constant radius, the list of radii contains a single item that you can apply to one or more edges. When creating a variable fillet, you must specify the list of radii. The edge to be filleted is then specified in the radius definition.

[Top]


References

[1] Building and Launching a CAA V5 Use Case
[2] Overview of the Topological Operators
[Top]

History

Version: 1 [March 2002] Document created
[Top]

Copyright © 2000, Dassault Systèmes. All rights reserved.