[go: up one dir, main page]

CN114611359A - Grid-parameter hybrid model modeling method and system - Google Patents

Grid-parameter hybrid model modeling method and system Download PDF

Info

Publication number
CN114611359A
CN114611359A CN202210259350.4A CN202210259350A CN114611359A CN 114611359 A CN114611359 A CN 114611359A CN 202210259350 A CN202210259350 A CN 202210259350A CN 114611359 A CN114611359 A CN 114611359A
Authority
CN
China
Prior art keywords
mesh
grid
model
parameter
boundary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210259350.4A
Other languages
Chinese (zh)
Other versions
CN114611359B (en
Inventor
习俊通
洪子橙
胡国栋
杨肖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Jiao Tong University
Original Assignee
Shanghai Jiao Tong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jiao Tong University filed Critical Shanghai Jiao Tong University
Priority to CN202210259350.4A priority Critical patent/CN114611359B/en
Publication of CN114611359A publication Critical patent/CN114611359A/en
Application granted granted Critical
Publication of CN114611359B publication Critical patent/CN114611359B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/23Design optimisation, verification or simulation using finite element methods [FEM] or finite difference methods [FDM]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/005Tree description, e.g. octree, quadtree
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/10Additive manufacturing, e.g. 3D printing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a mesh-parameter mixed model modeling method and a system, wherein point cloud data of an object to be measured are obtained, the point cloud data are converted into a mesh curved surface by using a mesh generation technology, mesh offset processing and boundary stitching processing are carried out on the mesh curved surface, and the mesh curved surface is converted into a closed mesh model; setting characteristic parameters of an object to be detected, establishing a parameter model, and carrying out gridding processing on the parameter model; and synthesizing a grid model and a parameter model into a mixed model based on Boolean operation, wherein the mixed model is characterized by using a grid. The system comprises a point cloud data module, a grid model module, a parameter model module and a Boolean operation module. The grid-parameter mixed model established by the method not only keeps the precision of the original measurement model, but also has the characteristic of user-defined addition, and not only can be used for operating the grid model, but also can be used for operating the parameter model, so that the precision and the efficiency of subsequent redesign are improved.

Description

一种网格-参数混合模型建模方法和系统A mesh-parameter mixed model modeling method and system

技术领域technical field

本申请属于计算机设计技术领域,具体涉及一种网格-参数混合模型建模方法和系统。The present application belongs to the technical field of computer design, and in particular relates to a grid-parameter hybrid model modeling method and system.

背景技术Background technique

计算机辅助设计技术是电子信息技术的一个重要组成部分,它改变了产品设计工作的内容和方式,颠覆了传统手工设计绘图的方式,极大地提高了产品开发的速度和设计精度。Computer-aided design technology is an important part of electronic information technology. It changes the content and method of product design work, subverts the traditional manual design and drawing method, and greatly improves the speed and design accuracy of product development.

建模技术的发展经历了二维建模、三维几何建模、特征建模及产品集成建模的发展过程。其中三维几何建模又分为线框建模、曲面建模和实体建模。曲面模型主要依据顶点、边、面片3中拓扑元素及其相互的拓扑关系来描述三维物体的形状。其通过曲面来构造、表示三维物体,可以获取物体表面的三维信息。The development of modeling technology has gone through the development process of 2D modeling, 3D geometric modeling, feature modeling and product integration modeling. Three-dimensional geometric modeling is divided into wireframe modeling, surface modeling and solid modeling. The surface model mainly describes the shape of three-dimensional objects according to the topological elements in vertices, edges, and patches and their mutual topological relationships. It constructs and represents three-dimensional objects through curved surfaces, and can obtain three-dimensional information on the surface of the object.

近年来,随着测量精度的大幅提高,利用逆向工程获得的离散网格曲面模型也被用于设计建模中。其中,三角网格模型采用轻量化三角面片结构描述数据点之间的拓扑关系,在表达曲面模型时具有快速灵活、拓扑适应能力强等优点。In recent years, with the great improvement of measurement accuracy, the discrete mesh surface model obtained by reverse engineering is also used in design modeling. Among them, the triangular mesh model uses a lightweight triangular patch structure to describe the topological relationship between data points, which has the advantages of fast and flexible and strong topology adaptability when expressing surface models.

网格曲面具有几何精度高、完整性好、拓扑一致性强的优点,但数据量随着精度提高而增大,适合描述复杂曲面;参数曲面具有数据量小,描述简单曲面精度高的优势,但描述复杂曲面误差大。Mesh surface has the advantages of high geometric accuracy, good integrity and strong topology consistency, but the amount of data increases with the increase of accuracy, which is suitable for describing complex surfaces; parametric surface has the advantages of small amount of data and high accuracy for describing simple surfaces. However, there is a large error in describing complex surfaces.

如何集合网格曲面和参数曲面的优点,同时规避两者的缺点,建立一种网格-参数混合模型,成为建模领域的研究重点。How to integrate the advantages of mesh surface and parametric surface while avoiding the disadvantages of both, and establishing a mesh-parametric hybrid model has become the focus of research in the field of modeling.

发明内容SUMMARY OF THE INVENTION

本申请提出了一种网格-参数混合模型建模方法和系统,应用于三维原型再设计、增材制造以及三维模型的渲染等领域,在三维模型的再设计过程中,通过视觉传感器等方法提取到三维模型的点云原型,将其转换为网格模型,并通过参数建模的方式提供再设计的工具,该建模方法获得的网格模型水密且无拓扑错误,且为具有一定厚度的体模型,适用于增材制造以及渲染。This application proposes a mesh-parameter hybrid model modeling method and system, which are applied to the fields of 3D prototype redesign, additive manufacturing, and 3D model rendering. The point cloud prototype extracted from the 3D model is converted into a mesh model, and a redesign tool is provided by means of parametric modeling. The mesh model obtained by this modeling method is watertight and free of topology errors, and has a certain thickness. volume models, suitable for additive manufacturing as well as rendering.

为实现上述目的,本申请提供了如下方案:To achieve the above purpose, the application provides the following solutions:

一种网格-参数混合模型建模方法,包括如下步骤:A mesh-parameter mixed model modeling method, comprising the following steps:

获取待测物体的点云数据,利用网格生成技术,将所述点云数据转换为网格曲面,对所述网格曲面进行网格偏置处理和边界缝合处理,将所述网格曲面转换为封闭的所述网格模型;Obtain the point cloud data of the object to be measured, use the grid generation technology to convert the point cloud data into a grid surface, perform grid offset processing and boundary stitching processing on the grid surface, and convert the grid surface to the grid surface. converted to closed said mesh model;

设定所述待测物体的特征参数,基于所述特征参数,建立参数模型,并对所述参数模型进行网格化处理,所述参数模型使用网格进行表征;Setting characteristic parameters of the object to be measured, establishing a parametric model based on the characteristic parameters, and performing grid processing on the parametric model, and the parametric model is represented by a grid;

基于布尔运算,将所述网格模型和所述参数模型合成混合模型,所述混合模型使用网格进行表征。Based on Boolean operations, the mesh model and the parametric model are combined into a hybrid model, which is characterized using the mesh.

可选的,使用改进的贪婪投影三角化法获得所述网格曲面;Optionally, use an improved greedy projection triangulation method to obtain the mesh surface;

所述改进的贪婪投影三角化法包括如下步骤:The improved greedy projection triangulation method includes the following steps:

使用移动最小二乘法对所述点云数据进行平滑处理,获取MLS拟合曲面;Smoothing the point cloud data using the moving least squares method to obtain an MLS fitting surface;

基于所述MLS拟合曲面,获得所有所述点云数据的点云法矢量;Based on the MLS fitting surface, obtain point cloud normal vectors of all the point cloud data;

基于所述点云法矢量,利用贪婪投影三角化法进行重建,得到所述网格曲面。Based on the point cloud normal vector, the greedy projection triangulation method is used for reconstruction to obtain the mesh surface.

可选的,所述网格偏置处理的方法包括:Optionally, the grid offset processing method includes:

基于三角形的形状、质心距以及顶角的角度对顶点法矢的影响,建立新的权重因子λ;Based on the influence of the shape of the triangle, the distance of the centroid and the angle of the vertex on the vertex normal, a new weight factor λ is established;

设定边界顶点vi左右两侧各有n个连续的边界顶点,分别为左边界顶点(vl,l=i-1,i-2,...,i-n)和右边界顶点(vr,r=i+1,i+2,...,i+n),在所述边界顶点左右两侧通过所述边界顶点vi分别与所述左边界顶点和所述右边界顶点相连,各获得n个向量,分别记为左向量(ei,l,l=i-1,i-2,...,i-n)和右向量(ei,r,r=i+1,i+2,...,i+n);It is assumed that there are n continuous boundary vertices on the left and right sides of the boundary vertex v i , which are the left boundary vertex (v l , l=i-1, i-2,...,in) and the right boundary vertex (v r , r=i+1,i+2,...,i+n), the left and right sides of the boundary vertex are respectively connected to the left boundary vertex and the right boundary vertex through the boundary vertex v i , Each obtains n vectors, denoted as left vector ( ei,l ,l=i-1,i-2,...,in) and right vector ( ei,r ,r=i+1,i+ 2,...,i+n);

基于所述左向量和所述右向量,计算左边向量el和右边向量erBased on the left vector and the right vector, calculate the left vector el and the right vector er ;

基于所述左边向量el和所述右边向量er,建立修正向量NeBased on the left vector e l and the right vector er , a correction vector Ne is established;

分别为所述边界顶点vi的初始法矢量Nv和所述修正向量Ne分配边界顶点权重k1和修正向量权重k2,基于所述初始法矢量Nv、所述修正向量Ne、所述边界顶点权重k1和所述修正向量权重k2,计算矫正后的边界顶点法矢量NbA boundary vertex weight k 1 and a correction vector weight k 2 are respectively allocated to the initial normal vector N v and the correction vector Ne of the boundary vertex v i , based on the initial normal vector N v , the correction vector Ne , The boundary vertex weight k 1 and the correction vector weight k 2 are used to calculate the corrected boundary vertex normal vector N b ;

基于所述新的权重因子λ、所述左边向量el、所述右边向量er和所述边界顶点法矢量Nb,得到所述边界顶点vi的修正法向量,完成所述网格偏置处理。Based on the new weight factor λ, the left vector e l , the right vector er , and the boundary vertex normal vector N b , the modified normal vector of the boundary vertex v i is obtained, and the mesh biasing is completed. set processing.

可选的,所述边界缝合处理的方法包括:Optionally, the method for boundary stitching processing includes:

将所述网格曲面的每个顶点沿顶点法向量偏置后,得到网格偏置曲面;After offsetting each vertex of the mesh surface along the vertex normal vector, a mesh offset surface is obtained;

在所述网格曲面和所述网格偏置曲面间建立缝合曲面,所述缝合曲面为离散的三角面片的集合;establishing a seam surface between the mesh surface and the mesh offset surface, the seam surface is a collection of discrete triangular patches;

使用标号算法优化所述三角面片,并依次生成新的三角面片,将所述新的三角面片插入到所述网格曲面和所述网格偏置曲面之间,完成所述网格曲面和所述网格偏置曲面的边界缝合。Use the labeling algorithm to optimize the triangular patch, and sequentially generate new triangular patches, insert the new triangular patch between the mesh surface and the mesh offset surface, and complete the mesh The surface and the boundary of the mesh offset surface are stitched.

可选的,所述布尔运算的方法包括:Optionally, the method for the Boolean operation includes:

对所述网格模型和所述参数模型之间产生交叉的三角网格面片进行检测;Detecting triangular mesh patches that intersect between the mesh model and the parametric model;

对产生交叉的三角网格面片区域及其邻域的网格进行局部的重网格化,实现交叉区域网格密度的调整;Perform local remeshing on the meshes of the intersecting triangular mesh patch area and its neighbors to adjust the mesh density of the intersection area;

再次检测产生交叉的三角网格面片,并将其从网格中删除,删去交叉区域后的网格模型被分割成不同的网格补丁;Detect the intersecting triangular mesh patches again, and delete them from the mesh. The mesh model after deleting the intersection area is divided into different mesh patches;

基于布尔运算以及网格补丁的内外分布对所述网格补丁进行重新组合,组合后的模型为带间隙的网格补丁;Recombining the grid patches based on the Boolean operation and the inner and outer distribution of the grid patches, and the combined model is a grid patch with gaps;

基于重新组合后的网格补丁,提取带间隙网格的边界边环,通过投票的方式建立边界边环对应关系,将对应的边界边环以迭代前向缝合的方法连接起来,生成网格-参数混合模型。Based on the recombined mesh patches, the boundary edge loops of the mesh with gaps are extracted, the corresponding relationship between the boundary edge loops is established by voting, and the corresponding boundary edge loops are connected by an iterative forward stitching method to generate a mesh- Parametric Mixture Model.

可选的,三角网格面片交叉的判断方法包括如下步骤:Optionally, the method for judging the intersection of triangular meshes includes the following steps:

采用八叉树的方法,分别对所述网格模型和所述参数模型来进行给定点数多少以及空间大小的八叉树的划分,分别得到网格八叉树和参数八叉树;By adopting the method of octree, the grid model and the parameter model are respectively divided into octrees with a given number of points and space size, so as to obtain grid octrees and parameter octrees respectively;

检测所述网格八叉树和所述参数八叉树对应的所有叶节点是否在空间上交叉,如果交叉,则对对应叶节点内顶点的全部一环邻接面进行遍历交叉检测。Detect whether all leaf nodes corresponding to the grid octree and the parameter octree intersect in space, and if they intersect, perform traversal intersection detection on all one-ring adjacent surfaces of the vertices in the corresponding leaf nodes.

可选的,交叉区域网格密度的调整方法包括如下步骤:Optionally, the method for adjusting the grid density of the intersection area includes the following steps:

将交叉的三角网格面片的顶点控制边长设置为给定的边长,对其邻域进行曲率自适应的控制边长计算,然后对整个区域的网格控制边长进行加权平滑,计算出控制边长后,再通过局部拓扑调整的方法来重网格化局部的网格,完成交叉区域网格密度的调整。Set the vertex control edge length of the intersecting triangular mesh patch to a given edge length, perform curvature adaptive control edge length calculation on its neighborhood, and then perform weighted smoothing on the mesh control edge length of the entire area, calculate After the control side length is obtained, the local mesh is re-meshed by the method of local topology adjustment to complete the adjustment of the mesh density in the intersection area.

可选的,对所述网格补丁进行重新组合的方法包括:Optionally, the method for recombining the grid patches includes:

根据布尔运算,首先对网格补丁进行内外判定,网格补丁的内外判定根据三维绕组数的计算来判定;According to the Boolean operation, firstly, the inner and outer judgment of the grid patch is performed, and the inner and outer judgment of the grid patch is determined according to the calculation of the three-dimensional winding number;

利用投票方式,对边界环上的每个顶点选择其对应的最邻近的边界环,如果其对应的边界环中的顶点也作出了相同的投票,即将两个边界环对应起来,确定要进行缝合的边界环的对应关系,完成网格补丁的重新组合。Using the voting method, select the corresponding nearest boundary ring for each vertex on the boundary ring. If the corresponding vertices in the boundary ring also make the same vote, that is, the two boundary rings are corresponding, and it is determined to be stitched. The corresponding relationship of the boundary ring, complete the recombination of mesh patches.

为实现上述目的,本申请还提供了一种网格-参数混合模型建模系统,包括点云数据模块、网格模型模块、参数模型模块和布尔运算模块;In order to achieve the above purpose, the present application also provides a grid-parameter hybrid model modeling system, including a point cloud data module, a grid model module, a parameter model module and a Boolean operation module;

所述点云数据模块用于获取待测物体的点云数据;The point cloud data module is used to obtain point cloud data of the object to be measured;

所述网格模型模块用于利用网格生成技术,将所述点云数据转换为网格曲面,对所述网格曲面进行网格偏置处理和边界缝合处理,将所述网格曲面转换为封闭的所述网格模型;The grid model module is used to convert the point cloud data into a grid surface by using grid generation technology, perform grid offset processing and boundary stitching processing on the grid surface, and convert the grid surface is the closed mesh model;

所述参数模型模块用于设定所述待测物体的特征参数,基于所述特征参数,建立参数模型,并对所述参数模型进行网格化处理,所述参数模型使用网格进行表征;The parameter model module is used to set the characteristic parameters of the object to be measured, establish a parameter model based on the characteristic parameters, and perform grid processing on the parameter model, and the parameter model is characterized by a grid;

所述布尔运算模块用于基于布尔运算,将所述网格模型和所述参数模型合成混合模型,所述混合模型使用网格进行表征。The Boolean operation module is configured to synthesize the mesh model and the parametric model into a mixed model based on the Boolean operation, and the mixed model is characterized by using the mesh.

可选的,所述布尔运算模块包括交叉检测单元、网格密度调整单元、网格补丁单元和缝合单元:Optionally, the Boolean operation module includes a cross detection unit, a grid density adjustment unit, a grid patch unit and a stitching unit:

所述交叉检测单元用于对所述网格模型和所述参数模型之间产生交叉的三角网格面片进行检测;The intersection detection unit is configured to detect the triangular mesh face that intersects between the mesh model and the parametric model;

所述网格密度调整单元用于对产生交叉的三角网格面片区域及其邻域的网格进行局部的重网格化,实现交叉区域网格密度的调整;The mesh density adjustment unit is used to locally re-mesh the meshes of the intersecting triangular mesh patch area and its neighborhood, so as to adjust the mesh density of the intersection area;

所述网格补丁单元用于再次检测产生交叉的三角网格面片,并将其从网格中删除,删去交叉区域后的网格模型被分割成不同的网格补丁,基于布尔运算以及网格补丁的内外分布对所述网格补丁进行重新组合,组合后的模型为带间隙的网格补丁;The mesh patch unit is used to detect the intersecting triangular mesh patches again, and delete them from the mesh. The mesh model after deleting the intersection area is divided into different mesh patches, based on Boolean operations and The inner and outer distributions of the grid patches recombine the grid patches, and the combined model is a grid patch with gaps;

所述缝合单元用于基于重新组合后的网格补丁,提取带间隙网格的边界边环,通过投票的方式建立边界边环对应关系,将对应的边界边环以迭代前向缝合的方法连接起来,生成网格-参数混合模型。The stitching unit is used to extract the boundary edge loops of the mesh with gaps based on the recombined mesh patches, establish the corresponding relationship between the boundary edge loops by voting, and connect the corresponding boundary edge loops by an iterative forward stitching method. up, generate a mesh-parameter hybrid model.

本申请的有益效果为:The beneficial effects of this application are:

本申请公开了一种网格-参数混合模型建模方法和系统,应用于三维原型再设计、增材制造以及三维模型的渲染等领域,将点云数据利用网格生成技术转化为初始的网格曲面模型,再对曲面模型进行网格偏置和边界缝合,使其变为封闭的网格模型;参数模型来源于用户自定义的各种特征,并使用网格对其进行表征;然后对两个模型进行布尔运算使得两个模型组合成为一个模型,既保持原始测量模型精度又具有用户自定义添加特征的混合模型。同时,该混合模型使用网格来进行表征,且在用户添加特征处又保留自定义的参数特征,这种特性使得混合模型既能应用网格模型的操作(例如网格重构、平滑,单个面片的增删减等),又能应用参数模型的操作(例如模型的直接拉伸、变形等),提高后续再设计的精度和效率。The present application discloses a mesh-parameter hybrid model modeling method and system, which are applied to the fields of three-dimensional prototype redesign, additive manufacturing, and three-dimensional model rendering, etc. Grid surface model, and then perform grid offset and boundary stitching on the surface model to make it a closed grid model; the parametric model is derived from various user-defined features, and is characterized by grid; then The Boolean operation of the two models allows the two models to be combined into one model, which not only maintains the accuracy of the original measurement model but also has a hybrid model with user-defined added features. At the same time, the hybrid model is represented by a grid, and the user-defined parameter features are retained at the feature added by the user. This feature enables the hybrid model to apply the operations of the grid model (such as grid reconstruction, smoothing, single The addition and deletion of patches, etc.), and the operation of the parametric model (such as direct stretching and deformation of the model, etc.) can be applied to improve the accuracy and efficiency of subsequent redesign.

附图说明Description of drawings

为了更清楚地说明本申请的技术方案,下面对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. As far as technical personnel are concerned, other drawings can also be obtained based on these drawings without the need for creative labor.

图1为本申请实施例一的网格-参数混合模型建模方法整体流程示意图;1 is a schematic diagram of the overall flow of the grid-parameter hybrid model modeling method according to Embodiment 1 of the present application;

图2为本申请实施例一的任意顶点vi的一环邻域示意图;2 is a schematic diagram of a ring neighborhood of an arbitrary vertex v i according to Embodiment 1 of the present application;

图3为本申请实施例一中的边界处顶点法矢估计误差示意图;3 is a schematic diagram of the estimation error of vertex normal vector at the boundary in Embodiment 1 of the present application;

图4为本申请实施例一中使用一环邻域面片法矢量估计示意图;FIG. 4 is a schematic diagram of using a ring of neighborhood patch normal vector estimation in Embodiment 1 of the present application;

图5为本申请实施例一中的在有向图G中生成三角面片序列T的方法示意图;5 is a schematic diagram of a method for generating a triangular patch sequence T in a directed graph G according to Embodiment 1 of the present application;

图6为本申请实施例一中的八叉树划分方法示意图;6 is a schematic diagram of an octree division method in Embodiment 1 of the present application;

图7为本申请实施例一中的判断空间中的两个三角面片是否相交的流程示意图;7 is a schematic flowchart of determining whether two triangular patches in a space intersect in Embodiment 1 of the present application;

图8为本申请实施例一中的近似容差ε与目标边长l的关系,其中a描述2D情况,b描述3D情况;8 is the relationship between the approximate tolerance ε and the target side length l in the first embodiment of the application, wherein a describes the 2D situation, and b describes the 3D situation;

图9为本申请实施例一中的局部重网格化方法示意图;FIG. 9 is a schematic diagram of a local remeshing method in Embodiment 1 of the present application;

图10为本申请实施例一中的判断三角网格补丁位于另外一个三角网格模型的内部还是外部的方法示意图;10 is a schematic diagram of a method for judging whether a triangular mesh patch is located inside or outside another triangular mesh model in Embodiment 1 of the application;

图11为本申请实施例一中的迭代缝合的方法示意图;11 is a schematic diagram of an iterative stitching method in Embodiment 1 of the present application;

图12为本申请实施例二的网格-参数混合模型建模系统结构示意图。FIG. 12 is a schematic structural diagram of a grid-parameter hybrid model modeling system according to Embodiment 2 of the present application.

图13为本申请实施例三的网格-参数混合模型建模方法和系统的具体实例图。FIG. 13 is a diagram of a specific example of the grid-parameter hybrid model modeling method and system according to Embodiment 3 of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。In order to make the above objects, features and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and specific embodiments.

下述实施例,均以人体小腿处的康复辅具设计制造的技术需求展开。The following embodiments are all developed based on the technical requirements for the design and manufacture of rehabilitation aids at the calf of the human body.

实施例一Example 1

如图1所示,为本申请实施例的网格-参数混合模型建模方法整体流程示意图。首先需要获取网格模型和参数模型,在本实施例中,网格模型来自于人体小腿的实际测量数据,在获取腿部的测量点云后,需要将点云数据利用网格生成技术转化为初始的网格曲面模型,之后对曲面模型进行网格偏置和边界缝合,使其变为封闭的网格模型。参数模型是由用户自定义的各种几何特征,并进行网格化操作,使用网格对其进行表征。As shown in FIG. 1 , it is a schematic diagram of the overall flow of the grid-parameter mixed model modeling method according to an embodiment of the present application. First, a grid model and a parameter model need to be obtained. In this embodiment, the grid model comes from the actual measurement data of the human calf. After the measurement point cloud of the leg is obtained, the point cloud data needs to be converted into The initial mesh surface model, and then the mesh offset and boundary stitching are performed on the surface model to make it a closed mesh model. The parametric model is a variety of geometric features defined by the user, and meshing operations are performed to characterize them using meshes.

完成初始的网格模型和参数模型获取工作后,需要对两个模型进行布尔运算使得两个模型组合成为一个模型,首先进行交叉区域的检测和局部拓扑调整,然后,对两个模型相交叉的区域进行密度调整以及网格面片补丁的重组和缝合操作,最终获取既保持原始腿部数据精度又具有用户自定义添加几何特征的混合模型。After completing the acquisition of the initial mesh model and parameter model, it is necessary to perform Boolean operations on the two models to combine the two models into one model. Density adjustment of regions and reorganization and stitching of mesh patch patches result in a hybrid model that retains the accuracy of the original leg data and has user-defined added geometric features.

下面,具体介绍本实施例涉及的各项操作步骤:Below, the operation steps involved in this embodiment are described in detail:

1.点云数据到网格模型的转换1. Conversion of point cloud data to mesh model

网格-参数混合建模的第一步就是获取精度足够高的测量的网格模型。随着视觉测量技术的发展与应用,物体三维信息的获取变得更加精准和高效。使用视觉测量获取的数据主要是无序的散乱数据集点,即为点云数据。点云数据可以通过重建算法,恢复出近似物体表面的网格模型。The first step in mesh-parametric hybrid modeling is to obtain a mesh model of the measurements with sufficient accuracy. With the development and application of visual measurement technology, the acquisition of three-dimensional information of objects has become more accurate and efficient. The data obtained using visual measurement are mainly disordered scattered data set points, namely point cloud data. The point cloud data can be reconstructed by a reconstruction algorithm to restore a mesh model that approximates the surface of the object.

传统贪婪投影三角化算法中,点云法向量精度对重建结果有直接影响。使用PCA获取的点云法向量,即使点云在同一平面上,其法矢量方向也并不会严格一致。因此,在本实施例中,使用移动最小二乘(MLS)进行重采样,对法矢进行估计。该方法也可以对输入的点云数据进行平滑操作,提高贪婪投影三角化的重建效果。离散点云的曲线曲面拟合过程,在曲线曲面形式未知的情况下,MLS相比PCA和LS可以提供更高的拟合精度。In the traditional greedy projection triangulation algorithm, the point cloud normal vector accuracy has a direct impact on the reconstruction results. Using the point cloud normal vector obtained by PCA, even if the point cloud is on the same plane, the normal vector direction will not be strictly consistent. Therefore, in this embodiment, moving least squares (MLS) is used for resampling to estimate the normal vector. This method can also smooth the input point cloud data to improve the reconstruction effect of greedy projection triangulation. In the curve-surface fitting process of discrete point clouds, MLS can provide higher fitting accuracy than PCA and LS when the curve and surface form is unknown.

在点云的局部子域上,拟合函数f(x)表示为:On the local subdomain of the point cloud, the fitting function f(x) is expressed as:

Figure BDA0003550180020000081
Figure BDA0003550180020000081

其中α(x)=[α1(x),α2(x),...,αn(x)]T为待求系数,ρ(x)=[ρ1(x),ρ2(x),...,ρn(x)]T为基函数。where α(x)=[α 1 (x),α 2 (x),...,α n (x)] T is the coefficient to be determined, ρ(x)=[ρ 1 (x),ρ 2 ( x),...,ρ n (x)] T is the basis function.

已知节点X=[x1,x2,...,xm]T,每个节点对应的节点值为Y=[y1,y2,...,ym]T,式(1)所示的拟合函数必须满足,Given that node X=[x 1 , x 2 ,...,x m ] T , the node value corresponding to each node is Y=[y 1 , y 2 ,..., y m ] T , formula (1 ), the fitting function must satisfy,

Figure BDA0003550180020000091
Figure BDA0003550180020000091

将式(1)代入式(2),得Substituting equation (1) into equation (2), we get

Figure BDA0003550180020000092
Figure BDA0003550180020000092

显然,当

Figure BDA0003550180020000093
时,式(3)有极小值Obviously, when
Figure BDA0003550180020000093
When , equation (3) has a minimum value

Figure BDA0003550180020000094
Figure BDA0003550180020000094

Figure BDA0003550180020000095
B(x)=[w(x-x1)p(x1),...,w(x-xm)p(xm)],则式(4)可写成矩阵形式:make
Figure BDA0003550180020000095
B(x)=[w(xx 1 )p(x 1 ),...,w(xx m )p(x m )], then equation (4) can be written in matrix form:

Figure BDA0003550180020000096
Figure BDA0003550180020000096

解,得Solutions have to

α(x)=A-1(x)B(x)Y (6)α(x)=A -1 (x)B(x)Y (6)

代入式(1)可得拟合函数,Substitute into equation (1) to get the fitting function,

f(x)=ρT(x)A-1(x)B(x)Y (7)f(x)=ρ T (x)A -1 (x)B(x)Y (7)

在选定基函数以及权函数后,由式(7)就可求得局部子域的拟合函数。权函数在MLS中也起着非常重要的作用,其应该具有紧支性,即其应该在当前子域内不等于0,且在子域外全为0。权函数在子域内应该是非负的,且随着||x-xi||2的增大而减小。常用的权函数是样条函数,记s=x-xi,同时将整个点云域距离归一化

Figure BDA0003550180020000101
smax是影响区域的半径,则可以使用如下三次样条函数作为权函数:After selecting the basis function and the weight function, the fitting function of the local subdomain can be obtained by formula (7). The weight function also plays a very important role in MLS, and it should have compact support, that is, it should not be equal to 0 in the current subdomain, and be all 0 outside the subdomain. The weight function should be non-negative in the subdomain and decrease as ||xx i || 2 increases. The commonly used weight function is the spline function, denoted s=xx i , and the distance of the entire point cloud domain is normalized at the same time
Figure BDA0003550180020000101
s max is the radius of the affected area, then the following cubic spline function can be used as the weight function:

Figure BDA0003550180020000102
Figure BDA0003550180020000102

通常smax需要足够大,以保证式(7)中的A-1(x)有意义。同时,由于基函数为线性基,曲面拟合过程中,影响区域内应至少包含不在同一直线上的三个节点。Usually s max needs to be large enough to ensure that A -1 (x) in equation (7) is meaningful. At the same time, since the basis function is a linear basis, in the process of surface fitting, the affected area should contain at least three nodes that are not on the same straight line.

在选定基函数和权函数后,使用式(7)求出拟合曲面。一般权函数都能保证C1连续,由于拟合函数会继承权函数的光滑性,因此拟合函数也至少具有C1连续。可以通过将点云投影到拟合曲面使得点云更加平滑。After selecting the basis function and weight function, use equation (7) to find the fitting surface. Generally, the weight function can guarantee C 1 continuity. Since the fitting function will inherit the smoothness of the weight function, the fitting function also has at least C 1 continuity. The point cloud can be made smoother by projecting it onto the fitted surface.

在获取拟合曲面后,可以通过式(9)获取节点的法矢量:After obtaining the fitted surface, the normal vector of the node can be obtained by formula (9):

Figure BDA0003550180020000103
Figure BDA0003550180020000103

因此改进的贪婪投影三角化算法流程如下:Therefore, the process of the improved greedy projection triangulation algorithm is as follows:

Step1.对点云数据使用MLS平滑操作,提高点云数据光滑性;Step1. Use the MLS smoothing operation on the point cloud data to improve the smoothness of the point cloud data;

Step2.基于MLS拟合的曲面计算所有点云法矢量;Step2. Calculate all point cloud normal vectors based on the surface fitted by MLS;

Step3.使用贪婪投影三角化方法进行重建。Step3. Use the greedy projection triangulation method to reconstruct.

2.网格偏置2. Grid Bias

扫描技术获取的点云数据仅仅是物体表面数据,使用网格生成技术所生成同样是物体的表面。针对非封闭点云,利用该操作获取的网格模型将是一个非封闭的薄面片,无法应用于实际制造。通过网格偏置操作,可以使得该薄片拓展成为两个拓扑连接关系相同,几何形状相似的曲面,通过边界缝合获得一个封闭的网格体模型。The point cloud data obtained by the scanning technology is only the surface data of the object, and the surface of the object is also generated using the grid generation technology. For the non-closed point cloud, the mesh model obtained by this operation will be a non-closed thin patch, which cannot be applied to actual manufacturing. Through the mesh offset operation, the sheet can be expanded into two surfaces with the same topological connection relationship and similar geometric shapes, and a closed mesh model can be obtained by boundary stitching.

三角网格模型采用轻量化三角面片结构描述数据点之间的拓扑关系,在表达曲面模型时具有快速灵活、拓扑适应能力强等优点,广泛应用于CAD/CAE/CAM系统中。在进行曲面偏置、曲面重构、模型降噪与光顺、网格孔洞修复等处理过程中,网格模型的法矢信息不可或缺,法矢估算的准确性将严重影响后续模型处理效果。The triangular mesh model uses a lightweight triangular patch structure to describe the topological relationship between data points. It has the advantages of fast flexibility and strong topology adaptability when expressing surface models. It is widely used in CAD/CAE/CAM systems. In the process of surface offset, surface reconstruction, model noise reduction and smoothing, mesh hole repair, etc., the normal vector information of the mesh model is indispensable, and the accuracy of the normal vector estimation will seriously affect the subsequent model processing effect. .

利用估算法矢进行网格偏置,可以将一个非封闭的网格曲面模型拓展为体模型。在大曲率变化模型中,由于顶点法矢估算存在误差以及边界顶点几何信息缺失,导致偏置曲面的拓扑质量下降,并且其形状也难以与原曲面保持一致。这种偏差随着偏置距离增大而增大。Using the estimated normal vector for mesh offset, a non-closed mesh surface model can be extended to a volume model. In the model with large curvature change, due to the error of vertex normal vector estimation and the lack of geometric information of boundary vertices, the topological quality of the offset surface is degraded, and its shape is difficult to keep consistent with the original surface. This deviation increases as the offset distance increases.

参数曲面是一个从R2到R3的连续映射,其通常可以使用一个解析表达式表示。参数曲面上的每一个节点都能准确的计算其法矢。网格曲面不同于参数曲面,它是一个离散表示,无法使用一个解析表达式准确表示所有节点。 A parametric surface is a continuous map from R2 to R3 , which can usually be represented using an analytical expression. Each node on the parametric surface can accurately calculate its normal vector. Unlike parametric surfaces, a mesh surface is a discrete representation and cannot accurately represent all nodes with one analytical expression.

网格模型其每个顶点坐标都可以精确获取,结合模型所输出的拓扑关系,可以精确地求取每个面片的法矢信息,利用面法矢来估计顶点法矢,即对模型中所有信息有效利用,同时降低拟合过程所引入的误差,使得顶点法矢估算结果更加准确。The coordinates of each vertex of the mesh model can be accurately obtained. Combined with the topological relationship output by the model, the normal vector information of each patch can be accurately obtained, and the vertex normal vector can be estimated by using the surface normal vector, that is, all the information in the model can be calculated. Effective use, while reducing the error introduced by the fitting process, makes the vertex normal vector estimation result more accurate.

三角网格模型可以表示为以顶点和三角面片组成的线性表,M={V,F},其中V={vi|1≤i≤n}为模型中所有顶点的集合,F={fj|1≤j≤m}为模型中所有面片的集合。A triangular mesh model can be represented as a linear table composed of vertices and triangular patches, M={V,F}, where V={v i |1≤i≤n} is the set of all vertices in the model, F={ f j |1≤j≤m} is the set of all the patches in the model.

图2为三角网格模型某顶点vi的一环邻域面片示意图,

Figure BDA0003550180020000111
为所求顶点法矢量,fj表示与该顶点相接的三角面片,
Figure BDA0003550180020000112
为三角形fj的质心,Gj为质心到顶点vi的欧式距离,aj为三角形fj在顶点vi处的顶角,
Figure BDA0003550180020000121
为三角面片fj的外法向。Fig. 2 is a schematic diagram of a ring neighborhood patch of a vertex v i of the triangular mesh model,
Figure BDA0003550180020000111
is the normal vector of the desired vertex, f j represents the triangular patch connected to the vertex,
Figure BDA0003550180020000112
is the centroid of the triangle f j , G j is the Euclidean distance from the centroid to the vertex v i , a j is the vertex angle of the triangle f j at the vertex v i ,
Figure BDA0003550180020000121
is the outward normal of the triangular patch f j .

Figure BDA0003550180020000122
定义为:
Figure BDA0003550180020000122
defined as:

Figure BDA0003550180020000123
Figure BDA0003550180020000123

Figure BDA0003550180020000124
由下式定义:
Figure BDA0003550180020000124
is defined by:

Figure BDA0003550180020000125
Figure BDA0003550180020000125

每个面片法矢都可以由式(11)精确求出,显然,式(10)中的权重选择决定了顶点法矢估算精度。The normal vector of each patch can be accurately calculated by Equation (11). Obviously, the weight selection in Equation (10) determines the estimation accuracy of the vertex normal.

三角形的几何特性有很多,例如面积、质心到顶点距离、顶角角度等。一般而言,三角形的面积、顶角角度越大,形状越接近正三角形,其对顶点法矢的贡献也将越大;三角形的质心到顶点距离越远、三角形的边长越大,对顶点法矢的贡献将越小。可以依据这些特点,选择某一种几何特征作为权重,亦可以使用这些特征的组合形成组合权重因子。但是,对于单一特征的权重因子,存在易出现三角形几何形状差异较大但表达相同权重的问题。如图2所示,图中两对三角形具有相同的面积、顶角角度以及质心距,但其形状差异较大,在单一权重的度量下,这两对三角形将表达相等的权值。因此单一权重的度量,很难准确的反映该面片对顶点法矢的真实贡献情况。There are many geometric properties of triangles, such as area, distance from centroid to vertex, vertex angle, etc. Generally speaking, the larger the area and apex angle of a triangle, the closer the shape is to a regular triangle, and the greater its contribution to the vertex normal vector; The contribution of the normal vector will be smaller. According to these features, a certain geometric feature can be selected as the weight, or a combination of these features can be used to form a combined weight factor. However, for the weight factor of a single feature, there is a problem that the geometric shapes of the triangles are quite different but the same weight is expressed. As shown in Figure 2, the two pairs of triangles in the figure have the same area, vertex angle and centroid distance, but their shapes are quite different. Under the measurement of a single weight, the two pairs of triangles will express equal weights. Therefore, the measurement of a single weight is difficult to accurately reflect the true contribution of the patch to the vertex normal.

为了提升权重因子描述三角形各种几何特性的准确度,引入能够表达三角形形状的形状因子μ,其定义为三角形外接圆半径与内切圆半径之比的两倍。In order to improve the accuracy of the weight factor describing various geometric properties of triangles, a shape factor μ that can express the shape of the triangle is introduced, which is defined as twice the ratio of the radius of the circumcircle to the radius of the inscribed circle of the triangle.

Figure BDA0003550180020000126
Figure BDA0003550180020000126

式中的a,b,c分别为三角形的三边长。结合这种形状因子的形状质心距法,为不同形状的三角面片赋予了不同权重。where a, b, and c are the lengths of the three sides of the triangle, respectively. Combined with the shape centroid distance method of this shape factor, different weights are given to triangular patches of different shapes.

为了使得提高顶点法矢在曲率变化大、锐边等特征区域的估算准确度,在形状质心权重的基础上进行改进,综合考虑三角形的形状、质心距以及顶角的角度对顶点法矢的影响,提出新的权重因子。表达式如式(11):In order to improve the estimation accuracy of the vertex normal vector in characteristic areas such as large curvature change and sharp edges, the improvement is made on the basis of the shape centroid weight, and the influence of the shape of the triangle, the centroid distance and the angle of the vertex angle on the vertex normal vector is comprehensively considered. , and propose a new weighting factor. The expression is as formula (11):

Figure BDA0003550180020000131
Figure BDA0003550180020000131

其中α为三角形顶角角度。where α is the angle of the vertex of the triangle.

模型的边界顶点,由于其周围的面片数量不足,导致几何信息缺失,使得该处法矢量的估计准确性低。The boundary vertex of the model, due to the insufficient number of surrounding patches, leads to the lack of geometric information, which makes the estimation accuracy of the normal vector at this location low.

图3是边界顶点法矢估计的误差示意,当外侧是凸面时,其边界处的三角形具有向内部偏转的趋势,因此估算法矢会偏向模型方向(图3中Nconvex向量),当外侧是凹面时,情形相反(图3中Ncnocave向量),因此需要在边界处对法矢估算结果进行修正。Figure 3 is a schematic diagram of the error of the normal vector estimation of the boundary vertex. When the outer side is convex, the triangle at the boundary has a tendency to deflect inward, so the estimated normal vector will be biased towards the model direction (N convex vector in Figure 3), when the outer side is When the surface is concave, the situation is opposite (the N cnocave vector in Fig. 3), so the normal vector estimation result needs to be corrected at the boundary.

如图4所示,图中Nv向量是使用一环邻域面片法矢量估计的值,若希望这个矢量向真实法矢量偏转,则需要一个修正向量Ne。获取设定在边界顶点vi左右两侧各有n个连续的边界顶点,分别为(vl,l=i-1,i-2,...,i-n),(vr,r=i+1,i+2,...,i+n)。在左右两侧可以通过vi分别与vl,vr相连,各获得n个向量分别记为(ei,l,l=i-1,i-2,...,i-n)和(ei,r,r=i+1,i+2,...,i+n)。As shown in FIG. 4 , the N v vector in the figure is a value estimated by using the normal vector of a ring of neighborhood patches. If this vector is to be deflected toward the true normal vector, a correction vector Ne is required. Obtain and set n continuous boundary vertices on the left and right sides of the boundary vertex v i , respectively (v l ,l=i-1,i-2,...,in), (v r ,r=i +1,i+2,...,i+n). On the left and right sides, it can be connected to v l , v r through v i respectively, and each obtains n vectors, which are respectively recorded as (e i,l ,l=i-1,i-2,...,in) and (e i,r ,r=i+1,i+2,...,i+n).

获取这两个向量集后,使用(14)式计算两个边向量el,er。其中n=round(bsize/10),bsize是当前边界上顶点的数目。After obtaining the two vector sets, use equation (14) to calculate the two edge vectors e l , er . where n=round(b size /10), where b size is the number of vertices on the current boundary.

Figure BDA0003550180020000132
Figure BDA0003550180020000132

修正向量Ne定义为el和er的叉积:The correction vector Ne is defined as the cross product of e l and er:

Figure BDA0003550180020000141
Figure BDA0003550180020000141

为了使得vi初始的法矢量Nv能够平滑地趋向于修正矢量Ne,分别为Nv和Ne分配两个权重k1,k2,权重的选择与边界处垂直向外方向的曲率有关,该方向曲率越大|k2|越大。因此,校正后的边界顶点法矢Nb由下式确定:In order to make the initial normal vector N v of vi tend to the correction vector Ne smoothly, two weights k 1 , k 2 are assigned to N v and Ne respectively, and the selection of the weight is related to the curvature of the vertical outward direction at the boundary , the greater the curvature of the direction |k 2 | Therefore, the corrected boundary vertex normal vector N b is determined by:

Nb=k1Nv+k2Ne,|k1|+|k2|=1 (16)N b =k 1 N v +k 2 Ne ,|k 1 |+|k 2 |=1 (16)

将前述提出的新的权重因子代入法矢估算中,得Substituting the new weight factor proposed above into the normal vector estimation, we get

Figure BDA0003550180020000142
Figure BDA0003550180020000142

3.边界缝合3. Border stitching

基于前述,将原模型每个顶点沿顶点法向偏置后,可以得到偏置模型。顶点经偏置后的位置由下式确定:Based on the above, after offsetting each vertex of the original model along the vertex normal, the offset model can be obtained. The offset position of the vertex is determined by:

Figure BDA0003550180020000143
Figure BDA0003550180020000143

其中

Figure BDA0003550180020000144
表示偏置后顶点位置,
Figure BDA0003550180020000145
表示原顶点位置,dis表示偏置的距离。in
Figure BDA0003550180020000144
represents the vertex position after offset,
Figure BDA0003550180020000145
Represents the original vertex position, and dis represents the offset distance.

两个模型的顶点相互对应,且顶点间的拓扑连接关系相同。为了得到封闭的体模型,需要将两个面进行缝合。将原模型的边界点集与偏置模型的边界点集分别记为P,Q,其中:The vertices of the two models correspond to each other, and the topological connections between the vertices are the same. To get a closed volume model, two faces need to be stitched together. Denote the boundary point set of the original model and the boundary point set of the biased model as P and Q respectively, where:

P={p0,p1,p2,...,pm-1} (19)P={p 0 ,p 1 ,p 2 ,...,p m-1 } (19)

Q={q0,q1,q2,...,qn-1} (20)Q={q 0 ,q 1 ,q 2 ,...,q n-1 } (20)

两个边界各包含m,n个点,并且边界是由m,n条线段连接而成。Each of the two boundaries contains m, n points, and the boundary is connected by m, n line segments.

通过在两个离散的曲线间构造一个曲面来完成缝合。这个曲面和两个模型一样是离散的三角面片集合。这些面片的顶点是边界点,从一个边界序列中选取两个点,并从另一个边界序列中选取一个点,来组成一个缝合的面片。因此每个三角面片都可以定义为{pi,pj,qk}或者{pi,qj,qk}。Stitching is done by constructing a surface between two discrete curves. This surface, like the two models, is a collection of discrete triangular patches. The vertices of these patches are boundary points, and a stitched patch is formed by picking two points from one boundary sequence and one point from another boundary sequence. So each triangular patch can be defined as {pi ,p j ,q k } or { pi ,q j , q k } .

显然,每个新生成的三角面片都满足:Obviously, each newly generated triangular patch satisfies:

(1)每个面片都由一条“轮廓边”(两个顶点在同一个边界序列的边,如pipj)和两条“桥接边”(两个顶点不在同一个边界序列的边,如piqk,pjqk)组成;(1) Each patch consists of a "silhouette edge" (edge whose two vertices are in the same boundary sequence, such as p i p j ) and two "bridge edges" (edge whose two vertices are not in the same boundary sequence) , such as p i q k , p j q k );

