- C3d aggiornamento librerie ( 118020).
This commit is contained in:
SaraP
2024-12-31 08:42:54 +01:00
parent d6eac07eea
commit 6872a4d4f8
26 changed files with 1201 additions and 326 deletions
+4 -4
View File
@@ -1577,8 +1577,8 @@ MATH_FUNC (MbResultType) CreateContourChamfer( const MbContourChamferParams & pa
//-------------------------------------------------------------------------------
/** \brief \ru Построить развертку кривых и точек на плоскость.
\en Construct unwrapped curves and points. \~
\details \ru Построение развертки кривых и точек на плоскость. См. также #CurvesUnwrapping.\n
\en Construct unwrapped curves and points on a plane. Also check out #CurvesUnwrapping.\n \~
\details \ru Построение развертки кривых и точек на плоскость.\n
\en Construct unwrapped curves and points on a plane.\n \~
\param[in] params - \ru Параметры разворачивания.
\en Unwrapping parameters. \~
\param[out] result - \ru Результат разворачивания.
@@ -1595,8 +1595,8 @@ MATH_FUNC (MbResultType) UnwrapCurve( const MbCurvesWrappingParams & parameters
//-------------------------------------------------------------------------------
/** \brief \ru Выполнить операцию сворачивания кривых и точек на поверхность.
\en Perform the operation of wrapping curves and points on a surface. \~
\details \ru Выполнить операцию сворачивания кривых на поверхность. См. также #CurvesWrapping.\n
\en Perform the operation of wrapping curves on a surface. Also check out #CurvesWrapping.\n \~
\details \ru Выполнить операцию сворачивания кривых на поверхность.\n
\en Perform the operation of wrapping curves on a surface.\n \~
\param[in] params - \ru Параметры сворачивания.
\en Wrapping parameters. \~
\param[out] result - \ru Результат сворачивания.
+44
View File
@@ -27,6 +27,10 @@ class MbDrapeShellResults;
class MbRemeshParams;
class MbShellLinearizationParams;
class MbMergePolymeshParams;
class MbMeshSmoothingParams;
class MbPolyline3D;
class MbPolylinePolymeshProjectParams;
class MbPolylinePolymeshProjectResults;
//------------------------------------------------------------------------------
@@ -321,4 +325,44 @@ MATH_FUNC( MbResultType ) DrapeShell( const MbDrapeShellParams & params, MbDrape
\en Under development.\~
*/ // ---
MATH_FUNC( MbResultType ) MergePolymeshes( const MbPolymesh & meshFrom, const MbMergePolymeshParams & params, MbPolymesh & meshTo );
//------------------------------------------------------------------------------
/** \brief \ru Сгладить полигональный объект по набору входных параметров сглаживания.
\en Smooth a polygonal object using a set of input smoothing parameters. \~
\param[in] params - \ru Параметры сглаживания.
\en Smoothing parameters. \~
\param[in-out] mesh - \ru Полигональный объект.
\en A polygonal object. \~
\return \ru Код результата операции, rt_Success если объект успешно сглажен.
\en Returns the operation result code, rt_Success if the object is successfully smoothed. \n
\warning \ru В разработке.
\en Under development.\~
*/ // ---
MATH_FUNC( MbResultType ) SmoothPolymesh( const MbMeshSmoothingParams & params, MbPolymesh & mesh );
//------------------------------------------------------------------------------
/** \brief \ru Спроецировать полилинию на полигональный объект.
\en Project a polyline on a polygonal object. \~
\details \ru Спроецировать полилинию на полигональный объект.
Если на некотором участке полилиния проецируется внутрь фасета, он разделяется на несколько фасетов.
При этом создаются новые рёбра полигонального объекта.
\en Project a polyline on a polygonal object.
In case of projecting a polyline's fragment inside a facet, it splits into new ones, so new edges are created. \~
\param[in-out] mesh - \ru Полигональный объект.
\en A polygonal object being projected on. \~
\param[in] params - \ru Параметры проецирования полилинии на полигональный объект.
\en Parameters for projecting a polyline on a polymesh. \~
\param[out] results - \ru Результат проецирования полилинии на полигональный объект.
\en Result of projecting a polyline on a polymesh. \~
\return \ru Код результата операции, rt_Success, если проекция успешно построена.
\en Returns the operation result code, rt_Success if a polyline is successfully projected. \n
\warning \ru В разработке.
\en Under development.\~
*/ // ---
MATH_FUNC( MbResultType ) ProjectPolylineOnPolymesh( MbPolymesh & mesh, const MbPolylinePolymeshProjectParams & params, MbPolylinePolymeshProjectResults & results );
#endif // __ACTION_POLYMESH_H
+4 -4
View File
@@ -90,7 +90,7 @@ struct MATH_CLASS cdet_query
enum cback_res ///< Result code of the callback function
{
CBACK_VOID
, CBACK_SUFFICIENT ///< This code means that an app stops collision query for given pair of lumps.
, CBACK_SUFFICIENT ///< This code means that an app stops collision query for the given pair of geometric objects.
, CBACK_SKIP ///< Skip testing the given pair.
, CBACK_NEED ///< Enable testing the given pair.
, CBACK_BREAK ///< Break search of all collisions of the set.
@@ -112,9 +112,9 @@ struct MATH_CLASS cdet_query
struct geom_element ///< Structure representing a collision detection geometry.
{
cdet_app_item appItem;
const MbRefItem * refItem;
const MbMatrix3D * wMatrix;
cdet_app_item appItem; ///< Application pointer to a geometric object.
const MbRefItem * refItem; ///< Pointer to the collided face or grid.
const MbMatrix3D * wMatrix; ///< Matrix mapping the collided item to The world CS of the scene.
geom_element()
: appItem( nullptr )
, refItem( nullptr )
+7
View File
@@ -32,5 +32,12 @@ enum MbeConvResType {
cnv_UnsupportedVersion ///< \ru Неподдерживаемая версия формата. \en Unsupported format version.
};
//------------------------------------------------------------------------------
/** \brief \ru Получить строковое описание результата конвертирования.
\en Get string description of the result of converting operation.
\ingroup Data_Interface
*/
// ---
CONV_FUNC (std::string) MbeConvResTypeToString(MbeConvResType result);
#endif
+3 -3
View File
@@ -32,6 +32,9 @@ public:
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbWrapCurveCreator( const MbCurvesWrappingParams & params );
private:
MbWrapCurveCreator(); // \ru Не реализовано \en Not implemented
public:
virtual ~MbWrapCurveCreator() {};
@@ -55,11 +58,8 @@ public:
bool CreateWireFrame( MbWireFrame *&, MbeCopyMode, RPArray<MbSpaceItem> * items = nullptr ) override;
private:
MbWrapCurveCreator(); // \ru Не реализовано \en Not implemented
OBVIOUS_PRIVATE_COPY( MbWrapCurveCreator )
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbWrapCurveCreator )
}; // MbWrapCurveCreator
#endif // __CR_WRAP_CURVE_H
+9
View File
@@ -2235,6 +2235,15 @@ GCE_FUNC(GCE_result) GCE_Transform( GCE_system gSys, const MbMatrix & mat );
//---
GCE_FUNC(bool) GCE_SetJournal( GCE_system gSys, const char * fName );
//----------------------------------------------------------------------------------------
/** \brief \ru Выдать журнал записывающий вызовы Solver API, а также другие события, имеющие отношение к взаимодействием с солвером.
\en Get a logger that recording API calls, as well as other events related to interaction with the solver. \~
\note \ru Вызов используется пока только для тестовых целей. Может быть изменен или удален из API в следующих ревизиях.
\en The call is used for testing purposes only. It may be changed or removed in future revisions. \~
*/
//---
GCE_FUNC(GCE_journal) GCE_SubscribeJournal( GCE_system gSys, GCE_log_func logFunc, GCE_extra_param extParam );
//----------------------------------------------------------------------------------------
/**
\brief \ru Устаревшая функция. Вызов будет удален в одной из следующих версий.
+6 -1
View File
@@ -30,7 +30,7 @@ using GCE_geom_registered = void (*)( GCE_app_geom ag); ///< Application geom
using GCE_geom_unregistered = void (*)( GCE_app_geom ag);
using GCE_allow_zero_radius = bool (*)( GCE_app_geom ag); ///< \ru Разрешает окружность нулевого радиуса. \en Allow zero radius of a circle.
using GCE_allow_zero_length = bool (*)( GCE_app_geom ag); ///< \ru Разрешает участок кривой или отрезок нулевой длины. \en Allow zero length of a bounded curve or line segments.
using GCE_get_lseg_direction = GCE_vec2d (*)(GCE_app_geom ag); ///< \ru Функция, которая выдет направляющий вектор отрезка. \en Function that returns the direction of a line segment.
using GCE_get_lseg_direction = GCE_vec2d (*)(GCE_app_geom ag); ///< \ru Функция, которая выдает направляющий вектор отрезка. \en Function that returns the direction of a line segment.
using GCE_abort = bool (*)(); ///< Query to interrupt calculations
//----------------------------------------------------------------------------------------
@@ -90,6 +90,11 @@ GCE_FUNC(GCE_result) GCE_Register( GCE_system gSys, const GCE_callback_table & c
//---
GCE_FUNC(void) GCE_Bind( GCE_system, geom_item, GCE_app_geom );
//----------------------------------------------------------------------------------------
/// Disassociate an application geometry and a solver's descriptor.
//---
GCE_FUNC(void) GCE_Unbind( GCE_system, geom_item );
/**
\}
Constraints2D_API
+42
View File
@@ -747,6 +747,48 @@ struct GCT_CLASS GCT_diagnostic_pars
{}
};
//----------------------------------------------------------------------------------------
/** \brief \ru Дополнительные данные колбэка #GCE_log_func, интерпретируемые на стороне приложения.
\en Additional #GCE_log_func callback data interpreted on the application side. \~
\sa #GCE_log_func
*/
//---
struct GCE_CLASS GCE_extra_param
{
size_t funcId; // Integral identifier of a user-defined callback.
void * funcData; // Pointer to an application data structure.
GCE_extra_param() { funcId = 0, funcData = 0; }
};
//----------------------------------------------------------------------------------------
// It represents a journal that logs Solver API transactions.
//---
struct ItJrnLogger;
//----------------------------------------------------------------------------------------
// It represents a journal that logs Solver API transactions.
//---
typedef struct
{
const ItJrnLogger * logger; // Internal C3D Solver logger.
GCE_extra_param extra; // Callback extra data interpreted in the application side.
} GCE_journal;
//----------------------------------------------------------------------------------------
// Type of log string.
//---
typedef enum
{
GCE_LOG_JournalLine /// \ru Строка отчета о вызове Solver API. \en Reporting string about the Solver API call.
, GCE_LOG_Message /// \ru Строка передает некоторое информативное сообщение. \en The string notifies that something informative happend.
, GCE_LOG_Error /// \ru Строка извещает об ошибочной ситуации. \en Error notification.
} GCE_log_type;
//----------------------------------------------------------------------------------------
// Callback function for logging messages from the solver.
//---
typedef void ( *GCE_log_func )( GCE_journal, GCE_log_type logType, const char* recStr );
/**
\}
Constraints2D_API
+1 -1
View File
@@ -1240,7 +1240,7 @@ struct GCT_diagnostic_pars;
It's used for testing purposes only.
*/
//---
GCM_FUNC(const GCT_diagnostic_pars) GCM_DiagnosticPars( GCM_system gSys );
GCM_FUNC(GCT_diagnostic_pars) GCM_DiagnosticPars( GCM_system gSys );
//----------------------------------------------------------------------------------------
// Deprecated (2021). Use GCM_GeometryStatus to query about GCM_G_STATUS_Frozen.
+11
View File
@@ -170,6 +170,12 @@ struct MATH_CLASS ActiveFacetsBegEndPair
*/
struct MATH_CLASS EdgeConstIterator
{
using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = MbHalfedgeEdge;
using pointer = MbHalfedgeEdge *;
using reference = MbHalfedgeEdge &;
const MbHalfedge & _topo; //< \ru Ссылка на топологию. \en Topology reference.
bool _bFirst = true; //< \ru Признак того, что не нужно проверять окончание итерации. \en If true there is no need to check the end of the iteration.
size_t _edge = SYS_MAX_T; //< \ru Индекс текущего ребра. \en An actual edge index.
@@ -236,10 +242,15 @@ struct MATH_CLASS EdgesAroundFacetBegEndPair
*/
struct MATH_CLASS VertexFacetConstIterator : EdgeFacetConstIterator
{
using value_type = MbHalfedgeEdge;
using pointer = MbHalfedgeEdge *;
using reference = MbHalfedgeEdge &;
/// \ru Конструктор. \en Constructor.
VertexFacetConstIterator( const MbHalfedge & topo, size_t iF, bool begin = true ) noexcept;
/// \ru Доступ к данным. \en Data access.
const MbHalfedgeVertex & operator*() const noexcept;
const MbHalfedgeVertex * operator->() const noexcept;
};
+121
View File
@@ -0,0 +1,121 @@
////////////////////////////////////////////////////////////////////////////////
/**
\file
\brief Вспомогательный интерфейс для полигональной топологии.
*/
////////////////////////////////////////////////////////////////////////////////
#ifndef __MESH_PROVIDER_H
#define __MESH_PROVIDER_H
#include <mb_cart_point3d.h>
class MbAttributeContainer;
class MbPolymeshTopo;
class MbPolymesh;
class MbMesh;
//------------------------------------------------------------------------------
/** \brief \ru Абстрактный контейнер данных полигонального объекта.
\en An abstract container for polygonal object data. \~
\details \ru Абстрактный контейнер данных полигонального объекта.
\en An abstract container for polygonal object data. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS IMeshProvider
{
protected:
/// \ru Конструктор. \en Constructor.
IMeshProvider() = default;
public:
/// \ru Деструктор. \en Destructor.
virtual ~IMeshProvider() = default;
/** \brief \ru Создать экземпляр класса на основе MbMesh.
\en Create an object by MbMesh. \~
\param[in] mesh - \ru Полигональный геометрический объект.
\en A polygonal geometric object. \~
\return \ru Возвращает указатель на созданный объект.
\en Returns pointer to created object. \~
*/
static IMeshProvider * Create( const MbMesh & mesh );
/// \ru Валидны ли данные. \en Returns true if the object is ready to be used.
virtual bool IsReady() const = 0;
/// \ru Получить количество точек \en Get the number of points.
virtual size_t GetPointsCount() const = 0;
/// \ru Получить количество нормалей \en Get the number of normals.
virtual size_t GetNormalsCount() const = 0;
/// \ru Получить точку с индексом index \en Get the point with given index.
virtual void GetPoint( size_t index, MbCartPoint3D & point ) const = 0;
/// \ru Получить нормаль с индексом index \en Get the normal with given index.
virtual void GetNormal( size_t index, MbVector3D & normal ) const = 0;
/// \ru Получить количество вершин \en Get the number of normals.
virtual size_t GetVerticesCount() const { return GetPointsCount(); }
/// \ru Получить количество граней \en Get the number of facets.
virtual size_t GetFacetsCount() const = 0;
/// \ru Получить индекс точки для вершины с индексом index \en Get point index for the vertex with the given index.
virtual size_t GetVertexPointIndex( size_t index ) const = 0;
/// \ru Получить количество вершин на грани с индексом index \en Get the number of vertices for the face with the given index.
virtual size_t GetFacetVerticesCount( size_t index ) const = 0;
/// \ru Получить индекс для вершины с порядковым номером number на грани с индексом index. \en Get the vertex index for the vertex on the facet with the given index with the given position number.
virtual size_t GetFacetVertexIndex( size_t index, size_t number ) const = 0;
/// \ru Получить флаг наличия нормалей граней. \en Returns true if facets normals exist.
virtual bool HasFacetNormals() const { return false; }
/// \ru Получить индекс нормали для грани с индексом index \en Get normal index for the facet with the given index.
virtual size_t GetFacetNormalIndex( size_t index ) const { return index; }
/// \ru Получить флаг наличия нормалей вершин граней \en Returns true if vertices normals exist.
virtual bool HasFacetVertexNormals() const { return false; }
/// \ru Получить индекс нормали для вершины с порядковым номером number на грани с индексом index. \en Get the vertex normal index for the vertex on the facet with the given index with the given position number.
virtual size_t GetFacetVertexNormalIndex( size_t index, size_t number ) const = 0;
/// \ru Получить количество групп граней \en Get the number of facet groups.
virtual size_t GetFacetGroupsCount() const { return 1; }
/// \ru Получить индекс группы для грани с индексом index. \en Get the facet group index for the facet with the given index.
virtual size_t GetFacetGroup( size_t /*index*/ ) const { return 0; }
/// \ru Получить флаг наличия атрибутов групп граней. \en Returns true if facets groups attributes exist.
virtual bool HasFacetGroupAttributes() const { return false; }
/// \ru Получить атрибуты для группы граней с индексом index \en Get facets group attributes.
virtual void GetFacetGroupAttributes( size_t /*index*/, std::unique_ptr<MbAttributeContainer> & /*cont*/ ) const {}
/** \brief \ru Установить атрибуты топологии.
\en Set mesh topology attributes. \~
\details \ru Предполагается, что объект polymesh содержит аттрибут маппинга от ребер сетки к порядковому номеру вершины на грани MbHalfedgeAttrSizetEdge
и атрибут для пометок перевернутых в процессе алгоритма фасетов MbHalfedgeAttrBoolFacet.
Среди всех атрибутов данная функция устанавливает только атрибуты нормалей вида MbHalfedgeAttrNormalsVertex.
Для установки других атрибутов следует создать наследника этого класса.
\en It's assumed that the polymesh object contains MbHalfedgeAttrSizetEdge attribute with edge mapping to the vertex facet position number
and MbHalfedgeAttrBoolFacet attribute with bool marks if facets were inverted during topology creation.
Among all attributes this function sets up only normals through MbHalfedgeAttrNormalsVertex attribute.
To add more attributes an inherited class should be created.
\param[in] bNormalsAveraging - \ru Флаг усреднения нормалей по веерам объединенных вершин.
\en A flag for normal vectors averaging around merged vertices fans. \~
\param[in,out] polymesh - \ru Полигональный геометрический объект.
\en A polygonal geometric object. \~
*/
virtual void SetMeshAttributes( bool bNormalsAveraging, MbPolymeshTopo & polymesh ) const;
/** \brief \ru Установить атрибуты сегментации.
\en Set attributes mesh segmentation attributes. \~
\details \ru Данная функция сохраняет аттрибуты C3D оригинальных групп фасетов.
Для установки других атрибутов следует создать наследника этого класса.
\en This function saves original C3D attributes from original facet groups.
To add more attributes an inherited class should be created.
*/
virtual void SetSegmAttributes( MbPolymeshTopo & polymesh ) const;
/** \brief \ru Установить атрибуты полигонального объекта.
\en Set the polygonal object attributes. \~
*/
virtual void SetPolymeshAttributes( MbPolymesh & /*polymesh*/ ) const {}
protected:
/** \brief \ru Установить нормали сетки без усреднения в вершинах.
\en Set mesh normal vectors without averaging. \~
*/
void InitFacetVertexNormals( MbPolymeshTopo & polymesh ) const;
/** \brief \ru Установить нормали сетки с усреднением в вершинах.
\en Set mesh normal vectors with averaging. \~
*/
void InitFacetVertexNormalsWithAveraging( MbPolymeshTopo & polymesh ) const;
};
#endif // __MESH_PROVIDER_H
File diff suppressed because it is too large Load Diff
+27 -10
View File
@@ -304,28 +304,45 @@ public:
\ingroup Polygonal_Objects
*/
// ---
class MATH_CLASS MbRepairInconsistentMeshParams
class MATH_CLASS MbRepairInconsistentMeshParams
{
private:
/// \ru Ориентировать нормали вовне, если это возможно. \en Orient normals outward if possible.\~
bool _orientOutward;
bool _orientOutward;
/// \ru Точность объединения вершин (не используется, если отрицательная). \en A tolerance for vertices merging (not used if negative).\~
double _tolerance;
/// \ru Двуграный угол для расчета нормалей (не используется, если отрицательный). \en A dihedral angle for normal vectors calculation (not used if negative).\~
double _angleSharp;
/// \ru Флаг усреднения нормалей по веерам объединенных вершин. \en A flag for normal vectors averaging around merged vertices fans.\~
bool _bNormalAveraging;
public:
/// \ru Конструктор по-умолчанию. \en Default constructor.\~
MbRepairInconsistentMeshParams()
: _orientOutward( false )
{}
/// \ru Конструктор. \en Constructor. \~
MbRepairInconsistentMeshParams( bool orientOutward )
: _orientOutward( orientOutward )
: _orientOutward ( false )
, _tolerance ( METRIC_EPSILON )
, _angleSharp ( -1. )
, _bNormalAveraging( true )
{}
/// \ru Конструктор. \en Constructor. \~;
MbRepairInconsistentMeshParams( bool orientOutward );
/// \ru Конструктор. \en Constructor. \~;
MbRepairInconsistentMeshParams( double tolerance, bool orientOutward, double sharpAngle, bool normalAveraging );
/// \ru Деструктор. \en Destructor. \~
~MbRepairInconsistentMeshParams() {}
/// \ru Переключатель между абсолютной и относительной точностью. \en Switch between absolute and relative accuracy. \~
void SetOrientOutward( bool orient ) { _orientOutward = orient; }
/// \ru Ориентировать ли нормали вовне \en Whether the accuracy is set to absolute or relative. \~
bool IsOrientOutward() const { return _orientOutward; }
void SetOrientOutward( bool orient ) { _orientOutward = orient; }
/// \ru Ориентировать ли нормали вовне. \en Whether the accuracy is set to absolute or relative. \~
bool IsOrientOutward() const { return _orientOutward; }
/// \ru Установить точность. \en Set tolerance. \~
void SetTolerance( double tolerance ) { _tolerance = tolerance; }
/// \ru Получить точность. \en Get tolerance. \~
double GetTolerance() const { return _tolerance; }
/// \ru Получить угол. \en Get angle. \~
double GetSharpAngle() const { return _angleSharp; }
/// \ru Усреднять ли нормали. \en Whether normal vectors is to be averaged. \~
bool NeedNormalsAveraging() const { return _bNormalAveraging; }
OBVIOUS_PRIVATE_COPY( MbRepairInconsistentMeshParams );
};
+167
View File
@@ -22,6 +22,7 @@ class MbFaceShell;
class MbHalfedgeAttrSizetEdge;
class MbHalfedgeAttrDoubleEdge;
class MbHalfedgeAttrBoolVertex;
class MbPolyline3D;
//------------------------------------------------------------------------------
/** \brief \ru Параметры ремешинга.
@@ -476,4 +477,170 @@ public:
OBVIOUS_PRIVATE_COPY( MbMergePolymeshParams );
}; // MbMergePolymeshParams
//------------------------------------------------------------------------------
/** \brief \ru Параметры сглаживания полигональных объектов.
\en Parameters for the polymesh smoothing. \~
\details \ru Параметры сглаживания полигональных объектов. \n
Параметры содержат информацию о коэффициентах сглаживания, методе сглаживания, максимальном числе итераций,
наборе индексов фасетов для сглаживания.
\en Parameters for the polymesh smoothing. \n
The parameters contain information about the smoothing coefficients, the smoothing method, the maximum number of iterations
and the set of facet indices for smoothing. \~
\ingroup Polygonal_Objects
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbMeshSmoothingParams
{
public:
//------------------------------------------------------------------------------
/** \brief \ru Перечисление методов сглаживания.
\en Enumeration for smoothing methods. \~
*/
// ---
enum class MethodSmoothMesh
{
smoothTaubin, ///< \ru Метод Таубина. \en Taubin's method.
smoothLaplas ///< \ru Метод Лапласа. \en Laplace method.
};
private:
MethodSmoothMesh _method; ///< \ru Метод сглаживания сетки. \en Mesh smoothing method.
double _lambda; ///< \ru Коэффициент сжатия, используемый на нечетных шагах в "taubin smoothing". \en The compression factor used in odd steps in "taubin smoothing".
double _mu; ///< \ru Коэффициент расширения, используемый на четных шагах в "taubin smoothing". \en The expansion factor used in even steps in "taubin smoothing".
size_t _maxIter; ///< \ru Максимальное число итераций. \en Maximum iteration number.
bool _bFixBorders; ///< \ru Сохранять границы. \en Save borders.
c3d::IndicesVector _facets; ///< \ru Индексы фасетов. Если набор фасетов пустой, то сглаживается вся сетка. \en Facet indices to smooth. If the facet set is empty, the entire mesh is smoothed.
c3d::IndicesVector _fixVertices; ///< \ru Индексы фиксированных вершин. \en Fixed vertex indices.
public:
/// \ru Конструктор. \en Constructor.
MbMeshSmoothingParams()
: _method ( MethodSmoothMesh::smoothTaubin )
, _lambda ( 0.33 )
, _mu ( -0.34 )
, _maxIter ( 100 )
, _bFixBorders ( true )
, _facets ( )
, _fixVertices ( )
{}
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbMeshSmoothingParams( MethodSmoothMesh method,
double lambda,
double mu,
size_t maxIter,
bool bFixBorders,
const c3d::IndicesVector & facets,
const c3d::IndicesVector & fixVertices )
: _method ( method )
, _lambda ( lambda )
, _mu ( mu )
, _maxIter ( maxIter )
, _bFixBorders ( bFixBorders )
, _facets ( facets )
, _fixVertices ( fixVertices )
{}
/// \ru Деструктор. \en Destructor.
~MbMeshSmoothingParams() {}
public:
// \ru Установить метод сглаживания. \en Set the smoothing method. \~
void SetMethod( MethodSmoothMesh method ) { _method = method; }
// \ru Установить коэффициент сжатия. \en Set the compression factor. \~
void SetLambda( double lambda ) { _lambda = lambda; }
// \ru Установить коэффициент расширения. \en Set the expansion factor. \~
void SetMu( double mu ) { _mu = mu; }
// \ru Установить максимальное число итераций. \en Set the maximum iteration number. \~
void SetMaxIter( size_t maxIter ) { _maxIter = maxIter; }
// \ru Установить флаг сохранения границ. \en Set the save borders flag. \~
void SetFixBorders( bool bFixBorders ) { _bFixBorders = bFixBorders; }
// \ru Установить набор индексов фасетов для сглаживания. \en Set facet indices to smooth. \~
void SetFacets( const c3d::IndicesVector & facets ) { _facets = facets; }
// \ru Установить набор фиксированных вершин. \en Set the fixed vertex indices. \~
void SetFixVertices( const c3d::IndicesVector & fixVertices ) { _fixVertices = fixVertices; }
// \ru Получить метод сглаживания. \en Get the the smoothing method. \~
MethodSmoothMesh GetMethod() const { return _method; }
// \ru Получить коэффициент сжатия. \en Get the the compression factor. \~
double GetLambda() const { return _lambda; }
// \ru Получить коэффициент расширения. \en Get the expansion factor. \~
double GetMu() const { return _mu; }
// \ru Получить максимальное число итераций. \en Get the maximum iteration number. \~
size_t GetMaxIter() const { return _maxIter; }
// \ru Получить флаг сохранения границ. \en Get the save borders flags. \~
bool GetFixBorders() const { return _bFixBorders; }
// \ru Получить набор индексов фасетов для сглаживания. \en Get facet indices to smooth. \~
const c3d::IndicesVector & GetFacets() const { return _facets; }
// \ru Получить набор фиксированных вершин. \en Get the fixed vertex indices. \~
const c3d::IndicesVector & GetFixVertices() const { return _fixVertices; }
OBVIOUS_PRIVATE_COPY( MbMeshSmoothingParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Параметры проецирования полилинии на полигональный объект.
\en Parameters for projecting a polyline on a polymesh. \~
\details \ru Параметры проецирования полилинии на полигональный объект. \n
Параметры содержат проецируемую полилинию.
\en Parameters for projecting a polyline on a polymesh. \n
Parameters contain a polyline to be projected. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbPolylinePolymeshProjectParams : public MbPrecision
{
private:
const MbPolyline3D & _polyline; ///< \ru Полилиния. \en Polyline. \~
public:
/// \ru Конструктор по параметрам. \en Constructor by parameters.
MbPolylinePolymeshProjectParams( const MbPolyline3D & polyline )
: MbPrecision( )
, _polyline ( polyline )
{}
/// \ru Деструктор. \en Destructor.
~MbPolylinePolymeshProjectParams() {}
public:
// \ru Получить полилинию. \en Get the polyline. \~
const MbPolyline3D & GetPolyline() const { return _polyline; }
OBVIOUS_PRIVATE_COPY( MbPolylinePolymeshProjectParams );
};
//------------------------------------------------------------------------------
/** \brief \ru Результаты проецирования полилинии на полигональный объект.
\en Results of projecting a polyline on a polymesh. \~
\details \ru Результаты проецирования полилинии на полигональный объект. \n
Результаты содержат массив цепочек пар рёбер вдоль проекции.
\en Results of projecting a polyline on a polymesh. \n
Results contain paths of edge pairs along the projection. \~
\warning \ru В разработке.
\en Under development. \~
*/
// ---
class MATH_CLASS MbPolylinePolymeshProjectResults
{
private:
std::vector<c3d::IndicesPairsVector> _paths; ///< \ru Цепочки пар рёбер. \en Paths of edge pairs. \~
public:
/// \ru Конструктор. \en Constructor.
MbPolylinePolymeshProjectResults() : _paths() {}
/// \ru Деструктор. \en Destructor.
~MbPolylinePolymeshProjectResults() {}
public:
// \ru Получить полилинию. \en Get the polyline. \~
const std::vector<c3d::IndicesPairsVector> & GetEdgePairPaths() const { return _paths; }
// \ru Получить полилинию. \en Get the polyline. \~
std::vector<c3d::IndicesPairsVector> & GetEdgePairPaths() { return _paths; }
OBVIOUS_PRIVATE_COPY( MbPolylinePolymeshProjectResults );
};
#endif // __OP_POLYMESH_PARAMETERS_H
+4
View File
@@ -14,6 +14,8 @@
class MbPolymeshTopo;
class MbFaceShell;
class IMeshProvider;
class MbRepairInconsistentMeshParams;
//------------------------------------------------------------------------------
/** \brief \ru Полигональный объект модели - представление топологии в виде halfedge объекта.
@@ -39,6 +41,8 @@ public:
explicit MbPolymesh();
/// \ru Конструктор по топологии. \en Constructor by topology.
explicit MbPolymesh( MbPolymeshTopo * pTopo );
/// \ru Конструктор. \en Constructor.
explicit MbPolymesh( const IMeshProvider & provider, const MbRepairInconsistentMeshParams & params );
/// \ru Деструктор. \en Destructor.
virtual ~MbPolymesh();
+18 -4
View File
@@ -13,10 +13,12 @@
#include <reference_item.h>
#include <halfedge.h>
class MbMesh;
class MbFaceShell;
class MbCube;
class MbAttributeContainer;
class MbMesh;
class MbFaceShell;
class MbCube;
class MbAttributeContainer;
class IMeshProvider;
class MbRepairInconsistentMeshParams;
//------------------------------------------------------------------------------
/** \brief \ru Представление топологии полигональной модели в виде halfedge.
@@ -74,8 +76,20 @@ public:
\en A polygonal geometric object. \~
\param[in] toleranceSew - \ru Метрическая погрешность совпадения точек.
\en Metric tolerance of points coincidence. \~.
\return \ru Возвращает указатель на созданный объект.
\en Returns pointer to created object. \~
*/
static MbPolymeshTopo * Create( const MbMesh & mesh, double toleranceSew );
/** \brief \ru Создать экземпляр класса на основе контейнера данных и параметров лечения.
\en Create an object by mesh provider and repairing parameters. \~
\param[in] provider - \ru Контейнер данных полигонального объекта.
\en A container for polygonal object data. \~
\param[in] params - \ru Параметры лечения.
\en Repairing parameters. \~.
\return \ru Возвращает указатель на созданный объект.
\en Returns pointer to created object. \~
*/
static MbPolymeshTopo * Create( const IMeshProvider & provider, const MbRepairInconsistentMeshParams & params );
/// \ru Деструктор. \en Destructor.
virtual ~MbPolymeshTopo() {}
+24
View File
@@ -195,6 +195,30 @@ public:
static MbChannelSurface * CreateKerbLawFillet( double rad, MbFunction & law, MbSurfaceCurve & curv1, bool sgn1,
MbSurfaceCurve & curv2, bool sgn2, bool byFirst, VERSION vers );
/// \ru Создать поверхность скругления по поверхности и кромке с касанием
/// \en
/** \brief \ru Создать поверхность скругления по двум поверхностям с указанием кромки касания
\en Create a fillet surface by two support surfaces, specifying the kerb-curve of touching \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
\en If successful, a fillet surface is created with version >= fsv_Ver1. \~
\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 fillet, false - curve1 curve is fillet. \~
\param[in] vers - \ru Версия.
\en Version. \~
\return \ru Возвращает указатель на созданную поверхность скругления в случае успеха, иначе - nullptr.
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbChannelSurface * CreateKerbTouchingFillet( double rad, MbFunction & law, MbSurfaceCurve & curv1, bool sgn1,
MbSurfaceCurve & curv2, bool sgn2, bool byFirst, VERSION vers );
protected:
/// \ru Конструктор для наследников обычной поверхности скругления. \en Constructor for inheritors of ordinary fillet surface.
MbChannelSurface( MbSurfaceCurve & curv1, double d1,
+2 -6
View File
@@ -15,7 +15,7 @@
#include <tool_multithreading.h>
class MbFunction;
class MATH_CLASS MbFunction;
struct MbFilletSurfaceCacheData;
//------------------------------------------------------------------------------
@@ -193,7 +193,6 @@ public:
MbFilletSurface( MbSurface & surf1, MbCurve & curv1,
MbSurface & surf2, MbCurve & curv2,
MbCurve3D & curv0, double d1, double d2, MbeSmoothForm fm, double cn, bool ev );
/** \brief \ru Создать поверхность скругления по двум поверхностям с постоянным радиусом.
\en Create a fillet surface by two surfaces with a constant radius. \~
@@ -218,7 +217,6 @@ public:
*/
static MbFilletSurface * CreateSimpleFillet( double rad, MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, double conicFact, VERSION vers );
/** \brief \ru Создать поверхность скругления по двум поверхностям "дугой эллипса".
\en Create a fillet surface by two surfaces by an "arc of an ellipse". \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
@@ -238,7 +236,6 @@ public:
*/
static MbFilletSurface * CreateEllipticalFillet( MbSurfaceCurve & curv1, double rad1, MbSurfaceCurve & curv2, double rad2, VERSION vers );
/** \brief \ru Создать поверхность скругления по двум поверхностям с постоянной хордой.
\en Create a fillet surface by two surfaces with a constant chord. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
@@ -260,7 +257,6 @@ public:
*/
static MbFilletSurface * CreateChordFillet( double h, MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, VERSION vers );
/** \brief \ru Создать поверхность скругления по поверхности и кромке с постоянным радиусом
\en Create fillet surface a constant radius by support surface and support kerb-curve. \~
\details \ru В случае успеха создается поверхность скругления с версией >= fsv_Ver1.
@@ -286,7 +282,6 @@ public:
*/
static MbFilletSurface * CreateKerbFillet( double rad, MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, bool byFirst, double conicFact, VERSION vers );
/// \ru Создать поверхность скругления по поверхности и кромке с касанием
/// \en
/** \brief \ru Создать поверхность скругления по двум поверхностям с указанием кромки касания
@@ -309,6 +304,7 @@ public:
\en Returns a pointer to the created fillet surface if successful, nullptr otherwise. \~
*/
static MbFilletSurface * CreateKerbTouchingFillet( MbSurfaceCurve & curv1, bool sgn1, MbSurfaceCurve & curv2, bool sgn2, bool byFirst, VERSION vers );
protected:
/// \ru Конструктор для наследников обычной поверхности скругления. \en Constructor for inheritors of ordinary fillet surface.
MbFilletSurface( MbSurfaceCurve & curv1, double d1,
+1 -1
View File
@@ -445,7 +445,7 @@ public:
\return \ru true - Нормаль установлена.
\en True - The Normal installed. \~
*/
bool IsSetNormal( bool atStart ) { return atStart ? border1.setNormal : border2.setNormal; }
bool IsSetNormal( bool atStart ) const { return atStart ? border1.setNormal : border2.setNormal; }
/** \} */
protected:
+59
View File
@@ -252,6 +252,64 @@ public:
VERSION vers,
MbResultType & resType );
/** \brief \ru Создание поверхности переменного сечения на заданном участке опорной кривой.
\en The mutable section surface creation on the given section of the reference curve. \~
\details \ru Создание поверхности переменного сечения по опорной кривой и двум направляющим на заданном участке опорной кривой.
\en The mutable section surface creation by reference curve and guide curves on the given section of the reference curve. \~
\param[in] rc - \ru Опорная кривая.
\en The reference curve (spine). \~
\param[in] g1 - \ru Первая направляющая кривая.
\en The first guide curve. \~
\param[in] g2 - \ru Вторая направляющая кривая (g1==g2 совпадает с первой при cs_Round).
\en The second guide curve (g1==g2 the same first guide for cs_Round). \~
\param[in] c0 - \ru Дополнительная направляющая кривая (может быть nullptr).
\en The additional guide curve (may be nullptr). \~
\param[in] f - \ru Форма сечения поверхности.
\en The form of the surface section. \~
\param[in] sense - \ru Направление нормали поверхности направляющей кривой (для guide1==guide2).
\en The normal direction of guide curve surface (for guide1==guide2). \~
\param[in] uBeg - \ru Минимальное значение первого параметра поверхности.
\en The minimum value of the first surface parameter. \~
\param[in] uEnd - \ru Максимальное значение первого параметра поверхности.
\en The maximum value of the first surface parameter. \~
\param[in] func - \ru Функция управления сечением поверхности.
\en Section control function. \~
\param[in] patt - \ru Образующая кривая при form==cs_Shape.
\en Forming curve for form==cs_Shape. \~
\param[in] rcTBeg - \ru Начальный параметр опорной кривой.
\en Start parameter of the reference curve. \~
\param[in] rcTEnd - \ru Конечный параметр опорной кривой.
\en End parameter of the reference curve. \~
\param[in] buildSag - \ru Угловое отклонение при движении по кривым и поверхностям.
\en Angular deviation while moving along curves and surfaces. \~
\param[in] accuracy - \ru Точность построения.
\en The accuracy of building. \~
\param[in] countBin - \ru Минимальное количество шагов при движении по опорной кривой.
\en Minimum number of steps while moving along the reference curve. \~
\param[in] vers - \ru Версия поверхности.
\en The surface version. \~
\param[out] resType - \ru Код ошибки построения.
\en Result code of building. \~
\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, MbeSmoothForm sf,
bool sense,
double uBeg, double uEnd,
const MbFunction * func,
const MbCurve * patt,
double rcTBeg,
double rcTEnd,
double buildSag,
double accuracy,
uint32 countBin,
VERSION vers,
MbResultType & resType );
/** \ru \name Общие функции геометрического объекта
\en \name Common functions of a geometric object
\{ */
@@ -370,6 +428,7 @@ public:
MbCurve3D * CurveU( double v, MbRect1D *pRgn, bool bApprox = true ) const override; // \ru Пространственная копия линии v = const. \en Spatial copy of 'v = const'-line.
MbCurve3D * CurveV( double u, MbRect1D *pRgn, bool bApprox = true ) const override; // \ru Пространственная копия линии u = const. \en Spatial copy of 'u = const'-line.
MbeParamDir GetFilletDirection( double accuracy = METRIC_REGION ) const override; // \ru Направление поверхности скругления. \en Direction of fillet surface.
// \ru Построить касательные и нормальные плейсменты конструктивных плоскостей. \en Construct tangent and normal placements of constructive planes.
bool CreateNormalPlacements ( const MbVector3D & axisZ, double angle, SArray<MbPlacement3D> & places, VERSION version = Math::DefaultMathVersion() ) const override;
bool CreateTangentPlacements( const MbVector3D & axisZ, SArray<MbPlacement3D> & places ) const override;
+10 -10
View File
@@ -68,6 +68,7 @@ private:
MbVector3D ort1; ///< \ru Вектор базиса в точке ortParam направляющей. \en A basis vector in the point ortParam of the spine.
MbVector3D ort2; ///< \ru Вектор базиса в точке ortParam направляющей. \en A basis vector in the point ortParam of the spine.
VERSION version; ///< \ru Версия расчета вектора direction. \en Version of vector "direction" calculation.
bool quadrExt; ///< \ru Флаг параболического продления. \en Flag of parabolic extension.
//------------------------------------------------------------------------------
/** \brief \ru Вспомогательные данные.
@@ -332,13 +333,13 @@ public:
when getting out of the spine curve domain bounds.
\{ */
/// \ru Точка на кривой. \en Point on the curve.
void PointOn ( double & t, MbCartPoint3D & p ) const { curve->PointOn(t,p); }
void PointOn ( double & t, MbCartPoint3D & p ) const;
/// \ru Первая производная. \en The first derivative.
void FirstDer ( double & t, MbVector3D & p ) const { curve->FirstDer(t,p); }
void FirstDer ( double & t, MbVector3D & p ) const;
/// \ru Вторая производная. \en The second derivative.
void SecondDer( double & t, MbVector3D & p ) const { curve->SecondDer(t,p); }
void SecondDer( double & t, MbVector3D & p ) const;
/// \ru Третья производная. \en Third derivative.
void ThirdDer ( double & t, MbVector3D & p ) const { curve->ThirdDer(t,p); }
void ThirdDer ( double & t, MbVector3D & p ) const;
/** \} */
/** \ru \name Функции для работы внутри и вне области определения направляющей кривой
функции _PointOn, _FirstDer... корректируют параметры
@@ -348,17 +349,16 @@ public:
when getting out of the spine curve domain bounds.
\{ */
/// \ru Точка на кривой. \en Point on the curve.
void _PointOn ( double t, MbCartPoint3D & p ) const { curve->_PointOn(t,p); }
void _PointOn ( double t, MbCartPoint3D & p ) const;
/// \ru Первая производная. \en The first derivative.
void _FirstDer ( double t, MbVector3D & p ) const { curve->_FirstDer(t,p); }
void _FirstDer ( double t, MbVector3D & p ) const;
/// \ru Вторая производная. \en The second derivative.
void _SecondDer( double t, MbVector3D & p ) const { curve->_SecondDer(t,p); }
void _SecondDer( double t, MbVector3D & p ) const;
/// \ru Третья производная. \en Third derivative.
void _ThirdDer ( double t, MbVector3D & p ) const { curve->_ThirdDer(t,p); }
void _ThirdDer ( double t, MbVector3D & p ) const;
/// \ru Вычислить значения точки и производных для заданного параметра. \en Calculate point and derivatives of object for given parameter. \~
virtual void Explore( double & t, bool ext,
MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const
{ curve->Explore( t, ext,pnt, fir, sec, thir ); }
MbCartPoint3D & pnt, MbVector3D & fir, MbVector3D * sec, MbVector3D * thir ) const;
/** \} */
/** \ru \name Функции движения по направляющей кривой
\en \name Function of moving by spine curve
+1 -1
View File
@@ -158,7 +158,7 @@ public:
virtual MbeTopologyType IsA() const = 0;
/// \ru Подготовить объект к записи. \en Prepare an object for writing.
void PrepareWrite() const { SetRegistrable( GetUseCount() > 1 ? registrable : noRegistrable ); }
void PrepareWrite() const { SetRegistrable( (GetUseCount() > 1) ? registrable : noRegistrable ); }
bool IsAVertex() const { return (IsA() == tt_Vertex); } ///< \ru Это вершина? \en Is it a vertex?
bool IsAWireEdge() const { return (IsA() == tt_Edge); } ///< \ru Это ребро каркаса? \en Is it an edge of wireframe?
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.