Sat, 11/10/2012 - 01:00

In BrepOffsetAPI_ThruSections, there are some mysterious methods to change its behaviour.

Does anyone know their meaning and use?

void SetSmoothing (const Standard_Boolean UseSmoothing)

"Define the approximation algorithm"

The following method has effect just if UseSmoothing is true:

void SetParType (const Approx_ParametrizationType ParType)

"Define the type of parametrization used in the approximation",

where an Approx_ParametrizationType can have one of these values:

Approx_ChordLength

Approx_Centripetal

Approx_IsoParametric

The following method has effect just if UseSmoothing is false:

void SetCriteriumWeight(const Standard_Real W1, const Standard_Real W2, const Standard_Real W3)

"define the Weights associed to the criterium used in the optimization"

void CheckCompatibility (const Standard_Boolean check=Standard_True)

I guess that the aim of this is to orient the wires in a consistent way.

The default values are:

smoothing: false;

criterium weights: 0.4, 0.2, 0.4;

parametrization type: ChordLength

check compatibility: true

Thanks again.

Mauro

Wed, 05/14/2014 - 16:59

Dear Mauro,

what you wrote regarding which method has effect if UseSmoothing is true/false is not correct.

See the following code from BRepOffsetAPI_ThruSections::TotalSurf

if(myUseSmoothing) {

anApprox.SetCriteriumWeight(myCritWeights[0], myCritWeights[1], myCritWeights[2]);

anApprox.PerformSmoothing(line, section);

}

else {

anApprox.SetParType(myParamType);

anApprox.Perform(line, section, SpApprox);

}

So, only if UseSmoothing is true, SetCriteriumWeight has effect.

Only if UseSmoothing is false, SetParType has effect.

I also think that the documentation should be improved here regarding the Smoothing.

In OCC 6.3.1 Release Notes I found the following:

Advanced approximation method (implemented in class AppDef_TheVariational) has been

included in algorithms for creation of curves and surfaces:

GeomAPI_PointsToBSpline,

GeomAPI_PointsToBSplineSurface,

Geom2dAPI_PointsToBSpline,

GeomFill_AppSurf,

BRepOffsetAPI_ThruSection

Here is an explanation about the meaning of the weight parameters for smoothing:

http://www.opencascade.org/org/forum/thread_345/?forum=3

When I tried smoothing with more complex surfaces, I often got exceptions. Does anyone have experience with smoothing / using AppDef_TheVariational? What are the requirements in order to use it successfully?

Kind regards,

Timo