(2)每两个相邻的三角面片都存在一条公共的桥接边;(2) There is a common bridging edge for every two adjacent triangular patches;

(3)对任意两条桥接边piqj,pkql,若i≤k,则j≤l,反之亦然。(3) For any two bridging edges p i q j , p k q l , if i≤k, then j≤l, and vice versa.

可以将获取这一组三角形序列的问题看做一个图论问题。首先定义一个有向图G=<V,Arc>来描述两个轮廓之间的所有桥接边。其中V表示有向图G节点的集合:The problem of obtaining this set of triangle sequences can be viewed as a graph theory problem. First define a directed graph G=<V, Arc> to describe all bridging edges between two contours. where V represents the set of nodes in the directed graph G:

V={vi,j|i=0,1,2,...,m-1,j=0,1,2,...,n-1} (21)V={v i,j |i=0,1,2,...,m-1,j=0,1,2,...,n-1} (21)

Arc为弧的集合:Arc is a collection of arcs:

Arc={ak=<vk,l,vs,t>|s=k且l=t-1或s=k-1且l=t} (22)Arc={ ak =< vk,l ,vs ,t >|s=k and l=t-1 or s=k-1 and l=t} (22)

显然,在有向图G中,每条弧都唯一对应一个三角面片(每条弧实际确定了3个顶点)。因此,任意一条从源节点v0,0到终节点vm-1,n-1的路径,都能确定唯一的三角面片序列T,如图5所示。Obviously, in the directed graph G, each arc uniquely corresponds to a triangular patch (each arc actually determines 3 vertices). Therefore, any path from the source node v 0,0 to the end node v m-1,n-1 can determine a unique triangular patch sequence T, as shown in Figure 5.

