- C3d aggiornamento delle librerie ( 117975).
This commit is contained in:
SaraP
2024-02-12 12:45:55 +01:00
parent abb1b7aa83
commit 60f0922072
37 changed files with 478 additions and 193 deletions
+2
View File
@@ -671,6 +671,8 @@ public:
/// \ru Установить режим работы. \en Set operation mode.
void SetOperationMode( OperationMode mode ) { calcMode = mode; }
private:
/// \ru Инциализация по кривой пересечения и граням. \en Initialize by intersection curve and faces.
bool Init( const MbSurfaceIntersectionCurve & initCurve, const MbFace * face1, const MbFace * face2 );
/// \ru Инциализация по ребру. \en Initialize by edge.
bool Init( const MbCurveEdge & );
/// \ru Инциализация по двум ребрам. \en Initialize by edges pair.
+35 -35
View File
@@ -22,12 +22,12 @@
#include <templ_sptr.h>
#include <mb_cart_point3d.h>
#include <space_item.h>
#include <curve3d.h>
#include <mb_operation_result.h>
#include <vector>
class MATH_CLASS MbCurve;
class MATH_CLASS MbCurve3D;
class MATH_CLASS MbContour3D;
class MATH_CLASS MbWireFrame;
class MATH_CLASS MbFace;
@@ -218,11 +218,11 @@ MATH_FUNC (MbResultType) NurbsCurve( const SArray<MbCartPoint3D> & pointList,
*/
// ---
MATH_FUNC (double) NurbsFitting( const std::vector<MbCartPoint3D> & pointList,
bool curveClosed,
size_t degree,
size_t mode,
double & accuracy,
MbCurve3D *& result );
bool curveClosed,
size_t degree,
size_t mode,
double & accuracy,
MbCurve3D *& result );
//------------------------------------------------------------------------------
@@ -239,7 +239,7 @@ MATH_FUNC (double) NurbsFitting( const std::vector<MbCartPoint3D> & pointList,
\ingroup Curve3D_Modeling
*/
//---
MATH_FUNC (MbResultType) NurbsCopy( const MbCurve3D & curve,
MATH_FUNC (MbResultType) NurbsCopy( const MbCurve3D & curve,
MbCurve3D *& result );
@@ -439,7 +439,7 @@ MATH_FUNC (MbCurve3D *) DuplicateCurve( const MbCurve3D & curve,
//---
MATH_FUNC (MbResultType) AddCurveToContour( MbCurve3D & curve,
MbCurve3D & contour,
bool toEnd );
bool toEnd );
//------------------------------------------------------------------------------
@@ -461,8 +461,8 @@ MATH_FUNC (MbResultType) AddCurveToContour( MbCurve3D & curve,
*/
// ---
MATH_FUNC (MbResultType) PlaneCurve( const MbPlacement3D & place,
const MbCurve & curve,
MbCurve3D *& result );
const MbCurve & curve,
MbCurve3D *& result );
//------------------------------------------------------------------------------
/** \brief \ru Построить кривую на поверхности по двумерной кривой.
@@ -482,8 +482,8 @@ MATH_FUNC (MbResultType) PlaneCurve( const MbPlacement3D & place,
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC (MbResultType) SurfaceCurve( const MbSurface & surface,
const MbCurve & curve,
MATH_FUNC (MbResultType) SurfaceCurve( const MbSurface & surface,
const MbCurve & curve,
MbCurve3D *& result );
@@ -622,10 +622,10 @@ MATH_FUNC (MbResultType) CreateContours( RPArray<MbCurve3D> & curves,
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC (MbResultType) WireFrame( const MbCurve3D & curve,
const MbName & curveName,
SimpleName mainName,
MbWireFrame *& result );
MATH_FUNC (MbResultType) WireFrame( const MbCurve3D & curve,
const MbName & curveName,
SimpleName mainName,
MbWireFrame *& result );
//------------------------------------------------------------------------------
@@ -647,9 +647,9 @@ MATH_FUNC (MbResultType) WireFrame( const MbCurve3D & curve,
*/
// ---
MATH_FUNC (MbResultType) WireFrame( const RPArray<MbCurve3D> & curves,
const RPArray<MbName> & curveNames,
SimpleName mainName,
MbWireFrame *& result );
const RPArray<MbName> & curveNames,
SimpleName mainName,
MbWireFrame *& result );
//------------------------------------------------------------------------------
@@ -674,11 +674,11 @@ MATH_FUNC (MbResultType) WireFrame( const RPArray<MbCurve3D> & curves,
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC (MbResultType) CreatePolyArcCurve3D( const MbCurve3D & curve,
MbCurve3D *& result,
double & eps,
double minRad = Math::minRadius,
double maxRad = Math::maxRadius );
MATH_FUNC (MbResultType) CreatePolyArcCurve3D( const MbCurve3D & curve,
MbCurve3D *& result,
double & eps,
double minRad = Math::minRadius,
double maxRad = Math::maxRadius );
//------------------------------------------------------------------------------
@@ -705,10 +705,10 @@ MATH_FUNC (MbResultType) CreatePolyArcCurve3D( const MbCurve3D & curve,
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC (bool) GetSpaceCurve( const MbItem & item,
MATH_FUNC (bool) GetSpaceCurve( MbItem & item,
bool keepPlacement,
SPtr<MbCurve3D> & curve0,
std::vector< SPtr<MbCurve3D> > * curves = nullptr );
c3d::SpaceCurveSPtr & curve0,
c3d::SpaceCurvesSPtrVector * curves = nullptr );
//-------------------------------------------------------------------------------
@@ -736,10 +736,10 @@ MATH_FUNC (bool) GetSpaceCurve( const MbItem & item,
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC (MbCurve3D *) UnwrapCurve( const MbCurve3D & curve,
MATH_FUNC (MbCurve3D *) UnwrapCurve( const MbCurve3D & curve,
const MbPlacement3D & placement,
const MbCartPoint3D & point,
double deviationAngle = DEVIATION_SAG);
double deviationAngle = DEVIATION_SAG);
//------------------------------------------------------------------------------
@@ -768,13 +768,13 @@ MATH_FUNC (MbCurve3D *) UnwrapCurve( const MbCurve3D & curve,
\ingroup Curve3D_Modeling
*/
// ---
MATH_FUNC (MbResultType) EvolutionSection( const MbSweptData & generCurves,
const MbCurve3D & guideCurve,
double guideParam,
MATH_FUNC (MbResultType) EvolutionSection( const MbSweptData & generCurves,
const MbCurve3D & guideCurve,
double guideParam,
const EvolutionValues & params,
MbSweptData & result,
VERSION version = Math::DefaultMathVersion(),
double angleEpsilon = ANGLE_EPSILON );
MbSweptData & result,
VERSION version = Math::DefaultMathVersion(),
double angleEpsilon = ANGLE_EPSILON );
//------------------------------------------------------------------------------
+4 -4
View File
@@ -679,7 +679,7 @@ MATH_FUNC( bool ) CheckMeshClosure( const MbMesh & mesh, MeshInfo & info );
//------------------------------------------------------------------------------
/** \brief \ru Определить замкнутость объекта и выдать подробную информацию о границах.
\en Check the object closeness and provide detailed information about boundaries. \~
\detail \ru Определить замкнутость объекта и выдать подробную информацию о границах. Расширенная версия #CheckMeshClosure.
\details \ru Определить замкнутость объекта и выдать подробную информацию о границах. Расширенная версия #CheckMeshClosure.
\en Check the object closeness and provide detailed information about boundaries. An extended version of #CheckMeshClosure. \~
\param[in] mesh - \ru Полигональный объект.
\en The polygonal object. \~
@@ -697,7 +697,7 @@ MATH_FUNC( bool ) InspectMeshClosure( const MbMesh & mesh, MeshInfo & info );
//------------------------------------------------------------------------------
/** \brief \ru Упростить триангуляцию.
\en Simplify triangulation. \~
\detail \ru Упростить триангуляцию.
\details \ru Упростить триангуляцию.
\en Simplify triangulation. \~
\param[in] mesh - \ru Полигональный объект.
\en The polygonal object. \~
@@ -713,7 +713,7 @@ MATH_FUNC( MbResultType ) SimplifyTriangularMesh( const MbMesh & mesh, const MbM
//------------------------------------------------------------------------------
/** \brief \ru Упростить триангуляцию.
\en Simplify triangulation. \~
\detail \ru Упростить триангуляцию. Делает упрощение до первого уровня, указанного в параметрах.
\details \ru Упростить триангуляцию. Делает упрощение до первого уровня, указанного в параметрах.
\en Simplify triangulation up to the first level from parameters. \~
\param[in] params - \ru Параметры симплификации.
\en Simplifiation parameters. \~
@@ -749,7 +749,7 @@ MATH_FUNC( MbResultType ) UnwrapMesh( const MbMeshUnwrapParams & params, MbMeshU
//------------------------------------------------------------------------------
/** \brief \ru Совместить объекты.
\en Align objects. \~
\detail \ru Совместить два объекта: moving к fixed.
\details \ru Совместить два объекта: moving к fixed.
\en Align two objects: moving to fixed. \~
\param[in] fixed - \ru Объект, к которому выполняем совмещение.
\en Object to which another object is aligned. \~
+1 -1
View File
@@ -1004,7 +1004,7 @@ public:
public:
/// \ru Установить внешний индикатор прогресса выполнения. \en Set external progress indicator.
void SetProgressIndicator( IProgressIndicator * prog ) { progress = prog; }
/// \ru Установить внешний индикатор прогресса выполнения. \en Set external progress indicator.
/// \ru Взять внешний индикатор прогресса выполнения. \en Take external progress indicator.
IProgressIndicator * TakeProgressIndicator() const { return progress; }
OBVIOUS_PRIVATE_COPY( MbMinMaxGridDistancesParams )
+2 -1
View File
@@ -49,7 +49,8 @@ public:
conicSectionHP, ///< \ru Хот-точка операции построения переменного конического сечения. \en The conic section operation hot point.
DMFilletRadiusSetHP, ///< \ru Хот-точка операции прямого моделирования по установке радиусов граням скругления. \en The direct modeling operation's hot point by set fillet face's radius.
elementaryHP, ///< \ru Хот-точка операции построения элементарного тела. \en The elementary solid operation hot point.
DMReplaceFacesHP, ///< \ru Хот-точка операции модифицирования граней. \en Hot point of the face modification operation.
DMReplaceFacesHP, ///< \ru Хот-точка операции замены граней. \en Hot point of the face replacement operation.
DMOffsetFacesHP, ///< \ru Хот-точка операции замены граней на эквидистантные. \en Hot point of the operation of replacement faces with the offset ones.
// \ru Вставлять новые типы перед этим типом. \en Insert new types before this type.
endHP = SYS_MAX_INT16
};
+18
View File
@@ -176,6 +176,24 @@ public:
\en A type of returned attributes. \~
*/
void GetAttributes( c3d::AttrVector & attrs, MbeAttributeType aType ) const;
/** \brief \ru Выдать атрибуты.
\en Get attributes. \~
\details \ru Выдать атрибуты.
\en Get attributes. \~
\param[out] attrs - \ru Массив возвращаемых атрибутов.
\en An array of returned attributes.\~
*/
template <class AttrVector>
void GetAttributes( AttrVector & attrs ) const
{
AttrMap_t::Iterator curIter = attributes.LowerBound( at_Undefined );
while ( !curIter.Empty() ) {
MbAttribute * attr = curIter.Value();
if ( attr != nullptr )
attrs.push_back( attr );
curIter++;
}
}
/// \ru Выдать атрибуты по строке описания. \en Get attributes using sample of description string.
void GetCommonAttributes( c3d::AttrVector &, const c3d::string_t & samplePrompt, MbeAttributeType subType = at_Undefined, bool firstFound = false ) const;
/// \ru Выдать строковые атрибуты по строке содержания. \en Get string attributes using sample of contents of the string.
+35 -3
View File
@@ -13,10 +13,10 @@
#include <surf_spine.h>
#include <cr_swept_solid.h>
#include <cur_contour_on_surface.h>
class MATH_CLASS MbEvolutionShellParams;
class MATH_CLASS MbEvolutionShellParams;
struct MATH_CLASS MeshSurfaceValues;
//------------------------------------------------------------------------------
/** \brief \ru Направляющая кинематической операции.
@@ -90,6 +90,8 @@ protected :
SPtr<MbSNameMaker> spineNames; ///< \ru Именователь направляющей. \en An object defining the name of the spine curve.
EvolutionValues parameters; ///< \ru Параметры. \en Parameters.
std::vector<std::shared_ptr<MeshSurfaceValues>> meshSurfVals; ///< \ru Данные для операции с динамической параметризацией сечения. \en Data for sweeping operation with variable section.
public :
/** \brief \ru Конструктор.
\en Constructor. \~
@@ -202,6 +204,36 @@ public :
const RPArray<MbSNameMaker> & contoursNames,
const MbSNameMaker & spineNames_ );
/** \brief \ru Конструктор.
\en Constructor. \~
\details \ru Конструктор по данным для операции с динамической параметризацией сечения.
\en Constructor using data for sweeping operation with variable section. \~
\param[in] sweptData_ - \ru Образующая.
\en Generating curve. \~
\param[in] spine_ - \ru Направляющая кривая с дополнительной информацией.
\en The spine curve with additional information. \~
\param[in] params - \ru Параметры кинематической операции.
\en Parameters of the sweeping operation. \~
\param[in] meshSurfVals_ - \ru Данные для операции с динамической параметризацией сечения.
\en Data for sweeping operation with variable section. \~
\param[in] oType - \ru Тип булевой операции с предыдущим результатом.
\en Type of Boolean operation with the previous result. \~
\param[in] operNames - \ru Именователь операции.
\en An object defining names generation in the operation. \~
\param[in] contourNames - \ru Имена контуров образующей для именования граней.
\en Generatix contours' names for naming faces. \~
\param[in] spineNames - \ru Имена направляющей.
\en Generating curve names. \~
*/
MbCurveEvolutionSolid( const MbSweptData & sweptData_,
const MbSpine & spine_,
const EvolutionValues & params,
const std::vector<std::shared_ptr<MeshSurfaceValues>> & meshSurfVals_,
OperationType oType,
const MbSNameMaker & operNames,
const RPArray<MbSNameMaker> & contoursNames,
const MbSNameMaker & spineNames_ );
private :
MbCurveEvolutionSolid( const MbCurveEvolutionSolid & init, MbRegDuplicate * ireg );
// \ru Объявление конструктора копирования без реализации, чтобы не было копирования по умолчанию. \en Declaration without implementation of the copy-constructor to prevent copying by default.
+1 -1
View File
@@ -55,7 +55,7 @@ public:
void Move ( const MbVector3D &, MbRegTransform * = nullptr ) override; // \ru Сдвиг \en Translation
void Rotate ( const MbAxis3D &, double angle, MbRegTransform * = nullptr ) override; // \ru Повернуть вокруг оси \en Rotate about an axis
MbePrompt GetPropertyName() override; // \ru Дать имя свойства объекта \en Get the object property name
MbePrompt GetPropertyName() override; // \ru Дать имя свойства объекта \en Get the object property name
void GetProperties( MbProperties & ) override; // \ru Выдать свойства объекта \en Get properties of the object
void SetProperties( const MbProperties & ) override; // \ru Записать свойства объекта \en Set properties of the object
void GetBasisItems ( RPArray<MbSpaceItem> & ) override; // \ru Дать базовые объекты \en Get the basis objects
+3
View File
@@ -60,9 +60,12 @@ public:
void Rotate( const MbAxis3D &,
double angle,
MbRegTransform * = nullptr ) override; // \ru Повернуть вокруг оси \en Rotate about an axis
MbePrompt GetPropertyName() override; // \ru Выдать заголовок свойства объекта \en Get a name of object property
void GetProperties( MbProperties & ) override; // \ru Выдать свойства объекта \en Get properties of the object
void SetProperties( const MbProperties & ) override; // \ru Записать свойства объекта \en Set properties of the object
void GetBasisItems( RPArray<MbSpaceItem> & ) override; // \ru Дать базовые объекты \en Get the basis objects
bool IsSame( const MbCreator &,
double accuracy ) const override; // \ru Являются ли объекты равными? \en Determine whether an object is equal?
bool IsSimilar( const MbCreator & ) const override; // \ru Являются ли объекты подобными \en Whether the objects are similar
+2 -2
View File
@@ -66,7 +66,6 @@ private:
// ---
class MbCharacterAuxiliaryData : public AuxiliaryData {
public:
double _metricLength; ///< \ru Метрическая длина кривой. \en Metric length of the curve.
MbCube _cube; ///< \ru Габарит кривой. \en Bounding box of a curve.
MbeSpaceType _type; ///< \ru Тип пространственно близкой кривой. \en Space-near curve type.
@@ -83,7 +82,8 @@ private:
virtual ~MbCharacterAuxiliaryData();
};
mutable CacheManager<MbCharacterAuxiliaryData> cache;
mutable CacheManager<MbCharacterAuxiliaryData> cache; /// \ru Вспомогательные данные для ускорения вычислений. \en Auxiliary data to speed up computations.
mutable atomic_double metricLength; ///< \ru Метрическая длина кривой. \en Metric length of the curve.
public:
/// \ru Конструктор (использует оригиналы функций). \en Constructor (uses functions originals).
+24 -10
View File
@@ -20,6 +20,7 @@ class MATH_CLASS MbMatrix;
class MATH_CLASS MbContour;
class MATH_CLASS MbSurface;
class MATH_CLASS MbSurfaceCurve;
class MATH_CLASS MbContour3D;
class MATH_CLASS MbCurveTessellation;
class MbCurveIntoNurbsInfo;
class MbSegmentsSearchTree;
@@ -178,12 +179,13 @@ public :
/// \ru Вычислить параметрический габарит контура. \en Calculate the parametric bounding box of the contour.
virtual void CalculateUVLimits( MbRect & uvRect );
void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ) override; // \ru Изменить носителя. \en Change the carrier.
bool ChangeCarrierBorne( const MbSpaceItem & item, MbSpaceItem & init, const MbMatrix & matr ) override; // \ru Изменить носимые элементы. \en Change carrier elements.
void ChangeCarrier( const MbSpaceItem & item, MbSpaceItem & init ) override; // \ru Изменить носителя. \en Change the carrier.
bool ChangeCarrierBorne( const MbSpaceItem & item, MbSpaceItem & init, const MbMatrix & matr ) override; // \ru Изменить носимые элементы. \en Change carrier elements.
/// \ru Заменить поверхность контура. \en Replace the surface of contour.
virtual bool ChangeSurface( const MbSurface & );
/// \ru Заменить двумерный контур. \en Replace the two-dimensional contour.
void ChangeContour( MbContour & );
bool IsPlanar( double accuracy = METRIC_EPSILON ) const override; // \ru Определить, является ли кривая плоской. \en Determine whether the curve is planar.
bool IsSmoothConnected( double angleEps ) const override; // \ru Определить, является ли контур гладким. \en Define whether the contour is smooth.
// \ru Дать плоскую кривую и плейсмент, если пространственная кривая плоская (после использования вызывать DeleteItem на двумерную кривую). \en Get planar curve and placement if the space curve is planar (after the using call DeleteItem for two-dimensional curves)
@@ -200,20 +202,21 @@ public :
MbCurve * GetMap( const MbMatrix3D &, MbRect1D * pRgn = nullptr,
VERSION version = Math::DefaultMathVersion(), bool * coincParams = nullptr ) const override; // \ru Дать плоскую проекцию кривой. \en Get a planar projection of curve.
/// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. \en Get the boundaries of the curve sections that are described by one analytical function. \~
// \ru Получить границы участков кривой, которые описываются одной аналитической функцией. \en Get the boundaries of the curve sections that are described by one analytical function. \~
void GetAnalyticalFunctionsBounds( std::vector<double> & params ) const override;
/// \ru Найти все особые точки функции кривизны кривой. \en Find all the special points of the curvature function of the curve.
// \ru Найти все особые точки функции кривизны кривой. \en Find all the special points of the curvature function of the curve.
void GetCurvatureSpecialPoints( std::vector<c3d::DoublePair> & points ) const override;
bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const override; // \ru Непрерывна ли первая производная? \en Have the first derivative the continuous?
/// \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length.
// \ru Непрерывна ли первая производная? \en Have the first derivative the continuous?
bool IsContinuousDerivative( bool & contLength, bool & contDirect, c3d::DoubleVector * params = nullptr, double epsilon = EPSILON ) const override;
// \ru Устранить разрывы первых производных по длине. \en Eliminate the discontinuities of the first derivative at length.
bool SetContinuousDerivativeLength( VERSION version, double epsilon = EPSILON ) override;
/// \ ru Определение точек излома контура. \en The determination of contour smoothness break points.
// \ ru Определение точек излома контура. \en The determination of contour smoothness break points.
void BreakPoints( std::vector<double> & vBreaks, double precision = ANGLE_REGION ) const override;
/// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
// \ru Продлить кривую. \en Extend the curve. \~
MbResultType Extend( const MbCurveExtensionParameters3D & parameters, c3d::SpaceCurveSPtr & resCurve ) const override;
/// \ru Доступ к полям класса. \en Access to the fields of a class.
// \ru Доступ к полям класса. \en Access to the fields of a class.
/// \ru Выдать базовую поверхность. \en Get the base surface.
const MbSurface & GetSurface() const { return *surface; }
@@ -233,6 +236,17 @@ public :
/// \ru Выдать копию двумерного контура. \en Get a copy of the two-dimensional contour.
MbContour & ContourDuplicate() const;
/** \brief \ru Создать пространственную копию контура на поверхности.
\en Create a spatial copy of a contour on a surface. \~
\details \ru Создать пространственную копию контура на поверхности.
Используется общая копия поверхности и копии сегментов контура. \n
\en Create a spatial copy of a contour on a surface.
Created contour is using a general copy of the surface and copies of the contour segments. \n \~
\return \ru Возвращает пространственную копию контура на поверхности.
\en Returns a spatial copy of a contour on a surface. \~
*/
MbContour3D * CreateContour() const;
/// \ru Вычислить нормали к поверхности по параметру кривой. \en Calculate normals to the surface in the curve parameter.
void SurfaceNormal( double t, MbVector3D & n ) const;
/// \ru Кривизна поверхности в поперечном направлении к вектору tau. \en The surface curvature in the transverse direction to the vector tau.
+2
View File
@@ -170,6 +170,8 @@ public :
/// \ru Найти все особые точки функции кривизны кривой.
/// \en Find all the special points of the curvature function of the curve.
void GetCurvatureSpecialPoints( std::vector<c3d::DoublePair> & points ) const override;
/// \ ru Определение точек излома кривой. \en The determination of curve smoothness break points.
void BreakPoints( std::vector<double> & vBreaks, double precision = ANGLE_REGION ) const override;
// \ru Прохождение кривой через точку \en Passing of curve through a point
//virtual bool GoThroughPoint( double t, MbCartPoint3D & p0 );
+9 -10
View File
@@ -18,7 +18,6 @@
#include <array>
#include <tool_multithreading.h>
#include <templ_sptr.h>
#include <system_atomic.h>
class MATH_CLASS MbMatrix;
@@ -142,13 +141,13 @@ private :
MbSurfaceCurve curveTwo; ///< \ru Кривая на второй поверхности. \en Curve on the second surface.
MbeCurveBuildType buildType; ///< \ru Тип кривой по построению. \en A curve type by construction.
mutable atomic_enum_type<MbeCurveGlueType> glueType; ///< \ru Тип кривой по топологии. \en A curve type by topology.
mutable atomic_double tolerance; ///< \ru Погрешность построения кривой. \en The tolerance of curve construction. \~
mutable MbeCurveGlueType glueType; ///< \ru Тип кривой по топологии. \en A curve type by topology.
mutable double tolerance; ///< \ru Погрешность построения кривой. \en The tolerance of curve construction. \~
mutable MbCube cube; ///< \ru Габаритный куб кривой. \en Bounding box of a curve. \~
mutable atomic_double metricLength; ///< \ru Метрическая длина кривой. \en Metric length of a curve. \~
mutable atomic_double lengthEvaluation; ///< \ru Оценочная длина кривой. \en Estimated length of a curve. \~
mutable atomic_double curveRadius; ///< \ru Радиус кривой, если она является дугой окружности в пространстве. \en The radius of the curve, if the curve is a spatial arc.
mutable c3d::AtomicDoublePair radiusAccuracy; ///< \ru Точности вычисления curveRadius. \en The precisions for the calculation of curveRadius.
mutable double metricLength; ///< \ru Метрическая длина кривой. \en Metric length of a curve. \~
mutable double lengthEvaluation; ///< \ru Оценочная длина кривой. \en Estimated length of a curve. \~
mutable double curveRadius; ///< \ru Радиус кривой, если она является дугой окружности в пространстве. \en The radius of the curve, if the curve is a spatial arc.
mutable c3d::DoublePair radiusAccuracy; ///< \ru Точности вычисления curveRadius. \en The precisions for the calculation of curveRadius.
#ifdef C3D_SIGNAL_ENABLED
mutable atomic_bool inChange; ///< \ru Указывает на нахождение в процессе изменений. \en Indicates to being in the process of changes.
@@ -482,7 +481,7 @@ public:
bool IsSpaceSame( const MbSpaceItem & item, double eps = METRIC_REGION ) const override;
/// \ru Получить тип кривой по топологии. \en Get a curve type by topology.
MbeCurveGlueType GetGlueType() const { return glueType(); }
MbeCurveGlueType GetGlueType() const { return glueType; }
/// \ru Установить тип кривой по топологии. \en Set a curve type by topology.
void SetGlueType( MbeCurveGlueType type ) { glueType = type; }
/// \ru Установить тип кривой по топологии. \en Set a curve type by topology.
@@ -807,11 +806,11 @@ inline bool MbSurfaceIntersectionCurve::CopyReadyMutable( const MbSurfaceInterse
bool changed = false;
if ( lengthEvaluation < 0.0 && s.lengthEvaluation >= 0.0 ) {
lengthEvaluation = s.lengthEvaluation.load();
lengthEvaluation = s.lengthEvaluation;
changed = true;
}
if ( metricLength < 0.0 && s.metricLength >= 0.0 ) {
metricLength = s.metricLength.load();
metricLength = s.metricLength;
changed = true;
}
if ( cube.IsEmpty() && !s.cube.IsEmpty() ) {
+2 -2
View File
@@ -739,8 +739,8 @@ public :
\en Direction of a trimmed curve in relation to an initial curve.
sense = 1 - direction does not change.
sense = -1 - direction changes to the opposite value. \~
\param[in] xyEps - \ru Двумерная точность.
\en Two-dimensional accuracy. \~
\param[in] xyEps - \ru Двумерная точность. Используется для оценок вблизи точек, соответствующих параметрам t1 и t2.
\en Two-dimensional accuracy. It is used for estimations near the points corresponding to the parameters t1 and t2. \~
\param[in] saveParLenAndLaw - \ru Сохранять параметрическую длину и закон.
\en Save parametric length and law. \~
\internal \ru При изменении поведения или документации метода переделать юнит-тестирование.
+3
View File
@@ -113,6 +113,9 @@ public: // Общие методы
/// \ru Вернуть значение минимальной компоненты точности. \en Return the value of the minimum accuracy component.
double GetMin() const;
/// \ru Длина вектора, построенного на компонентах точности. \en Length of the vector built on accuracy components.
double GetLength() const;
/// \ru Доступ к компонентe точности по индексу. \en Access to accuracy component by index.
double & operator [] ( size_t i );
/// \ru Значение компоненты точности по индексу. \en The value of accuracy component by index.
+1
View File
@@ -356,6 +356,7 @@ enum MbeLabelState {
*/
// ---
enum MbeSmoothForm {
st_Unknown = -2, ///< \ru Неопределенное сопряжение. \en Undefined blend item.
st_Span = -1, ///< \ru Скругление с заданной хордой. \en Fillet with a given chord.
st_Fillet = 0, ///< \ru Скругление с заданными радиусами. \en Fillet with given radii.
st_Chamfer = 1, ///< \ru Фаска с заданными катетами. \en Chamfer with given cathetuses.
+19 -24
View File
@@ -12,7 +12,6 @@
#include <mb_cart_point.h>
#include <system_atomic.h>
#include <io_base.h>
#include <mb_homogeneous.h>
@@ -25,9 +24,9 @@ class MATH_CLASS MbHomogeneous;
template<class Transform>
void CheckOrigin ( const Transform & trans, atomic_uint8 & flag, bool resetFlag );
void CheckOrigin ( const Transform & trans, uint8 & flag, bool resetFlag );
template<class Transform>
void CheckRotation( const Transform & trans, atomic_uint8 & flag, bool resetFlag );
void CheckRotation( const Transform & trans, uint8 & flag, bool resetFlag );
//------------------------------------------------------------------------------
@@ -107,7 +106,7 @@ private:
DO NOT USE "Get..." METHODS TO MODIFY MATRIX ELEMENTS BY RENAMING const TO non-const,
USE ONLY Get* AND Set* TO ACCESS AND MODIFY OF MATRIX DATA. \~
*/
mutable atomic_uint8 flag;
mutable uint8 flag;
public:
static const MbMatrix identity; ///< \ru Единичная матрица, I = diag(1,1,1); \en Identity matrix, I = diag(1,1,1);
@@ -116,7 +115,7 @@ public :
/// \ru Конструктор по умолчанию. \en Default constructor.
MbMatrix() : flag( MB_UNSET ) { Init(); }
/// \ru Конструктор копирования. \en Copy constructor.
MbMatrix( const MbMatrix & init ) : flag( init.flag.load() ) { ::memcpy( &el, init.el, sizeof(el) ); }
MbMatrix( const MbMatrix & init ) : flag( init.flag ) { ::memcpy( &el, init.el, sizeof(el) ); }
/// \ru Конструктор по локальной системе координат. \en The constructor by placement.
explicit MbMatrix( const MbPlacement & place ) : flag( MB_UNSET ) { Set( place ); }
public:
@@ -561,7 +560,7 @@ public:
/// \ru Домножить на матрицу справа. \en Multiply by the matrix on the right.
MbMatrix & operator *= ( const MbMatrix & m ) { return PostMultiply( m ); }
/// \ru Присвоить значение. \en Assign a value.
MbMatrix & operator = ( const MbMatrix & m ) { flag = m.flag.load(); ::memcpy( &el, m.el, sizeof(el) ); return *this; }
MbMatrix & operator = ( const MbMatrix & m ) { flag = m.flag; ::memcpy( &el, m.el, sizeof(el) ); return *this; }
/// \ru Сравнить с матрицей (точность - LENGTH_EPSILON). \en Compare with a matrix(tolerance- LENGTH_EPSILON).
bool operator == ( const MbMatrix & ) const;
@@ -581,11 +580,11 @@ private:
/// \ru Выставить флаги. \en Set flags.
uint8 ResetFlag() const;
// Оценить флаги, если оценки не было
uint8 CheckFlag() const { return IsUnSet() ? ResetFlag() : flag.load(); }
uint8 CheckFlag() const { return IsUnSet() ? ResetFlag() : flag; }
// Проверить флаг смещения.
void CheckOrigin() const { ::CheckOrigin( *this, flag, true ); }
void CheckOrigin() const { uint8 val = flag; ::CheckOrigin( *this, val, true ); flag = val; }
// \ru Проверить флаг вращения. \en Check rotation flag.
void CheckRotation() const { ::CheckRotation( *this, flag, true ); }
void CheckRotation() const { uint8 val = flag; ::CheckRotation( *this, val, true ); flag = val; }
public:
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbMatrix, MATH_FUNC_EX ) // \ru Для работы со ссылками и объектами класса \en For working with references and objects of the class.
@@ -602,21 +601,19 @@ public:
*/
// ---
template<class Transform>
void CheckOrigin( const Transform & trans, atomic_uint8 & flag, bool resetFlag )
void CheckOrigin( const Transform & trans, uint8 & flag, bool resetFlag )
{
uint8 val = flag.load();
if ( !(val & MB_UNSET) ) {
if ( !(flag & MB_UNSET) ) {
const MbCartPoint & pOrigin = trans.GetOrigin();
const double lengthEpsilon = LENGTH_EPSILON;
if ( (::fabs(pOrigin.x) > lengthEpsilon) ||
(::fabs(pOrigin.y) > lengthEpsilon) )
val |= MB_TRANSLATION;
flag |= MB_TRANSLATION;
else if ( resetFlag ) {
val &= ~MB_TRANSLATION;
flag &= ~MB_TRANSLATION;
}
}
flag = val;
}
@@ -629,10 +626,9 @@ void CheckOrigin( const Transform & trans, atomic_uint8 & flag, bool resetFlag )
*/
// ---
template<class Transform>
void CheckRotation( const Transform & trans, atomic_uint8 & flag, bool resetFlag )
void CheckRotation( const Transform & trans, uint8 & flag, bool resetFlag )
{
uint8 val = flag.load();
if ( !(val & MB_UNSET) ) {
if ( !(flag & MB_UNSET) ) {
const MbVector & axisX = trans.GetAxisX();
const MbVector & axisY = trans.GetAxisY();
@@ -643,16 +639,15 @@ void CheckRotation( const Transform & trans, atomic_uint8 & flag, bool resetFlag
::fabs(axisX.x - 1.0) > eps ||
::fabs(axisY.y - 1.0) > eps )
{
val |= MB_ROTATION;
flag |= MB_ROTATION;
}
else if ( resetFlag ) {
val &= ~MB_ROTATION;
val &= ~MB_LEFT;
val &= ~MB_ORTOGONAL;
val &= ~MB_AFFINE;
flag &= ~MB_ROTATION;
flag &= ~MB_LEFT;
flag &= ~MB_ORTOGONAL;
flag &= ~MB_AFFINE;
}
}
flag = val;
}
+5 -5
View File
@@ -610,9 +610,9 @@ private:
// Оценить флаги, если оценки не было
uint8 CheckFlag() const { return IsUnSet() ? ResetFlag() : flag; }
// Проверить флаг смещения.
void CheckOrigin() const { ::CheckOrigin3D( *this, flag, true ); }
void CheckOrigin() const { uint8 val = flag; ::CheckOrigin3D( *this, val, true ); flag = val; }
/// \ru Проверить флаг вращения. \en Check rotation flag.
void CheckRotation() const { ::CheckRotation3D( *this, flag, true ); }
void CheckRotation() const { uint8 val = flag; ::CheckRotation3D( *this, val, true ); flag = val; }
void CheckScale() const;
@@ -631,7 +631,7 @@ public:
*/
// ---
template<class Transform>
void CheckOrigin3D( const Transform & trans, uint8 & flag, bool resetFlag )
void CheckOrigin3D( const Transform & trans, uint8 & flag, bool resetFlag )
{
if ( !(flag & MB_UNSET) ) {
const MbCartPoint3D & pOrigin = trans.GetOrigin();
@@ -717,10 +717,10 @@ void CheckAffine3D( const Transform & trans, uint8 & flag )
else {
double lnZ = vAxisZ.Length();
if ( ::fabs( vAxisX * vAxisZ ) > (epsX * lnZ) )
flag |= MB_AFFINE;
flag |= MB_AFFINE;
else {
if ( ::fabs( vAxisY * vAxisZ ) > (eps * lnY * lnZ) )
flag |= MB_AFFINE;
flag |= MB_AFFINE;
else if ( (::fabs(lnX - 1.0) > eps) ||
(::fabs(lnY - 1.0) > eps) ||
(::fabs(lnZ - 1.0) > eps) )
+5
View File
@@ -285,6 +285,11 @@ enum MbResultType {
rt_NoRayIntersection, ///< \ru В выбранном направлении нет пересечения луча со вторым объектом. \en There is no intersection of a ray and a second object in the selected direction.
rt_ExtremesRequestExceeded, ///< \ru Количество экстремумов превышает количество измерений. \en The number of extremes exceeds the number of measurements.
rt_ConstraintSurfaceDomainError,///< \ru В области определения элемента обнаружена недопустимая ситуация относительно внешнего объекта ограничения - поверхности. \en In the range of spine curve's parameter an unacceptable situation with respect to a surface used in a constraint was encountered.
rt_ConstraintCurveEmptyDomain, ///< \ru Пустая область определения относительно внешнего объекта ограничения - кривой. \en The range of spine curve's parameter is empty with respect to a curve used in a constraint.
rt_ConstraintCurveDomainError, ///< \ru В области определения элемента обнаружена недопустимая ситуация относительно внешнего объекта ограничения - кривой. \en In the range of spine curve's parameter an unacceptable situation with respect to a curve used in a constraint was encountered.
rt_ConstraintCurveNoBijection, ///< \ru Нарушение биекции между траекторией и внешним объектом ограничения - кривой. \en Violation of the bijection between the spine's curve and a curve used in a constraint.
// \ru !!! СТРОКИ ВСТАВЛЯТЬ СТРОГО ПЕРЕД ЭТОЙ СТРОКОЙ !!!! \en !!! INSERT LINES STRICTLY BEFORE THIS LINE !!!!
rt_ErrorTotal // \ru НИЖЕ НЕ ДОБАВЛЯТЬ! \en DON'T ADD BELOW!
};
+6 -7
View File
@@ -10,7 +10,6 @@
#include <mb_cart_point.h>
#include <mb_matrix.h>
#include <system_atomic.h>
//----------------------------------------------------------------------------------------
@@ -72,7 +71,7 @@ private:
'flag' has to be reset to unspecified MB_UNSET state while changing the coordinate system. \n
if 'flag' == MB_UNSET then the state of coordinate system is specified while it is being used.\n \~
*/
mutable atomic_uint8 flag;
mutable uint8 flag;
public :
/// \ru Конструктор по умолчанию. \en Default constructor.
@@ -240,11 +239,11 @@ private:
/// \ru Выставить флаги. \en Set flags.
uint8 ResetFlag() const;
// Оценить флаги, если оценки не было
uint8 CheckFlag() const { return IsUnSet() ? ResetFlag() : flag.load(); }
uint8 CheckFlag() const { return IsUnSet() ? ResetFlag() : flag; }
// Проверить флаг смещения.
void CheckOrigin() const { ::CheckOrigin( *this, flag, true ); }
void CheckOrigin() const { uint8 val = flag; ::CheckOrigin( *this, val, true ); flag = val; }
// \ru Проверить флаг вращения. \en Check rotation flag.
void CheckRotation() const { ::CheckRotation( *this, flag, true ); }
void CheckRotation() const { uint8 val = flag; ::CheckRotation( *this, val, true ); flag = val; }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbPlacement, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbPlacement )
@@ -271,7 +270,7 @@ inline MbPlacement::MbPlacement( const MbPlacement & other )
: origin( other.origin ) // начало координат
, axisX ( other.axisX ) // направление оси 0X
, axisY ( other.axisY ) // направление оси 0Y
, flag ( other.flag.load() )
, flag ( other.flag )
{
}
@@ -386,7 +385,7 @@ inline void MbPlacement::operator = ( const MbPlacement & other )
origin = other.origin; // \ru Начало координат \en The origin
axisX = other.axisX; // \ru Направление оси 0X \en Direction of 0X-axis
axisY = other.axisY; // \ru Направление оси 0Y \en Direction of 0Y-axis
flag = other.flag.load();
flag = other.flag;
}
+2 -2
View File
@@ -497,9 +497,9 @@ private :
// Оценить флаги, если оценки не было
uint8 CheckFlag() const { return IsUnSet() ? ResetFlag() : flag; }
// Проверить флаг смещения.
void CheckOrigin() const { ::CheckOrigin3D( *this, flag, true ); }
void CheckOrigin() const { uint8 val = flag; ::CheckOrigin3D( *this, val, true ); flag = val; }
// \ru Проверить флаг вращения. \en Check rotation flag.
void CheckRotation() const { ::CheckRotation3D( *this, flag, true ); }
void CheckRotation() const { uint8 val = flag; ::CheckRotation3D( *this, val, true ); flag = val; }
KNOWN_OBJECTS_RW_REF_OPERATORS_EX_BASE( MbPlacement3D, MATH_FUNC_EX )
DECLARE_NEW_DELETE_CLASS( MbPlacement3D )
+60
View File
@@ -275,6 +275,66 @@ public:
_approxWeights.resize( _approxPoints.size() );
}
/** \brief \ru Инициализировать по точкам и параметрам, создать равномерный узловой вектор.
\en Initialize by points and parameters. Create uniform knot vector. \~
\details \ru Инициализировать по точкам и параметрам, создать равномерный узловой вектор по заданному пользователем количеству сегментов.
Начальное и конечное значение узлов будут равны первому и последнему параметру точек, либо расширены на указанное значение.
Веса всех точек будут единичные. Констрейны для точек и производных отсутствуют.
Кривая будет незамкнута.
\en Initialize by points and parameters. Create uniform knot vector with user defined number of spans.
First and last knots will be equal to first and last paramemters values or will be extended by specified value. All point weights are unit.
There are no constraints for points and derivatives. The curve will be unclosed. \~
\param[in] aPt - \ru Точки для аппроксимации.
\en Points for approximation. \~
\param[in] aPrm - \ru Параметры точек.
\en Point parameters. \~
\param[in] order - \ru Порядок кривой.
\en Curve order. \~
\param[in] nSpan - \ru Количество сегментов в узловом векторе.
\en Number of spans. \~
\param[in] smooth - \ru Коэффициент сглаживания.
\en Smoothing coefficient. \~
\param[in] orderSmoothing - \ru Порядок производных для сглаживания.
\en Derivative order for smoothing. \~
\param[in] tolerance - \ru Точность аппроксимации.
\en Approximation tolerance. \~
\param[in] bClosed - \ru Флаг замкнутости.
\en Closure flag. \~
\param[in] extendBeg - \ru Величина расширения параметрической длины в начале кривой в процентах относительно
разности начального и конечного параметра точек (опционально).
\en Parametric length extention value for the curve beginning as percent w.r.t. difference
between last and first point parameter (optional). \~
\param[in] extendEnd - \ru Величина расширения параметрической длины в конце кривой в процентах относительно
разности начального и конечного параметра точек (опционально).
\en Parametric length extention value for the curve end as percent w.r.t. difference
between last and first point parameter (optional). \~
*/
void InitUniformByPointsAndParams( const std::vector<Point> & aPt,
const std::vector<double> & aPrm,
size_t order,
size_t nSpan,
double smooth,
MbeSmoothingMethod typeSmoothing,
double tolerance,
bool bClosed,
double extendBeg = 0.,
double extendEnd = 0. )
{
if ( aPt.empty() )
return;
_approxPoints = aPt;
_approxParams = aPrm;
_bClosed = bClosed;
_order = order;
_methodSmoothing = typeSmoothing;
_methodSmoothing = order > 3 ? typeSmoothing : MbeSmoothingMethod::sm_Curvature;
_coefSmoothing = smooth;
_tolerance = tolerance;
GetUniformKnots( bClosed ? 0. : -extendBeg, bClosed ? 1. : 1. + extendEnd, nSpan, order, bClosed, _approxKnots );
_approxWeights.resize( _approxPoints.size() );
}
/** \brief \ru Инициализировать по точкам.
\en Initialize by points. \~
\details \ru Инициализировать по точкам. Параметры аппроксимируемых точек будут рассчитаны по длине полилинии.
+28 -6
View File
@@ -924,12 +924,16 @@ public:
MbAxis3D & circleCenter,
double & alpha ) const;
/** \brief \ru Получить хот-точку и нормаль на грани для операции модифицирования граней.
\en Get hot point and normal on a face for face modification operation. \~
\details \ru Хот-точка размещается в центре первой замещающей грани.
\en The hot point is placed at the center of the first replacement face.\~
\param[out] pnt - \ru Точка, лежащая в центре первой замещающей грани.
\en The point at the center of the first replacement face. \~
/** \brief \ru Получить хот-точку и её вектор направления смещения для операции замены граней.
\en Get hot point and its displacement direction vector for the face replacement operation. \~
\details \ru В случае успешного выполнения операции хот-точка размещается в центре первой замещающей грани.
В случае неудачного выполнения операции хот-точка располагается на линии, соединяющей центр первой заменяемой
грани и его проекцию на заменяющую поверхность, при этом смещение учитывается относительно проекции.
\en If the operation is successful, the hot point is placed in the center of the first replacement face.
If the operation fails, the hot point is located on the line connecting the center of the first replaced face
and its projection onto the replacement surface, and the offset is taken relative to the projection.\~
\param[out] pnt - \ru Хот-точка.
\en Hot point. \~
\param[out] dir - \ru Вектор направления смещения хот-точки.
\en Hot point displacement direction vector.\~
\return \ru Возвращает "true", если хот-точка была рассчитана.
@@ -938,6 +942,24 @@ public:
bool GetReplaceFacesHotPoint( MbCartPoint3D & pnt,
MbVector3D & dir ) const;
/** \brief \ru Получить хот-точку и её вектор направления смещения для операции замены граней на эквидистантные.
\en Get hot point and its displacement direction vector for the operation of replacement faces with the offset ones. \~
\details \ru В случае успешного выполнения операции хот-точка размещается в центре первой эквидистантной грани.
В случае неудачного выполнения операции хот-точка располагается на нормали к центру первой заменяемой грани,
при этом смещение учитывается относительно этого центра.
\en If the operation is successful, the hot point is placed in the center of the first equidistant face.
If the operation fails, the hot point is located on the normal to the center of the first replaced face,
and the offset is taken relative to this center.\~
\param[out] pnt - \ru Хот-точка.
\en Hot point. \~
\param[out] dir - \ru Вектор направления смещения хот-точки.
\en Hot point displacement direction vector.\~
\return \ru Возвращает "true", если хот-точка была рассчитана.
\en Returns "true" if the hot-point is calculated. \~
*/
bool GetOffsetFacesHotPoint( MbCartPoint3D & pnt,
MbVector3D & dir ) const;
/** \brief \ru Получить константную ссылку на массив вариантов замены граней.
\en Get a constant reference to an array of face replacement options. \~
\details \ru Получить константную ссылку на массив вариантов замены граней.
+132 -49
View File
@@ -3333,15 +3333,17 @@ OBVIOUS_PRIVATE_COPY( MbMedianShellResults )
// ---
struct MATH_CLASS MbShellStitchParams {
private:
SPtr<MbSNameMaker> nameMaker; ///< \ru Именователь операции. \en An object defining names generation in the operation.
double stitchAccuracy; ///< \ru Точность сшивки (точность поиска парных ребер). \en Stitching accuracy (search accuracy of edges pairs).
bool formSolidBody; ///< \ru Флаг формирования твердого тела из результирующей оболочки. \en Whether to form a solid solid from the resultant shell.
bool mergeEdges; ///< \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
SPtr<MbSNameMaker> _nameMaker; ///< \ru Именователь операции. \en An object defining names generation in the operation.
double _stitchAccuracy; ///< \ru Точность сшивки (точность поиска парных ребер). \en Stitching accuracy (search accuracy of edges pairs).
bool _formSolidBody; ///< \ru Флаг формирования твердого тела из результирующей оболочки. \en Whether to form a solid solid from the resultant shell.
bool _mergeEdges; ///< \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
private:
mutable IProgressIndicator * _progress; ///< \ru Индикатор прогресса выполнения операции. \en A progress indicator of the operation.
private:
MbShellStitchParams();
public:
/** \brief \ru Конструктор параметров сшивки оболочек.
\en Stitch faces of several solids into single solid. \~
\en Stitch faces of several solids into single solid. \~
\details \ru Сшить стыкующиеся друг с другом грани нескольких тел в одно тело. Ориентация граней может быть изменена. \n
\en Stitch faces of several solids with coincident edges into single solid. The faces orientation can be changed. \n \~
\param[in] operNames - \ru Именователь операции.
@@ -3354,22 +3356,27 @@ public:
\en Whether to merge similar edges (true). \~
*/
MbShellStitchParams( const MbSNameMaker & operNames, bool formBody, double sewingAccuracy, bool edgesMerging = true )
: nameMaker ( &operNames.Duplicate() )
, stitchAccuracy( sewingAccuracy )
, formSolidBody ( formBody )
, mergeEdges ( edgesMerging )
: _nameMaker ( &operNames.Duplicate() )
, _stitchAccuracy( sewingAccuracy )
, _formSolidBody ( formBody )
, _mergeEdges ( edgesMerging )
{}
~MbShellStitchParams()
{}
public:
/// \ru Получить именователь операции. \en Get the object defining names generation in the operation.
const MbSNameMaker & GetNameMaker() const { return *nameMaker; }
const MbSNameMaker & GetNameMaker() const { return *_nameMaker; }
/// \ru Получить точность поиска парных ребер. \en Get search accuracy of edges pairs.
double GetStitchAccuracy() const { return stitchAccuracy; }
double GetStitchAccuracy() const { return _stitchAccuracy; }
/// \ru Пытаться формировать твердое тело из результирующей оболочки.. \en Whether to try forming a solid solid from the resultant shell.
bool TryBodyForming() const { return formSolidBody; }
bool TryBodyForming() const { return _formSolidBody; }
/// \ru Сливать подобные ребра (true). \en Whether to merge similar edges (true).
bool PerformEdgesMerging() const { return mergeEdges; }
bool PerformEdgesMerging() const { return _mergeEdges; }
public:
/// \ru Установить внешний индикатор прогресса выполнения. \en Set external progress indicator.
void SetProgressIndicator( IProgressIndicator * prog ) { _progress = prog; }
/// \ru Взять внешний индикатор прогресса выполнения. \en Take external progress indicator.
IProgressIndicator * TakeProgressIndicator() const { return _progress; }
OBVIOUS_PRIVATE_COPY ( MbShellStitchParams )
};
@@ -4776,6 +4783,83 @@ void MbLoftedSolidParams::GetContoursNames( NamesPointers & sectionsNames ) cons
}
//------------------------------------------------------------------------------
/** \brief \ru Данные, необходимые для построения элемента по траектории с динамической параметризацией сечения.
\en Data required for sweeping operation with variable section. \~
\details \ru Данные, необходимые для построения элемента по траектории с динамической параметризацией сечения.
\en Data required for sweeping operation with variable section. \~
\ingroup Shell_Building_Parameters
\warning \ru В разработке. \en Under development.
*/
// ---
struct MATH_CLASS VariableSectionValues
{
private:
const IVariableSectionData & _sectionData; ///< \ru Интерфейс для получения сечений в кинематической операции с динамической параметризацией сечения. \en An interface for obtaining sections for sweeping operation with variable section. \~
std::set<const MbFunction *> _constrFuncs; ///< \ru Функции ограничений, наложенных на образующие контуры. \en Functions of constraints imposed on generating contours. \~
std::map<size_t, std::set<const MbSpaceItem *>> _constrObjs; ///< \ru Ассоциативный контейнер: ключ - индекс образующего контура, значение - множество пространственных объектов, используемых в ограничениях, наложенных на соответствующий образующий контур. \en Associative container: key - index of generating contour, value - set of space items used in constraints imposed on the corresponding generating contour. \~
c3d::DoubleVector _spineTValsForReqSections; ///< \ru Значения параметра направляющей кривой, в которых обязательно должны быть построены сечения. \en Spine curve's parameter values in which sections must be constructed. \~
bool _splitAtG1Corners; ///< \ru Разбивать элемент на грани вдоль траектории в местах стыковки сегментов траектории и внешних объектов ограничений (кривых), которые стыкуются с гладкостью G1 и выше. \en Split into faces along spine at points where segments of spine or curves used in constraints join smoothly (G1 and up). \~
public:
/** \brief \ru Конструктор по параметрам.
\en Constructor by the parameters. \~
\details \ru Конструктор по параметрам.
\en Constructor by the parameters. \~
\param[in] sectionData - \ru Интерфейс для получения сечений в кинематической операции с динамической параметризацией сечения.
\en An interface for obtaining sections for sweeping operation with variable section. \~
*/
VariableSectionValues( const IVariableSectionData & sectionData );
/** \brief \ru Добавить функцию ограничения, наложенного на образующие контуры.
\en Add function of constraint imposed on generating contours. \~
\details \ru Добавить функцию ограничения, наложенного на образующие контуры.
\en Add function of constraint imposed on generating contours. \~
\param[in] func - \ru Функция ограничения, наложенного на образующие контуры.
\en Function of constraint imposed on generating contours. \~
\return \ru true, если функция была добавлена.
\en true if function was added. \~
*/
bool AddConstraintFunction( const MbFunction * func );
/** \brief \ru Добавить пространственный объект, используемый в ограничении.
\en Add space item used in constraint. \~
\details \ru Добавить пространственный объект, используемый в ограничении, наложенном на образующий контур с заданным индексом.
\en Add space item used in constraint imposed generating contour with specified index. \~
\param[in] cntrIdx - \ru Индекс образующего контура, на который действует ограничение.
\en Index of generating contour subjected to the constraint. \~
\param[in] obj - \ru Пространственный объект, используемый в ограничении.
\en Space item used in constraint. \~
\return \ru true, если объект был добавлен.
\en true if object was added. \~
*/
bool AddConstraintObject( const size_t cntrIdx, const MbSpaceItem * obj );
/// \ru Добавить значение параметра направляющей кривой, при котором обязательно должно быть построено сечение. \en Add spine curve's parameter value at which section must be constructed. \~
void AddSpineTValForReqSection( const double t );
/// \ru Установить флаг разбиения элемента на грани вдоль траектории в местах стыковки сегментов траектории и внешних объектов ограничений (кривых), которые стыкуются с гладкостью G1 и выше. \en Set the flag of splitting into faces along spine at points where segments of spine or curves used in constraints join smoothly (G1 and up). \~
void SetSplittingAtSmoothCorners( const bool split );
/// \ru Получить интерфейс для получения сечений в кинематической операции с динамической параметризацией сечения. \en Get an interface for obtaining sections for sweeping operation with variable section. \~
const IVariableSectionData & GetSectionData() const;
/// \ru Получить функции ограничений, наложенных на образующие контуры. \en Get functions of constraints imposed on generating contours. \~
const std::set<const MbFunction *> & GetFuncs() const;
/// \ru Получить пространственные объекты, используемые в ограничениях, наложенных на образующие контуры. \en Get space items used in constraints imposed on generating contours. \~
const std::map<size_t, std::set<const MbSpaceItem *>> & GetConstrObjects() const;
/// \ru Получить значения параметра направляющей кривой, в которых обязательно должны быть построены сечения. \en Get spine curve's parameter values at which sections must be constructed. \~
const c3d::DoubleVector & GetSpineTValsForReqSections() const;
/// \ru Получить флаг разбиения элемента на грани вдоль траектории в местах стыковки сегментов траектории и внешних объектов ограничений (кривых), которые стыкуются с гладкостью G1 и выше. \en Get the flag of splitting into faces along spine at points where segments of spine or curves used in constraints join smoothly (G1 and up). \~
bool GetSplittingAtSmoothCorners() const;
OBVIOUS_PRIVATE_COPY( VariableSectionValues )
};
//------------------------------------------------------------------------------
/** \brief \ru Исходные данные для операции построения кинематического тела.
\en Input data for sweeping solid operation.
@@ -4796,10 +4880,9 @@ protected:
const MbSNameMaker & _spineName; ///< \ru Именователь направляющей. \en An object defining the name of a spine curve. \~
std::vector<const MbSNameMaker *> _contoursNames; ///< \ru Именователь контуров образующей. \en An object defining the names of generating curve contours. \~
const EvolutionValues & _evolParams; ///< \ru Параметры операции. \en The operation parameters. \~
// Данные, необходимые для построения элемента по траектории с динамической параметризацией сечения.
const c3d::ConstFunctionSPtrVector * _funcs; ///< \ru Функции ограничений, наложенных на сегменты контуров образующей (при использовании динамической параметризации сечения). \en Functions of constraints imposed on segments of generating curve contours (when using variable section). \~
const IVariableSectionData * _sectionData; ///< \ru Интерфейс для получения сечений в кинематической операции с динамической параметризацией сечения. \en An interface for obtaining sections for sweeping operation with variable section. \~
const VariableSectionValues * _varSectVals; ///< \ru Данные, необходимые для построения элемента по траектории с динамической параметризацией сечения. \en Data required for sweeping operation with variable section. \~
MbRect1D _varSectDomain; ///< \ru Рассчитанная область значений параметра направляющей кривой, в которой строится кинематическое тело при использовании динамической параметризации сечения. \en The calculated range of spine curve's parameter where creation of sweeping solid with variable section takes place. \~
MbResultType _vsDomCalcRes; ///< \ru Код результата расчета области значений параметра направляющей кривой, в которой строится кинематическое тело при использовании динамической параметризации сечения. \en The result code of calculating the range of spine curve's parameter where creation of sweeping solid with variable section takes place. \~
public:
mutable IProgressIndicator * _progress; ///< \ru Индикатор прогресса выполнения операции. \en An operation progress indicator.
@@ -4888,36 +4971,33 @@ public:
/** \brief \ru Конструктор по параметрам операции.
\en Constructor by the operation parameters. \~
\details \ru Конструктор параметрам операции.
\details \ru Конструктор по параметрам операции.
\en Constructor by the operation parameters. \~
\param[in] sweptData - \ru Данные об образующей.
\en The generating curve data. \~
\param[in] spine - \ru Направляющая кривая c дополнительной информацией.
\en The spine curve with additional data. \~
\param[in] evolParams - \ru Параметры операции.
\en The operation parameters. \~
\param[in] funcs - \ru Функции ограничений, наложенных на сегменты контуров образующей (при использовании динамической параметризации сечения).
\en Functions of constraints imposed on segments of generating curve contours (when using variable section). \~
\param[in] sectionData - \ru Интерфейс для получения сечений в кинематической операции с динамической параметризацией сечения.
\en An interface for obtaining sections for sweeping operation with variable section. \~
\param[in] operName - \ru Именователь операции.
\en An object defining names generation in the operation. \~
\param[in] contourNames - \ru Именователь контуров образующей.
\en An object defining the names of generating curve contours. \~
\param[in] spineName - \ru Именователь направляющей.
\en An object defining the name of a guide curve. \~
\param[in] prog - \ru Индикатор прогресса выполнения операции.
\en An operation progress indicator. \~
\param[in] sweptData - \ru Данные об образующей.
\en The generating curve data. \~
\param[in] spine - \ru Направляющая кривая c дополнительной информацией.
\en The spine curve with additional data. \~
\param[in] evolParams - \ru Параметры операции.
\en The operation parameters. \~
\param[in] operName - \ru Именователь операции.
\en An object defining names generation in the operation. \~
\param[in] contoursNames - \ru Именователь контуров образующей.
\en An object defining the names of generating curve contours. \~
\param[in] spineName - \ru Именователь направляющей.
\en An object defining the name of a guide curve. \~
\param[in] varSectVals - \ru Данные, необходимые для построения элемента по траектории с динамической параметризацией сечения.
\en Data required for sweeping operation with variable section. \~
\param[in] prog - \ru Индикатор прогресса выполнения операции.
\en An operation progress indicator. \~
*/
MbEvolutionShellParams( const MbSweptData & sweptData,
const MbSpine & spine,
const EvolutionValues & evolParams,
const c3d::ConstFunctionSPtrVector * funcs,
const IVariableSectionData & sectionData,
const MbSNameMaker & operName,
const RPArray<MbSNameMaker> & contoursNames,
const MbSNameMaker & spineName,
IProgressIndicator * prog = nullptr );
MbEvolutionShellParams( const MbSweptData & sweptData,
const MbSpine & spine,
const EvolutionValues & evolParams,
const MbSNameMaker & operName,
const RPArray<MbSNameMaker> & contoursNames,
const MbSNameMaker & spineName,
const VariableSectionValues & varSectVals,
IProgressIndicator * prog = nullptr );
/** \brief \ru Конструктор копирования с заменой образующей
\en Copy constructor with generator replacement. \~
@@ -4962,17 +5042,20 @@ public:
/// \ru Получить именователь направляющей. \en Get the object defining the name of a spine. \~
const MbSNameMaker & GetSpineName() const;
/// \ru Получить интерфейс для получения сечений в кинематической операции с динамической параметризацией сечения. \en Get an interface for obtaining sections for sweeping operation with variable section. \~
const IVariableSectionData * GetSectionData() const;
/// \ru Получить данные, необходимые для построения элемента по траектории с динамической параметризацией сечения. \en Get data required for sweeping operation with variable section. \~
const VariableSectionValues * GetVariableSectionValues() const;
/// \ru Получить функции ограничений, наложенных на сегменты контуров образующей. \en Get functions of constraints imposed on segments of generating curve contours. \~
const c3d::ConstFunctionSPtrVector * GetFunctions() const;
/// \ru Получить рассчитанную область значений параметра направляющей кривой, в которой строится кинематическое тело при использовании динамической параметризации сечения. \en Get the calculated range of spine curve's parameter where creation of sweeping solid with variable section takes place. \~
MbResultType GetVariableSectionDomain( MbRect1D & dom ) const;
private:
/// \ru Задать именователи контуров. NamesPointers - вектор указателей (можно SPtr) на MbSNameMaker. \en Set the objects defining the names of generating contours. NamesPointers is a vector of pointers (SPtr is available, too) to MbSNameMaker. \~
template<class NamesPointers>
void SetContoursNames( const NamesPointers & contoursNames );
/// \ru Рассчитать область значений параметра направляющей кривой, в которой строится кинематическое тело при использовании динамической параметризации сечения. \en Calculate range of spine curve's parameter where creation of sweeping solid with variable section will take place. \~
void CalcVariableSectionDomain();
OBVIOUS_PRIVATE_COPY( MbEvolutionShellParams )
};
+1 -1
View File
@@ -312,7 +312,7 @@ MbSmoothSurface * CreateChannelSurface( const MbSurface & surface1, SArray<MbCar
const MbSurface & surface2, SArray<MbCartPoint> & points2,
MbeSmoothForm form, double distance1, double distance2, double conic,
SArray<double> & dFactor, SArray<double> & dTendency,
bool even );
bool even, VERSION vers );
//------------------------------------------------------------------------------
+2 -2
View File
@@ -21,11 +21,11 @@ class MATH_CLASS MbOffsetSurface;
//------------------------------------------------------------------------------
/** \brief \ru Поверхность выдавливания.
\en Extrusion surface. \~
\details \ru Поверхность выдавливания является кинематической поверхностью с прямолинейной образующей.
\details \ru Поверхность выдавливания является кинематической поверхностью с прямолинейной направляющей.
Радиус-вектор поверхности описывается векторной функцией \n
r(u,v) = curve(u) + (direction distance v). \n
Первый параметр поверхности совпадает с параметром образующей кривой.
\en Extrusion surface is swept surface with rectilinear generating curve.
\en Extrusion surface is swept surface with a rectilinear directrix.
Radius-vector of surface is described by the vector function \n
r(u,v) = curve(u) + (direction distance v). \n
First parameter of surface coincides with parameter of generating curve. \~
+6 -5
View File
@@ -415,7 +415,7 @@ public:
MbVector3D * uuDer, MbVector3D * vvDer, MbVector3D * uvDer, MbVector3D * nor ) const override;
/// \ru Вычислить двумерные значения точки и производных для опорной кривой (0 - первая, иначе - вторая) (для внутреннего использования)
/// \en Calculate the two-dimensional values of the point and derivatives for the surface curve (0 - first, otherwise - second) (for internal use) \~
bool SurfaceCurveExplore( size_t ind, double t, MbCartPoint & pnt, MbVector * fir, MbVector * sec, MbVector * thir ) const;
void SurfaceCurveExplore( size_t ind, double t, MbCartPoint & pnt, MbVector * fir, MbVector * sec, MbVector * thir ) const;
// \ru Вычислить значения всех производных в точке. \en Calculate all derivatives at point. \~
void _PointNormal( double u, double v,
@@ -440,6 +440,7 @@ public:
MbSplineSurface * NurbsSurface( double, double, double, double, bool bmatch = false ) const override; // \ru Построить NURBS копию поверхности. \en Construct a NURBS copy of a surface.
MbSurface * NurbsSurface( const MbNurbsParameters & uParam, const MbNurbsParameters & vParam ) const override; // \ru Построить NURBS-копию поверхности. \en Construct a NURBS-copy of a surface.
MbSurface * Offset( double d, bool same ) const override; // \ru Создание эквидистантной поверхности. \en Create an offset surface.
MbFilletSurface * OffsetByFillet( double d, const MbSurface & offSurf1, const MbSurface & offSurf2 ) const; // \ru Создание эквидистантной поверхности. \en Create an offset surface.
MbCurve3D * CurveV( double u, MbRect1D *pRgn, bool bApprox = true ) const override; // \ru Пространственная копия линии u = const. \en Spatial copy of 'u = const'-line.
@@ -776,17 +777,17 @@ protected:
void CheckUParam( double & u ) const;
void CheckVParam( double & v ) const;
// Расчет производных опорных кривых для случая скругления по двум поверхностям (постоянный, элиптический, хорда, закон)
void FilletCaseDerivatives( ptrdiff_t ord, double a, double b, MbFilletSurfaceCacheData & dat ) const;
void FilletCaseDerivatives( ptrdiff_t ord, double u, MbFilletSurfaceCacheData & dat ) const;
// Расчет производных опорных кривых для случая скругления поверхности и кромки (постоянный)
void KerbCaseDerivatives( ptrdiff_t ord, const MbSurfaceCurve * (&curves)[2], double (&uu)[2], MbFilletSurfaceCacheData & dat ) const;
void KerbCaseDerivatives( ptrdiff_t ord, double u, MbFilletSurfaceCacheData & dat ) const;
// Расчет производных опорных кривых для случая поверхности скругления по двум поверхностям с кромкой на одной из них
void KerbTouchingCaseDerivatives( ptrdiff_t ord, const MbSurfaceCurve * (&curves)[2], double (&uu)[2], MbFilletSurfaceCacheData & dat ) const;
void KerbTouchingCaseDerivatives( ptrdiff_t ord, double u, MbFilletSurfaceCacheData & dat ) const;
// Расчитать производные опорных кривых.
void CalculateCurvesDerivatives( double u, ptrdiff_t ord, MbFilletSurfaceCacheData & dat ) const;
void GetCurvesParams( double u, double (&uu)[2], MbVector (&move)[2] ) const;// Получить расчетные параметры для двумерных кривых + вектор сдвига.
// Расчитать производные поверхности.
void Explore( double & u, double & v, bool ext, ptrdiff_t ordU, MbFilletSurfaceCacheData & dat ) const;
bool NeedInsertPoints() override { return version == fsv_Ver0; } // Есть ли необходимость вставки новых точек.
MbSurfaceCurve * GetExactCurve( size_t ind ); // Получить опорную кривую.
const MbSurfaceCurve * GetExactCurve( size_t ind ) const; // Получить опорную кривую.
#ifdef C3D_DEBUG
+12
View File
@@ -160,6 +160,18 @@ public:
\en Requested point. \~
*/
void GetPoint ( size_t i, size_t j, MbCartPoint3D & pnt ) const { pnt = points( i, j ); }
/** \brief \ru Изменить точку, расположенную в i строке, j колонке.
\en Change the point located at row i and column j. \~
\details \ru Изменить точку, расположенную в i строке, j колонке.\n
\en Change the point located at row i and column j.\n \~
\param[in] i - \ru Строка.
\en String. \~
\param[in] j - \ru Колонка.
\en Column. \~
\param[in] pnt - \ru Новая точка.
\en New point. \~
*/
void SetPoint( size_t i, size_t j, const MbCartPoint3D & pnt ) { points( i, j ).Init( pnt ); }
/** \brief \ru Сдвинуть точку, расположенную в i строке, j колонке на заданный вектор.
\en Translate the point located at row i and column j by the given vector. \~
\details \ru Сдвинуть точку, расположенную в i строке, j колонке на заданный вектор.\n
+2 -2
View File
@@ -25,14 +25,14 @@ class MATH_CLASS MbOffsetSurface;
//------------------------------------------------------------------------------
/** \brief \ru Поверхность вращения.
\en Revolution surface. \~
\details \ru Поверхность вращения является кинематической поверхностью с образующей в форме дуги окружности.
\details \ru Поверхность вращения является кинематической поверхностью с направляющей в форме дуги окружности.
Поверхность вращения получена путем движения образующей кривой curve по окружности или её дуге.
Радиус-вектор поверхности описывается векторной функцией \n
r(u,v) = position.origin + M(v)(curve(u) - position.origin), \n
где M(v) - матрица поворота точки вокруг оси position.axisZ. \n
Первый параметр поверхности совпадает с параметром образующей кривой.
Второй параметр поверхности совпадает с углом поворота образующей кривой.
\en A revolution surface is a swept surface with generatrix in a circle arc form.
\en A revolution surface is a swept surface with a directrix in a circle arc form.
A revolution surface is obtained by moving of the generatrix 'curve' along the circle or its arc.
Radius-vector of line surface is described by the vector function \n
r(u,v) = position.origin + M(v)(curve(u) - position.origin), \n
+30 -16
View File
@@ -22,10 +22,10 @@
#include <templ_dptr.h>
#define _RO_MIN_ 0.001 // \ru Минимальный дискримонант переменного сечения. \en The minimum discriminant of the mutable section.
#define _CIRCLE_ 0.4142135623730950488016887242097 // \ru Дискримонант для дуги окружности в сечении. \en The discriminant is corresponding to the circle.
#define _PARABOLA_ 0.5 // \ru Дискримонант для параболы в сечении. \en The discriminant is corresponding to the parabola.
#define _RO_MAX_ 0.999 // \ru Максимальный дискримонант переменного сечения. \en The maximum discriminant of the mutable section.
#define _RO_MIN_ 0.001 // \ru Минимальный дискриминант переменного сечения. \en The minimum discriminant of the mutable section.
#define _CIRCLE_ 0.4142135623730950488016887242097 // \ru Дискриминант для дуги окружности в сечении. \en The discriminant is corresponding to the circle.
#define _PARABOLA_ 0.5 // \ru Дискриминант для параболы в сечении. \en The discriminant is corresponding to the parabola.
#define _RO_MAX_ 0.999 // \ru Максимальный дискриминант переменного сечения. \en The maximum discriminant of the mutable section.
class MATH_CLASS MbSurfaceWorkingData;
@@ -58,7 +58,7 @@ class MATH_CLASS MbSectionSurface : public MbSurface {
public:
double ts; ///< \ru Параметр опорной кривой. \en The parameter of the spine.
double t1; ///< \ru Параметр первой направляющей кривой. \en The parameter of the guide1.
double t2; ///< \ru Параметр первой направляющей кривой. \en The parameter of the guide2.
double t2; ///< \ru Параметр второй направляющей кривой. \en The parameter of the guide2.
double t0; ///< \ru Параметр средней кривой. \en The XY parameter of the curves[0].
public:
@@ -74,15 +74,18 @@ class MATH_CLASS MbSectionSurface : public MbSurface {
protected:
MbSpine * spine; ///< \ru Опорная кривая. \en The reference curve. \~
MbFunction * radius1; ///< \ru Функция первого радиуса для поверхности скругления (может быть nullptr). \en The function of the first fillet surface radius (may be nullptr).
MbFunction * radius2; ///< \ru Функция второго радиуса для поверхности скругления (может быть nullptr). \en The function of the second fillet surface radius (may be nullptr).
MbCurve3D * guide1; ///< \ru Первая направляющая кривая. \en The first guide curve. \~
MbCurve3D * guide2; ///< \ru Вторая направляющая кривая. \en The second guide curve. \~
std::vector<MbCurve3D *> curves; ///< \ru Дополнительные контрольные кривые (могут отсутствовать). \en The additional control curves (may be empty). \~
MbFunction * function; ///< \ru Функция управления сечением (радиус или дискриминант, может быть nullptr)). \en Section control function (radius or discriminant, may be nullptr). \~
MbFunction * function; ///< \ru Функция управления сечением (дискриминант, может быть nullptr)). \en Section control function (discriminant, may be nullptr). \~
MbPolyCurve * pattern; ///< \ru Образующая кривая при form==cs_Shape (для других форм nullptr). \en Forming curve for form==cs_Shape (nullptr on other case). \~
std::vector<MbCartPoint> shape; ///< \ru Описание сечения при form==cs_Shape (пуст в других случаях). \en Description of shape cross-section for form==cs_Shape (is empty on other case). \~
std::vector<double> knots; ///< \ru Узловой вектор сплайна. \en Knot vector of the spline. \~
size_t order; ///< \ru Порядок сплайна (степень + 1). \en Order of spline (degree + 1). \~
MbeSectionShape form; ///< \ru Форма сечения поверхности при фиксированном втором параметре. \en The surface cross-section shape with the second parameter fixed. \~
MbeSmoothForm sform; ///< \ru Форма поверхности скругления. \en The fillet surface form. \~
double umin; ///< \ru Минимальное значение первого параметра u. \en Minimal value of parameter u. \~
double umax; ///< \ru Максимальное значение первого параметра u. \en Maximal value of parameter u. \~
double vmin; ///< \ru Минимальное значение второго параметра v. \en Minimal value of parameter v. \~
@@ -92,7 +95,7 @@ protected:
bool poleVMin; ///< \ru Наличие полюса поверхности при vmin. \en Existence of a pole at vmin. \~
bool poleVMax; ///< \ru Наличие полюса поверхности при vmax. \en Existence of a pole at vmax. \~
std::vector<double> vBreaks; ///< \ru Параметры опорной кривой, для которых направляющие терпят излом. \en Parameters of the reference curve for which the guides have a break. \~
std::vector<MbSettings> settings; ///< \ru Нулевые приближения параметров опороных кривых служат для ускорения работы объекта. \en Zero approximations of the parameters of the reference curves are used for fast calculations. \n \~
std::vector<MbSettings> settings; ///< \ru Нулевые приближения параметров опорных кривых служат для ускорения работы объекта. \en Zero approximations of the parameters of the reference curves are used for fast calculations. \n \~
//------------------------------------------------------------------------------
/// \ru Вспомогательные данные служат для ускорения работы объекта. \en Auxiliary data are used for fast calculations. \n \~
@@ -120,7 +123,7 @@ protected:
MbVector3D wSecn3; ///< \ru Вторая производная по v оси axisZ плоскости. \en The second derivative of axisZ of wPlace with respect to v.
std::vector<double> wSplns; ///< \ru Рабочее множество В-сплайнов. \en The work set of B-splines.
std::vector<MbCartPoint> wxy; ///< \ru Рабочее множество точек. \en The work set of the points.
std::vector<MbVector> wxyV; ///< \ru Рабочее множество первых производных по V. \en The work set of the firsf derivatives.
std::vector<MbVector> wxyV; ///< \ru Рабочее множество первых производных по V. \en The work set of the first derivatives.
std::vector<MbVector> wxyVV; ///< \ru Рабочее множество вторых производных по V. \en The work set of the second derivatives.
std::vector<MbVector> wxyVVV; ///< \ru Рабочее множество третьих производных по V. \en The work set of the third derivatives.
double wVal; ///< \ru Параметр v, для которого вычислены производные начала и орт плоскости wPlace. \en The parameter v for which was calculated the plane origin derivative and axises derivatives.
@@ -162,10 +165,11 @@ protected:
\param[in] sh - \ru Описание сечения при form==cs_Shape (пуст в других случаях).
\en Description of shape cross-section for form==cs_Shape. \~
*/
MbSectionSurface( MbSpine & sp, MbCurve3D & c1, MbCurve3D & c2,
std::vector<MbCurve3D *> cs, MbeSectionShape f,
MbSectionSurface( MbSpine & sp, MbFunction * r1, MbFunction * r2,
MbCurve3D & c1, MbCurve3D & c2,
std::vector<MbCurve3D *> cs, MbeSectionShape f, MbeSmoothForm sf,
double uBeg, double uEnd, MbFunction * func,
MbPolyCurve * patt, std::vector<MbCartPoint> & sh );
MbPolyCurve * patt, const std::vector<MbCartPoint> & sh );
/** \brief \ru Конструктор поверхности переменного сечения.
\en The mutable section surface constructor. \~
@@ -181,7 +185,7 @@ protected:
\en The minimum value of the first surface parameter (uBeg<uEnd). \~
\param[in] uEnd - \ru Максимальное значение первого параметра поверхности (0<uEnd<M_IP2).
\en The maximum value of the first surface parameter (0<uEnd<M_IP2). \~
\param[in] func - \ru Функция именения радиуса сечения поверхности.
\param[in] func - \ru Функция изменения радиуса сечения поверхности.
\en Section radius function. \~
*/
MbSectionSurface( MbSpine & sp, MbCurve3D & c0, MbeSectionShape f, double uBeg, double uEnd, MbFunction & func );
@@ -228,15 +232,16 @@ public:
\en Minimum number of steps while moving along the reference curve. \~
\param[in] vers - \ru Версия поверхности.
\en The surface version. \~
\param[out] resType - \ru Код ошибки порстроения.
\param[out] resType - \ru Код ошибки построения.
\en Result code of building. \~
\result \ru Возвращает построенную поверхностьь.
\result \ru Возвращает построенную поверхность.
\en Returns the constructed surface. \~
*/
static MbSectionSurface * Create( const MbCurve3D & rc,
const MbFunction * r1, const MbFunction * r2,
const MbCurve3D & g1, const MbCurve3D & g2,
const MbCurve3D * c0,
MbeSectionShape f,
MbeSectionShape f, MbeSmoothForm sf,
bool sense,
double uBeg, double uEnd,
const MbFunction * func,
@@ -394,6 +399,10 @@ public:
const MbSpine & GetSpine() const { return *spine; }
/// \ru Дать опорную кривую. \en Get reference curve.
const MbCurve3D & GetSpineCurve() const { return spine->GetCurve(); }
/// \ru Дать функцию первого радиуса поверхности скругления. \en Get function of the first fillet surface radius.
const MbFunction * GetRadius1() const { return radius1; }
/// \ru Дать функцию второго радиуса поверхности скругления. \en Get function of the second fillet surface radius.
const MbFunction * GetRadius2() const { return radius2; }
/// \ru Дать первую направляющую кривую (может быть nullptr). \en Get first guide curve (may be nullptr).
const MbCurve3D * GetGuide1() const { return guide1; }
/// \ru Дать вторую направляющую кривую (может быть nullptr). \en Get second guide curve (may be nullptr).
@@ -408,6 +417,8 @@ public:
const MbPolyCurve * GetPattern() const { return pattern; }
/// \ru Дать форму сечения поверхности при фиксированном втором параметре. \en Get the surface cross-section shape with the second parameter fixed.
MbeSectionShape GetSectionForm() const { return form; }
///< \ru Дать форму поверхности скругления. \en Get the fillet surface form. \~
MbeSmoothForm GetSmoothForm() const { return sform; }
/// \ru Дать параметры опорной кривой, для которых направляющие терпят излом. \en Get parameters of the reference curve for which the guides have a break.
void GetBreakVParams( std::vector<double> & vParams ) const;
@@ -438,11 +449,14 @@ protected :
void CacheInit( bool resetLongTerm = true ); // \ru Инициализация вспомогательных данных. \en Auxiliary data init.
// \ru Проверить и изменить при необходимости параметры поверхности. \en Check and correct parameters of the surface.
void CheckParams( double & u, double & v, bool ext ) const;
// \ru Вычисление пересечений направляющих с плоскостью сечения поверхности. \ en Calculating the intersections of guides with the surface cross -section plane.
// \ru Вычисление пересечений направляющих с плоскостью сечения поверхности. \ en Calculating the intersections of guides with the surface cross-section plane.
bool SectionData( const MbCurve3D * curve0, const double & v, MbPlacement3D & place,
MbCartPoint & xy0, double & t0,
MbCartPoint & xy1, MbVector & vec1, double & t1,
MbCartPoint & xy2, MbVector & vec2, double & t2 ) const;
// \ru // Уточнение точек пересечений направляющих с плоскостью сечения поверхности. \ en Refinement of the intersections points of guides with the surface cross-section plane.
bool SmoothSection( const double & v, const MbPlacement3D & place, const double & t1, const double & t2,
MbCartPoint & xy1, MbCartPoint & xy2, MbCartPoint & xy0 ) const;
// \ru Расчет двумерных точек и их производных на плоском сечении поверхности. \en Calculation of two-dimension points and their derivatives on the surface plane section.
void Round( const double & u, const double & v,
const MbCartPoint & xy1, const MbVector & xy1V, const MbVector & xy1VV, const MbVector & xy1VVV,
-1
View File
@@ -342,7 +342,6 @@ protected:
void InitSmoothSurface ( const MbSmoothSurface & );
void Init ( const MbSmoothSurface & );
virtual bool NeedInsertPoints() { return true; }
private:
// \ru Определениe точки пересечения края поверхности и кривой на смежной поверхности. \en Determination of intersection point between the surface boundary and the adjacent surface.
+6
View File
@@ -1042,6 +1042,8 @@ public :
/// \ru Выдать ребро грани MbCurveEdge. \en Get a face edge MbCurveEdge.
MbCurveEdge & GetCurveEdge() const { return *curveEdge; }
/// \ru Выдать ребро грани MbCurveEdge. \en Get a face edge MbCurveEdge.
MbCurveEdge & SetCurveEdge() { return *curveEdge; }
/// \ru Выдать направление по отношению к кривой. \en Get the direction relative to the curve.
bool IsSameSense() const;
@@ -1293,8 +1295,12 @@ public :
void InitOrientedEdge( size_t edgeIndex, MbCurveEdge & initEdge, bool initOrientation, bool replaceVertices );
/// \ru Выдать ориентированное ребро по номеру. \en Get an oriented edge by the number.
MbOrientedEdge * GetOrientedEdge( size_t index ) const { return (index < edgeList.size()) ? edgeList[index] : nullptr; }
/// \ru Выдать ориентированное ребро по номеру. \en Get an oriented edge by the number.
MbOrientedEdge * SetOrientedEdge( size_t index ) { return (index < edgeList.size()) ? edgeList[index] : nullptr; }
/// \ru Выдать ориентированное ребро по номеру без проверки корректности индекса. \en Get an oriented edge by the number without check of correctness of the index.
MbOrientedEdge *_GetOrientedEdge( size_t index ) const { return edgeList[index]; }
/// \ru Выдать ориентированное ребро по номеру без проверки корректности индекса. \en Get an oriented edge by the number without check of correctness of the index.
MbOrientedEdge *_SetOrientedEdge( size_t index ) { return edgeList[index]; }
/// \ru Добавить ребро без проверки. \en Add an edge without check.
void _AddEdge ( const MbOrientedEdge & );
+18 -4
View File
@@ -60,6 +60,9 @@ typedef std::set<const MbFaceShell *> ConstShellsSet;
typedef ConstShellsSet::iterator ConstShellsSetIt;
typedef ConstShellsSet::const_iterator ConstShellsSetConstIt;
typedef std::pair<ConstShellsSetConstIt, bool> ConstShellsSetRet;
typedef std::pair<ShellSPtr, AttrSPtrVector> ShellAttrsSPtrPair;
typedef std::vector<ShellAttrsSPtrPair> ShellsAttrsSPtrVector;
}
@@ -1967,8 +1970,12 @@ size_t SetEdgesLabel( const FacesVector & faceSet, MbeLabelState label, void * k
// поднимаем флаг
for ( size_t i = 0, fcount = faceSet.size(); i < fcount; ++i ) {
const MbFace * face = faceSet[i];
if ( face == nullptr )
continue;
for ( size_t j = 0, lcount = face->GetLoopsCount(); j < lcount; ++j ) {
const MbLoop * loop = face->_GetLoop( j );
if ( loop == nullptr )
continue;
size_t ecount = loop->GetEdgesCount();
for ( size_t k = 0; k < ecount; ++k ) {
MbCurveEdge * edge = &loop->_GetOrientedEdge( k )->GetCurveEdge();
@@ -2004,15 +2011,22 @@ void GetEdges( const FacesVector & faceSet, EdgesVector & edges )
size_t maxCount = SetEdgesLabel( faceSet, ls_Used );
edges.reserve( edges.size() + maxCount );
SPtr<MbCurveEdge> edge;
// опускаем флаг
for ( size_t i = 0, fcount = faceSet.size(); i < fcount; ++i ) {
const MbFace * face = faceSet[i];
SPtr<MbCurveEdge> edge;
if ( face == nullptr )
continue;
for ( size_t j = 0, lcount = face->GetLoopsCount(); j < lcount; ++j ) {
const MbLoop * loop = face->_GetLoop( j );
for ( size_t k = 0, ecount = loop->GetEdgesCount(); k < ecount; k++ ) {
edge = const_cast<MbCurveEdge *>( &loop->_GetOrientedEdge( k )->GetCurveEdge() );
if ( loop == nullptr )
continue;
for ( size_t k = 0, ecount = loop->GetEdgesCount(); k < ecount; ++k ) {
MbOrientedEdge * orientEdge = const_cast<MbOrientedEdge *>( loop->_GetOrientedEdge(k) );
if ( orientEdge == nullptr )
continue;
edge = &orientEdge->SetCurveEdge();
if ( edge->GetLabel() == ls_Used ) {
edge->SetOwnLabel( ls_Null );
edges.push_back( edge );
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.