CN117351170A - A method and system for realizing regional 3D model replacement - Google Patents
A method and system for realizing regional 3D model replacement Download PDFInfo
- Publication number
- CN117351170A CN117351170A CN202311299864.3A CN202311299864A CN117351170A CN 117351170 A CN117351170 A CN 117351170A CN 202311299864 A CN202311299864 A CN 202311299864A CN 117351170 A CN117351170 A CN 117351170A
- Authority
- CN
- China
- Prior art keywords
- model
- replacement
- dimensional
- original
- space
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/10—Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
Landscapes
- Physics & Mathematics (AREA)
- Geometry (AREA)
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域Technical field
本发明涉及计算机图形处理技术领域,尤其涉及一种实现区域三维模型替换的方法及其系统。The present invention relates to the technical field of computer graphics processing, and in particular to a method and system for realizing regional three-dimensional model replacement.
背景技术Background technique
目前在三维场景编辑和替换领域,已经存在很多相关的技术,但大多数都需要以手动的方式进行处理,具体包括:CAD/CAM技术:计算机辅助设计和制造技术已经广泛应用于三维模型的编辑和替换领域,通过CAD/CAM技术可以实现对三维模型的参数化修改和替换操作;三维建模软件:现有的三维建模软件可以实现对三维场景的编辑和替换。例如,3dsMax、Maya等软件可以实现对三维模型的编辑和替换操作,具体的实现方式一般为手动选择三维模型节点,对其进行删除/隐藏操作,最后将新的模型插入到此场景中。Currently, there are many related technologies in the field of 3D scene editing and replacement, but most of them need to be processed manually, including: CAD/CAM technology: Computer-aided design and manufacturing technology has been widely used in the editing of 3D models. In the field of 3D modeling and replacement, CAD/CAM technology can be used to implement parametric modification and replacement operations on 3D models; 3D modeling software: Existing 3D modeling software can implement editing and replacement of 3D scenes. For example, software such as 3dsMax and Maya can edit and replace 3D models. The specific implementation method is generally to manually select 3D model nodes, delete/hide them, and finally insert the new model into the scene.
中国专利申请CN109410346A公开一种在线编辑三维建筑模型的系统,包括用户交互界面、图像转换模块、图像检查模块、图像计算模块、三维模型重建模块、三维模型在线实时渲染交互模块;其中,用户交互界面用于在线进行CAD图档的输入、编辑及参数修改;图像转换模块用于将CAD图档转换成矢量图;图像检查模块用于检查矢量图中的封闭区域;图像计算模块用于根据CAD图档中的参数及封闭区域进行计算,并针对封闭区域进行建模网格化;三维模型重建模块用于将多张计算后的图像结合,进行三维模型重建;三维模型在线实时渲染交互模块用于将三维建筑模型在网页端展示并交互。Chinese patent application CN109410346A discloses a system for online editing of three-dimensional architectural models, including a user interactive interface, an image conversion module, an image inspection module, an image calculation module, a three-dimensional model reconstruction module, and a three-dimensional model online real-time rendering interactive module; among which, the user interactive interface It is used to input, edit and modify parameters of CAD drawings online; the image conversion module is used to convert CAD drawings into vector drawings; the image inspection module is used to check closed areas in vector drawings; the image calculation module is used to calculate the CAD drawings based on the CAD drawings. The parameters and closed areas in the file are calculated, and the closed area is modeled and meshed; the 3D model reconstruction module is used to combine multiple calculated images to reconstruct the 3D model; the 3D model online real-time rendering interactive module is used Display and interact with 3D building models on the web.
现有的相关技术虽可以实现对三维场景的编辑和替换,但替换步骤普遍较为繁琐,具体步骤通常包含:(1)手动选择模型节点,并删除;(2)重新导入替换的新模型;(3)根据替换的位置,调整替换模型位置。在手动选择节点执行删除、替换及调整操作的过程中,可能遇到数据量大、选择不完全以及删除不干净等问题,且若上述过程产生的数据量过大,需过滤判断目录树中需要的模型节点(因一片区域内的模型往往在目录树中的结构很分散,故需要手动多选或者用筛选工具进行筛选,然而多数软件并不能完美得支持筛选),进而替换效率过于低下,并且针对指定区域内的模型,无法完成快速替换。Although existing related technologies can edit and replace three-dimensional scenes, the replacement steps are generally cumbersome. Specific steps usually include: (1) Manually selecting model nodes and deleting them; (2) Re-importing the replaced new model; ( 3) Adjust the position of the replacement model according to the replacement position. In the process of manually selecting nodes to perform deletion, replacement, and adjustment operations, you may encounter problems such as large data volume, incomplete selection, and unclean deletion. If the amount of data generated by the above process is too large, you need to filter and determine what is needed in the directory tree. model nodes (because the models in an area are often very scattered in the directory tree, so you need to manually select multiple items or use filtering tools to filter. However, most software cannot perfectly support filtering), and the replacement efficiency is too low, and Quick replacement cannot be completed for models in the specified area.
综上,目前的三维模型替换技术主要是从模型编辑的角度出发,以选择-删除-导入的基础功能而设计,并未充分考虑业务需求。鉴于此,亟待提出一种模型替换方法,以允许用户更快捷、更高效地对三维场景中的模型进行编辑和替换操作。In summary, the current 3D model replacement technology is mainly designed from the perspective of model editing and based on the basic functions of select-delete-import, without fully considering business needs. In view of this, it is urgent to propose a model replacement method to allow users to edit and replace models in three-dimensional scenes more quickly and efficiently.
此外,一方面由于对本领域技术人员的理解存在差异;另一方面由于申请人做出本发明时研究了大量文献和专利,但篇幅所限并未详细罗列所有的细节与内容,然而这绝非本发明不具备这些现有技术的特征,相反本发明已经具备现有技术的所有特征,而且申请人保留在背景技术中增加相关现有技术之权利。In addition, on the one hand, there are differences in the understanding of those skilled in the art; on the other hand, the applicant studied a large number of documents and patents when making the present invention, but due to space limitations, all details and contents are not listed in detail. However, this is by no means The present invention does not have these features of the prior art. On the contrary, the present invention already has all the features of the prior art, and the applicant reserves the right to add relevant prior art to the background art.
发明内容Contents of the invention
针对现有技术之不足,本发明提供了一种实现区域三维模型替换的方法及其系统,旨在解决现有技术中存在的至少一个或多个技术问题。In view of the shortcomings of the existing technology, the present invention provides a method and system for realizing regional three-dimensional model replacement, aiming to solve at least one or more technical problems existing in the existing technology.
为实现上述目的,本发明提供了一种实现区域三维模型替换的方法,包括如下步骤:In order to achieve the above objectives, the present invention provides a method for realizing regional three-dimensional model replacement, which includes the following steps:
在三维场景中构建部分或全部地包含若干三维模型的替换空间;Construct a replacement space that partially or fully contains several three-dimensional models in a three-dimensional scene;
筛选过滤替换空间中的若干三维模型以确定待替换的原始模型;Filter several three-dimensional models in the replacement space to determine the original model to be replaced;
响应于替换需求获取替换模型以将每个原始模型替换为替换模型。Replacement models are obtained in response to replacement requirements to replace each original model with a replacement model.
相比现有技术大多通过手动方式进行场景编辑和替换的方式,本发明针对的是三维场景中的划定空间区域的编辑和替换,本发明中,对于指定/划定的空间区域只需要在三维空间中形成一个空间几何体或空间包络体便可快速地过滤筛选出所需的原始模型节点,并直接对区域内的模型进行替换,同时支持用户对替换模型进行二次选择,以执行预览、检查及调整等操作。与此相反的是,目前现有技术大多需要通过人工反复地在模型目录树中一个一个挑选,当模型目录树上所需的节点很分散或者体量很大的时候人工选择费时费力且不够准确,而现有技术中的节点搜索功能则不能筛选缺省很多信息的模型,本发明所述的模型替换方法提供自定义区域划分的功能,允许用户规划某个范围,省去用户手动选择多个模型节点的过程,且对模型节点名称、节点属性都无要求,只要有三维模型即可过滤筛选。Compared with the existing technology, which mostly performs scene editing and replacement manually, the present invention is aimed at the editing and replacement of delineated spatial areas in three-dimensional scenes. In the present invention, the designated/delimited spatial area only needs to be edited and replaced manually. Forming a spatial geometry or spatial envelope in the three-dimensional space can quickly filter out the required original model nodes, and directly replace the model in the area. It also supports users to make a secondary selection of the replacement model to perform preview. , inspection and adjustment operations. On the contrary, most of the current existing technologies require manual selection one by one in the model directory tree. When the required nodes in the model directory tree are scattered or large in size, manual selection is time-consuming, laborious and inaccurate. , while the node search function in the prior art cannot filter models that default to a lot of information. The model replacement method of the present invention provides the function of customizing area divisions, allowing users to plan a certain range, eliminating the need for users to manually select multiple The process of model nodes, and there are no requirements for model node names and node attributes. As long as there is a three-dimensional model, it can be filtered.
现有技术中的三维模型建立过程是以打点、搭线、铺面以及合体的方式逐级形成三维模型的搭建。例如,现有技术CN111223177A公开了一种三维空间的三维模型的构建方法和装置,通过获取三维空间的二维全景图像以及三维空间的第一表面的四个顶点在二维全景图像的坐标系中的坐标;基于第一表面的四个顶点在二维全景图像的坐标系中的坐标将第一表面的四个顶点投影到三维投影空间中,以获得第一表面的四个顶点在三维投影空间中的四个第一投影点;对四个第一投影点进行共面校正,以基于四个第一投影点获得第一表面的四个顶点在三维投影空间中的四个第二投影点;基于四个第二投影点获取三维模型的第一表面的四个顶点;基于三维模型的第一表面的四个顶点以及三维空间在三维投影空间中投影的沿第一坐标轴的高度获取三维模型的第二表面的四个顶点,其中的点线面以及最终形成的三维模型实体具有逐级且连续的模型目录树结构,其中每个模型要素的建立都具有特定的编辑顺序。因此,如果需要对此种方式建立的三维模型的部分内容进行替换时,现有的常规技术手段通常是直接选取需要进行替换的点线面或者三维实体的部分模型,此时选中的待替换模型存在模型目录树结构的跨序问题,即选取的替换部段存在跨越多个树杈结构以及多个编辑顺序的问题,由此也将打乱模型目录树中的编辑顺序,一旦模型目录树中的编辑顺序存在不连续的状况时,将直接影响到三维模型的后期组合渲染,从而提高替换后的三维模型的数据运算处理量。另一方面,以此种方式进行替换后的三维模型目录树的顺序将发生变化,基于编辑顺序进行搜索的节点选取功能也将存在断点,而无法进行全面的节点搜索,从而导致节点搜索信息在模型替换部分的缺失。与上述现有技术不同的是,本发明以三维场景中的空间区域为编辑和替换对象,使得三维模型需要编辑和替换的具体要素都能够被囊括在该部分空间区域内,从而摈弃模型目录树中的编辑顺序对三维模型编辑和替换过程所产生的影响,进一步显著降低三维模型编辑和替换过程中三维模型的点线面等具体要素变化对三维模型整体所带来的影响所进行的数据运算处理量。The three-dimensional model building process in the prior art is to build a three-dimensional model step by step through dotting, wiring, paving, and integration. For example, the prior art CN111223177A discloses a method and device for constructing a three-dimensional model in a three-dimensional space, by acquiring a two-dimensional panoramic image of the three-dimensional space and the four vertices of the first surface of the three-dimensional space in the coordinate system of the two-dimensional panoramic image coordinates; project the four vertices of the first surface into the three-dimensional projection space based on the coordinates of the four vertices of the first surface in the coordinate system of the two-dimensional panoramic image to obtain the four vertices of the first surface in the three-dimensional projection space four first projection points in; perform coplanar correction on the four first projection points to obtain four second projection points of the four vertices of the first surface in the three-dimensional projection space based on the four first projection points; Obtain the four vertices of the first surface of the three-dimensional model based on the four second projection points; obtain the three-dimensional model based on the four vertices of the first surface of the three-dimensional model and the height along the first coordinate axis of the three-dimensional space projected in the three-dimensional projection space The four vertices of the second surface, the points, lines, surfaces, and the final three-dimensional model entity have a hierarchical and continuous model directory tree structure, in which each model element is established in a specific editing order. Therefore, if it is necessary to replace part of the three-dimensional model created in this way, the existing conventional technical method is usually to directly select the point, line, surface or part of the three-dimensional solid model that needs to be replaced. At this time, the selected model to be replaced There is a cross-order problem in the model directory tree structure, that is, the selected replacement section has the problem of spanning multiple tree branch structures and multiple editing orders. This will also disrupt the editing order in the model directory tree. Once the model directory tree is in When there is discontinuity in the editing sequence, it will directly affect the post-combined rendering of the 3D model, thereby increasing the data calculation processing volume of the replaced 3D model. On the other hand, the order of the 3D model directory tree after replacement in this way will change, and the node selection function that searches based on the editing order will also have breakpoints, making it impossible to conduct a comprehensive node search, resulting in node search information Missing part in model replacement. Different from the above-mentioned prior art, the present invention uses the spatial area in the three-dimensional scene as the editing and replacement object, so that the specific elements that need to be edited and replaced in the three-dimensional model can be included in this part of the spatial area, thus eliminating the need for the model directory tree. The impact of the editing sequence in the 3D model editing and replacement process will further significantly reduce the impact of changes in specific elements such as points, lines, and surfaces of the 3D model on the overall 3D model during the 3D model editing and replacement process. processing volume.
可以理解的是,当需要对三维模型中的部分内容进行编辑和替换时,现有的常规处理方式需要选中特定的需要进行编辑和替换的三维模型中的实体要素,例如点线面等,选中部分的要素需要通过确定的参考坐标系来进行位置的确定,通常的参考坐标系为三维模型初始建立时所确定的坐标系,此时选中的需要进行替换的要素的位置基于参考坐标系进行确定,不同的要素具有完全不同的坐标信息。当需要将待替换模型新加入到原始模型中时,此时需要对待替换模型的每一个要素赋予与选中的需要进行替换的要素相对应的坐标信息,并将其纳入到新模型的模型目录树中,该过程需要对每一个要素的坐标信息进行相应的数据运算及处理,从而显著增加了数据运算的处理量。相反地,本发明将需要进行编辑和替换的要素以空间区域的方式进行限定,从而将所有需要进行编辑和替换的目标模型的相关要素以统一“打包”的数据形式进行处理,省去了需要对每一个要素进行坐标信息处理的步骤,显著降低了需要进行坐标信息处理的数据量。此时需要进行编辑和替换的空间区域以相关关联的集合体存在于原始三维模型中,该空间区域的位置信息仅需要通过单次的运算处理便能够确定,以此提供需要进行编辑和替换的准确位置信息,极大地提高了三维模型编辑和替换的数据处理效率,尤其是通过在三维空间中形成一个空间几何体或空间包络体来避免模型目录树中编辑顺序信息造成的模型编辑和替换运算处理量的增加。It is understandable that when part of the content in the 3D model needs to be edited and replaced, the existing conventional processing method requires selecting the specific entity elements in the 3D model that need to be edited and replaced, such as points, lines, surfaces, etc., and selecting Some elements need to be positioned through a certain reference coordinate system. The usual reference coordinate system is the coordinate system determined when the three-dimensional model is initially established. At this time, the location of the selected elements that need to be replaced is determined based on the reference coordinate system. , different features have completely different coordinate information. When the model to be replaced needs to be added to the original model, each element of the model to be replaced needs to be assigned coordinate information corresponding to the selected element that needs to be replaced, and included in the model directory tree of the new model. , this process requires corresponding data operations and processing on the coordinate information of each element, thus significantly increasing the processing volume of data operations. On the contrary, the present invention limits the elements that need to be edited and replaced in the form of spatial areas, so that all relevant elements of the target model that need to be edited and replaced are processed in a unified "packaged" data form, eliminating the need for The step of processing coordinate information for each element significantly reduces the amount of data that needs to be processed for coordinate information. At this time, the spatial area that needs to be edited and replaced exists in the original three-dimensional model as a related aggregate. The position information of this spatial area only needs to be determined through a single operation, thereby providing the information that needs to be edited and replaced. Accurate position information greatly improves the data processing efficiency of 3D model editing and replacement, especially by forming a spatial geometry or spatial envelope in the 3D space to avoid model editing and replacement operations caused by editing sequence information in the model directory tree. Increased throughput.
优选地,在三维场景中构建部分或全部地包含若干三维模型的替换空间包括:Preferably, constructing a replacement space that partially or fully contains several three-dimensional models in a three-dimensional scene includes:
在三维场景中构建至少一个平面区域,平面区域位于若干待替换的三维模型所共用的至少一个投影面;Constructing at least one planar area in the three-dimensional scene, the planar area being located on at least one projection plane shared by several three-dimensional models to be replaced;
根据投影面沿法向方向的最大包络高度确定平面区域的拓展高度;Determine the expansion height of the plane area based on the maximum envelope height of the projection surface along the normal direction;
基于拓展高度形成替换空间。A replacement space is formed based on the extended height.
优选地,筛选过滤替换空间中的若干三维模型以确定待替换的原始模型包括:Preferably, filtering several three-dimensional models in the replacement space to determine the original model to be replaced includes:
将全部顶点与线条终结于替换空间内的三维模型确定为待替换的第一原始模型;Determine the three-dimensional model in which all vertices and lines end in the replacement space as the first original model to be replaced;
将部分顶点与线条终结于替换空间内的三维模型确定为待替换的第二原始模型。A three-dimensional model in which some vertices and lines end in the replacement space is determined as the second original model to be replaced.
优选地,在三维模型为顶点与边线均位于替换空间内的第一原始模型的情况下,替换步骤包括:Preferably, when the three-dimensional model is the first original model with both vertices and edges located in the replacement space, the replacement step includes:
在三维场景下选中替换空间内的所有第一原始模型;Select all the first original models in the replacement space in the three-dimensional scene;
从三维模型数据库中选择用以替换第一原始模型的各个替换模型的模型文件;Selecting model files for each replacement model to replace the first original model from the three-dimensional model database;
分析确定模型文件内的各个替换模型和三维场景下各个第一原始模型的中心位置和取向;Analyze and determine the center position and orientation of each replacement model in the model file and each first original model in the three-dimensional scene;
基于确定的中心位置和取向用各个替换模型来取代三维场景下的所有第一原始模型。All first original models in the three-dimensional scene are replaced with respective replacement models based on the determined center position and orientation.
优选地,在三维模型为部分顶点与边线位于替换空间内的第二原始模型的情况下,替换步骤包括:Preferably, when the three-dimensional model is a second original model with some vertices and edges located in the replacement space, the replacement step includes:
在三维场景下选中三维模型贯穿或部分嵌入替换空间的至少一个三维模型部段;Select at least one three-dimensional model section in the three-dimensional scene where the three-dimensional model penetrates or is partially embedded in the replacement space;
将至少一个三维模型部段的与替换空间包络线相交的点或线确定为替换性三维模型部段的顶点和/或最外侧线条;Determining a point or line of at least one three-dimensional model segment that intersects the replacement space envelope as the vertex and/or the outermost line of the replacement three-dimensional model segment;
将替换性三维模型部段确定为第二原始模型;identifying the alternative three-dimensional model segment as the second original model;
从三维模型数据库中选择用以替换第二原始模型的各个替换模型的模型文件;Selecting model files for each replacement model to replace the second original model from the three-dimensional model database;
分析确定模型文件内的各个替换模型和三维场景下各个第二原始模型的中心位置和取向;Analyze and determine the center position and orientation of each replacement model in the model file and each second original model in the three-dimensional scene;
基于确定的中心位置和取向用各个替换模型来取代三维场景下的第二原始模型。The second original model in the three-dimensional scene is replaced with each replacement model based on the determined center position and orientation.
优选地,分析确定模型文件内的各个替换模型和三维场景下各个第一原始模型或第二原始模型的中心位置和取向还包括:Preferably, analyzing and determining the center position and orientation of each replacement model in the model file and each first original model or second original model in the three-dimensional scene also includes:
分析确定各个替换模型和三维场景下各个第一原始模型或第二原始模型各自的单位替换空间的中心位置和取向。相比于框选多个模型,由于模型包围盒(即单位替换空间)是更为规则的几何体,其中心位置坐标和取向向量计算所需运算量更小,可以实现一次性快速粘贴替换明显更为大量的三维模型。Analyze and determine the center position and orientation of the unit replacement space of each replacement model and each first original model or second original model in the three-dimensional scene. Compared with box-selecting multiple models, since the model bounding box (i.e., the unit replacement space) is a more regular geometry, the calculation of its center position coordinates and orientation vector requires less computation, making it possible to achieve one-time quick paste replacement, which is significantly more efficient. for a large number of three-dimensional models.
优选地,响应于替换需求获取替换模型以将每个原始模型替换为替换模型还包括:Preferably, obtaining the replacement model to replace each original model with the replacement model in response to the replacement requirement further includes:
以所有原始模型彼此间的相对几何位置来确定相应的替换模型于替换空间中的布置位置;Determine the arrangement position of the corresponding replacement model in the replacement space based on the relative geometric positions of all original models to each other;
基于确定的布置位置用各个替换模型来取代三维场景下的原始模型。Each replacement model is used to replace the original model in the three-dimensional scene based on the determined layout position.
由于同比缩放的所需计算量是以三维空间内的全部替换模型为对象进行联合计算的,其并非需要对各个顶点和线条进行单独分析(其中可能包含遍历大量节点的计算而蕴含了大量内存消耗),而本发明提供的该种替换方式不需要遍历各个节点,所以能够满足一次性替换较多数量的三维模型。况且,同比缩放所带来的替换方式需要后期手动调整的工作量也非常少。可以理解的是,当采用现有技术中的常规技术手段调整需要进行编辑和替换的三维模型范围时,所选取的目标要素为点线面等实际的三维模型组成要素,单个元素的范围调整仅涉及该要素在其延伸方向上的变化,而并不延及其他要素的范围调整。如果需要对三维模型进行大范围的编辑和替换时,则需要对每一个单一的要素进行独立的运算,并且不同的要素由于其可能具有完全不同的延伸方向,从而导致不同的要素所要进行调整的运算量也是显著不同的,因此无法通过统一的运算处理方式来提高数据的运算处理效率。相反地,本发明通过将不同的要素限定在同一个空间区域内部,仅需要通过对空间的拓展范围这一项数据进行调整,便能够满足预期的范围调整,并且能够将不同要素范围调整的运算处理过程统一到单一的空间区域调整运算过程中,从而避免了需要分别对三维模型中不同要素进行运算的过程,显著降低了三维模型编辑和替换的运算工作量。Since the calculation required for year-on-year scaling is jointly calculated based on all replacement models in the three-dimensional space, it does not require separate analysis of each vertex and line (which may include calculations that traverse a large number of nodes, which consumes a lot of memory) ), and the replacement method provided by the present invention does not require traversing each node, so it can replace a large number of three-dimensional models at one time. Moreover, the replacement method brought about by year-on-year scaling requires very little manual adjustment in the future. It can be understood that when conventional technical means in the prior art are used to adjust the range of the 3D model that needs to be edited and replaced, the selected target elements are actual 3D model components such as points, lines, and surfaces, and the range adjustment of a single element is only It involves the change of the feature in its extension direction and does not extend to the scope adjustment of other features. If a large-scale editing and replacement of a 3D model is required, independent operations must be performed on each single element, and different elements may have completely different extension directions, resulting in different elements that need to be adjusted. The amount of operations is also significantly different, so it is impossible to improve the efficiency of data operation processing through a unified operation processing method. On the contrary, by limiting different elements to the same spatial area, the present invention only needs to adjust the data of the expansion range of the space to meet the expected range adjustment, and can adjust the calculation of the range of different elements. The processing process is unified into a single spatial area adjustment operation process, thereby avoiding the need to separately operate different elements in the 3D model, and significantly reducing the computational workload of editing and replacing the 3D model.
优选地,本发明提供的实现区域三维模型替换的方法还包括:Preferably, the method for realizing regional three-dimensional model replacement provided by the present invention also includes:
结合所选择的各个替换模型的模型文件提供用于替换的替换列表,以允许用户能够基于替换列表确定替换模型和原始模型的对应关系,并执行对替换模型的手动替换。A replacement list for replacement is provided in combination with the model file of each selected replacement model to allow the user to determine the correspondence between the replacement model and the original model based on the replacement list and perform manual replacement of the replacement model.
优选地,本发明的最大包络高度大于或等于待替换的若干三维模型中法线高度最大的顶点或线条所在的位置。Preferably, the maximum envelope height of the present invention is greater than or equal to the location of the vertex or line with the largest normal height in several three-dimensional models to be replaced.
优选地,本发明还涉及一种实现区域三维模型替换的系统,该系统包括:Preferably, the present invention also relates to a system for realizing regional three-dimensional model replacement, which system includes:
构建模块,用于在三维场景中构建部分或全部地包含若干三维模型的替换空间;Building module, used to construct a replacement space that partially or fully contains several three-dimensional models in a three-dimensional scene;
确定模块,用于筛选过滤替换空间中的若干三维模型以确定待替换的原始模型;The determination module is used to filter several three-dimensional models in the replacement space to determine the original model to be replaced;
执行模块,用于响应替换需求获取替换模型以将每个原始模型替换为替换模型。An execution module is configured to obtain replacement models in response to replacement requirements to replace each original model with a replacement model.
附图说明Description of drawings
图1是本发明提供的一种优选实施方式的原始模型与替换模型在替换空间内的空间位置示意图之一;Figure 1 is one of the schematic diagrams of the spatial positions of the original model and the replacement model in the replacement space according to a preferred embodiment of the present invention;
图2是本发明提供的一种优选实施方式的原始模型与替换模型在替换空间内的空间位置示意图之二;Figure 2 is a second schematic diagram of the spatial positions of the original model and the replacement model in the replacement space according to a preferred embodiment of the present invention;
图3是本发明提供的一种优选实施方式的实现区域三维模型替换的方法的流程示意图。Figure 3 is a schematic flowchart of a method for realizing regional three-dimensional model replacement according to a preferred embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图对本发明的较佳实施例进行详细阐述,以使本发明的优点和特征能更易于被本领域技术人员理解,从而对本发明的保护范围做出更为清楚明确的界定。虽然附图中显示了本发明的示例性实施方式,然而应当理解的是,可以以各种形式实现本发明而不应被这里阐述的实施方式所限制。The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, and the protection scope of the present invention can be more clearly defined. Although exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be embodied in various forms and is not limited to the embodiments set forth herein.
实施例1Example 1
本发明实施例提供了一种实现区域三维模型替换的方法,可以包括如下步骤:The embodiment of the present invention provides a method for realizing regional three-dimensional model replacement, which may include the following steps:
在三维场景中构建部分或全部地包含若干三维模型的替换空间。Construct a replacement space that partially or completely contains several 3D models in a 3D scene.
筛选过滤替换空间中的若干三维模型以确定待替换的原始模型。Filter several three-dimensional models in the replacement space to determine the original model to be replaced.
响应于替换需求获取替换模型以将每个原始模型替换为替换模型。Replacement models are obtained in response to replacement requirements to replace each original model with a replacement model.
特别地,本发明中,原始模型可以理解为所构建的替换空间或空间包络体中待替换的三维模型。替换模型可以理解为用于替换所构建的替换空间或空间包络体中原始模型的三维模型。换言之,利用替换模型取代替换空间或空间包络体中对应位置的原始模型。In particular, in the present invention, the original model can be understood as the three-dimensional model to be replaced in the constructed replacement space or spatial envelope. The replacement model can be understood as a three-dimensional model used to replace the original model in the constructed replacement space or space envelope. In other words, a replacement model is used to replace the original model at the corresponding location in the replacement space or space envelope.
图1示出了原始模型与替换模型在替换空间内的空间位置示例之一,图1所示的虚线框可以表示本发明所述的替换空间。该替换空间可由包围“若干三维模型”在至少一个投影面上的所有顶点和线条的平面区域拉伸形成。例如,替换空间可由图1所示的若干原始模型的竖向投影所在底面沿高度方向拓展形成。进一步地,该替换空间部分或全部地包含一个或多个待替换的三维模型(即原始模型),在利用替换模型取代原始模型时,取代操作是在该替换空间内执行的。应当理解的是,图1虽示出了替换空间的一种具体形状实例,但仅是作为非限制性实例的说明,在一些实施例中,该替换空间可以是除图1之外的能够部分或全部地包含若干三维模型的任何规则或不规则的空间几何形状。Figure 1 shows one example of the spatial positions of the original model and the replacement model in the replacement space. The dotted box shown in Figure 1 can represent the replacement space according to the present invention. The replacement space may be formed by stretching a planar area surrounding all vertices and lines of "several three-dimensional models" on at least one projection plane. For example, the replacement space can be formed by extending the bottom surface along the height direction where the vertical projections of several original models shown in Figure 1 are located. Further, the replacement space partially or completely contains one or more three-dimensional models to be replaced (i.e., original models). When the replacement model is used to replace the original model, the replacement operation is performed in the replacement space. It should be understood that although Figure 1 shows a specific shape example of the replacement space, it is only used as a non-limiting example. In some embodiments, the replacement space can be a part other than Figure 1 Or any regular or irregular spatial geometry that entirely encompasses several three-dimensional models.
根据一种优选实施方式,本发明中,在三维场景中构建部分或全部地包含若干三维模型的替换空间之步骤可包括:According to a preferred embodiment, in the present invention, the step of constructing a replacement space that partially or fully includes several three-dimensional models in a three-dimensional scene may include:
在三维场景中构建至少一个平面区域,所述平面区域位于若干待替换的三维模型所共用的至少一个投影面。At least one planar area is constructed in the three-dimensional scene, and the planar area is located on at least one projection plane shared by several three-dimensional models to be replaced.
根据所述投影面沿法向方向的最大包络高度确定所述平面区域的拓展高度。The expansion height of the planar area is determined based on the maximum envelope height of the projection surface along the normal direction.
基于所述拓展高度形成所述替换空间。The replacement space is formed based on the extended height.
具体地,首先该平面区域位于有待替换的若干三维模型所共用的至少一个投影面上,且该平面区域包围“有待替换的若干三维模型”在该至少一个投影面上的所有顶点和线条;其次,根据“有待替换的若干三维模型”的从该至少一个投影面沿法向方向的最大包络高度来确定该平面区域的拓展高度,也即该平面区域向另一个方向(如竖向)的生长所需的高度,根据该拓展高度“生长再拉伸”,由此形成一个空间几何体或空间包络体,将其作为所述替换空间,规划该替换空间的目的在于选择将要被替换的若干三维模型。特别地,顶点与线条完全终结于替换空间内的三维模型在下文也被称为第一原始模型。优选地,本发明中,最大包络高度大于或等于有待替换的若干三维模型中法线高度最大的顶点或线条所在的位置。Specifically, first, the plane area is located on at least one projection plane shared by several three-dimensional models to be replaced, and the plane area surrounds all vertices and lines of the "several three-dimensional models to be replaced" on the at least one projection plane; secondly, , the expansion height of the plane area is determined based on the maximum envelope height of the "several three-dimensional models to be replaced" along the normal direction from the at least one projection surface, that is, the expansion height of the plane area in another direction (such as the vertical direction) The height required for growth is "grown and stretched" according to the expanded height, thereby forming a spatial geometry or spatial envelope, which is used as the replacement space. The purpose of planning the replacement space is to select several objects to be replaced. 3D model. In particular, the three-dimensional model whose vertices and lines completely terminate in the replacement space is also referred to as the first original model below. Preferably, in the present invention, the maximum envelope height is greater than or equal to the location of the vertex or line with the maximum normal height in several three-dimensional models to be replaced.
总体上,用户首先手动创建一个平面区域,然后由系统处理器(CentralProcessing Unit,CPU)基于该确定的平面区域计算分析形成包围有待替换的若干三维模型的空间几何体或空间包络体。为便于理解,本发明中将该空间几何体或空间包络体称为替换空间。Generally speaking, the user first manually creates a plane area, and then the system processor (Central Processing Unit, CPU) calculates and analyzes based on the determined plane area to form a spatial geometry or spatial envelope that surrounds several three-dimensional models to be replaced. For ease of understanding, this spatial geometry or spatial envelope is called a replacement space in the present invention.
特别地,平面区域的选取或创建可以利用该方法搭载的系统或平台之中的区域选取工具来完成,类似现有建模软件之中的矩形选择工具、多边形选择工具等。利用矩形选择工具可以在图形用户界面之上通过拖动光标来选择一个矩形区域内的模型,这种选择方式适用于选择较大的区域。利用多边形选择工具可以在图形用户界面之上通过拖动光标来选择一个多边形区域内的模型,这种选择方式适用于选择不规则形状的区域。可以理解的是,上述创建平面区域的方式仅是作为非限制性实例的说明,不应视为对本发明的具体限制,本领域技术人员也可通过本文未公开的其他所熟知的手段来创建该平面区域。In particular, the selection or creation of a planar area can be accomplished using the area selection tool in the system or platform equipped with this method, similar to the rectangular selection tool, polygon selection tool, etc. in existing modeling software. You can use the rectangular selection tool to select a model within a rectangular area by dragging the cursor on the graphical user interface. This selection method is suitable for selecting larger areas. The polygon selection tool allows you to select a model within a polygonal area by dragging the cursor on the graphical user interface. This selection method is suitable for selecting irregularly shaped areas. It can be understood that the above-mentioned method of creating a planar area is only used as a non-limiting example and should not be regarded as a specific limitation of the present invention. Those skilled in the art can also create the planar area through other well-known means not disclosed herein. flat area.
图1所示的平面区域及其对应的替换空间是规则的立方体,在其它可选实施方式中,平面区域及其对应的替换空间可以是不规则的空间几何体。具体而言,在利用平面区域及其对应的替换空间选中若干待替换的三维模型之时,替换空间的形态可以根据处于该替换空间边界的一个或多个三维模型的形态来确认。例如,若替换空间其中一侧包围面所包含的一个三维模型相对该侧的轮廓是弧面,则替换空间于该侧的包围面的部分或全部可以是适应该三维模型的弧面轮廓的形状(如弧形)。或者,若替换空间内包含的具有最大法线高度的三维模型的顶面是圆锥面时,则该替换空间相对于该三维模型的顶部包围面的部分或全部可以是适应该三维模型的圆锥轮廓的形状(如锥形)。由此,可以构建出各种形态的替换空间以包含若干类型的三维模型。尤其是,根据处于替换空间外围边界的一个或多个三维模型的形态来确认替换空间的形态可以避免选中过多无用空间(如不存在三维模型的区域),同时减少选中过多可能无需替换但置入替换空间的模型部段,从而增加系统处理计算量。The planar area and its corresponding replacement space shown in Figure 1 are regular cubes. In other optional embodiments, the planar area and its corresponding replacement space may be irregular spatial geometries. Specifically, when using a planar area and its corresponding replacement space to select several three-dimensional models to be replaced, the shape of the replacement space can be confirmed based on the shape of one or more three-dimensional models at the boundary of the replacement space. For example, if a three-dimensional model contained in one of the enclosing surfaces of one side of the replacement space is an arc relative to the outline of that side, then part or all of the enclosing surface of the replacement space on that side can be a shape adapted to the arcuate outline of the three-dimensional model. (like an arc). Alternatively, if the top surface of the three-dimensional model with the maximum normal height contained in the replacement space is a conical surface, then part or all of the top surrounding surface of the three-dimensional model relative to the replacement space can be a conical outline adapted to the three-dimensional model. shape (such as cone). From this, various forms of replacement spaces can be constructed to contain several types of three-dimensional models. In particular, confirming the shape of the replacement space based on the shape of one or more 3D models at the outer boundary of the replacement space can avoid selecting too many useless spaces (such as areas where there are no 3D models), and at the same time reduce the number of selected areas that may not require replacement. Model segments are placed in replacement spaces, thereby increasing the amount of calculations the system processes.
根据一种优选实施方式,本发明中,筛选过滤替换空间中的若干三维模型以确定待替换的原始模型包括:According to a preferred embodiment, in the present invention, screening several three-dimensional models in the replacement space to determine the original model to be replaced includes:
将全部顶点与线条终结于替换空间内的三维模型确定为待替换的第一原始模型。The three-dimensional model in which all vertices and lines end in the replacement space is determined as the first original model to be replaced.
将部分顶点与线条终结于替换空间内的三维模型确定为待替换的第二原始模型。A three-dimensional model in which some vertices and lines end in the replacement space is determined as the second original model to be replaced.
具体地,每个三维模型通常是由若干面组合而成的空间立体结构,该空间立体结构包含的每个面由相应的顶点和各顶点之间的连线所构成。因此,每个三维模型包含若干顶点和边线。进一步地,在确定的替换空间中,各三维模型与替换空间的空间几何关系通常包含一个或多个三维模型全部地包含于该替换空间,或者一个或多个三维模型部分地包含于该替换空间。鉴于此,将全部顶点与线条终结于所述替换空间内的三维模型确定为待替换的第一原始模型;将部分顶点与线条终结于所述替换空间内的三维模型确定为待替换的第二原始模型。相应地,在利用替换模型替换或取代替换空间中的三维模型(即原始模型)之时,至少涉及将替换空间中的每个三维模型全部替换或者仅替换部分的情况。Specifically, each three-dimensional model is usually a spatial three-dimensional structure composed of several faces, and each face included in the spatial three-dimensional structure is composed of a corresponding vertex and a connection between the vertices. Therefore, each 3D model contains several vertices and edges. Further, in the determined replacement space, the spatial geometric relationship between each three-dimensional model and the replacement space usually includes one or more three-dimensional models being completely included in the replacement space, or one or more three-dimensional models being partially included in the replacement space. . In view of this, the three-dimensional model with all vertices and lines ending in the replacement space is determined as the first original model to be replaced; the three-dimensional model with some vertices and lines ending in the replacement space is determined as the second original model to be replaced. original model. Correspondingly, when using a replacement model to replace or replace a three-dimensional model in the replacement space (ie, the original model), it at least involves replacing all or only part of each three-dimensional model in the replacement space.
根据一种优选实施方式,本发明中,响应于替换需求获取用以替换每个原始模型的替换模型包括响应于用户输入的替换需求选择本地模型以生成替换模型。也即根据用户需求从三维模型数据库中选取对应的替换模型。进一步地,通过对比原始模型和替换模型的差异可以确定需要进行替换的部分。According to a preferred embodiment of the present invention, obtaining a replacement model to replace each original model in response to a replacement requirement includes selecting a local model to generate a replacement model in response to a replacement requirement input by a user. That is, the corresponding replacement model is selected from the three-dimensional model database according to the user's needs. Furthermore, by comparing the differences between the original model and the replacement model, the parts that need to be replaced can be determined.
根据一种优选实施方式,本发明中,在所有原始模型的顶点和边线均位于替换空间内的第一情形下(也即三维模型为顶点与边线均位于替换空间内的第一原始模型的情况下),替换步骤包括:According to a preferred embodiment of the present invention, in the first situation where all vertices and edges of the original model are located in the replacement space (that is, the three-dimensional model is the first original model with both vertices and edges located in the replacement space). (below), the replacement steps include:
P1在三维场景下选中替换空间之内的所有原始模型(即第一原始模型)。P1 selects all original models within the replacement space (i.e., the first original model) in the three-dimensional scene.
P2从三维模型数据库中选择用以替换所有原始模型的各个替换模型的相应模型文件(一个或多个文件)。P2 selects the corresponding model file (one or more files) of each replacement model to replace all original models from the three-dimensional model database.
P3分析确定相应模型文件内的各个替换模型和三维场景下的各个原始模型的中心位置和取向。P3 analysis determines the center position and orientation of each replacement model in the corresponding model file and each original model in the three-dimensional scene.
P4用各个替换模型来取代所述三维场景下的所有原始模型。P4 replaces all original models in the three-dimensional scene with each replacement model.
根据一种优选实施方式,第一情形所述步骤P4中的“取代”操作进一步包括:根据各个原始模型的中心位置和取向来分别确定相应替换模型的中心位置和取向,从而按照相应原始模型的中心位置和取向来在三维场景下布置各个替换模型。换言之,使原始模型和替换后的替换模型在替换空间中的中心位置和/或取向向量保持一致。According to a preferred embodiment, the "replacement" operation in step P4 in the first scenario further includes: determining the center position and orientation of the corresponding replacement model according to the center position and orientation of each original model, so as to determine the center position and orientation of the corresponding original model according to the center position and orientation of each original model. Center position and orientation to arrange each replacement model in the 3D scene. In other words, the center position and/or orientation vector of the original model and the replaced replacement model in the replacement space are kept consistent.
根据一种优选实施方式,在本发明第一情形所述的步骤P2之后还包括:结合所选择的替换模型的模型文件向用户提供用于替换的替换列表,该替换列表用于用户手动确定替换模型和原始模型的对应关系,并允许用户手动执行替换。例如用户可手动选择替换模型节点,针对细节具体的替换模型节点选择是否要被替换。进一步地,在利用替换模型取代或替换原始模型的过程中,允许用户决定是否将原始模型从场景中删除或者隐藏。According to a preferred embodiment, after step P2 in the first aspect of the present invention, it also includes: providing the user with a replacement list for replacement in combination with the model file of the selected replacement model, and the replacement list is used for the user to manually determine the replacement. Correspondence between the model and the original model, and allows the user to perform replacement manually. For example, the user can manually select the replacement model node, and select whether the replacement model node should be replaced in detail. Further, in the process of replacing or replacing the original model with the replacement model, the user is allowed to decide whether to delete or hide the original model from the scene.
根据一种优选实施方式,在本发明第一情形所述的步骤P3步骤中,在分析确定替换模型和原始模型的中心位置和取向时,可以通过确定替换模型和原始模型的包围盒的中心位置和取向来代之。换言之,可以通过分析确定三维场景下各个替换模型和各个原始模型(即第一原始模型或第二原始模型)各自的单位替换空间的中心位置和取向的对应性来确定替换模型的导入或替换位置。具体地,首先基于确定的一个或多个原始模型,获取这些原始模型整体的模型包围盒(或第一单位替换空间),以此模型包围盒的第一中心坐标系为参考。进一步地,获取需导入的替换模型的模型包围盒(或第二单位替换空间)的第二中心坐标系,将两坐标系(即第一中心坐标系和第二中心坐标系)重合,以此作为替换模型替换位置的导入依据。According to a preferred embodiment, in step P3 described in the first aspect of the present invention, when analyzing and determining the center position and orientation of the replacement model and the original model, the center position of the bounding box of the replacement model and the original model can be determined by and orientation instead. In other words, the import or replacement position of the replacement model can be determined by analyzing and determining the correspondence between the center position and orientation of each replacement model and each original model (i.e., the first original model or the second original model) in the unit replacement space in the three-dimensional scene. . Specifically, based on the determined one or more original models, the model bounding box (or the first unit replacement space) of the entire original model is obtained, using the first center coordinate system of the model bounding box as a reference. Further, obtain the second center coordinate system of the model bounding box (or the second unit replacement space) of the replacement model to be imported, and overlap the two coordinate systems (i.e., the first center coordinate system and the second center coordinate system), so as to As the import basis for the replacement model replacement position.
特别地,每个原始模型和替换模型可对应有一个单位替换空间。例如图1所示的虚线框中的每个原始模型或替换模型都有一个最小替换空间(图中未示出),该最小替换空间类似于一个包围盒(如立方体结构)包含于前文所述的替换空间内,且该最小替换空间具有能够完整包含对应的一个原始模型或替换模型的最小空间几何尺寸。由此,对比分析每个原始模型和替换模型各自对应的单位替换空间的中心位置和取向的对应关系来确定替换模型的替换/导入位置。In particular, there can be one unit of replacement space for each original model and replacement model. For example, each original model or replacement model in the dotted box shown in Figure 1 has a minimum replacement space (not shown in the figure). This minimum replacement space is similar to a bounding box (such as a cubic structure) contained in the previous article. within the replacement space, and the minimum replacement space has the minimum spatial geometric size that can completely contain the corresponding original model or replacement model. Therefore, the corresponding relationship between the center position and orientation of the unit replacement space corresponding to each original model and the replacement model is compared and analyzed to determine the replacement/import position of the replacement model.
在一些可选实施方式中,针对上文所述的步骤P3:除了执行以中心位置和取向来确定替换模型的布置位置的第一替换方案之外,本发明另一方面还提供以三维场景内的各三维模型之间的相对几何位置关系来确定替换模型的布置位置的第二替换方案。具体地,替换模型之间的相互间距比例是以原始模型的相互间距比例来确定的,例如在同一三维空间内同比缩小或同比放大相互间距,以满足替换模型所带来的尺寸差异。换而言之,第二替换方案是以相对间距而不是中心位置来确定布置位置的,但替换模型的取向向量是与相应原始模型的取向向量保持一致。In some optional implementations, for step P3 described above: in addition to performing the first alternative solution of determining the arrangement position of the replacement model with the center position and orientation, another aspect of the present invention also provides the method of determining the arrangement position within the three-dimensional scene. The relative geometric positional relationship between the three-dimensional models is used to determine the second alternative of the arrangement position of the replacement model. Specifically, the mutual spacing ratio between the replacement models is determined based on the mutual spacing ratio of the original models, for example, the mutual spacing is reduced year-on-year or enlarged year-on-year in the same three-dimensional space to meet the size difference caused by the replacement models. In other words, the second alternative is to determine the arrangement position based on the relative spacing rather than the central position, but the orientation vector of the replacement model is consistent with the orientation vector of the corresponding original model.
根据一种优选实施方式,本发明中,在原始模型的部分顶点和边线位于替换空间(如三维模型存贯穿或部分嵌入替换空间中的三维模型部段)内的第二情形下(也即三维模型为部分顶点与边线位于替换空间内的第二原始模型的情况下),替换步骤包括:According to a preferred embodiment of the present invention, in the second situation where some vertices and edges of the original model are located in the replacement space (such as a three-dimensional model segment that runs through or is partially embedded in the replacement space) (that is, the three-dimensional model is When the model is a second original model with some vertices and edges located in the replacement space), the replacement steps include:
P5在三维场景下选中三维模型贯穿或部分嵌入替换空间的至少一个三维模型部段。P5 selects at least one three-dimensional model segment in the three-dimensional scene where the three-dimensional model penetrates or is partially embedded in the replacement space.
P6将至少一个三维模型部段的与替换空间包络线相交的点或线确定为替换性三维模型部段的顶点和/或最外侧线条。P6 determines the point or line of at least one three-dimensional model section that intersects the replacement space envelope as the vertex and/or the outermost line of the replacement three-dimensional model section.
P7将替换性三维模型部段确定为第二原始模型。P7 determines the alternative three-dimensional model segment as the second original model.
P8从三维模型数据库中选择用以替换第二原始模型的各个替换模型的模型文件。P8 selects model files of each replacement model to replace the second original model from the three-dimensional model database.
P9分析确定模型文件内的各个替换模型和三维场景下各个第二原始模型的中心位置和取向。P9 analysis determines the center position and orientation of each replacement model in the model file and each second original model in the three-dimensional scene.
P10基于确定的中心位置和取向用各个替换模型来取代三维场景下的第二原始模型。P10 replaces the second original model in the three-dimensional scene with each replacement model based on the determined center position and orientation.
具体地,在“选中替换空间之内的原始模型之时”预先确定贯穿或部分嵌入替换空间中的至少一个三维模型部段是应当予以替换的情况下,将该至少一个三维模型部段的与替换空间包络线相交的点或线确定为替换性三维模型部段的顶点和/或最外侧线条,由此将该替换性三维模型部段确定为第二原始模型。换言之,第二原始模型是贯穿或部分嵌入替换空间中的应当予以替换的三维模型部段,但在替换期间被视为是替换空间之内的原始模型。Specifically, when it is determined in advance that at least one three-dimensional model section that runs through or is partially embedded in the replacement space should be replaced "when the original model within the replacement space is selected", the at least one three-dimensional model section is combined with The point or line where the replacement space envelope intersects is determined as the vertex and/or the outermost line of the replacement three-dimensional model segment, thereby determining the replacement three-dimensional model segment as the second original model. In other words, the second original model is a three-dimensional model section that is to be replaced throughout or partially embedded in the replacement space, but during the replacement is considered to be the original model within the replacement space.
如图2所示,在替换空间内存在至少一个贯穿或部分嵌入替换空间的三维模型部段A时,将该至少一个三维模型部段A的与替换空间包络线相交的点或线确定为替换性三维模型部段的顶点和/或最外侧线条,并将该替换性三维模型部段确定为应当予以替换的第二原始模型。从三维模型数据库中选择用以替换第二原始模型的各个替换模型的模型文件,并通过分析各个替换模型和各个第二原始模型的中心位置和取向来将该三维模型部段A替换为三维模型部段A’。进一步地,将处于该替换空间之外的原本与三维模型部段A一体的三维模型部段B和三维模型部段C与替换后的三维模型部段A’适应性组合以形成一体化模型。As shown in Figure 2, when there is at least one three-dimensional model section A in the replacement space that runs through or is partially embedded in the replacement space, the point or line of the at least one three-dimensional model section A that intersects the envelope of the replacement space is determined as The vertices and/or outermost lines of the alternative three-dimensional model section are replaced and the alternative three-dimensional model section is determined as the second original model that should be replaced. Select the model file of each replacement model to replace the second original model from the three-dimensional model database, and replace the three-dimensional model section A with the three-dimensional model by analyzing the center position and orientation of each replacement model and each second original model. Section A'. Further, the three-dimensional model section B and the three-dimensional model section C that are originally integrated with the three-dimensional model section A and are outside the replacement space are adaptively combined with the replaced three-dimensional model section A' to form an integrated model.
作为非限制性实例的说明,所谓适应性组合例如是:当三维模型部段A是横穿替换空间的某一管道的部分节段,而替换后的三维模型部段A’是管径相较缩小的另一管道时,将处于该替换空间之外的原本与三维模型部段A一体的三维模型部段B和三维模型部段C同比缩放,并与替换后的三维模型部段A’在与替换空间包络线相交的点或线处进行接合。或者,当三维模型部段A是横穿替换空间的直线形管道,而替换后的三维模型部段A’是直径基本相同的蜿蜒形管道时,将处于该替换空间之外的原本与三维模型部段A一体的三维模型部段B和三维模型部段C与替换后的三维模型部段A’在与替换空间包络线相交的点或线处进行接合。另外,在其他可选实施方式中,可以将处于该替换空间之外的原本与三维模型部段A一体的三维模型部段B和三维模型部段C与替换后的三维模型部段A’适应性同步替换,并由用户决定后续操作,如拒绝替换、同意替换或修改替换等。特别地,在替换“贯穿或部分嵌入替换空间中的至少一个三维模型部段”时,可以采用以模型中心位置和取向为依据的第一替换方案,或者以各模型之间的相对几何位置关系为依据的第二替换方案。As a non-limiting example, the so-called adaptive combination is, for example: when the three-dimensional model section A is a partial section of a certain pipe that crosses the replacement space, and the replaced three-dimensional model section A' is a pipe diameter compared to When shrinking another pipeline, the 3D model section B and the 3D model section C that are originally integrated with the 3D model section A and are outside the replacement space are scaled proportionally, and are placed in the same position as the replaced 3D model section A'. Join at a point or line that intersects the replacement space envelope. Or, when the three-dimensional model section A is a straight pipe crossing the replacement space, and the replaced three-dimensional model section A' is a serpentine pipe with basically the same diameter, the original and three-dimensional pipes outside the replacement space will be The three-dimensional model sections B and C integrated with the model section A are joined to the replaced three-dimensional model section A' at a point or line that intersects the replacement space envelope. In addition, in other optional embodiments, the three-dimensional model section B and the three-dimensional model section C that are originally integrated with the three-dimensional model section A and are outside the replacement space can be adapted to the replaced three-dimensional model section A'. Substitution is performed synchronously, and the user decides the subsequent operations, such as rejecting the substitution, agreeing to the substitution, or modifying the substitution, etc. In particular, when replacing "at least one three-dimensional model segment that runs through or is partially embedded in the replacement space", the first replacement solution based on the center position and orientation of the model can be used, or the relative geometric position relationship between the models can be used based on the second alternative.
根据一种优选实施方式,在替换空间内除了待替换的第一原始模型和第二原始模型之外,还存在“贯穿或部分嵌入替换空间中的应当予以保留的三维模型部段”的第三情形下,替换步骤包括:According to a preferred embodiment, in the replacement space, in addition to the first original model and the second original model to be replaced, there is also a third "three-dimensional model section that runs through or is partially embedded in the replacement space and should be retained." In this case, the replacement steps include:
在第一情形的步骤P3步骤之前,当分析确定相应模型文件内的各个替换模型和三维场景下的各个原始模型的中心位置和取向时,确定出至少一个顶点或边线位于三维场景之外的三维模型时,将该三维模型确定为作为非原始模型的固定三维模型。在第一情形的步骤P4步骤中,所述固定三维模型的中心位置和取向是不加以分析确定的,或者分析确定的结果不予以保留的,进而该固定三维模型不存在与之对应并用以取代的替换模型。Before step P3 in the first situation, when analyzing and determining the center position and orientation of each replacement model in the corresponding model file and each original model in the three-dimensional scene, it is determined that at least one vertex or edge is located outside the three-dimensional scene. When creating a model, the three-dimensional model is determined as a fixed three-dimensional model that is not an original model. In step P4 of the first situation, the center position and orientation of the fixed three-dimensional model are not determined by analysis, or the results of the analysis and determination are not retained, and the fixed three-dimensional model does not correspond to it and is used to replace it. replacement model.
进一步地,基于上述的“贯穿或部分嵌入替换空间中的应当予以保留的三维模型部段”第三情形,还可能存在如下所述的第四情形:Furthermore, based on the above-mentioned third situation of "three-dimensional model sections that penetrate or are partially embedded in the replacement space and should be retained", there may also be a fourth situation as described below:
当固定三维模型与原始模型存在因法规或客观条件而存在固定的间距要求的情况下,在第二替换方案中计算相对间距时,在保留第一原始模型与第二原始模型和/或固定三维模型的绝对间距的前提下,遵循第一原始模型的相互间距比例关系来计算替换模型的相互间距。When the fixed three-dimensional model and the original model have fixed spacing requirements due to regulations or objective conditions, when calculating the relative spacing in the second alternative, the first original model and the second original model and/or the fixed three-dimensional On the premise of the absolute spacing of the models, the mutual spacing of the replacement models is calculated according to the mutual spacing proportional relationship of the first original model.
优选地,根据本发明,一个第一原始模型与另一个第一原始模型之间的间距也可以预先被设定为需要保留的绝对间距,在执行针对原始模型的替换时,所述绝对间距在第二替换方案中计算将予以保留。Preferably, according to the present invention, the distance between one first original model and another first original model can also be preset as an absolute distance that needs to be retained. When performing a replacement for the original model, the absolute distance is The calculations in the second alternative will be preserved.
特别地,第一替换方案与第二替换方案可以联合使用,即将三维空间内划分为以中心位置为关键要素进行替换的至少一个第一区域、以相互间距为关键要素进行替换的至少一个第二区域、考虑相互间距和绝对间距两者作为关键要素进行替换的至少一个第三区域以及考虑中心位置、相互间距和绝对间距三者作为关键要素进行替换的至少一个第四区域。In particular, the first replacement scheme and the second replacement scheme can be used jointly, that is, the three-dimensional space is divided into at least one first area for replacement with the central position as the key element, and at least one second area for replacement with the mutual spacing as the key element. area, at least one third area that considers both mutual spacing and absolute spacing as key elements for replacement, and at least one fourth area that considers center position, mutual spacing, and absolute spacing as key elements for replacement.
图3示出了本发明所述的实现区域三维模型替换的方法的一种操作流程,该操作流程具体可包括如下步骤:Figure 3 shows an operation flow of the method for realizing regional three-dimensional model replacement according to the present invention. The operation flow may specifically include the following steps:
S1三维模型数据准备。S1 3D model data preparation.
S2绘制平面区域并形成包含一个或多个待替换的三维模型的替换空间。S2 draws a planar area and forms a replacement space containing one or more three-dimensional models to be replaced.
S3响应于用户的替换需求获取本地替换模型。S3 obtains the local replacement model in response to the user's replacement request.
S4预览窗口中二次筛选替换模型。Secondary filtering and replacement of models in the S4 preview window.
S5利用替换模型取代替换空间中的一个或多个待替换的三维模型。S5 uses the replacement model to replace one or more three-dimensional models to be replaced in the replacement space.
S6对替换后的替换模型的替换位置进行调整。S6 adjusts the replacement position of the replaced replacement model.
根据一种优选实施方式,在执行步骤S2之时或之后还包括步骤S7:获取替换空间中的一个或多个待替换的三维模型的模型包围盒(或单位替换空间)的第一中心位置。According to a preferred embodiment, when or after step S2 is executed, step S7 is also included: obtaining the first center position of the model bounding box (or unit replacement space) of one or more three-dimensional models to be replaced in the replacement space.
根据一种优选实施方式,在执行步骤S4之时或之后还包括步骤S8:获取一个或多个执行替换的替换模型的模型包围盒(或单位替换空间)的第二中心位置。进一步地,执行步骤S9:将一个或多个待替换的三维模型的模型包围盒(或单位替换空间)的第一中心位置与相应的一个或多个执行替换的替换模型的模型包围盒(或单位替换空间)的第二中心位置对齐,从而基于两两中心位置的对齐结果执行替换模型对原始模型的取代操作。According to a preferred embodiment, when or after step S4 is executed, step S8 is also included: obtaining the second center position of the model bounding box (or unit replacement space) of one or more replacement models for performing replacement. Further, step S9 is performed: comparing the first center position of the model bounding box (or unit replacement space) of one or more three-dimensional models to be replaced with the corresponding model bounding box (or model bounding box) of one or more replacement models to be replaced. The unit replacement space) is aligned with the second center position, so that the substitution operation of the replacement model for the original model is performed based on the alignment result of the pairwise center positions.
本领域技术人员应理解,只要能够实现本发明的目的,在上述各步骤前后或步骤之间还可包含其他步骤或操作,例如进一步优化和/或改善本发明所述的方法。此外,本发明所述的方法虽被显示和描述为按顺序执行的一系列动作,但是应当理解为该方法不受顺序的限制。例如,一些动作可以以与本文描述的顺序不同的顺序发生。或者,一个动作可以与另一个动作同时发生。Those skilled in the art will understand that as long as the purpose of the present invention can be achieved, other steps or operations may be included before or after each of the above steps or between the steps, such as further optimizing and/or improving the method of the present invention. In addition, although the method of the present invention is shown and described as a series of actions performed in sequence, it should be understood that the method is not limited to the sequence. For example, some actions may occur in a different order than described herein. Or, one action can occur simultaneously with another action.
实施例2Example 2
本实施例提供了一种实现区域三维模型替换的系统,可以包括:This embodiment provides a system for realizing regional 3D model replacement, which may include:
构建模块,用于在三维场景中构建部分或全部地包含若干三维模型的替换空间;Building module, used to construct a replacement space that partially or fully contains several three-dimensional models in a three-dimensional scene;
确定模块,用于筛选过滤替换空间中的若干三维模型以确定待替换的原始模型;The determination module is used to filter several three-dimensional models in the replacement space to determine the original model to be replaced;
执行模块,用于响应替换需求获取替换模型以将每个原始模型替换为替换模型。An execution module is configured to obtain replacement models in response to replacement requirements to replace each original model with a replacement model.
根据一种优选实施方式,本发明中,构建模块进一步地可包括:According to a preferred embodiment, in the present invention, the building blocks may further include:
选取单元,用于用户在三维场景中构建至少一个位于若干待替换的三维模型所共用的至少一个投影面上的平面区域;Selecting a unit is used for the user to construct at least one plane area located on at least one projection plane shared by several three-dimensional models to be replaced in the three-dimensional scene;
计算单元,用于根据该投影面沿法向方向的最大包络高度确定平面区域的拓展高度;A calculation unit used to determine the expansion height of the plane area based on the maximum envelope height of the projection surface along the normal direction;
成形单元,用于基于计算单元确定的拓展高度形成替换空间。The forming unit is used to form the replacement space based on the expansion height determined by the calculation unit.
根据一种优选实施方式,本发明中,确定模块进一步地可包括:According to a preferred implementation, in the present invention, the determining module may further include:
第一筛选单元,用于将全部顶点与线条终结于替换空间内的三维模型确定为待替换的第一原始模型;The first screening unit is used to determine the three-dimensional model in which all vertices and lines end in the replacement space as the first original model to be replaced;
第二筛选单元,用于将部分顶点与线条终结于替换空间内的三维模型确定为待替换的第二原始模型。The second screening unit is used to determine the three-dimensional model whose vertices and lines terminate in the replacement space as the second original model to be replaced.
根据一种优选实施方式,本发明中,执行模块进一步可包括:According to a preferred implementation, in the present invention, the execution module may further include:
获取单元,用于响应用户输入的替换需求获取用以替换的替换模型;The acquisition unit is used to obtain the replacement model for replacement in response to the replacement requirement input by the user;
替换单元,用于将每个原始模型替换为替换模型。Replacement unit used to replace each original model with a replacement model.
本实施例提供的实现区域三维模型替换的系统的有益效果与上述实施例提供的实现区域三维模型替换的方法的有益效果相同,且该实现区域三维模型替换的系统中的其他技术特征与上述实施例公开的特征相同,为避免篇幅冗长,在此不做赘述。The beneficial effects of the system for realizing regional three-dimensional model replacement provided by this embodiment are the same as the beneficial effects of the method for realizing regional three-dimensional model replacement provided by the above-mentioned embodiments, and other technical features of the system for realizing regional three-dimensional model replacement are the same as those of the above-mentioned implementation. The features disclosed in the examples are the same and will not be described in detail here to avoid redundancy.
需要注意的是,上述具体实施例是示例性的,本领域技术人员可以在本发明公开内容的启发下想出各种解决方案,而这些解决方案也都属于本发明的公开范围并落入本发明的保护范围之内。本领域技术人员应该明白,本发明说明书及其附图均为说明性而并非构成对权利要求的限制。本发明的保护范围由权利要求及其等同物限定。本发明说明书包含多项发明构思,诸如“优选地”“根据一个优选实施方式”或“可选地”均表示相应段落公开了一个独立的构思,申请人保留根据每项发明构思提出分案申请的权利。It should be noted that the above specific embodiments are exemplary, and those skilled in the art can come up with various solutions inspired by the disclosure of the present invention, and these solutions also belong to the disclosure scope of the present invention and fall within the scope of the present invention. within the scope of protection of the invention. Those skilled in the art should understand that the description of the present invention and the accompanying drawings are illustrative and do not constitute limitations on the claims. The scope of protection of the present invention is defined by the claims and their equivalents. The description of the present invention contains multiple inventive concepts, such as "preferably", "according to a preferred embodiment" or "optionally" all indicate that the corresponding paragraph discloses an independent concept, and the applicant reserves the right to file a divisional application based on each inventive concept. s right.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311299864.3A CN117351170B (en) | 2023-10-09 | 2023-10-09 | A method and system for realizing regional three-dimensional model replacement |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311299864.3A CN117351170B (en) | 2023-10-09 | 2023-10-09 | A method and system for realizing regional three-dimensional model replacement |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117351170A true CN117351170A (en) | 2024-01-05 |
| CN117351170B CN117351170B (en) | 2025-01-28 |
Family
ID=89362512
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311299864.3A Active CN117351170B (en) | 2023-10-09 | 2023-10-09 | A method and system for realizing regional three-dimensional model replacement |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117351170B (en) |
Citations (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180205941A1 (en) * | 2017-01-17 | 2018-07-19 | Facebook, Inc. | Three-dimensional scene reconstruction from set of two dimensional images for consumption in virtual reality |
| CN109300188A (en) * | 2018-10-23 | 2019-02-01 | 北京旷视科技有限公司 | Threedimensional model processing method and processing device |
| US20200201945A1 (en) * | 2018-12-24 | 2020-06-25 | Dassault Systemes Solidworks Corporation | CAD Models by Creating Best-Fit Approximate 3D B-Rep Geometry |
| CN112381901A (en) * | 2020-11-16 | 2021-02-19 | 北京博能科技股份有限公司 | Three-dimensional model updating method and device and electronic equipment |
| CN112560125A (en) * | 2020-12-10 | 2021-03-26 | 上海联泰科技股份有限公司 | Generation method, generation system and preprocessing system of lattice structure model |
| CN112800511A (en) * | 2020-12-31 | 2021-05-14 | 杭州群核信息技术有限公司 | Home decoration material adjusting method and device, computer equipment and storage medium |
| CN113052983A (en) * | 2021-04-14 | 2021-06-29 | 杭州群核信息技术有限公司 | Customizable indoor three-dimensional scene editing method, device and system and storage medium |
| CN113593020A (en) * | 2021-08-10 | 2021-11-02 | 四川易方智慧科技有限公司 | Large-scale three-dimensional city scene generation method based on ArcGIS |
| CN114202626A (en) * | 2021-12-07 | 2022-03-18 | 中煤浙江测绘地理信息有限公司 | Model replacement method and storage medium for visual building |
| CN114693782A (en) * | 2020-12-29 | 2022-07-01 | 北京外号信息技术有限公司 | Method and device for determining the conversion relationship between a three-dimensional scene model coordinate system and a physical coordinate system |
| CN115457202A (en) * | 2022-09-07 | 2022-12-09 | 北京四维远见信息技术有限公司 | Method and device for updating three-dimensional model and storage medium |
| CN115471617A (en) * | 2022-10-14 | 2022-12-13 | 浙江省测绘科学技术研究院 | Local update method for real-world 3D slice data in large scenes |
| CN115600307A (en) * | 2022-12-01 | 2023-01-13 | 北京飞渡科技有限公司(Cn) | Method for generating single building from Mesh model of urban scene |
| US20230093087A1 (en) * | 2021-09-17 | 2023-03-23 | Yembo, Inc. | Browser optimized interactive electronic model based determination of attributes of a structure |
| CN115953535A (en) * | 2023-01-03 | 2023-04-11 | 深圳华为云计算技术有限公司 | Three-dimensional reconstruction method, device, computing device and storage medium |
| CN116071529A (en) * | 2023-02-08 | 2023-05-05 | 珠海金山数字网络科技有限公司 | Three-dimensional model processing method and device |
-
2023
- 2023-10-09 CN CN202311299864.3A patent/CN117351170B/en active Active
Patent Citations (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180205941A1 (en) * | 2017-01-17 | 2018-07-19 | Facebook, Inc. | Three-dimensional scene reconstruction from set of two dimensional images for consumption in virtual reality |
| CN109300188A (en) * | 2018-10-23 | 2019-02-01 | 北京旷视科技有限公司 | Threedimensional model processing method and processing device |
| US20200201945A1 (en) * | 2018-12-24 | 2020-06-25 | Dassault Systemes Solidworks Corporation | CAD Models by Creating Best-Fit Approximate 3D B-Rep Geometry |
| CN112381901A (en) * | 2020-11-16 | 2021-02-19 | 北京博能科技股份有限公司 | Three-dimensional model updating method and device and electronic equipment |
| CN112560125A (en) * | 2020-12-10 | 2021-03-26 | 上海联泰科技股份有限公司 | Generation method, generation system and preprocessing system of lattice structure model |
| CN114693782A (en) * | 2020-12-29 | 2022-07-01 | 北京外号信息技术有限公司 | Method and device for determining the conversion relationship between a three-dimensional scene model coordinate system and a physical coordinate system |
| CN112800511A (en) * | 2020-12-31 | 2021-05-14 | 杭州群核信息技术有限公司 | Home decoration material adjusting method and device, computer equipment and storage medium |
| CN113052983A (en) * | 2021-04-14 | 2021-06-29 | 杭州群核信息技术有限公司 | Customizable indoor three-dimensional scene editing method, device and system and storage medium |
| CN113593020A (en) * | 2021-08-10 | 2021-11-02 | 四川易方智慧科技有限公司 | Large-scale three-dimensional city scene generation method based on ArcGIS |
| US20230093087A1 (en) * | 2021-09-17 | 2023-03-23 | Yembo, Inc. | Browser optimized interactive electronic model based determination of attributes of a structure |
| CN114202626A (en) * | 2021-12-07 | 2022-03-18 | 中煤浙江测绘地理信息有限公司 | Model replacement method and storage medium for visual building |
| CN115457202A (en) * | 2022-09-07 | 2022-12-09 | 北京四维远见信息技术有限公司 | Method and device for updating three-dimensional model and storage medium |
| CN115471617A (en) * | 2022-10-14 | 2022-12-13 | 浙江省测绘科学技术研究院 | Local update method for real-world 3D slice data in large scenes |
| CN115600307A (en) * | 2022-12-01 | 2023-01-13 | 北京飞渡科技有限公司(Cn) | Method for generating single building from Mesh model of urban scene |
| CN115953535A (en) * | 2023-01-03 | 2023-04-11 | 深圳华为云计算技术有限公司 | Three-dimensional reconstruction method, device, computing device and storage medium |
| CN116071529A (en) * | 2023-02-08 | 2023-05-05 | 珠海金山数字网络科技有限公司 | Three-dimensional model processing method and device |
Non-Patent Citations (2)
| Title |
|---|
| 张孝勇 等: "建筑信息模型与3D WebGIS平台集成方法研究", 《测绘》, no. 04, 15 August 2019 (2019-08-15) * |
| 汪利斌 等: "局部表面参数化的实景三角网模型语义增强方法", 《测绘学报》, no. 02, 15 February 2020 (2020-02-15) * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117351170B (en) | 2025-01-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9171400B2 (en) | Creating a surface from a plurality of 3D curves | |
| CN106683167B (en) | Automatic modeling method for high-precision model of complex building | |
| US20080040080A1 (en) | System and Method for Identifying Original Design Intents Using 3D Scan Data | |
| KR20140142679A (en) | Designing a 3d modeled object with 2d views | |
| US20080174599A1 (en) | Implicit Feature Recognition for a Solid Modeling System | |
| CN118094691A (en) | Automated system for artificial rock structural design and manufacture | |
| CN117853691B (en) | Graphic processing method and system of three-dimensional model | |
| CN117611768B (en) | A road parametric modeling method based on CAD drawings | |
| CN112634455A (en) | Method for repairing three-dimensional model ridge line by using cutting triangular surface patch | |
| CN103238170A (en) | Display processing method and device | |
| CN109509249B (en) | Virtual scene light source intelligent generation method based on components | |
| CN114329666B (en) | Method, device, processor and computer-readable storage medium for parsing and importing three-dimensional pipe tool path | |
| CN113674294B (en) | A 3D model slicing processing method and device | |
| Santos et al. | Integration of CAD Models into Game Engines. | |
| CN117351170A (en) | A method and system for realizing regional 3D model replacement | |
| JP3786410B2 (en) | Fillet creation method and 3D CAD program | |
| CN116934986A (en) | Three-dimensional road map optimization method and device and electronic equipment | |
| JP7641179B2 (en) | Three-dimensional model creation support system, program and recording medium | |
| JP3582509B2 (en) | 3D map data processing method, apparatus and program | |
| CN114791800A (en) | White-model building edge tracing method and device, computer equipment and storage medium | |
| JP4771807B2 (en) | Computer-aided design apparatus, program and method thereof | |
| WO2015172504A1 (en) | Method for constructing three-dimensional objects and computer aided design system | |
| CN119963734B (en) | Real-time editing and rendering method and system for large-scale periodic lattice-like porous structures based on spherical tracking | |
| CN113721802B (en) | Vector capturing method | |
| CN120276365B (en) | Numerical control five-axis tool path generation method based on free-form surface model |
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 |