为了使新生成的面片形状尽可能的规则,使用式(12)来描述新三角面片的形状规则度。优化的目标是使三角面片序列中所有三角面片的形状因子之和最大(无论哪种序列,所有三角面片的总数是相同的都为m+n-2)。使用标号算法来寻找该有向图G的最优路径。In order to make the shape of the newly generated patch as regular as possible, formula (12) is used to describe the shape regularity of the new triangular patch. The goal of optimization is to maximize the sum of the shape factors of all triangular patches in the triangular patch sequence (regardless of the sequence, the total number of all triangular patches is the same m+n-2). Use the labeling algorithm to find the optimal path of this directed graph G.

将节点vi,j的标号记为(i,j,μa,Disi,j,prev),其中i,j为节点下标,μ为式(12)所定义的形状因子,Disi,j表示从源节点到当前节点的加权长度,prev为当前路径中vi,j的上一节点相对于它的位置。Denote the label of node v i,j as (i,j,μ a ,Dis i,j ,prev), where i,j are node subscripts, μ is the shape factor defined by equation (12), Dis i, j represents the weighted length from the source node to the current node, and prev is the position of the previous node of vi ,j in the current path relative to it.

从源节点到当前节点的距离为,从源节点到当前节点的上一节点的最大距离加上当前的带权弧长:The distance from the source node to the current node is the maximum distance from the source node to the previous node of the current node plus the current weighted arc length:

