# Smoothing Curves

This task shows how to smooth a curve, i.e. fill the gaps, and smooth tangency and curvature discontinuities, in order to generate better quality geometry when using this curve to create other elements, such as swept surfaces for example.

Open the Smooth1.CATPart document.

1. Click Curve Smooth .

 The Curve Smooth Definition dialog box is displayed.
2. Select the curve to be smoothed.

You can only select an element, not a sub-element, as the curve to be smoothed. This is to prevent any confusion with possible elements to freeze, that can only be sub-elements.
If you wish to select the sub-element of a curve, use the Extract command and select the extracted feature as the element to be smoothed.

Texts are displayed on the curve indicating its discontinuities before smoothing, and type of discontinuity (point, curvature or tangency) and their values (In area). These values are expressed in the following units:
• for a point discontinuity: the unit is the document's distance unit (mm by default)
• for a tangency discontinuity: the unit is the document's angular unit (degree by default)
• for a curvature discontinuity: the value is a ratio between 0 and 1 which is defined as follows: if ||Rho1-Rho2|| / ||Rho2|| < (1-r)/r  where Rho1 is the curvature vector on one side of the discontinuity, Rho2 the curvature vector on the other side, and r the ratio specified by the user; then the discontinuity is smoothed. For example, r=1 corresponds to a continuous curvature and r=0.98 to the model tolerance (default value). A great discontinuity will require a low r to be smoothed.
3. Click Preview to display texts indicating the curve discontinuities that are still present after the smoothing operation, and whether they are within the threshold values (yellow box) or outside the set values (red box) (Out area).

The following elements C0, C1 and C2 that are displayed before the discontinuity information indicate that the vertex is respectively point continuous (C0), tangent continuous (C1) and curvature continuous (C2).
The value and location of the Maximum deviation between the curve to be smoothed and the smoothed curve are displayed in the 3D geometry.
In the example, from top to bottom, once the curve is smoothed:
• the tangency discontinuity still is present
• there is no more discontinuity, the point discontinuity is corrected
• the curvature discontinuity is still present, even though it is slightly modified (different In and Out values)
• the curvature discontinuity still is present and not improved at all
Basically:
• a red box indicates that the system could not find any solution to fix the discontinuity while complying with the specified parameters
• a yellow box indicates that some discontinuity has been improved, where there was a point discontinuity there now is a tangency discontinuity for example
• a green box indicates that the discontinuity no longer exists; it has been smoothed.

### Defining tangency and curvature thresholds, maximum deviation and continuity

4. From the Parameters tab modify the Tangency threshold, that is the tangency discontinuity value above which the curve is smoothed.
If the curve presents a tangency discontinuity greater than this threshold, it is not smoothed.

 If you increase the threshold value to 1.0 in our example, you notice that the Tangency discontinuity value, which was below 1, changes to a curvature discontinuity.
5. Similarly, you can check Curvature threshold to set curvature discontinuity value above which the curve is smoothed.

6. Define a Maximum deviation value to set the allowed deviation between the initial curve and the smoothed curve.
Therefore, the resulting smoothed curve fits into a pipe which radius is the maximum deviation value and the center curve is defined by the selected curve.

7. Define the Continuity, that is the correction mode for the smoothing, by checking either:

• Threshold: default mode. The tangency and curvature thresholds options are taken into account.

• Point: no point discontinuity should remain.

 There is no point discontinuity in our example.
• Tangent: no tangent discontinuity should remain. The tangency threshold option is not taken into account, it is grayed out and the defined value is ignored.

 You notice that the Tangency discontinuity changes to a curvature discontinuity.
• Curvature: no curvature discontinuity should remain. The curvature threshold option is not taken into account, it is grayed out and the defined value is ignored.

 You notice that there is no discontinuity any more. In case tangent or curvature discontinuities remain, an error message is issued. When a curve is curvature continuous and you try to smooth it, a warning message informs you that there is no discontinuity to smooth. Nevertheless, you can still improve the curve smoothing by clicking on Preview or OK in the Curve Smooth Definition dialog box. The following options are grayed out when smoothing a curve that is curvature continuous: both Tangency and Curvature Thresholds, all the Continuity options and the Freeze tab.

Optionally, you can select a surface on which the curve lies.
In this case the smoothing is performed so that the curve remains on the Support surface. This ensues that the maximum degree of smoothing is limited by the support surface's level of discontinuity.

### Selecting Elements not to be smoothed

8. Click the Freeze tab.

 This tab enables you to select sub-elements of the curve that should not be smoothed. These sub-elements can either be vertices or edges. In case of a vertex, the local neighborhood remains unchanged, thus keeping the discontinuity. The Remove button enables to remove a single or a set of sub-elements.
 External elements cannot be selected as sub-elements.

### Setting continuity conditions

You now set continuity conditions on the resulting smoothed curve for each extremity with regards to the input curve. As a comparison basis, the continuity condition was previously always curvature: the output curve had the same extremity points, tangencies and curvatures as the input curve.
9. Click the Extremities tab and define the continuity conditions at each curve's extremity:

• Curvature (by default): extremity point, tangency and curvature are the same

• Tangency: extremity point and tangency are the same (curvature can be different)

• Point: extremity points are the same (tangency and curvature can be different)

You can also right-click the icon at the curve's extremity and choose one of the following options. You can sequentially move from one condition to the next one by clicking on the icons.
Point and Tangency conditions can only be successfully applied if the Maximum Deviation is larger than 0.005mm. Note that these extremity conditions do not affect closed curves.

### Visualizing messages

10. Click the Visualization tab.

This tab lets you define the way the messages are displayed on the smoothed element. You can choose to see:
• All: those indicating where the discontinuity remains (red box) as well as those indicating where the discontinuity type has changed, or allows smoothing.
• Not corrected: Only those messages indicating where the discontinuity is not corrected and remains
• None: None of the messages.
You can also choose to:
• Display information interactively: only the pointers in the geometry are displayed, above which the text appears when passing the pointer.
• Display information sequentially: only one pointer and text are displayed in the geometry, and you can sequentially move from one pointer to the other using Previous/Next.

### Simplifying the topology

The Topology simplification option automatically deletes vertices on the curves when the curve is curvature continuous at these vertices, thus reducing its number of segments.
When it is the case, the displayed text indicates: Out: vertex erased to inform you that a simplification operation took place.
This text is also displayed when two vertices are very close to each other and the system erases one to avoid the creation of very small edges (i.e. shorter than 10 times the model tolerance) between two close vertices.
 This option is selected by default. It is grayed out when there is only one edge (that is when there is no vertex) on the curve. Note that it does not delete the closure vertex of the curve. In case of closed curves, the closure vertex may be modified. The chosen vertex corresponds to the least continuous vertex if a smoothing would be performed without topology simplification.
11. Click OK.

 The smoothed curve (identified as Curve smooth.xxx) is added to the specification tree. When smoothing a curve on support that lies totally or partially on the boundary edge of a surface or on an internal edge, a message may be issued indicating that the application found no smoothing solution on the support. In this case, you must enter a Maximum deviation value smaller than or equal to the tolerance at which two elements are considered as being only one (0.001mm by default) to keep the result on the support.