mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-11 10:10:56 +08:00
1. B-spline cache was moved into separated classes: BSplCLib_Cache for 2D and 3D curves and BSplSLib_Cache for surfaces. 2. The cache is used now in corresponding adaptor classes (Geom2dAdaptor_Curve, GeomAdaptor_Curve and GeomAdaptor_Surface) when the curve or surface is a B-spline. 3. Algorithms were changed to use adaptors for B-spline calculations instead of curves or surfaces. 4. Precised calculation of derivatives of surface of revolution is implemented for the points of surface placed on the axis of revolution (Geom_SurfaceOfRevolution.cxx) 5. Small modifications are made to adjust algorithms to new behavior of B-spline calculation. 6. Test cases were modified according to the modern behavior. 7. Changes in BOPAlgo_WireSplitter, BOPTools_AlgoTools, BRepLib_CheckCurveOnSurface and ShapeAnalysis_Wire to use adaptors instead of geometric entities 8. Allow Geom2dAdaptor and GeomAdaptor in case of offset curve to use corresponding adaptor for basis curve Modification of test-cases according to the new behavior.
191 lines
10 KiB
C++
191 lines
10 KiB
C++
// Copyright (c) 2015-... OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#ifndef _CSLib_Offset_Headerfile
|
|
#define _CSLib_Offset_Headerfile
|
|
|
|
#include <gp_Dir.hxx>
|
|
#include <gp_Pnt.hxx>
|
|
#include <gp_Pnt2d.hxx>
|
|
#include <gp_Vec.hxx>
|
|
#include <gp_Vec2d.hxx>
|
|
#include <Standard.hxx>
|
|
|
|
/** \namespace CSLib_Offset
|
|
* \brief Provides a number of static methods to calculate values and derivatives
|
|
* of an offset curves and surfaces using values and derivatives of
|
|
* a base curve/surface.
|
|
*/
|
|
namespace CSLib_Offset
|
|
{
|
|
/** \brief Calculate value of offset curve in 2D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseDeriv derivative on a base curve
|
|
* \param[in] theOffset size of offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
|
|
* \param[out] theResPoint point on offset curve
|
|
*/
|
|
Standard_EXPORT void D0(const gp_Pnt2d& theBasePoint,
|
|
const gp_Vec2d& theBaseDeriv,
|
|
Standard_Real theOffset,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt2d& theResPoint);
|
|
/** \brief Calculate value of offset curve in 3D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseDeriv derivative on a base curve
|
|
* \param[in] theOffsetDirection direction of the offset
|
|
* \param[in] theOffsetValue length of the offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
|
|
* \param[out] theResPoint point on offset curve
|
|
*/
|
|
Standard_EXPORT void D0(const gp_Pnt& theBasePoint,
|
|
const gp_Vec& theBaseDeriv,
|
|
const gp_Dir& theOffsetDirection,
|
|
Standard_Real theOffsetValue,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt& theResPoint);
|
|
|
|
|
|
/** \brief Calculate value and the first derivative of offset curve in 2D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseD1 first derivative on a base curve
|
|
* \param[in] theBaseD2 second derivative on a base curve
|
|
* \param[in] theOffset size of offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
|
|
* \param[out] theResPoint point on offset curve
|
|
* \param[out] theResDeriv derivative on offset curve
|
|
*/
|
|
Standard_EXPORT void D1(const gp_Pnt2d& theBasePoint,
|
|
const gp_Vec2d& theBaseD1,
|
|
const gp_Vec2d& theBaseD2,
|
|
Standard_Real theOffset,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt2d& theResPoint,
|
|
gp_Vec2d& theResDeriv);
|
|
/** \brief Calculate value and the first derivative of offset curve in 3D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseD1 first derivative on a base curve
|
|
* \param[in] theBaseD2 second derivative on a base curve
|
|
* \param[in] theOffsetDirection direction of the offset
|
|
* \param[in] theOffsetValue length of the offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
|
|
* \param[out] theResPoint point on offset curve
|
|
* \param[out] theResDeriv derivative on offset curve
|
|
*/
|
|
Standard_EXPORT void D1(const gp_Pnt& theBasePoint,
|
|
const gp_Vec& theBaseD1,
|
|
const gp_Vec& theBaseD2,
|
|
const gp_Dir& theOffsetDirection,
|
|
Standard_Real theOffsetValue,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt& theResPoint,
|
|
gp_Vec& theResDeriv);
|
|
|
|
|
|
/** \brief Calculate value and two derivatives of offset curve in 2D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseD1 first derivative on a base curve
|
|
* \param[in] theBaseD2 second derivative on a base curve
|
|
* \param[in] theBaseD3 third derivative on a base curve
|
|
* \param[in] theOffset size of offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
|
|
* \param[out] theResPoint point on offset curve
|
|
* \param[out] theResD1 first derivative on offset curve
|
|
* \param[out] theResD2 second derivative on offset curve
|
|
*/
|
|
Standard_EXPORT void D2(const gp_Pnt2d& theBasePoint,
|
|
const gp_Vec2d& theBaseD1,
|
|
const gp_Vec2d& theBaseD2,
|
|
const gp_Vec2d& theBaseD3,
|
|
Standard_Real theOffset,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt2d& theResPoint,
|
|
gp_Vec2d& theResD1,
|
|
gp_Vec2d& theResD2);
|
|
/** \brief Calculate value and two derivatives of offset curve in 3D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseD1 first derivative on a base curve
|
|
* \param[in] theBaseD2 second derivative on a base curve
|
|
* \param[in] theBaseD3 third derivative on a base curve
|
|
* \param[in] theOffsetDirection direction of the offset
|
|
* \param[in] theOffsetValue length of the offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
|
|
* \param[out] theResPoint point on offset curve
|
|
* \param[out] theResD1 first derivative on offset curve
|
|
* \param[out] theResD2 second derivative on offset curve
|
|
*/
|
|
Standard_EXPORT void D2(const gp_Pnt& theBasePoint,
|
|
const gp_Vec& theBaseD1,
|
|
const gp_Vec& theBaseD2,
|
|
const gp_Vec& theBaseD3,
|
|
const gp_Dir& theOffsetDirection,
|
|
Standard_Real theOffsetValue,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt& theResPoint,
|
|
gp_Vec& theResD1,
|
|
gp_Vec& theResD2);
|
|
|
|
/** \brief Calculate value and three derivatives of offset curve in 2D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseD1 first derivative on a base curve
|
|
* \param[in] theBaseD2 second derivative on a base curve
|
|
* \param[in] theBaseD3 third derivative on a base curve
|
|
* \param[in] theBaseD4 fourth derivative on a base curve
|
|
* \param[in] theOffset size of offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
|
|
* \param[out] theResPoint point on offset curve
|
|
* \param[out] theResD1 first derivative on offset curve
|
|
* \param[out] theResD2 second derivative on offset curve
|
|
* \param[out] theResD3 third derivative on offset curve
|
|
*/
|
|
Standard_EXPORT void D3(const gp_Pnt2d& theBasePoint,
|
|
const gp_Vec2d& theBaseD1,
|
|
const gp_Vec2d& theBaseD2,
|
|
const gp_Vec2d& theBaseD3,
|
|
const gp_Vec2d& theBaseD4,
|
|
Standard_Real theOffset,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt2d& theResPoint,
|
|
gp_Vec2d& theResD1,
|
|
gp_Vec2d& theResD2,
|
|
gp_Vec2d& theResD3);
|
|
/** \brief Calculate value and three derivatives of offset curve in 3D
|
|
* \param[in] theBasePoint point on a base curve
|
|
* \param[in] theBaseD1 first derivative on a base curve
|
|
* \param[in] theBaseD2 second derivative on a base curve
|
|
* \param[in] theBaseD3 third derivative on a base curve
|
|
* \param[in] theBaseD4 fourth derivative on a base curve
|
|
* \param[in] theOffsetDirection direction of the offset
|
|
* \param[in] theOffsetValue length of the offset
|
|
* \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
|
|
* \param[out] theResPoint point on offset curve
|
|
* \param[out] theResD1 first derivative on offset curve
|
|
* \param[out] theResD2 second derivative on offset curve
|
|
* \param[out] theResD3 third derivative on offset curve
|
|
*/
|
|
Standard_EXPORT void D3(const gp_Pnt& theBasePoint,
|
|
const gp_Vec& theBaseD1,
|
|
const gp_Vec& theBaseD2,
|
|
const gp_Vec& theBaseD3,
|
|
const gp_Vec& theBaseD4,
|
|
const gp_Dir& theOffsetDirection,
|
|
Standard_Real theOffsetValue,
|
|
Standard_Boolean theIsDirectionChange,
|
|
gp_Pnt& theResPoint,
|
|
gp_Vec& theResD1,
|
|
gp_Vec& theResD2,
|
|
gp_Vec& theResD3);
|
|
}
|
|
|
|
#endif // _CSLib_Offset_Headerfile
|