Disi,j=max(Disi,j-1,Disi-1,j)+μa (23)Dis i,j =max(Dis i,j-1 ,Dis i-1,j )+μ a (23)

求取最优路径的算法流程如下:The algorithm flow for finding the optimal path is as follows:

Step1.初始化v0,0的标号;Step1. Initialize the label of v 0,0 ;

Step2.计算Disi,j+1和Disi+1,j并选择二者中较大值,更新下一节点为加权长度更大的节点;Step2. Calculate Dis i,j+1 and Dis i+1,j and select the larger value of the two, and update the next node to be a node with a larger weighted length;

Step3.记录标号中的prev值,当Disi,j+1大时prev=0,当Disi+1,j大时prev=1;Step3. Record the prev value in the label. When Dis i, j+1 is large, prev=0, and when Dis i+1, j is large, prev=1;

Step4.重复Step2,Step3。Step4. Repeat Step2, Step3.

Step5.输出prev的序列。Step5. Output the sequence of prev.

确定prev的序列,即确定了该有向图G中满足优化目标的三角面片序列T。只需要根据该序列,依次生成新的三角面片插入到轮廓边界中即完成两个模型的缝合。Determining the sequence of prev means determining the triangular patch sequence T in the directed graph G that satisfies the optimization objective. It is only necessary to generate new triangular patches in turn according to the sequence and insert them into the contour boundary to complete the stitching of the two models.

