Geometric Modeler

Topology

How to Use the Smoothing Options when Creating a Sweep

Tolerant Modeling Capabilities in the CATFrFSweepOperator
Use Case

Abstract

The CATFrFTopologicalSweep operator enables you to create sweeps. This use case explains how to create a circle sweep with two guides and a tangency surface.


What You Will Learn With This Use Case

In this use case, you learn how to use the "Smooth Sweeping" option of the CATFrFTopologicalSweep operator. You create a segment sweep with a guide curve and a reference surface, specify the input data as indicated below and improve the sweep surface quality by acting on the "Smooth sweeping" parameters. CATFrFTopologicalSweep is to be used according to the general scheme of topological operators. If need be, you can take a look at "Overview of the Topological Operators" [1] for more information.

[Top]

The CAAAdtSweepSmoothing Use Case

Reminder

In a CATIA session, the "Smooth Sweeping" option can be used in two cases:

  1. whenever a sweep cannot be generated because the specified input data are invalid (guide not continuous in tangency or not planar).
  2. whenever the generated sweep does not provide the user with the expected quality. The user may wish to reduce the number of edges on the created surface or at least improve the tangency conditions along the edges.

There are two parameters to be adjusted in order to perform a sweep that does not complete with the standard options or to achieve a sweep of better quality:

The "Angular Correction" option

This parameter is related to the angular tolerance of the moving frame (plane that moves perpendicularly along the guide curve). When the "Angular Correction" option is activated, the sweep algorithm tries to modify the angle between the moving frame and the guide curve to complete the sweep operation or produce a surface of better quality.

Example: to understand well how it works, compare the angle between one edge of the sweep and the plane normal to the reference surface in TolerantSweepDev0.CATPart[*] and TolerantSweepDev1.CATPart[*].

The sweep wouldn't complete with the default options because the guide curve is not planar- but if the "Deviation from Guide" option is activated, it completes. The angle between the edge and the plane normal to the reference surface is 45deg, which is exactly the value specified for the sweep angle (see TolerantSweepDev0.CATPart[*]).
Now, if you specify an angle correction of 2deg, the angle between the edge and the plane normal to the reference surface is 43.867deg. This value is within the specified range. (See TolerantSweepDev1.CATPart[*]).

The "Deviation From Guide" option

This parameter defines the gap authorized between the guide curve and the sweep itself. With the default option, there is no gap. When this option is activated, the sweep algorithm tries to generate a surface that does not stick necessarily to the guide curve but is of better quality or enables the completion of the sweep operation. When the resulting sweep is smooth enough, some edges can be cleaned.

The improvements to be expected

By adjusting the parameters above, you can reduce the tangency constraints along the edges and reduce the number of patches for the Nurbs surfaces underlying the sweep faces.

[Top]

What Does CAAAdtSweepSmoothing Do ?

The use case:

[Top]

How to Launch CAAAdtSweepSmoothing

To launch CAAAdtSweepSmoothing, you will need to set up the build time environment, then compile CAAAdtSweepSmoothing.m, set up the run time environment, and then execute the use case [2].

If you simply type CAAAdtSweepSmoothingwith with TolerantSweepInit.ncgm as input 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 CAAAdtSweepSmoothing ...\tolerantSweepInit.ncgm e:\sweep.NCGM

With UNIX CAAAdtSweepSmoothing ...\tolerantSweepInit.ncgm /u/sweep.NCGM

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

[Top]

Where to Find the CAAAdtSweepSmoothing Code

The CAAAdtSweepSmoothing code use case is made of a main named CAAAdtSweepSmoothingCode.cpp located in the CAAAdtSweepSmoothing code.m module of the CAAAdvancedTopologicalOpe.edu framework:

Windows InstallRootDirectory\CAAAdvancedTopologicalOperators.edu\CAAAdtSweepSmoothing .m\
Unix InstallRootDirectory/CAAAdvancedTopologicalOperators.edu/CAAAdtSweepSmoothing .m/

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

[Top]

Step-by-Step

The use case is divided into the following main steps:

[Top]

Retrieving the Input Data

