Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:20:02

0001 // Copyright (c) 2025 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Geom2dEval_CircleInvoluteCurve_HeaderFile
0015 #define _Geom2dEval_CircleInvoluteCurve_HeaderFile
0016 
0017 #include <Geom2d_Curve.hxx>
0018 #include <gp_Ax2d.hxx>
0019 
0020 class gp_Trsf2d;
0021 class Geom2d_Geometry;
0022 
0023 //! Describes a 2D involute of a circle.
0024 //! Critical for gear tooth profiles.
0025 //!
0026 //! The parametric equation is:
0027 //! @code
0028 //!   C(t) = O + R*(cos(t) + t*sin(t))*XDir + R*(sin(t) - t*cos(t))*YDir
0029 //! @endcode
0030 //! where:
0031 //! - O, XDir are from the local coordinate system,
0032 //! - YDir is the perpendicular to XDir,
0033 //! - R is the base circle radius (> 0).
0034 //!
0035 //! The parameter range is [0, +inf).
0036 //! At t=0, the curve starts on the base circle. D1(0) = (0,0) (cusp).
0037 //! |D1(t)| = R*t (speed linear in parameter).
0038 class Geom2dEval_CircleInvoluteCurve : public Geom2d_Curve
0039 {
0040 public:
0041   //! Creates an involute of a circle.
0042   //! @param[in] thePosition the local coordinate system
0043   //! @param[in] theRadius the base circle radius (must be > 0)
0044   //! @throw Standard_ConstructionError if theRadius <= 0
0045   Standard_EXPORT Geom2dEval_CircleInvoluteCurve(const gp_Ax2d& thePosition, double theRadius);
0046 
0047   //! Returns the local coordinate system.
0048   Standard_EXPORT const gp_Ax2d& Position() const;
0049 
0050   //! Returns the base circle radius.
0051   Standard_EXPORT double Radius() const;
0052 
0053   //! Reversal is not supported for this eval curve.
0054   //! @throw Standard_NotImplemented
0055   Standard_EXPORT void Reverse() final;
0056 
0057   //! Reversal is not supported for this eval curve.
0058   //! @throw Standard_NotImplemented
0059   Standard_EXPORT double ReversedParameter(const double U) const final;
0060 
0061   //! Returns 0.
0062   Standard_EXPORT double FirstParameter() const final;
0063 
0064   //! Returns Precision::Infinite().
0065   Standard_EXPORT double LastParameter() const final;
0066 
0067   //! Returns false.
0068   Standard_EXPORT bool IsClosed() const final;
0069 
0070   //! Returns false.
0071   Standard_EXPORT bool IsPeriodic() const final;
0072 
0073   //! Returns GeomAbs_CN.
0074   Standard_EXPORT GeomAbs_Shape Continuity() const final;
0075 
0076   //! Returns true for any N >= 0.
0077   Standard_EXPORT bool IsCN(const int N) const final;
0078 
0079   //! Computes the point at parameter U.
0080   Standard_EXPORT gp_Pnt2d EvalD0(const double U) const final;
0081 
0082   //! Computes the point and first derivative at parameter U.
0083   Standard_EXPORT Geom2d_Curve::ResD1 EvalD1(const double U) const final;
0084 
0085   //! Computes the point and first two derivatives at parameter U.
0086   Standard_EXPORT Geom2d_Curve::ResD2 EvalD2(const double U) const final;
0087 
0088   //! Computes the point and first three derivatives at parameter U.
0089   Standard_EXPORT Geom2d_Curve::ResD3 EvalD3(const double U) const final;
0090 
0091   //! Computes the N-th derivative at parameter U.
0092   //! @throw Standard_RangeError if N < 1
0093   Standard_EXPORT gp_Vec2d EvalDN(const double U, const int N) const final;
0094 
0095   //! Transformation is not supported for this eval geometry.
0096   //! @throw Standard_NotImplemented
0097   Standard_EXPORT void Transform(const gp_Trsf2d& T) final;
0098 
0099   //! Creates a new object which is a copy of this curve.
0100   Standard_EXPORT occ::handle<Geom2d_Geometry> Copy() const final;
0101 
0102   //! Dumps the content of me into the stream.
0103   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const final;
0104 
0105   DEFINE_STANDARD_RTTIEXT(Geom2dEval_CircleInvoluteCurve, Geom2d_Curve)
0106 
0107 private:
0108   gp_Ax2d myPosition; //!< Local coordinate system
0109   double  myRadius;   //!< Base circle radius (> 0)
0110 };
0111 
0112 #endif // _Geom2dEval_CircleInvoluteCurve_HeaderFile