4.参数曲面网格化4. Parametric Surface Meshing

参数曲面网格化生成总体流程如下:The overall process of generating parametric surface meshing is as follows:

1)读入组合参数曲面模型和指定尺寸控制信息。1) Read in the combined parametric surface model and specify the size control information.

2)识别模型中的邻近特征和曲率特征,然后结合指定尺寸控制信息对模型中所有曲线进行几何自适应的离散,同时创建几何自适应密度场。2) Identify the adjacent features and curvature features in the model, and then combine the specified size control information to perform geometrically adaptive discretization on all curves in the model, and create a geometrically adaptive density field at the same time.

3)根据指定尺寸控制信息和几何自适应密度场对模型中的曲面片逐个生成网格。3) Generate meshes one by one for the surface patches in the model according to the specified size control information and the geometric adaptive density field.

4.1.几何自适应曲面边界离散过程4.1. Geometrically adaptive surface boundary discretization process

利用足够小的le对所有的曲面边界曲线进行采样,产生采样点集合,并在各采样点上设置全局尺寸值。全局尺寸值和le都可由用户设定,前者缺省为模型外包围盒尺寸的1/10,后者缺省为模型外包围盒尺寸的1/100。采样过程中先对每条曲线利用迭代的复合Simpson数值积分公式计算曲线长度L,则可确定该曲线上的采样点数目为m=L/le+1;然后根据弧长求得各采样点坐标.All surface boundary curves are sampled with a sufficiently small le to generate a set of sampling points, and a global size value is set at each sampling point. Both the global size value and le can be set by the user, the former defaults to 1/10 of the size of the outer bounding box of the model, and the latter defaults to 1/100 of the size of the outer bounding box of the model. In the sampling process, the curve length L is calculated for each curve by the iterative composite Simpson numerical integration formula, and the number of sampling points on the curve can be determined as m=L/le+1; then the coordinates of each sampling point are obtained according to the arc length. .

以采样后的边界作为输入,对采样点集合进行曲面CDT。对每个采样点,以其所属几个单元的外接圆半径最小值作为邻近特征距离,求得邻近特征自适应尺寸,将该尺寸值与原尺寸值比较并取较小值作为新的尺寸值。Using the sampled boundary as input, perform surface CDT on the set of sampled points. For each sampling point, the minimum value of the radius of the circumcircle of several units to which it belongs is used as the adjacent feature distance, and the adaptive size of the adjacent feature is obtained. The size value is compared with the original size value and the smaller value is taken as the new size value. .

遍历采样点,若采样点存在曲率特征,求得曲率特征自适应尺寸与该点已有尺寸值比较并取较小值作为新的尺寸值。Traverse the sampling points, if the sampling point has curvature features, find the adaptive size of the curvature feature and compare it with the existing size value of the point, and take the smaller value as the new size value.

若存在其他尺寸控制方式,遍历采样点,以其他尺寸控制方式求得尺寸与该点已有尺寸值比较并取较小值作为新的尺寸值。If there are other size control methods, traverse the sampling points, compare the size obtained by other size control methods with the existing size value of the point, and take the smaller value as the new size value.

对各边界曲线进行离散,以保证得到的离散点尺寸合理过渡。Discrete each boundary curve to ensure a reasonable transition of the size of the obtained discrete points.

4.2创建几何自适应密度场4.2 Creating a Geometrically Adaptive Density Field

几何自适应密度场在曲面边界采样点的CDT结果上创建,由于该结果在边界自适应离散的过程中就已经获得,因此不必重新计算,可以减少不少计算量。在CDT结果上首先设置三角形单元外心处的邻近特征自适应尺寸值,该值可利用三角形外接圆半径作为邻近特征距离,并使用对边界点同样的邻近特征自适应计算过程获得。The geometric adaptive density field is created on the CDT result of the sampling point of the surface boundary. Since the result has been obtained in the process of boundary adaptive discretization, it does not need to be recalculated, which can reduce a lot of calculation. On the CDT result, first set the value of the adaptive size of the adjacent features at the outer center of the triangle element. This value can be obtained by using the radius of the circumcircle of the triangle as the distance of the adjacent features, and using the same adaptive calculation process of the adjacent features for the boundary points.

4.3网格生成4.3 Mesh generation

本实施例采用基于映射法和前沿推进技术(advancing front technique AFT)的曲面网格生成方法。该方法在参数平面上进行前沿推进,支持最短边优先和最老边优先2种推进标准;通过在参数平面上进行的网格有效性和单元质量检查可提高产生前沿最佳点的算法效率;最后通过边交换和光滑化优化网格质量。将组合曲面边界的几何自适应离散结果作为该方法的输入,在产生前沿候选点时,利用曲面几何自适应密度场求得该候选点处的自适应尺寸值,并综合考虑通过其他尺寸控制方式得到的尺寸值,取最小值作为该点的尺寸值,最终生成组合参数曲面的几何自适应网格.This embodiment adopts a surface mesh generation method based on the mapping method and the advancing front technique (AFT). The method carries out frontier advancement on the parameter plane, and supports two advancement standards: the shortest edge first and the oldest edge first; the algorithm efficiency of generating the optimal point of the frontier can be improved by checking the grid validity and element quality on the parameter plane; Finally, the mesh quality is optimized by edge swapping and smoothing. The geometric self-adaptive discrete result of the combined surface boundary is used as the input of this method. When generating a frontier candidate point, the self-adaptive size value at the candidate point is obtained by using the surface geometric self-adaptive density field, and other size control methods are considered comprehensively. The obtained size value, take the minimum value as the size value of the point, and finally generate the geometric adaptive mesh of the combined parametric surface.

5.交叉区域的检测5. Detection of the intersection area

本实施例采用自适应八叉树的方法对交叉区域的检测过程进行加速,基本方法是,分别对两个网格模型来进行给定点数多少以及空间大小的八叉树的划分,然后检测两个八叉树对应的所有叶节点是否在空间上交叉,如果交叉,则对对应叶节点内顶点的全部一环邻接面进行遍历交叉检测。对于较高层级的八叉树节点(即靠近八叉树根节点的节点)而言,如果它不与同一层级所有八叉树的节点交叉,就没有必要对它进行进一步的八叉划分。具体的划分过程如图6所示。In this embodiment, the method of adaptive octree is used to speed up the detection process of the intersection area. The basic method is to divide the octree of the given number of points and the space size for the two grid models respectively, and then detect the two grid models. Whether all the leaf nodes corresponding to each octree intersect in space, and if so, perform traversal and intersection detection on all the adjacent surfaces of the vertices in the corresponding leaf node. For a higher-level octree node (ie, a node close to the octree's root node), if it does not intersect with all octree nodes at the same level, there is no need to further octree it. The specific division process is shown in Figure 6.

判断空间中的两个三角面片是否相交的流程如图7所示:The process of judging whether two triangular patches in space intersect is shown in Figure 7:

1)根据输入的两个三角面片(T1,T2)的六个顶点

Figure BDA0003550180020000181
分别计算出它们相对于另一个三角面片所在的平面的有向距离
Figure BDA0003550180020000182
1) According to the six vertices of the input two triangular patches (T 1 , T 2 )
Figure BDA0003550180020000181
Calculate their respective directed distances relative to the plane on which the other triangular patch lies
Figure BDA0003550180020000182

2)根据六个有向距离是否为零,判定两个三角面片是否共面;2) According to whether the six directional distances are zero, determine whether the two triangular facets are coplanar;

3)对于共面的三角面片,计算出六个顶点相对应得卷绕数,卷绕数若全部为零,则说明两个三角面片不相交。否则相交;3) For coplanar triangular patches, calculate the number of windings corresponding to the six vertices. If the winding numbers are all zero, it means that the two triangular patches do not intersect. otherwise intersect;

