Back to home page

EIC code displayed by LXR

 
 

    


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

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 _HelixGeom_HelixCurve_HeaderFile
0015 #define _HelixGeom_HelixCurve_HeaderFile
0016 
0017 #include <Adaptor3d_Curve.hxx>
0018 #include <Geom_Curve.hxx>
0019 #include <GeomAbs_Shape.hxx>
0020 
0021 class gp_Pnt;
0022 class gp_Vec;
0023 
0024 //! Adaptor class for calculation of helix curves with analytical expressions.
0025 //!
0026 //! This class provides parametric representation of helix curves including:
0027 //! - Cylindrical helixes (constant radius)
0028 //! - Tapered helixes (variable radius with taper angle)
0029 //! - Both clockwise and counter-clockwise orientations
0030 //!
0031 //! The helix is defined by parametric equations in cylindrical coordinates:
0032 //! - x(t) = r(t) * cos(t)
0033 //! - y(t) = r(t) * sin(t) [* direction factor]
0034 //! - z(t) = pitch * t / (2*PI)
0035 //! where r(t) = rStart + taper_factor * t
0036 //!
0037 //! @sa HelixGeom_BuilderHelix, HelixGeom_BuilderHelixCoil
0038 class HelixGeom_HelixCurve : public Adaptor3d_Curve
0039 {
0040   DEFINE_STANDARD_RTTIEXT(HelixGeom_HelixCurve, Adaptor3d_Curve)
0041 public:
0042   //! implementation of analytical expressions
0043   Standard_EXPORT HelixGeom_HelixCurve();
0044 
0045   //! Sets default values for parameters
0046   Standard_EXPORT void Load();
0047 
0048   //! Sets helix parameters
0049   Standard_EXPORT void Load(const double aT1,
0050                             const double aT2,
0051                             const double aPitch,
0052                             const double aRStart,
0053                             const double aTaperAngle,
0054                             const bool   aIsCW);
0055 
0056   //! Gets first parameter
0057   Standard_EXPORT double FirstParameter() const override;
0058 
0059   //! Gets last parameter
0060   Standard_EXPORT double LastParameter() const override;
0061 
0062   //! Gets continuity
0063   Standard_EXPORT GeomAbs_Shape Continuity() const override;
0064 
0065   //! Gets number of intervals
0066   Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;
0067 
0068   //! Gets parametric intervals
0069   Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0070                                  const GeomAbs_Shape         S) const override;
0071 
0072   //! Gets parametric resolution
0073   Standard_EXPORT double Resolution(const double R3d) const override;
0074 
0075   //! Returns False
0076   Standard_EXPORT bool IsClosed() const override;
0077 
0078   //! Returns False
0079   Standard_EXPORT bool IsPeriodic() const override;
0080 
0081   //! Returns 2*PI
0082   Standard_EXPORT double Period() const override;
0083 
0084   //! Computes the point of parameter theU on the curve.
0085   [[nodiscard]] Standard_EXPORT gp_Pnt EvalD0(const double theU) const final;
0086 
0087   //! Computes the point and first derivative at parameter theU.
0088   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD1 EvalD1(const double theU) const final;
0089 
0090   //! Computes the point and first two derivatives at parameter theU.
0091   [[nodiscard]] Standard_EXPORT Geom_Curve::ResD2 EvalD2(const double theU) const final;
0092 
0093   //! Returns the derivative of order theN at parameter theU.
0094   [[nodiscard]] Standard_EXPORT gp_Vec EvalDN(const double theU, const int theN) const final;
0095 
0096 protected:
0097   double myFirst;
0098   double myLast;
0099   double myPitch;
0100   double myRStart;
0101   double myTaperAngle;
0102   bool   myIsClockWise;
0103   double myC1;
0104   double myTgBeta;
0105   double myTolAngle;
0106 };
0107 
0108 #endif // _HelixGeom_HelixCurve_HeaderFile