The guide curva as well as the reference surface are retrieved from the input file by using the CATICGMObject::GetPersistentTag method.

[Top]

Creating a CATFrFTopologicalSweep operator instance

The CATFrFTopologicalSweep operator is created by the CATCreateFrFTopologicalSegmentSweepglobal function. The guide is passed in the form of a list as the third argument of the function.

// (a) - Define the list of guides (a single guide list in this case)
//
CATLISTP(CATGeometry) guides= NULL;
CATGeometry * guideGeom = (CATGeometry*)piInputBody ; 
guides.Append(guideGeom);

// (b) - Create the sweep operator
//
CATFrFTopologicalSweep * sweepOpe =::CATCreateFrFTopologicalSegmentSweep(piGeomFactory, 
&topdata, &guides);

    [Top]

Setting the Smooth Options

The "smooth sweeping" options are specified by using the combination of services below:

Service(s) Correspond(s) to
SetSmoothOption(1) + SetSmoothAngleThreshold(RadianAngleTol)  "Angular correction" check box activated.
SetCleanGuidesOption(1, ..., ..., ...);  "Deviation from Guide" check box activated.
No SetSmoothOption or SetSmoothOption(0)  "Angular correction" check box deactivated.
No SetCleanGuidesOption or SetCleanGuidesOption (0)  "Deviation from Guide" check box deactivated.

Four set of data are specified. The result is analyzed by using the "Apply Dress-Up" capability of the "Free Style" workbench. "Apply Dress-Up" allows you to display the number of patches for each face of the generated sweep as well as the isoparametric curves (dotted lines). The "Connect Checker" is used to check the tangency condition along edges.

Specification 1

Deviation from Guide: 0.03 mm
Angular correction:     not activated

Code
sweepOpe -> SetSmoothOption (0);
double iCleanMaxDeformation=0.03;
sweepOpe -> SetCleanGuidesOption(1, &iCleanMaxDeformation,
NULL, NULL);

Comments
The tangency conditions along the two edges are not satisfactory (maximum angle between edges: 5.921deg)

Face 1: 2 knots along U - 2 along V
Face 2: 3 knots along U - 2 along V
Face 3: 2 knots along U - 2 along V

Specification 2

Deviation from Guide: 0.03 mm
Angular correction:     0.5deg

Code
sweepOpe -> SetSmoothOption (1);
double AngleTol = 0.5 ;// in degrees
double RadianAngleTol = AngleTol*CATDegreeToRadian;
sweepOpe -> SetSmoothAngleThreshold(RadianAngleTol);
double iCleanMaxDeformation=0.03;
sweepOpe -> SetCleanGuidesOption(1, &iCleanMaxDeformation, NULL, NULL);

Comments
The tangency conditions along the two edges are satisfactory (Max is 0deg).

Face 1: 3 knots along U - 2 along V
Face 2: 4 knots along U - 2 along V
Face 3: 3 knots along U - 2 along V

Specification 3

Deviation from Guide: 1mm
Angular correction:    2deg

Code
sweepOpe -> SetSmoothOption (1);
double AngleTol = 2 ;// in degrees
double RadianAngleTol = AngleTol*CATDegreeToRadian;
sweepOpe -> SetSmoothAngleThreshold(RadianAngleTol);
double iCleanMaxDeformation=1;
sweepOpe -> SetCleanGuidesOption(1,
&iCleanMaxDeformation, NULL, NULL);

Comments
The tangency conditions along the two edges are satisfactory (Max is 0deg)

Face 1: 2 knots along U - 2 along V
Face 2: 3 knots along U - 2 along V
Face 3: 2 knots along U - 2 along V

Specification 4

No smooth option specified - a throw is issued - the sweep cannot be generated.

[Top]


In Short

This use case is an example of how to the smooth options to achieve a better quality of the segment sweep.

[Top]


References

[*] Delivered in CAAAdvancedTopologicalOpe.edu/FunctionTests/InputData
[1] Overview of the Topological Operators
[2] Building and Launching a CAA V5 Use Case
[3] Basic Topological Operators
[Top]

History

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

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