4)对于不共面的两个三角面片,则需要根据每个三角面片的顶点的有向距离的符号是否相同,判定其是否位于另一个平面的同一侧,若两个三角面片都位于另一个平面的同侧,则两个三角面片不相交;4) For two triangular patches that are not coplanar, it is necessary to determine whether they are located on the same side of the other plane according to whether the signs of the directional distances of the vertices of each triangular patch are the same. On the same side of another plane, the two triangular patches do not intersect;

5)对于不同侧的三角面片,需要根据它们在平面交线处的部分是否重叠来进一步的判定。5) For triangular patches on different sides, further judgment is needed according to whether their parts at the intersection of the plane overlap.

6.交叉区域的密度调整6. Density adjustment of the intersection area

本实施例通过对交叉的三角网格区域及其邻域的网格进行局部的重网格化来实现网格密度的调整,核心在于该区域的网格控制边长的确定。为了实现更好的网格质量,选取交叉的三角网格面片区域及其三到五环的邻域进行密度控制:将交叉的三角面片的顶点控制边长设置为给定的边长,对其邻域则进行曲率自适应的控制边长计算,最后为了防止密度突变,对整个区域的网格控制边长进行加权平滑。计算出控制边长后,再通过局部拓扑调整的方法来重网格化局部的网格。In this embodiment, the mesh density is adjusted by performing local re-mesh on the intersecting triangular mesh area and its neighboring meshes, and the core lies in the determination of the mesh control side length in this area. In order to achieve better mesh quality, select the intersecting triangular mesh patch area and its neighbors of three to five rings for density control: set the vertex control side length of the intersecting triangular patch to the given side length, For its neighborhood, the curvature-adaptive control edge length is calculated. Finally, in order to prevent the density mutation, the mesh control edge length of the entire region is weighted and smoothed. After the control side length is calculated, the local mesh is re-meshed by means of local topology adjustment.

6.1曲率自适应的控制边长计算6.1 Calculation of Controlled Side Length with Curvature Adaptive

图8(a描述2D情况,b描述3D情况)显示了逼近误差ε和目标边长l之间的关系。假设使用边l的直线逼近圆弧,最大逼近误差ε,即直线到圆弧的最大偏差,它们遵循约束关系:Figure 8 (a depicts the 2D case, b depicts the 3D case) shows the relationship between the approximation error ε and the target side length l. Assuming that a straight line of edge l is used to approximate the circular arc, the maximum approximation error ε, that is, the maximum deviation from the straight line to the circular arc, follows the constraint relationship:

Figure BDA0003550180020000191
Figure BDA0003550180020000191

将式(24)公式应用到三角面片来拟合曲面的过程中来,对应图8b,三角面片(近似为正三角形)的边长与误差ε以及局部的曲率之间的关系为:Applying the formula (24) to the process of fitting the curved surface by the triangular patch, corresponding to Figure 8b, the relationship between the side length of the triangular patch (approximately a regular triangle) and the error ε and the local curvature is:

Figure BDA0003550180020000192
Figure BDA0003550180020000192

对于网格模型的表达而言,三角网格的边长越短,误差ε就越小,网格越逼近于曲面,通过误差ε以及网格局部的曲率κ来实现对网格边长的控制。为了实现更加精细的控制,选取最大的法向曲率κ1(p)来计算网格的曲率半径r,使得网格的控制边长尽可能的更短。For the expression of the mesh model, the shorter the edge length of the triangular mesh, the smaller the error ε, the closer the mesh is to the surface, and the control of the mesh edge length is achieved through the error ε and the local curvature κ of the mesh . In order to achieve finer control, the maximum normal curvature κ 1 (p) is selected to calculate the radius of curvature r of the mesh, so that the control side length of the mesh is as short as possible.

在处理几乎相同分辨率的网格时,选择通用误差ε来控制整个网格是可以接受的。但是在处理分辨率明显不同的网格时,仍然会造成三角形的浪费。因为很难定义一个合适的ε,出于保守估计,ε需要适应更密集的部分,这会导致在低曲率区域过度细分。为避免对整个网格进行过度细分,ε不能太大,否则会导致高曲率区域细分不足。简言之,统一的ε将限制网格边长对曲率的适应性。When dealing with grids of nearly the same resolution, it is acceptable to choose a common error ε to control the entire grid. But when dealing with meshes of significantly different resolutions, there is still a waste of triangles. Because it is difficult to define a suitable ε, for conservative estimation, ε needs to fit into denser parts, which leads to over-subdivision in low-curvature regions. To avoid over-subdivision of the entire mesh, ε cannot be too large, otherwise it will lead to under-subdivision of areas of high curvature. In short, a uniform ε will limit the adaptability of the mesh edge length to the curvature.

因此,需要通过自适应的误差ε(x)来对网格的边长进行控制,可以使用网格原本的局部边长对不同区域的网格误差进行控制。如果使网格在局部区域的误差控制与其最短的边长正相关,即控制ε(x)=αlmin(x)。Therefore, it is necessary to control the edge length of the mesh through the adaptive error ε(x), and the original local edge length of the mesh can be used to control the mesh error in different regions. If the error control of the mesh in the local area is positively related to its shortest side length, that is, control ε(x)=αl min (x).

本实施例中,结合局部的平均边长以及最短边长,对网格的局部边长进行控制。为了度量局部边长的分布情况,引入局部的度量因子:In this embodiment, the local average side length and the shortest side length are combined to control the local side length of the mesh. In order to measure the distribution of local edge lengths, a local measurement factor is introduced:

Figure BDA0003550180020000201
Figure BDA0003550180020000201

对局部的边长分布进行度量,同时使用权重因子Measure the local edge length distribution using weighting factors

e-λ(ω(x)-1) (27)e -λ(ω(x)-1) (27)

对lmin(x)和Laver(x)进行插值,并且控制误差为插值的线性项。不失一般性地,可以将局部的误差控制为 lmin (x) and Laver (x) are interpolated, and the control error is a linear term of the interpolation. Without loss of generality, the local error can be controlled as

Figure BDA0003550180020000202
Figure BDA0003550180020000202

其中α,λ为自定义地控制系数,其中α为主控制系数,它的大小决定了误差的大小,λ是一个辅助的控制系数,可以对插值的过程进行控制。同时,为了避免计算过程中产生过长或是过短的边,需要对控制边长进行修剪,使得Among them, α and λ are self-defined control coefficients, among which α is the main control coefficient, and its size determines the size of the error, and λ is an auxiliary control coefficient, which can control the interpolation process. At the same time, in order to avoid the generation of too long or too short sides in the calculation process, the length of the control side needs to be trimmed, so that

L(x)∈[Lmin(x),Lmax(x)] (29)L(x)∈[ Lmin (x), Lmax (x)] (29)

其中in

Lmin(x)=γε(x) (30)L min (x)=γε(x) (30)

Lmax(x)=δε(x) (31)L max (x)=δε(x) (31)

γ,δ为自定义的系数。最终局部的控制边长L(x)和局部的边长以及曲率保持一致。γ, δ are self-defined coefficients. The final local control side length L(x) is consistent with the local side length and curvature.

L(x)是相对顶点而言的,对于边e(v1,v2),应当控制它的长度L(x) is relative to the vertex, for the edge e(v 1 , v 2 ), its length should be controlled

L(e)=min(L(v1),L(v2)) (32)L(e)=min(L(v 1 ),L(v 2 )) (32)

6.2局部重网格化方法6.2 Local remeshing method

重网格化的输入是一个由半边数据结构表示的网格,它为顶点、边、面及其拓扑信息提供了方便的循环方法。为了保持网格模型的形状,顶点将通过从初始网格构建的k-d树背景场重新投影回网格。整个过程如图9所示,具体地,按以下步骤实施。The input to remeshing is a mesh represented by a half-edge data structure, which provides a convenient loop method for vertices, edges, faces, and their topology information. To preserve the shape of the mesh model, the vertices are reprojected back to the mesh through a k-d tree background field built from the initial mesh. The whole process is shown in Figure 9, and specifically, it is implemented according to the following steps.

1)围绕顶点循环更新局部信息,包括局部最小边长、局部平均长度和1-环邻居的曲率。1) Cyclically update local information around vertices, including local minimum edge length, local average length, and curvature of 1-ring neighbors.

2)根据更新的信息,再次循环顶点,计算目标局部长度L(v),限制L(v)∈[Lmin(v),Lmax(v)]。2) According to the updated information, loop the vertices again, calculate the target local length L(v), and limit L(v) ∈ [L min (v), L max (v)].

3)循环边表,根据控制边长L(e)=min(L(v1),L(v2))调整网格,分裂过长的边(长于4/3L(e)),收缩太短的边(短于4/5L(e))。3) Circular edge table, adjust the mesh according to the control edge length L(e)=min(L(v1), L(v2)), split the edges that are too long (longer than 4/3L(e)), and shrink the ones that are too short side (shorter than 4/5L(e)).

4)循环边表,如果翻转降低了顶点的自由度,则翻转边。4) Circular edge table, if flipping reduces the degrees of freedom of the vertex, flip the edge.

5)循环顶点表,对每个顶点进行切线松弛,并通过k-d树背景将其重新投影回初始网格,本实施例采用拉普拉斯平滑的方式松弛顶点。5) Circulate the vertex table, perform tangent relaxation on each vertex, and reproject it back to the initial mesh through the k-d tree background. This embodiment uses Laplace smoothing to relax the vertex.

6)将步骤3)到4)重复迭代5-10次。6) Repeat steps 3) to 4) for 5-10 iterations.

7.面片补丁重新组合7. Patch Patch Recombination

根据布尔运算的定义对网格模型进行重新组合,首先对三角面片补丁进行内外判定。布尔交定义为位于两个三角网格模型内部的网格补丁的组合,布尔并定义为位于两个网格模型外部的补丁,布尔差则是一内一外的组合,布尔差的结果不唯一。网格补丁的内外判定可以根据三维绕组数的计算来判定。本实施例通过射线投影的方式进行判断。如图10所示,如果要判断被分割后的三角网格补丁位于另外一个三角网格模型的内部还是外部,可以随机选取网格补丁上的N个顶点,通过kdTree计算其在另一个网格模型上的最近点,计算该点到最近点的射线,计算射线与最近点所在平面法向的内积,据此判定点位于网格模型的内部还是外部。为了消除特殊情况,对N个顶点采取相同的操作,以超过N/2的顶点的情况确定网格补丁的内外部信息。The mesh model is recombined according to the definition of the Boolean operation, and the inner and outer judgments of the triangular patch patches are firstly performed. The Boolean intersection is defined as the combination of mesh patches located inside the two triangular mesh models, the Boolean union is defined as the patch located outside the two mesh models, and the Boolean difference is a combination of one inside and one outside, and the result of Boolean difference is not unique. . The inner and outer determination of the grid patch can be determined according to the calculation of the three-dimensional winding number. In this embodiment, the judgment is made by means of ray projection. As shown in Figure 10, if you want to determine whether the divided triangular mesh patch is inside or outside of another triangular mesh model, you can randomly select N vertices on the mesh patch, and use kdTree to calculate its location in another mesh. The closest point on the model, calculate the ray from this point to the closest point, calculate the inner product of the ray and the plane normal to the closest point, and determine whether the point is inside or outside the grid model. To eliminate the special case, the same operation is done for N vertices to determine the inner and outer information of the mesh patch in the case of more than N/2 vertices.

一般情况下,两个相交的网格模型会将彼此分割成不同数量的网格补丁,在将需要缝合的补丁基于以上的方法进行组合后,需要确定要进行缝合的边界环的对应关系,这可以通过投票的方式来确定。对于边界环上的每个顶点,选择其对应的最邻近的边界环,如果其对应的边界环中的顶点也作出了相同的投票,即将两个边界环对应起来。In general, two intersecting mesh models will be divided into different numbers of mesh patches. After the patches to be stitched are combined based on the above method, the corresponding relationship of the boundary rings to be stitched needs to be determined. It can be determined by voting. For each vertex on the boundary ring, select its corresponding nearest boundary ring, if the corresponding vertex in the boundary ring also makes the same vote, that is, the two boundary rings are corresponding.

