1 // Copyright (c) 2015-... OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _CSLib_Offset_Headerfile
15 #define _CSLib_Offset_Headerfile
19 #include <gp_Pnt2d.hxx>
21 #include <gp_Vec2d.hxx>
22 #include <Standard.hxx>
24 /** \namespace CSLib_Offset
25 * \brief Provides a number of static methods to calculate values and derivatives
26 * of an offset curves and surfaces using values and derivatives of
27 * a base curve/surface.
29 namespace CSLib_Offset
31 /** \brief Calculate value of offset curve in 2D
32 * \param[in] theBasePoint point on a base curve
33 * \param[in] theBaseDeriv derivative on a base curve
34 * \param[in] theOffset size of offset
35 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
36 * \param[out] theResPoint point on offset curve
38 Standard_EXPORT void D0(const gp_Pnt2d& theBasePoint,
39 const gp_Vec2d& theBaseDeriv,
40 Standard_Real theOffset,
41 Standard_Boolean theIsDirectionChange,
42 gp_Pnt2d& theResPoint);
43 /** \brief Calculate value of offset curve in 3D
44 * \param[in] theBasePoint point on a base curve
45 * \param[in] theBaseDeriv derivative on a base curve
46 * \param[in] theOffsetDirection direction of the offset
47 * \param[in] theOffsetValue length of the offset
48 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
49 * \param[out] theResPoint point on offset curve
51 Standard_EXPORT void D0(const gp_Pnt& theBasePoint,
52 const gp_Vec& theBaseDeriv,
53 const gp_Dir& theOffsetDirection,
54 Standard_Real theOffsetValue,
55 Standard_Boolean theIsDirectionChange,
59 /** \brief Calculate value and the first derivative of offset curve in 2D
60 * \param[in] theBasePoint point on a base curve
61 * \param[in] theBaseD1 first derivative on a base curve
62 * \param[in] theBaseD2 second derivative on a base curve
63 * \param[in] theOffset size of offset
64 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
65 * \param[out] theResPoint point on offset curve
66 * \param[out] theResDeriv derivative on offset curve
68 Standard_EXPORT void D1(const gp_Pnt2d& theBasePoint,
69 const gp_Vec2d& theBaseD1,
70 const gp_Vec2d& theBaseD2,
71 Standard_Real theOffset,
72 Standard_Boolean theIsDirectionChange,
73 gp_Pnt2d& theResPoint,
74 gp_Vec2d& theResDeriv);
75 /** \brief Calculate value and the first derivative of offset curve in 3D
76 * \param[in] theBasePoint point on a base curve
77 * \param[in] theBaseD1 first derivative on a base curve
78 * \param[in] theBaseD2 second derivative on a base curve
79 * \param[in] theOffsetDirection direction of the offset
80 * \param[in] theOffsetValue length of the offset
81 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative (not used)
82 * \param[out] theResPoint point on offset curve
83 * \param[out] theResDeriv derivative on offset curve
85 Standard_EXPORT void D1(const gp_Pnt& theBasePoint,
86 const gp_Vec& theBaseD1,
87 const gp_Vec& theBaseD2,
88 const gp_Dir& theOffsetDirection,
89 Standard_Real theOffsetValue,
90 Standard_Boolean theIsDirectionChange,
95 /** \brief Calculate value and two derivatives of offset curve in 2D
96 * \param[in] theBasePoint point on a base curve
97 * \param[in] theBaseD1 first derivative on a base curve
98 * \param[in] theBaseD2 second derivative on a base curve
99 * \param[in] theBaseD3 third derivative on a base curve
100 * \param[in] theOffset size of offset
101 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
102 * \param[out] theResPoint point on offset curve
103 * \param[out] theResD1 first derivative on offset curve
104 * \param[out] theResD2 second derivative on offset curve
106 Standard_EXPORT void D2(const gp_Pnt2d& theBasePoint,
107 const gp_Vec2d& theBaseD1,
108 const gp_Vec2d& theBaseD2,
109 const gp_Vec2d& theBaseD3,
110 Standard_Real theOffset,
111 Standard_Boolean theIsDirectionChange,
112 gp_Pnt2d& theResPoint,
115 /** \brief Calculate value and two derivatives of offset curve in 3D
116 * \param[in] theBasePoint point on a base curve
117 * \param[in] theBaseD1 first derivative on a base curve
118 * \param[in] theBaseD2 second derivative on a base curve
119 * \param[in] theBaseD3 third derivative on a base curve
120 * \param[in] theOffsetDirection direction of the offset
121 * \param[in] theOffsetValue length of the offset
122 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
123 * \param[out] theResPoint point on offset curve
124 * \param[out] theResD1 first derivative on offset curve
125 * \param[out] theResD2 second derivative on offset curve
127 Standard_EXPORT void D2(const gp_Pnt& theBasePoint,
128 const gp_Vec& theBaseD1,
129 const gp_Vec& theBaseD2,
130 const gp_Vec& theBaseD3,
131 const gp_Dir& theOffsetDirection,
132 Standard_Real theOffsetValue,
133 Standard_Boolean theIsDirectionChange,
138 /** \brief Calculate value and three derivatives of offset curve in 2D
139 * \param[in] theBasePoint point on a base curve
140 * \param[in] theBaseD1 first derivative on a base curve
141 * \param[in] theBaseD2 second derivative on a base curve
142 * \param[in] theBaseD3 third derivative on a base curve
143 * \param[in] theBaseD4 fourth derivative on a base curve
144 * \param[in] theOffset size of offset
145 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
146 * \param[out] theResPoint point on offset curve
147 * \param[out] theResD1 first derivative on offset curve
148 * \param[out] theResD2 second derivative on offset curve
149 * \param[out] theResD3 third derivative on offset curve
151 Standard_EXPORT void D3(const gp_Pnt2d& theBasePoint,
152 const gp_Vec2d& theBaseD1,
153 const gp_Vec2d& theBaseD2,
154 const gp_Vec2d& theBaseD3,
155 const gp_Vec2d& theBaseD4,
156 Standard_Real theOffset,
157 Standard_Boolean theIsDirectionChange,
158 gp_Pnt2d& theResPoint,
162 /** \brief Calculate value and three derivatives of offset curve in 3D
163 * \param[in] theBasePoint point on a base curve
164 * \param[in] theBaseD1 first derivative on a base curve
165 * \param[in] theBaseD2 second derivative on a base curve
166 * \param[in] theBaseD3 third derivative on a base curve
167 * \param[in] theBaseD4 fourth derivative on a base curve
168 * \param[in] theOffsetDirection direction of the offset
169 * \param[in] theOffsetValue length of the offset
170 * \param[in] theIsDirectionChange shows that it is necessary to consider the direction of derivative
171 * \param[out] theResPoint point on offset curve
172 * \param[out] theResD1 first derivative on offset curve
173 * \param[out] theResD2 second derivative on offset curve
174 * \param[out] theResD3 third derivative on offset curve
176 Standard_EXPORT void D3(const gp_Pnt& theBasePoint,
177 const gp_Vec& theBaseD1,
178 const gp_Vec& theBaseD2,
179 const gp_Vec& theBaseD3,
180 const gp_Vec& theBaseD4,
181 const gp_Dir& theOffsetDirection,
182 Standard_Real theOffsetValue,
183 Standard_Boolean theIsDirectionChange,
190 #endif // _CSLib_Offset_Headerfile