- C3d aggiornamento librerie ( 118030).
This commit is contained in:
SaraP
2025-04-29 09:09:40 +02:00
parent 3e22df0c99
commit bf6235c0d6
19 changed files with 362 additions and 73 deletions
+3 -1
View File
@@ -531,6 +531,8 @@ namespace c3d // namespace C3D
/// \ru Подсказка для удаляемой слипшейся грани. \en Hint for a deleted stuck face.
constexpr TCHAR c3dStr_StuckDelete[] = _T( "c3d_StuckDelete" );
/// \ru Подсказка для изначально граничного ребра. \en Hint for initially boundary edge.
constexpr TCHAR c3dStr_InitBoundaryEdge[] = _T( "c3d_InitBoundaryEdge" );
/// \ru Подсказка для расшивки граней по ребру. \en Hint for separation neighbour faces by an edge.
constexpr TCHAR c3dStr_UnstitchByEdge[] = _T( "c3d_UnstitchByEdge" );
/// \ru Подсказка для проверки идентификатора боковой грани. \en Hint for checking flank's identifier.
@@ -602,7 +604,7 @@ namespace c3d // namespace C3D
constexpr TCHAR c3dStr_SavedViewScale[] = _T( "c3d_SavedView_Scale" );
/** \ru Подсказка для типа текущего вида (ортогональный/перспективный). Хранится в виде значения bool.
\en Hint for the type of the current view (orthogonal/perspective). Stored as a bool value. \~*/
constexpr TCHAR c3dStr_SavedViewPerspective[] = _T( "c3d_SavedView_Perspective" );
constexpr TCHAR c3dStr_SavedViewPerspective[] = _T( "c3d_SavedView_Perspective" );
} // namespace C3D
+11 -3
View File
@@ -541,7 +541,7 @@ public:
virtual bool ImportMeshesWithTopology() const { return false; }
/// \ru Лечить ли неправильные сетки, и параметры для лечения. \en Whether to repair inconsistent meshes, and parameters for repairing.
virtual bool RepairInconsistentMesh(MbRepairInconsistentMeshParams&) { return false; }
virtual bool RepairInconsistentMesh( MbRepairInconsistentMeshParams & ) const { return false; }
}; // IConvertorProperty3D
@@ -587,7 +587,9 @@ public:
bool addRemovedFacesAsShells; ///< \ru Добавлять ли удаленные грани в качестве отдельных оболочек. \en Whether to add removed faces as shells.
double lengthUnitsFactor; ///< \ru Единицы длины модели. \en Length units of the model.
double appUnitsFactor; ///< \ru Единицы длины модели пользовательского приложения. \en Length units of the model used in user application.
//DEPRECATE_DECLARE
bool attatchIdAttributes; ///< \ru Следует ли формировать атрибут на основе идентификатора элемнта в файле. \en Whether to attatch the element's id in file as attribute.
//DEPRECATE_DECLARE
bool auditEnabled;
bool importMeshesWithTopology; ///< \ru Сохранять сетки в MbMesh (false) или в MbPolymesh (true). \en Save meshes to MbMesh (false) or to MbPolymesh (true).
bool repairInconsistentMesh; /// \ru Лечить ли неправильные сетки. \en Whether to repair inconsistent meshes.
@@ -738,9 +740,15 @@ public:
bool ImportMeshesWithTopology() const override { return importMeshesWithTopology; }
/// \ru Получить параметры для лечения неправильных сеток. \en Get parameters for repairing inconsistent meshes.
bool RepairInconsistentMesh( MbRepairInconsistentMeshParams &params ) override;
bool RepairInconsistentMesh( MbRepairInconsistentMeshParams &params ) const override;
OBVIOUS_PRIVATE_COPY( ConvConvertorProperty3D )
/// \ru Обновить значения свойств, за исключением: GetPropertyString() и LogReport(). \en Update properties, exept : GetPropertyString() и LogReport()
void Update( IConvertorProperty3D const & init );
private:
ConvConvertorProperty3D ( ConvConvertorProperty3D const & ) = delete;
ConvConvertorProperty3D & operator = ( ConvConvertorProperty3D const & ) = delete;
ConvConvertorProperty3D ( ConvConvertorProperty3D && ) = delete;
}; // IConvertorProperty3D
+1 -1
View File
@@ -908,7 +908,7 @@ public :
/// \ru Создать Bezier форму Nurbs. \en Create a Bezier shape of Nurbs.
void Bezier( MbNurbs & bezierForm ) const;
/// \ru Присоединить nurbs. \en Attach nurbs.
bool Concatenate( MbNurbs & );
bool Concatenate( const MbNurbs &, bool inverse = false );
/// \ru Задать вес для вершины. \en Set weight for control point.
void SetWeight( ptrdiff_t pointNumber, double newWeight );
+2 -2
View File
@@ -333,8 +333,8 @@ public :
\en The second surface. \~
\param[in] curve2 - \ru Вторая двумерная кривая.
\en The second two-dimensional curve. \~
\param[in] spaceCurve - \ru Аппроксимация кривой пересечения.
\en Approximation of the intersection curve. \~
\param[in] spaceCurve - \ru Аппроксимация кривой пересечения (параметрические пределы должны соответствовать пределам поверхностных кривых).
\en Approximation of the intersection curve (parametric limits must correspond to the limits of surface curves). \~
\param[in] buildType - \ru Тип кривой пересечения по построению.
\en An intersection curve type by construction. \~
\param[in] glueType - \ru Тип кривой пересечения по топологии.
+17
View File
@@ -350,6 +350,23 @@ GCE_FUNC(pattern_item) GCE_AddLinearPattern( GCE_system gSys, GCE_vec2d trans );
//---
GCE_FUNC(pattern_item) GCE_AddAngularPattern( GCE_system gSys, GCE_point point, double angle );
//----------------------------------------------------------------------------------------
/** \brief \ru Объявить паттерн отражения по линейному объекту.
\en Declare a reflection pattern on a linear object. \~
\param[in] gSys - \ru Система ограничений.
\en System of constraints. \~
\param[in] geom - \ru Дескриптор линейного объекта - ось зеркальной симметрии.
\en Linear object descriptor, i.e. reflection symmetry axis. \~
\return \ru Дескриптор зарегистрированного паттерна.
\en Descriptor of registered pattern. \~
\details \ru Метод создает паттерн отражения относительно линейного объекта.
\en The method creates a reflection pattern relative to a linear object. \~
*/
//---
GCE_FUNC(pattern_item) GCE_AddSymmetricPattern( GCE_system gSys, geom_item geom );
//----------------------------------------------------------------------------------------
/** \brief \ru Объявить составной паттерн по двум данным.
\en Declare a composition pattern of two patterns. \~
+8 -2
View File
@@ -104,11 +104,11 @@ typedef enum
//----------------------------------------------------------------------------------------
/** \brief \ru Идентификаторы означающие контрольные точки и другие элементы, составляющие
/** \brief \ru Идентификаторы, означающие контрольные точки и другие элементы, составляющие
запись (tuple) геометрического объекта.
\en IDs denoting control points and other elements that form a record (tuple)
of a geometric object. ~\
\details \ru Это перечисление применяется для запроса дескриптора характерных точке объекта,
\details \ru Это перечисление применяется для запроса дескриптора характерных точек объекта,
таких как центр окружности, концевая точка кривой и т.д...
\en This enum is used to request a descriptor of control point of an object,
such as center of circle, bounding point of a curve etc... ~\
@@ -143,6 +143,8 @@ typedef enum
*/
, GCE_ORIENTATION
, GCE_BASE_CURVE
, GCE_BASE_PATTERN
, GCE_BASE_GEOM
} subgeom_type;
//----------------------------------------------------------------------------------------
@@ -217,6 +219,10 @@ typedef enum
, GCE_OFFSET_DIM
, GCE_ANGLE
, GCE_INTERVAL
/*
The values below are used only within the solver.
*/
, GCE_IDENTITY
, GCE_CONSTRAINTS_COUNT ///< \ru Количество типов. \en Number of types.
, GCE_UNKNOWN = GCE_CONSTRAINTS_COUNT ///< \ru Неизвестный тип ограничения. \en Unknown constraint type.
, GCE_UNKNOWN_CON = GCE_UNKNOWN
+26
View File
@@ -372,6 +372,32 @@ SIMPLE_FACET_ATTRIBUTE( size_t, SYS_MAX_T, MbHalfedgeAttrSizetFacet, MbeTypeAttr
SIMPLE_VERTEX_ATTRIBUTE( size_t, SYS_MAX_T, MbHalfedgeAttrSizetVertex, MbeTypeAttr::ta_SizetValuesVertex );
//------------------------------------------------------------------------------
/** \brief \ru Атрибут для типа unsigned char, ассоциированных с ребрами.
\en The unsigned char attribute associated with edges.
\ingroup Data_Structures
*/
// ---
SIMPLE_EDGE_ATTRIBUTE( uint8, SYS_MAX_UINT8, MbHalfedgeAttrUcharEdge, MbeTypeAttr::ta_UcharValuesEdge );
/** \brief \ru Атрибут для типа unsigned char, ассоциированных с фасетами.
\en The unsigned char attribute associated with facets.
\ingroup Data_Structures
*/
// ---
SIMPLE_FACET_ATTRIBUTE( uint8, SYS_MAX_UINT8, MbHalfedgeAttrUcharFacet, MbeTypeAttr::ta_UcharValuesFacet );
//------------------------------------------------------------------------------
/** \brief \ru Атрибут для типа unsigned char, ассоциированных с вершинами.
\en The unsigned char attribute associated with vertices.
\ingroup Data_Structures
*/
// ---
SIMPLE_VERTEX_ATTRIBUTE( uint8, SYS_MAX_UINT8, MbHalfedgeAttrUcharVertex, MbeTypeAttr::ta_UcharValuesVertex );
//------------------------------------------------------------------------------
/** \brief \ru Атрибут для 3D векторов, ассоциированных с ребрами.
\en The 3D vector attribute associated with edges.
+3
View File
@@ -66,6 +66,9 @@ enum class MbeTypeAttr
ta_Parameters2DEdgeDependent, ///< \ru Тип атрибута MbHalfedgeAttrParamByEdge. \en Attribute's type is MbHalfedgeAttrParamByEdge.
ta_Strains, ///< \ru Тип атрибута MbHalfedgeAttrStrains. \en Attribute's type is MbHalfedgeAttrSizetVertex.
ta_PairValuesEdge, ///< \ru Тип атрибута MbHalfedgeAttrIndPairEdge. \en Attribute's type is MbHalfedgeAttrIndPairEdge.
ta_UcharValuesFacet, ///< \ru Тип атрибута MbHalfedgeAttrUcharFacet. \en Attribute's type is MbHalfedgeAttrUcharFacet.
ta_UcharValuesEdge, ///< \ru Тип атрибута MbHalfedgeAttrUcharEdge. \en Attribute's type is MbHalfedgeAttrUcharEdge.
ta_UcharValuesVertex, ///< \ru Тип атрибута MbHalfedgeAttrUcharVertex. \en Attribute's type is MbHalfedgeAttrUcharVertex.
ta_ContainerFacet = 1000, ///< \ru Внутренний тип атрибута MbHalfedgeAttrContainerFacet. \en Attribute's inner type is MbHalfedgeAttrContainerFacet.
ta_ContainerEdge, ///< \ru Внутренний тип атрибута MbHalfedgeAttrContainerEdge. \en Attribute's inner type is MbHalfedgeAttrContainerEdge.
ta_ContainerVertex, ///< \ru Внутренний тип атрибута MbHalfedgeAttrContainerVertex. \en Attribute's inner type is MbHalfedgeAttrContainerVertex.
+35 -8
View File
@@ -39,25 +39,46 @@ class MbStepData;
// ---
class MATH_CLASS MbMeshSimplificationParams
{
public:
//------------------------------------------------------------------------------
/** \brief \ru Метод упрощения триангуляции.
\en Triangulation simplification method. \~
\details \ru Метод упрощения триангуляции.
На текущий момент пользователь может выбирать между более точной и более быстрой версиями.
\en Triangulation simplification method.
At this moment the user can choose between the more precise version of the algorithm and the faster one. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
enum class MbeMeshSimplificationMethod
{
precise, ///< \ru Более точный. \en More precise.
fast ///< \ru Более быстрый. \en Faster.
};
private:
c3d::DoubleVector _toleranceLevels; ///< \ru Уровни точностей для упрощения. \en Tolerance levels for simplification. \~
c3d::IndicesVector _triangleCountLevels; ///< \ru Уровни количества треугольников для упрощения. \en Triangle count levels for simplification. \~
c3d::DoubleVector _toleranceLevels; ///< \ru Уровни точностей для упрощения. \en Tolerance levels for simplification. \~
c3d::IndicesVector _triangleCountLevels; ///< \ru Уровни количества треугольников для упрощения. \en Triangle count levels for simplification. \~
MbeMeshSimplificationMethod _method; ///< \ru Метод упрощения триангуляции. \en Triangulation simplification method. \~
public:
mutable IProgressIndicator * _progress; ///< \ru Индикатор прогресса выполнения операции. \en A progress indicator of the operation.
public:
/// \ru Конструктор для задания целевй точности. \en Constructor for tolerance target. \~
MbMeshSimplificationParams( const c3d::DoubleVector & toleranceLevels, IProgressIndicator * prog = nullptr )
: _toleranceLevels( toleranceLevels )
, _triangleCountLevels()
, _progress ( prog )
: _toleranceLevels ( toleranceLevels )
, _triangleCountLevels( )
, _method ( MbeMeshSimplificationMethod::fast )
, _progress ( prog )
{}
/// \ru Конструктор для задания целевого количества треугольников. \en Constructor for triangles count target. \~
MbMeshSimplificationParams( const c3d::IndicesVector & triangleCountLevels, IProgressIndicator * prog = nullptr )
: _toleranceLevels()
, _triangleCountLevels( triangleCountLevels )
, _progress( prog )
: _toleranceLevels ( )
, _triangleCountLevels( triangleCountLevels )
, _method ( MbeMeshSimplificationMethod::fast )
, _progress ( prog )
{}
/// \ru Деструктор. \en Destructor. \~
@@ -116,6 +137,12 @@ public:
return isValid;
}
///< \ru Установить метод упрощения. \en Set the simplification method. \~
void SetSimplificationMethod( MbeMeshSimplificationMethod method ) { _method = method; }
///< \ru Получить метод упрощения. \en Get the simplification method. \~
MbeMeshSimplificationMethod GetSimplificationMethod() const { return _method; }
OBVIOUS_PRIVATE_COPY( MbMeshSimplificationParams )
};
+31 -3
View File
@@ -730,22 +730,50 @@ public:
// ---
class MATH_CLASS MbFillPolymeshHoleParams
{
public:
//------------------------------------------------------------------------------
/** \brief \ru Перечисление методов заполнения отверстия.
\en Enumeration for filling methods. \~
*/
// ---
enum class MethodFillPolymeshHole
{
full, ///< \ru Полный. \en Full.
partial, ///< \ru Частичный. \en Partial.
};
private:
c3d::IndicesVector _boundary; ///< \ru Список ребер вдоль отверстия. \en The list of edges along the hole's boundary. \~
MethodFillPolymeshHole _method; ///< \ru Метод заполнения отверстия. \en The filling method. \~
c3d::IndicesVector _boundary; ///< \ru Список ребер вдоль отверстия. \en The list of edges along the hole's boundary. \~
public:
/// \ru Конструктор по умолчанию. \en Default constructor.
MbFillPolymeshHoleParams() : _boundary() {}
MbFillPolymeshHoleParams()
: _boundary( )
, _method ( MethodFillPolymeshHole::full )
{}
/// \ru Деструктор. \en Destructor.
~MbFillPolymeshHoleParams() {}
public:
/// \ru Инициализировать ребром топологии. \en Initialize by the topology edge.
bool InitializeByTopoEdge( const MbPolymesh & mesh, size_t iEdTopo );
/** \brief \ru Инициализировать частичное закрытие начальным и конечным ребрами топологии.
\en Initialize partial filling with the initial and final topology edges. \~
\param[in] mesh - \ru Полигональный объект.
\en A polygonal object. \~
\param[in] iEdTopoBegin - \ru Начальное открытое ребро сетки.
\en An initial open topology edge. \~
\param[in] iEdTopoEnd - \ru Конечное открытое ребро сетки.
\en A final open topology edge. \~
*/
bool InitializePartialByTwoTopoEdges( const MbPolymesh & mesh, size_t iEdTopoBegin, size_t iEdTopoEnd );
/// \ru Инициализировать ребром сегментации. \en Initialize by the segmentation edge.
bool InitializeBySegmEdge( const MbPolymesh & mesh, size_t iEdSegm );
// \ru Получить границу отверстия. \en Get the hole's boundary. \~
/// \ru Получить границу отверстия. \en Get the hole's boundary. \~
const c3d::IndicesVector & GetBoundary() const { return _boundary; }
/// \ru Получить метод заполнения отверстия. \en Get the filling method. \~
MethodFillPolymeshHole GetMethod() const { return _method; }
OBVIOUS_PRIVATE_COPY( MbFillPolymeshHoleParams );
};
+95 -44
View File
@@ -44,7 +44,8 @@
// ---
class MATH_CLASS MbChannelSurface : public MbFilletSurface {
private:
MbFunction * function; ///< \ru Функция изменения радиуса (переменный коэффициент). \en Function of change of the radius (variable coefficient).
MbFunction * function1; ///< \ru Функция изменения радиуса (переменный коэффициент). \en Function of change of the radius (variable coefficient).
MbFunction * function2; ///< \ru Функция изменения радиуса (переменный коэффициент). \en Function of change of the radius (variable coefficient).
public:
@@ -154,22 +155,21 @@ public:
/** \brief \ru Создать поверхность скругления по двум поверхностям по закону.
\en Create a fillet surface from two surfaces according to the law. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.\n
\en If successful, a fillet surface is created with version >= fsv_Ver1. \n\~
\deprecated \ru Конструктор устарел, взамен использовать конструктор с переменным коэффициентом формы.
\en The constructor is deprecated. Instead, use a constructor with a variable shape coefficient. \~
\param[in] rad - \ru Радиус скругления.
\en Fillet radius. \~
\param[in] law - \ru Функция домножения радиуса rad, зависящая от параметра u поверхности.
\en Multiplication function of radius rad, depending on the parameter u of the surface. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности.
\en Support curve at parameters of the first surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности.
\en Support curve at parameters of the second surface. \~
\param[in] sgn1, sgn2 - \ru Ориентации опорных поверхностей. В случае true отступ выполняетя по нормали, в случае false - против нормали.
\en Orientations of the support surfaces. If true, the indentation is performed along the normal,
if false, it is performed against the normal.\~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
@@ -181,20 +181,19 @@ public:
/** \brief \ru Создать поверхность скругления по двум поверхностям по закону.
\en Create a fillet surface from two surfaces according to the law. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1. \n
\en If successful, a fillet surface is created with version >= fsv_Ver1. \n\~
\param[in] rad - \ru Радиус скругления.
\en Fillet radius. \~
\param[in] law - \ru Функция домножения радиуса rad, зависящая от параметра u поверхности.
\en Multiplication function of radius rad, depending on the parameter u of the surface. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности.
\en Support curve at parameters of the first surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности.
\en Support curve at parameters of the second surface. \~
\param[in] sgn1, sgn2 - \ru Ориентации опорных поверхностей. В случае true отступ выполняетя по нормали, в случае false - против нормали.
\en Orientations of the support surfaces. If true, the indentation is performed along the normal,
if false, it is performed against the normal.\~
\param[in] cn - \ru Функция коэффициента формы. Если функция не задана или значение коэффициента 0,то в качестве профиля используется "дуга окружности".
Значения от 0.05 до 0.95 соответствуют коническому сечению. Переменный коэффициент формы используется только для создания скругления граней.
\en A function of the shape coefficient. If the function is not specified or the coefficient value is 0, then the "circle arc" profile is used.
@@ -207,24 +206,72 @@ public:
static MbChannelSurface * CreateLawFillet( double rad, MbFunction & law, MbSurfaceCurve & curv1, bool sgn1,
MbSurfaceCurve & curv2, bool sgn2, MbFunction * cn, VERSION vers );
/** \brief \ru Создать поверхность скругления по двум поверхностям по закону.
\en Create a fillet surface from two surfaces according to the law. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.\n
\en If successful, a fillet surface is created with version >= fsv_Ver1. \n\~
\param[in] curv1, curv2 - \ru Опорные кривые в параметрах поверхности
\en Support curves at parameters of surfaces \~
\param[in] fRad1, fRad2 - \ru Функции радиуса, зависящая от параметра u поверхности.
\en Radii function, depending on the parameter u of the surface. \~
\param[in] sgn1, sgn2 - \ru Ориентации опорных поверхностей. В случае true отступ выполняетя по нормали, в случае false - против нормали.
\en Orientations of the support surfaces. If true, the indentation is performed along the normal,
if false, it is performed against the normal.\~
\param[in] cn - \ru Функция коэффициента формы. Если функция не задана или значение коэффициента 0,то в качестве профиля используется "дуга окружности".
Значения от 0.05 до 0.95 соответствуют коническому сечению. Переменный коэффициент формы используется только для создания скругления граней.
\en A function of the shape coefficient. If the function is not specified or the coefficient value is 0, then the "circle arc" profile is used.
Values between 0.05 and 0.95 represent to the conic section. A variable shape coefficient is only used to create faces fillets. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbChannelSurface * CreateLawFillet( MbSurfaceCurve & curv1, bool sgn1, MbFunction & fRad1,
MbSurfaceCurve & curv2, bool sgn2, MbFunction & fRad2,
MbFunction * cn, VERSION vers );
/** \brief \ru Создать поверхность скругления по двум поверхностям с переменной хордой.
\en Create a fillet surface by two surfaces with a constant chord. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.\n
\en If successful, a fillet surface is created with version >= fsv_Ver1. \n\~
\param[in] curv1, curv2 - \ru Опорные кривые в параметрах поверхности.
\en Support curves at parameters of surfaces. \~
\param[in] sgn1, sgn2 - \ru Ориентации опорных поверхностей. В случае true отступ выполняетя по нормали, в случае false - против нормали.
\en Orientations of the support surfaces. If true, the indentation is performed along the normal,
if false, it is performed against the normal.\~
\param[in] h - \ru Функция величины хорды.
\en Chord function. \~
\param[in] cn - \ru Функция коэффициента формы. Если функция не задана или значение коэффициента 0,то в качестве профиля используется "дуга окружности".
Значения от 0.05 до 0.95 соответствуют коническому сечению. Переменный коэффициент формы используется только для создания скругления граней.
\en A function of the shape coefficient. If the function is not specified or the coefficient value is 0, then the "circle arc" profile is used.
Values between 0.05 and 0.95 represent to the conic section. A variable shape coefficient is only used to create faces fillets. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbChannelSurface * CreateChordLawFillet( MbSurfaceCurve & curv1, bool sgn1,
MbSurfaceCurve & curv2, bool sgn2,
MbFunction & hFunc, MbFunction * cn, VERSION vers );
/** \brief \ru Создать поверхность скругления по поверхности и кромке с радиусом по закону
\en Create fillet surface by support surface and by kerb-curve with a radius that varies according to the law. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.\n
\en If successful, a fillet surface is created with version >= fsv_Ver1.\n\~
\param[in] rad - \ru Радиус скругления.
\en Fillet radius. \~
\param[in] law - \ru Функция домножения радиуса rad, зависящая от параметра u поверхности.
\en Multiplication function of radius rad, depending on the parameter u of the surface. \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности
\en Support curve at parameters of the first surface \~
\param[in] sgn1 - \ru Ориентация первой опорной поверхности.
\en The orientation of the first support surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности
\en Support curve at parameters of the second surface \~
\param[in] sgn2 - \ru Ориентация второй опорной поверхности.
\en The orientation of the second support surface. \~
\param[in] byFirst - \ru true - кривая curve2 является кромкой, false - кривая curve1 является кромкой
\en True - curve2 curve is edge, false - curve1 curve is edge \~
\param[in] curv1 - \ru Опорная кривая в параметрах первой поверхности.
\en Support curve at parameters of the first surface. \~
\param[in] curv2 - \ru Опорная кривая в параметрах второй поверхности.
\en Support curve at parameters of the second surface. \~
\param[in] sgn1, sgn2 - \ru Ориентации опорных поверхностей. В случае true отступ выполняетя по нормали, в случае false - против нормали.
\en Orientations of the support surfaces. If true, the indentation is performed along the normal,
if false, it is performed against the normal.\~
\param[in] byFirst - \ru true - кривая curve2 является кромкой, false - кривая curve1 является кромкой.
\en True - curve2 curve is edge, false - curve1 curve is edge. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
@@ -237,6 +284,8 @@ protected:
/// \ru Конструктор для наследников обычной поверхности скругления. \en Constructor for inheritors of ordinary fillet surface.
MbChannelSurface( MbSurfaceCurve & curv1, double d1,
MbSurfaceCurve & curv2, double d2, MbFunction * cn, MbFunction & func );
MbChannelSurface( MbSurfaceCurve & curv1, double d1, MbFunction & func1,
MbSurfaceCurve & curv2, double d2, MbFunction & func2, MbFunction * cn );
MbChannelSurface( MbSurfaceCurve & curv1, double d1,
MbSurfaceCurve & curv2, double d2, MbFunction & func, bool byFirst );
MbChannelSurface( const MbChannelSurface &, MbRegDuplicate * );
@@ -320,19 +369,21 @@ public:
\en True - if pole has been found \~
*/
bool CheckPole( double & u, bool bModify = true );
/// \ru Получить функцию изменения радиуса. \en Get a function of radius changing.
const MbFunction & GetFunction() const { return *function; }
/// \ru Получить функцию изменения радиуса. \en Get a function of radius changing.
MbFunction & SetFunction() { return *function; }
/// \ru Заменить функцию изменения радиуса. \en Set a function of radius changing.
void SetFunction( MbFunction & funcNew ); // \ru (новая функция должна быть корректна) \en (new function must be correct)
/// \ru Построить функцию изменения радиуса от параметра u1 до параметра u2. \en Construct a function for changing the radius from parameter u1 to parameter u2.
MbFunction * MakeFunction( double u1, double u2 ) const;
/// \ru Получить функцию изменения радиуса (0 - первая кривая, иначе - вторая кривая) . \en Get a function of radius changing (0 - first curve, otherwise - second curve).
const MbFunction & GetFunction( size_t ind ) const { return ind == 0 ? *function1 : *function2; }
/// \ru Получить функцию изменения радиуса (0 - первая кривая, иначе - вторая кривая) . \en Get a function of radius changing (0 - first curve, otherwise - second curve).
MbFunction & SetFunction( size_t ind ) { return ind == 0 ? *function1 : *function2; }
/// \ru Заменить функцию изменения радиуса (0 - первая кривая, иначе - вторая кривая) . \en Set a function of radius changing (0 - first curve, otherwise - second curve).
void SetFunction( size_t ind, MbFunction & funcNew ); // \ru (новая функция должна быть корректна) \en (new function must be correct)
/// \ru Построить функцию изменения радиуса от параметра u1 до параметра u2 (0 - первая кривая, иначе - вторая кривая).
/// \en Construct a function for changing the radius from parameter u1 to parameter u2 (0 - first curve, otherwise - second curve).
MbFunction * MakeFunction( size_t ind, double u1, double u2 ) const;
/** \} */
private:
// \ru Дать коэффициент для радиуса \en Get coefficient for radius
double FunctionValue( double u ) const override;
// \ru Дать коэффициент для радиуса (0 - первая кривая, иначе - вторая кривая).
// \en Get coefficient for radius (0 - first curve, otherwise - second curve).
double FunctionValue( size_t ind, double u ) const override;
void CheckPole(); // \ru Проверить полюса \en Check poles
// \ru Добавить точку в опорные кривые границы поверхности с постоянной хордой. \en Add a point to the support curves of the boundary of surface with constant chord. \~
bool InsertForSpan( double & t1, const MbCartPoint & p1, bool add1,
@@ -363,7 +414,7 @@ MbSmoothSurface * CreateKerbChannelSurface( const MbSurface & surface1, SArray<M
MbeSmoothForm form, double distance1, double distance2, double conic,
const MbSurfaceIntersectionCurve & guideCurve, SArray<double> & params,
SArray<double> & dFactor,
bool byFirstSurface, bool even );
bool byFirstSurface, bool even, VERSION version );
#endif // __SURF_CHANNEL_SURFACE_H
+4 -3
View File
@@ -71,7 +71,8 @@ public:
ft_LawFillet = 3, ///< \ru Скругление двух поверхностей с радиусом, меняющимся по закону. \en Fillet of two surfaces with a radius that varies according to the law.
ft_KerbFillet = 4, ///< \ru Скругление поверхности и кромки с постоянным радиусом. \en Fillet surface and kerb-curve with constant radius.
ft_KerbLawFillet = 5, ///< \ru Скругление поверхности и кромки с радиусом по закону. \en Fillet surface and kerb-curve with a radius that varies according to the law.
ft_KerbTouchingFillet = 6 ///< \ru Скругление двух поверхностей по кромке одной из них. \en Fillet of two surfaces with the specified kerb-curve of touching
ft_KerbTouchingFillet = 6, ///< \ru Скругление двух поверхностей по кромке одной из них. \en Fillet of two surfaces with the specified kerb-curve of touching
ft_ChordLawFillet = 7 ///< \ru Скругление двух поверхностей с переменной хордой. \en Fillet of two surfaces with a constant chord.
};
protected:
@@ -825,8 +826,8 @@ protected:
protected:
// \ru Вычисление точки \en Calculation of a point
// void CalculateSurface( double u ) const;
// \ru Дать коэффициент для радиуса \en Get coefficient for radius
virtual double FunctionValue( double u ) const;
// \ru Дать коэффициент для радиуса (0 - первая кривая, иначе - вторая кривая) \en Get coefficient for radius (0 - first curve, otherwise - second curve)
virtual double FunctionValue( size_t ind, double u ) const;
void CalculateData ( double & u, double & v,
MbCartPoint3D & uPoint0, MbCartPoint3D & uPoint1, MbCartPoint3D & uPoint2, // \ru Точки на кривых curve0, curve1, curve2. \en Points on curve0, curve1, curve2.
MbVector3D * uFirst0, MbVector3D * uFirst1, MbVector3D * uFirst2, // \ru Производные кривых curve0, curve1, curve2. \en Derivatives of curve0, curve1, curve2.
+1
View File
@@ -254,6 +254,7 @@ inline SPtr<T> make_sptr( Args && ... args )
{
return SPtr<T>( new T(std::forward<Args>( args )...) );
}
} // namespace c3d
#endif // __TEMPL_SPTR_H
+23 -2
View File
@@ -411,6 +411,24 @@ public :
/// \ru Замена кривой ребра на кривую crv. \en Replacement of a curve by the curve 'crv'.
virtual bool ChangeCurve( MbCurve3D & crv );
/** \brief \ru Объединение двух стыкующихся ребер.
\en Merging of two connected edges. \~
\details \ru Объединение двух стыкующихся ребер. \n
\en Merging of two connected edges. \n \~
\param[in,out] edge2 - \ru Присоединяемое ребро.
\en Merging edge. \~
\param[in] begin1 - \ru К началу (true) или к концу (false) ребра this стыкуется присоединяемое ребро.
\en This edge is joined by the beginning (true) or by the ending (false). \~
\param[in] begin2 - \ru Началом (true) или концом (false) стыкуется присоединяемое ребро к ребру this.
\en The edge2 is joined by the beginning (true) or by the ending (false). \~
\param[in] snMaker - \ru Именователь с версией операции.
\en Names maker with a version of operation. \~
\param[in] precision - \ru Точность стыковки ребер.
\en Accuracy of edges joining. \~
\return \ru Возвращает поглощенное ребро edge2, которое можно удалять.
\en Returns absorbed edge (edge2), which can be removed. \~
*/
virtual MbEdge * MergeEdges( MbEdge & edge2, bool begin1, bool begin2, const MbSNameMaker & snMaker, double precision );
/// \ru Выдать кривую, по которой проходит ребро. \en Get a curve where an edge passes.
const MbCurve3D & GetCurve() const { return *curve; }
@@ -909,7 +927,8 @@ public :
\en Returns true if the edge was prolonged, otherwise returns false. \~
*/
bool ProlongEdge ( double & t, bool begin, double deviateAngle, const VERSION version, double eps = Math::paramNear );
// \ru Объединение двух гладко-стыкующихся ребер. \en Union of two smoothly joining edges.
MbEdge * MergeEdges( MbEdge & edge2, bool begin1, bool begin2, const MbSNameMaker & snMaker, double precision ) override;
/** \brief \ru Объединение двух стыкующихся ребер.
\en Merging of two connected edges. \~
\details \ru Объединение двух стыкующихся ребер: \n
@@ -926,11 +945,13 @@ public :
\en The edge2 is joined by the beginning (true) or by the ending (false). \~
\param[in] snMaker - \ru Именователь с версией операции.
\en Names maker with a version of operation. \~
\param[in] precision - \ru Точность стыковки ребер.
\en Accuracy of edges joining. \~
\return \ru Возвращает поглощенное ребро edge2, которое можно удалять.
\en Returns absorbed edge (edge2), which can be removed. \~
*/
MbCurveEdge * MergeEdges( MbCurveEdge & edge2, bool begin1, bool begin2,
const MbSNameMaker & snMaker, double tolerance = Math::paramNear );
const MbSNameMaker & snMaker, double precision = Math::paramNear );
/// \ru Собрать все ребра, стыкующиеся с заданным ребром в его начале begin==true (конце begin==false). \en Collect all edges which are connected with the given edge at its start vertex (begin==true) or at its end vertex (begin==false).
void GetConnectedEdges( bool begin, RPArray<MbCurveEdge> & edges, SArray<bool> & orients ) const;
+102 -4
View File
@@ -20,6 +20,7 @@
#include <vector>
class MbWireFrame;
class MbCreatePartsParams;
class MbSpaceContourCreationParams;
class MbWireFramePoint;
template <class Item>
@@ -278,7 +279,23 @@ public :
\en Returns true, if the edge was cut. \~
*/
bool CuttingEdge( MbEdge *& targetEdge, SArray<double> & params, bool beginSafe, double eps, RPArray<MbEdge> & edges );
/** \brief \ru Слить по возможности ребра, стыкующиеся с заданной точностью.
\en If possible, merge the edges, that connecting with a given precision. \~
\details \ru Если ребра гладко стыкуются с заданной толерантностью и под ними лежат кривые отдного типа, то кривые под ребрами массива connectedEdges сливаются
с кривой, лежащей под первым ребром из массива connectedEdges. При этом первое ребро изменяется c сохранением направления.
Если массив пустой, то по возможности сливаются все гладко стыкующиеся с заданной точностью ребра проволочного каркаса.
\en If the edges are smoothly connected with a given precision and there are curves of the same type under them, then the curves under edges from
the 'connectedEdges' array merges with a curve under the first edge from 'connectedEdges'. In this case, the first edge changes while maintaining the direction.
If the array is empty, then if possible all smmoothly connected wire frame edges with the specified accuracy are merged.\~
\param[in] connectedEdges - \ru Массив сливаемых ребер.
\en Array of merged edges \~
\param[in] precision - \ru Точность стыковки ребер.
\en Edges connection accuracy. \~
\return \ru Возвращает true, если какие-либо ребра слиты.
\en Returns true, if any edges are merged. \~
*/
template <class EdgesVector>
MATH_FUNC ( bool ) MergeEdges(EdgesVector & connectedEdges, double precision );
/// \ru Замкнут ли каркас? \en Is frame closed?
bool IsClosed();
/// \ru Является ли каркас многосвязным? \en Is frame multiply connected?
@@ -307,25 +324,59 @@ public :
void GetCurves( CurvesVector & ) const;
/// \ru Разложен ли каркас на связные части? \en Is a frame split into connected parts?
bool IsNormalizeWire() const { return normal; }
/// \ru Переставить кривые и переориентировать ребра, создав связные цепочки с общими вершинами. \en Perform curves reposition and edges reorientation by creating connected chains with common vertices.
DEPRECATE_DECLARE bool NormalizeWire( double precision = METRIC_REGION );
DEPRECATE_DECLARE_REPLACE( NormalizeWire with MbCreatePartsParams )
bool NormalizeWire( double precision = METRIC_REGION );
/// \ru Переставить кривые и переориентировать ребра, создав связные цепочки с общими вершинами (совпадающими геометрически с точностью precision ). \en Perform curves reposition and edges reorientation by creating connected chains with common vertices (coincident geometrically with accuracy precision).
DEPRECATE_DECLARE_REPLACE( NormalizeWire with MbCreatePartsParam )
bool NormalizeWire( double precision, VERSION version = Math::DefaultMathVersion() );
/** \brief \ru Переставить кривые и переориентировать ребра, создав связные цепочки с общими вершинами.
\en Perform curves reposition and edges reorientation by creating connected chains with common vertices. \~
\details \ru Переставить кривые и переориентировать ребра, создав связные цепочки с общими вершинами
(совпадающими геометрически с точностью precision ). \n
\en Perform curves reposition and edges reorientation by creating connected chains with common vertices
(coincident geometrically with accuracy precision). \~
\param[in] params - \ru Параметры операции.
\en Operation params. \~
\result \ru true, если операция выполнена успешно.
\en true if the operation was successful. \~
*/
bool NormalizeWire( const MbCreatePartsParams & params );
/** \brief \ru Отделение частей каркаса.
\en Detachment of frame parts \~
\details \ru Отделение частей каркаса с сохранением исходного объекта.
Если исходный каркас распадается на части, то все части складываются в parts. \n
\en Detachment of frame parts with saving an initial object.
If the initial frame is decomposed, all the parts are put into array 'parts'. \n \~
\param[in] version - \ru Версия.
\en Version. \~
\param[out] parts - \ru Каркасы, полученные из frame.
\en Frames obtained from 'frame'. \~
\param[in] version - \ru Версия.
\en Version. \~
\result \ru Возвращает количество каркасов в parts.
\en Returns a number of frames in 'parts'. \~
*/
DEPRECATE_DECLARE_REPLACE( CreateParts with MbCreatePartsParams )
size_t CreateParts( RPArray<MbWireFrame> & parts, VERSION version = Math::DefaultMathVersion() );
/** \brief \ru Отделение частей каркаса.
\en Detachment of frame parts \~
\details \ru Отделение частей каркаса с сохранением исходного объекта.
Если исходный каркас распадается на части, то все части складываются в parts. \n
\en Detachment of frame parts with saving an initial object.
If the initial frame is decomposed, all the parts are put into array 'parts'. \n \~
\param[out] parts - \ru Каркасы, полученные из frame. Возможные типы контейнеров - RPArray<MbWireFrame>, PArray<MbWireFrame>, WireFramesSPtrVector.
\en Frames obtained from 'frame'. Possible container types are RPArray<MbWireFrame>, PArray<MbWireFrame>, WireFramesSPtrVector. \~
\param[in] params - \ru Параметры операции.
\en Operation params. \~
\result \ru Возвращает количество каркасов в parts.
\en Returns a number of frames in 'parts'. \~
*/
template <class WFramesVector>
MATH_FUNC( size_t ) CreateParts( const MbCreatePartsParams & params, WFramesVector & parts );
/** \brief \ru Создать связные контуры с учётом толерантностей в вершинах рёбер каркаса.
\en Create connected contours according to vertex tolerances of the wire frame edges. \~
\details \ru Создать связные контуры с учётом толерантностей в вершинах рёбер каркаса
@@ -699,6 +750,53 @@ MATH_FUNC( bool ) CreateWireFrame( const c3d::SpaceCurvesSPtrVector & curves,
const c3d::CreatorSPtr & creator = nullptr );
//------------------------------------------------------------------------------
/** \brief \ru Параметры отделения частей проволочного каркаса.
\en Parameters for separating parts of the wire frame. \~
\details \ru Параметры отделения частей проволочного каркаса. \n
\en Parameters for separating parts of the wire frame. \n \~
\ingroup Data_Structures
*/
// ---
class MATH_CLASS MbCreatePartsParams : public MbPrecision
{
private:
/**
\ru Флаг обработки совпадения ребер.
Рекомендуется задавать "true", если в каркасе возможны совпадения ребер.
Рекомендуется задавать "false", если совпадения ребер проверены заранее.
Если _checkSameEdges == true, совпадающие ребра будут лежать в разных частях каркаса.
\en Edge match processing flag.
It is recommended to set "true" if edge matches are possible in the wire frame.
It is recommended to set "false" if edge matches are checked in advance.
If _checkSameEdges == true, matching edges will lie in different parts of the wire frame. \~
*/
bool _checkSameEdges;
VERSION _version; ///< \ru Версия операции. \en Operation version.
public:
/// \ru Конструктор по умолчанию. \en Default constructor. \~
MbCreatePartsParams()
: MbPrecision( METRIC_REGION, ANGLE_REGION )
, _checkSameEdges( true )
, _version( Math::DefaultMathVersion() ) {}
/// \ru Конструктор. \en Constructor. \~
explicit MbCreatePartsParams( bool checkSameEdges, double precision, VERSION version )
: MbPrecision( precision, ANGLE_REGION )
, _checkSameEdges( checkSameEdges )
, _version( version ) {}
/// \ru Требуется ли проверять совпадение ребер. \en Is it necessary to check for edge coincidence?
bool NeedCheckSameEdges() const { return _checkSameEdges; }
/// \ru Версия операции. \en Operation version.
VERSION GetVersion() const { return _version; }
OBVIOUS_PRIVATE_COPY( MbCreatePartsParams )
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры построения контура.
\en The parameters of creating a contour. \~
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.