8.网格补丁缝合算法8. Mesh patch stitching algorithm

布尔计算流程中的最后一步就是将存在间隙的三角网格连接起来。在本实施例中,采取迭代前向式的缝合策略。The last step in the Boolean calculation process is to connect the triangular meshes with gaps. In this embodiment, an iterative forward stitching strategy is adopted.

具体的算法实施可以总结为以下的几个步骤:The specific algorithm implementation can be summarized as the following steps:

1)查询到两个网格模型各自的边界环l1={V0,V1,…,Vn}以及l2={U0,U1,…,Un};1) Query the respective boundary rings l 1 ={V 0 ,V 1 ,...,V n } and l 2 ={U 0 ,U 1 ,...,U n } of the two mesh models;

2)对于l1中的每个顶点Vi,查询

Figure BDA0003550180020000221
为l2中离Vi最近的顶点,然后将Vi
Figure BDA0003550180020000222
移动,更新
Figure BDA0003550180020000223
2) For each vertex V i in l 1 , query
Figure BDA0003550180020000221
is the vertex closest to Vi in l 2 , and then move Vi towards
Figure BDA0003550180020000222
move, update
Figure BDA0003550180020000223

3)对于l2中的每个顶点Ui采取步骤2)中相同的处理;3) for each vertex U i in l 2 , take the same processing in step 2);

4)对l1以及l2的一环邻域使用前述的重网格化的方法进行重构。4) Use the aforementioned remeshing method to reconstruct a ring neighborhood of l1 and l2 .

迭代实施上述步骤直到l1以及l2中的顶点数相同,并且最近的顶点之间的距离低于阈值。最后以一个相同的顶点替代l1以及l2中的对应点,即可以实现缝合。迭代缝合的过程如图11所示:The above steps are performed iteratively until the number of vertices in l 1 and l 2 are the same and the distance between the closest vertices is below a threshold. Finally, replace the corresponding points in l 1 and l 2 with an identical vertex, that is, stitching can be achieved. The process of iterative stitching is shown in Figure 11:

如果在建立两个边界的点的对应关系过程中,如果存在着一个顶点有两个对应点的情况,那么这两个顶点之间的距离就会在迭代的过程中变得很近,通过后续的网格局部的重构的过程,会将靠的很近的两个顶点收缩为一个顶点,并最终建立起一一对应的关系。类似的如果一条边在拓扑调整的过程中被拉抻的很长,在边分裂的过程中,会分裂出新的顶点,建立对应关系。再次回到重连的整个过程,由于顶点位置的更新过程中,顶点可能会被更新到空间中的任意区域。这个与实际的网格相交的情况不符合,为了更好的拟合实际的情况,在每一次更新顶点的位置后,将它重投影回原本的网格模型中离它最近的一个三角面片上。If in the process of establishing the correspondence between the points of the two boundaries, if there is a situation where a vertex has two corresponding points, then the distance between the two vertices will become very close in the iterative process. The process of local reconstruction of the mesh will shrink two vertices that are very close to one vertex, and finally establish a one-to-one correspondence. Similarly, if an edge is stretched very long in the process of topology adjustment, in the process of edge splitting, new vertices will be split to establish a corresponding relationship. Going back to the whole process of reconnection again, due to the updating process of the vertex position, the vertex may be updated to any region in the space. This is inconsistent with the actual mesh. In order to better fit the actual situation, after each update of the vertex position, it is re-projected back to the nearest triangular patch in the original mesh model. .

实施例二Embodiment 2

如图12所示,为本申请实施例二的网格-参数混合模型建模系统结构示意图,主要包括点云数据模块、网格模型模块、参数模型模块和布尔运算模块;As shown in FIG. 12 , it is a schematic structural diagram of the grid-parameter hybrid model modeling system according to the second embodiment of the application, which mainly includes a point cloud data module, a grid model module, a parameter model module and a Boolean operation module;

具体的,在本实施例中,点云数据模块用于获取待测物体的点云数据。Specifically, in this embodiment, the point cloud data module is used to acquire point cloud data of the object to be measured.

网格模型模块用于利用网格生成技术,将点云数据转换为网格曲面,对网格曲面进行网格偏置处理和边界缝合处理,将网格曲面转换为封闭的网格模型。The mesh model module is used to convert point cloud data into mesh surfaces by using mesh generation technology, perform mesh offset processing and boundary stitching processing on mesh surfaces, and convert mesh surfaces into closed mesh models.

参数模型模块用于设定待测物体的特征参数,基于特征参数,建立参数模型,并对参数模型进行网格化处理,参数模型使用网格进行表征。The parametric model module is used to set the characteristic parameters of the object to be measured, establish a parametric model based on the characteristic parameters, and perform grid processing on the parametric model, and the parametric model is represented by a grid.

布尔运算模块用于基于布尔运算,将网格模型和参数模型合成混合模型,混合模型使用网格进行表征,包括交叉检测单元、网格密度调整单元、网格补丁单元和缝合单元。The Boolean operation module is used to synthesize a mesh model and a parametric model into a mixed model based on Boolean operations. The mixed model is characterized by mesh, including intersection detection unit, mesh density adjustment unit, mesh patch unit and stitching unit.

交叉检测单元用于对网格模型和参数模型之间产生交叉的三角网格面片进行检测。网格密度调整单元用于对产生交叉的三角网格面片区域及其邻域的网格进行局部的重网格化,实现交叉区域网格密度的调整。网格补丁单元用于再次检测产生交叉的三角网格面片,并将其从网格中删除,删去交叉区域后的网格模型被分割成不同的网格补丁,基于布尔运算以及网格补丁的内外分布对网格补丁进行重新组合,组合后的模型为带间隙的网格补丁。缝合单元用于基于重新组合后的网格补丁,提取带间隙网格的边界边环,通过投票的方式建立边界边环对应关系,将对应的边界边环以迭代前向缝合的方法连接起来,生成网格-参数混合模型。The intersection detection unit is used to detect the triangular mesh patches that intersect between the mesh model and the parametric model. The mesh density adjustment unit is used to locally re-mesh the meshes of the intersecting triangular mesh area and its neighborhood, so as to adjust the mesh density of the intersection area. The mesh patch unit is used to re-detect the intersecting triangular mesh patches and delete them from the mesh. The mesh model after deleting the intersection area is divided into different mesh patches, based on Boolean operations and meshes The inner and outer distributions of the patches recombine the mesh patches, and the combined model is a mesh patch with gaps. The stitching unit is used to extract the boundary edge loops of the mesh with gaps based on the recombined mesh patches, establish the corresponding relationship between the boundary edge loops by voting, and connect the corresponding boundary edge loops by an iterative forward stitching method. Generate mesh-parametric hybrid models.

实施例三Embodiment 3

如图13所示,为本申请实施例三的网格-参数混合模型建模方法和系统具体的应用实例图,展示为人体小腿处康复辅具的再设计过程。As shown in FIG. 13 , it is a specific application example diagram of the grid-parameter hybrid model modeling method and system according to the third embodiment of the present application, which shows the redesign process of the rehabilitation aid at the lower leg of the human body.

其中人体小腿的三维模型通过视觉传感器扫描获得点云原型,将点云模型应用点云数据模块进行网格模型的生成,再由网格模型模块对网格曲面进行网格偏置处理和边界缝合处理,获得封闭的网格模型,原始模型的精度得以保留。The 3D model of the human calf is scanned by the vision sensor to obtain the point cloud prototype, and the point cloud model is applied to the point cloud data module to generate the mesh model, and then the mesh model module performs mesh offset processing and boundary stitching on the mesh surface. processing, a closed mesh model is obtained, and the accuracy of the original model is preserved.

在康复辅具的实际设计过程中,为了满足在制造过程中节约材料、降低产品重量、提升康复辅具的透气性,提升佩戴舒适度等需求,需要在原模型基础上进行打孔操作。使用参数方法定义圆柱特征,并对参数定义的圆柱特征进行网格化处理,在三维空间中对多个模型进行对齐,最后通过布尔运算模块计算初始护具模型与自定义孔洞间的布尔差。In the actual design process of rehabilitation aids, in order to meet the needs of saving materials, reducing product weight, improving the breathability of rehabilitation aids, and improving wearing comfort during the manufacturing process, it is necessary to perform drilling operations on the basis of the original model. The parametric method is used to define the cylindrical feature, and the parametrically defined cylindrical feature is meshed, and multiple models are aligned in the three-dimensional space. Finally, the Boolean difference between the initial protective gear model and the custom hole is calculated by the Boolean operation module.

在整个过程中,保证了网格模型的水密性以及良好的拓扑特性,同时参与运算的示例为带有厚度的实体模型,最终结果保存为三维网格曲面模型,可以应用3D打印技术生成可穿戴的康复辅具。In the whole process, the watertightness and good topological properties of the mesh model are ensured. At the same time, the example involved in the calculation is a solid model with thickness, and the final result is saved as a 3D mesh surface model, which can be used to generate wearable meshes with 3D printing technology. rehabilitation aids.

Claims (10)

1. A grid-parameter hybrid model modeling method is characterized by comprising the following steps:
acquiring point cloud data of an object to be detected, converting the point cloud data into a mesh curved surface by utilizing a mesh generation technology, carrying out mesh offset processing and boundary stitching processing on the mesh curved surface, and converting the mesh curved surface into a closed mesh model;
setting characteristic parameters of the object to be detected, establishing a parameter model based on the characteristic parameters, and carrying out gridding processing on the parameter model, wherein the parameter model is characterized by using grids;
and synthesizing the grid model and the parameter model into a hybrid model based on Boolean operation, wherein the hybrid model is characterized by using a grid.
2. The grid-parameter hybrid model modeling method according to claim 1,
obtaining the mesh surface by using an improved greedy projection triangulation method;
the improved greedy projection triangularization method comprises the following steps:
smoothing the point cloud data by using a moving least square method to obtain an MLS fitting curved surface;
based on the MLS fitting curved surface, point cloud normal vectors of all the point cloud data are obtained;
and based on the point cloud method vector, reconstructing by using a greedy projection triangulation method to obtain the mesh curved surface.
3. The grid-parameter hybrid model modeling method according to claim 1,
the grid offset processing method comprises the following steps:
establishing a new weight factor lambda based on the influence of the shape, the centroid distance and the angle of the vertex angle of the triangle on the vertex normal vector;
setting boundary vertex viThe left and right sides of the frame have n continuous boundary vertices, namely, a left boundary vertex (v)lI-1, i-2,.., i-n) and a right boundary vertex (v)rR ═ i +1, i + 2.., i + n), passing through the boundary vertex v on both sides of the boundary vertexiRespectively connected with the left boundary vertex and the right boundary vertex to respectively obtain n vectors which are respectively marked as left vectors (e)i,lI-1, i-2, ai,r,r=i+1,i+2,...,i+n);
Calculating a left vector e based on the left vector and the right vectorlAnd the right vector er
Based on the left vector elAnd stationThe right vector erEstablishing a correction vector Ne
Respectively the boundary vertex viOf the initial normal vector NvAnd the correction vector NeAssigning boundary vertex weights k1And the correction vector weight k2Based on said initial normal vector NvThe correction vector NeThe boundary vertex weight k1And the correction vector weight k2Calculating a corrected boundary vertex normal vector Nb
Based on the new weight factor λ, the left vector elThe right vector erAnd said boundary vertex normal vector NbObtaining the boundary vertex viAnd (4) correcting the normal vector to finish the grid bias processing.
4. The grid-parameter hybrid model modeling method according to claim 3,
the method for border stitch processing includes:
after each vertex of the mesh curved surface is offset along a vertex normal vector, a mesh offset curved surface is obtained;
establishing a stitching curved surface between the mesh curved surface and the mesh offset curved surface, wherein the stitching curved surface is a set of discrete triangular surface patches;
and optimizing the triangular surface patch by using a labeling algorithm, sequentially generating new triangular surface patches, inserting the new triangular surface patches between the mesh curved surface and the mesh offset curved surface, and finishing the boundary stitching of the mesh curved surface and the mesh offset curved surface.
5. The grid-parameter hybrid model modeling method according to claim 1,
the Boolean operation method comprises the following steps:
detecting triangular mesh patches which are crossed between the mesh model and the parameter model;
local regridding is carried out on the triangular mesh patch area which generates the intersection and the mesh of the neighborhood thereof, so as to realize the adjustment of the mesh density of the intersection area;
detecting the triangular mesh patch generating the intersection again, deleting the triangular mesh patch from the mesh, and dividing the mesh model with the intersection area deleted into different mesh patches;
recombining the grid patches based on Boolean operation and internal and external distribution of the grid patches, wherein the combined model is a grid patch with gaps;
and extracting boundary side rings of the grid with gaps based on the recombined grid patches, establishing a corresponding relation of the boundary side rings in a voting mode, and connecting the corresponding boundary side rings by an iterative forward stitching method to generate a grid-parameter mixed model.
6. The grid-parameter hybrid model modeling method according to claim 5,
the judgment method for the intersection of the triangular mesh patches comprises the following steps:
dividing the octree with the number of given points and the space size for the grid model and the parameter model by adopting an octree method to obtain a grid octree and a parameter octree respectively;
detecting whether all leaf nodes corresponding to the grid octree and the parameter octree are crossed in space, and if so, performing traversal crossing detection on all ring-adjacent faces of the vertexes in the corresponding leaf nodes.
7. The grid-parameter hybrid model modeling method according to claim 5,
the method for adjusting the grid density of the cross region comprises the following steps:
setting the vertex control side length of the crossed triangular mesh patch as a given side length, carrying out curvature self-adaptive control side length calculation on the neighborhood of the triangle patch, then carrying out weighting smoothing on the mesh control side length of the whole area, after calculating the control side length, re-gridding the local mesh by using a local topology adjustment method, and finishing adjustment of the mesh density of the crossed area.
8. The grid-parameter hybrid model modeling method according to claim 5,
the method for recombining the grid patches comprises the following steps:
according to Boolean operation, firstly, carrying out internal and external judgment on a grid patch, wherein the internal and external judgment of the grid patch is judged according to the calculation of the number of three-dimensional windings;
and selecting the nearest boundary ring corresponding to each vertex on the boundary ring by using a voting mode, and determining the corresponding relation of the boundary rings to be stitched if the vertexes in the boundary rings corresponding to the vertexes are voted the same, i.
9. A grid-parameter mixed model modeling system is characterized by comprising a point cloud data module, a grid model module, a parameter model module and a Boolean operation module;
the point cloud data module is used for acquiring point cloud data of an object to be detected;
the mesh model module is used for converting the point cloud data into a mesh curved surface by using a mesh generation technology, carrying out mesh offset processing and boundary stitching processing on the mesh curved surface, and converting the mesh curved surface into a closed mesh model;
the parameter model module is used for setting characteristic parameters of the object to be measured, establishing a parameter model based on the characteristic parameters, and carrying out gridding processing on the parameter model, wherein the parameter model is characterized by grids;
the Boolean operation module is used for synthesizing the grid model and the parameter model into a mixed model based on Boolean operation, and the mixed model is characterized by using grids.
10. The grid-parameter hybrid model modeling system of claim 9,
the Boolean operation module comprises a cross detection unit, a grid density adjustment unit, a grid patch unit and a stitching unit:
the intersection detection unit is used for detecting a triangular mesh patch which is intersected between the mesh model and the parameter model;
the mesh density adjusting unit is used for carrying out local regridding on a triangular mesh patch area which generates intersection and a mesh in a neighborhood thereof so as to realize adjustment of mesh density of the intersection area;
the grid patch unit is used for detecting a triangular grid patch generating intersection again, deleting the triangular grid patch from the grid, dividing a grid model with an intersection area deleted into different grid patches, recombining the grid patches based on Boolean operation and internal and external distribution of the grid patches, and obtaining a combined model which is a grid patch with gaps;
the stitching unit is used for extracting boundary edge rings of the grid with gaps based on the recombined grid patches, establishing a corresponding relation of the boundary edge rings in a voting mode, connecting the corresponding boundary edge rings by an iterative forward stitching method, and generating a grid-parameter mixed model.
CN202210259350.4A 2022-03-16 2022-03-16 A grid-parameter hybrid model modeling method and system Active CN114611359B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210259350.4A CN114611359B (en) 2022-03-16 2022-03-16 A grid-parameter hybrid model modeling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210259350.4A CN114611359B (en) 2022-03-16 2022-03-16 A grid-parameter hybrid model modeling method and system

Publications (2)

Publication Number Publication Date
CN114611359A true CN114611359A (en) 2022-06-10
CN114611359B CN114611359B (en) 2024-08-16

Family

ID=81864070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210259350.4A Active CN114611359B (en) 2022-03-16 2022-03-16 A grid-parameter hybrid model modeling method and system

Country Status (1)

Country Link
CN (1) CN114611359B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115935447A (en) * 2022-11-09 2023-04-07 上海智能制造功能平台有限公司 Hybrid modeling method based on discrete Morse theoretical feature recognition
CN116341316A (en) * 2023-03-14 2023-06-27 江苏科技大学 A Design Method for Building Irregular Shaped Truss Base Structures Based on Discrete Approximate Boundaries
CN116778112A (en) * 2023-08-23 2023-09-19 中国空气动力研究与发展中心计算空气动力研究所 Curved surface triangle mesh generation method
CN118247466A (en) * 2024-04-28 2024-06-25 江苏霆升科技有限公司 Method for drawing laminating curve on surface of three-dimensional object
CN118468373A (en) * 2024-07-12 2024-08-09 山东华云三维科技有限公司 Engineering drawing generation method, equipment and medium based on discrete grid model
CN119167461A (en) * 2024-09-19 2024-12-20 宁波大学 A Modeling Method of CAD Surface Geometric Model Based on Image Recognition
CN120429936A (en) * 2025-07-07 2025-08-05 中国建筑西南设计研究院有限公司 Modeling method, equipment and medium for concrete slab hanging on large-span steel grid structure
CN120562158A (en) * 2025-07-31 2025-08-29 浙江华东工程数字技术有限公司 Grid model and entity model fusion method, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263384A (en) * 2019-05-28 2019-09-20 南京理工大学 Variation thickness offset modeling method for 3D mesh surface based on Laplacian differential domain deformation
WO2021000719A1 (en) * 2019-06-30 2021-01-07 华中科技大学 Three-dimensional point cloud-based robot processing boundary extraction method for small curvature thin-walled part

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263384A (en) * 2019-05-28 2019-09-20 南京理工大学 Variation thickness offset modeling method for 3D mesh surface based on Laplacian differential domain deformation
WO2021000719A1 (en) * 2019-06-30 2021-01-07 华中科技大学 Three-dimensional point cloud-based robot processing boundary extraction method for small curvature thin-walled part

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
WEI XU 等: "Finite element analysis based on a parametric model by approximating point clouds", ENGINEERING REMOTE SENSING, vol. 12, no. 3, 5 February 2020 (2020-02-05), pages 1 - 26 *
刘姝玉 等: "三次B样条插值的网格拼接和融合", 中国图象图形学报, vol. 23, no. 12, 16 December 2018 (2018-12-16), pages 1901 - 1909 *
肖和 等: "离散三角网格模型顶点法矢量估算", 计算机工程与应用, vol. 52, no. 19, 18 April 2016 (2016-04-18), pages 196 - 200 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115935447A (en) * 2022-11-09 2023-04-07 上海智能制造功能平台有限公司 Hybrid modeling method based on discrete Morse theoretical feature recognition
CN115935447B (en) * 2022-11-09 2024-07-05 上海智能制造功能平台有限公司 Mixed modeling method based on discrete Morse theory feature recognition
CN116341316A (en) * 2023-03-14 2023-06-27 江苏科技大学 A Design Method for Building Irregular Shaped Truss Base Structures Based on Discrete Approximate Boundaries
CN116778112A (en) * 2023-08-23 2023-09-19 中国空气动力研究与发展中心计算空气动力研究所 Curved surface triangle mesh generation method
CN116778112B (en) * 2023-08-23 2023-11-24 中国空气动力研究与发展中心计算空气动力研究所 Curved surface triangle mesh generation method
CN118247466A (en) * 2024-04-28 2024-06-25 江苏霆升科技有限公司 Method for drawing laminating curve on surface of three-dimensional object
CN118468373A (en) * 2024-07-12 2024-08-09 山东华云三维科技有限公司 Engineering drawing generation method, equipment and medium based on discrete grid model
CN119167461A (en) * 2024-09-19 2024-12-20 宁波大学 A Modeling Method of CAD Surface Geometric Model Based on Image Recognition
CN120429936A (en) * 2025-07-07 2025-08-05 中国建筑西南设计研究院有限公司 Modeling method, equipment and medium for concrete slab hanging on large-span steel grid structure
CN120562158A (en) * 2025-07-31 2025-08-29 浙江华东工程数字技术有限公司 Grid model and entity model fusion method, computer equipment and storage medium
CN120562158B (en) * 2025-07-31 2025-10-28 浙江华东工程数字技术有限公司 Grid model and entity model fusion method, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114611359B (en) 2024-08-16

Similar Documents

Publication Publication Date Title
CN114611359A (en) Grid-parameter hybrid model modeling method and system
CN110516388B (en) Generating method of circular cutting tool path for surface discrete point cloud model based on harmonic mapping
Massarwi et al. A B-spline based framework for volumetric object modeling
CN111797555B (en) Geometric reconstruction method based on finite element model
Eck et al. Automatic reconstruction of B-spline surfaces of arbitrary topological type
CN100468418C (en) Method and program for generating volume data from data represented by boundaries
US6996505B1 (en) Methods, apparatus and computer program products for automatically generating nurbs models of triangulated surfaces using homeomorphisms
CN100561523C (en) A 3D Model Mesh Reconstruction Method
CN109472870B (en) A Model Matching Method Based on Mesh Reconstruction and Multi-influence Domain Modification
CN104361632A (en) Triangular mesh hole-filling method based on Hermite radial basis function
CN105243687B (en) A kind of artificial tooth model triangle mesh algorithm method
de Cougny et al. Surface meshing using vertex insertion
CN110689620A (en) Multi-level optimized mesh surface discrete spline curve design method
CN108230452B (en) A Model Hole Filling Method Based on Texture Synthesis
CN117726773A (en) Grid self-adaptive subdivision optimization method and method applied to three-dimensional model rendering
Dai et al. Geometric accuracy analysis for discrete surface approximation
Ramanathan et al. Interior medial axis transform computation of 3D objects bound by free-form surfaces
Ng et al. Incremental tessellation of trimmed parametric surfaces
Azariadis et al. Product design using point-cloud surfaces: A recursive subdivision technique for point parameterization
Chen et al. Filleting and rounding using a point-based method
Xiong et al. Automated structured all-quadrilateral and hexahedral meshing of tubular surfaces
Liu Volumetric T-spline Construction for Isogeometric Analysis–Feature Preservation, Weighted Basis and Arbitrary Degree
Stoddart et al. Reconstruction of smooth surfaces with arbitrary topology adaptive splines
Bian et al. Topology recovery technique for complex freeform surface model after local geometry repair
Lin et al. Automatic reconstruction of B-spline surfaces with constrained boundaries

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant