Rapid mapping merging method in BIM model lightweight
By traversing and merging maps in the BIM model, the performance degradation and management complexity caused by a large number of independent maps in the BIM model are solved, and faster loading speed and higher efficiency are achieved.
Patent Information
- Application Number
- CN202411482879.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-18
AI Technical Summary
Using a large number of independent maps in a BIM model increases GPU memory footprint, resulting in performance degradation, and complex management and maintenance, affecting the loading speed of the BIM model.
By traversing all maps in the BIM model, obtain the parameter information of each map, map it into the UV space, create a new map, overlay the original map into the new map, and update the parameter information in the model data structure.
It realizes rapid merge of maps, reduces GPU memory footprint, improves loading speed, and simplifies storage and backup management.
Smart Images

Figure CN119478182A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a fast mapping merging method in lightweight BIM models. Background Art
[0002] In recent years, with the rapid development of computer graphics, digital image processing and BIM technology, texture mapping and mapping technology are widely used in computer graphics and digital image processing to simulate the texture and details of the surface of objects, making virtual scenes more realistic.
[0003] When a large number of independent textures are used in a BIM model, the GPU memory usage will increase. Each texture needs to be loaded in memory, and frequent texture switching may cause performance degradation. In large projects, there may be hundreds or thousands of different texture files, which makes management and maintenance very complicated. Each file needs to be stored, backed up, and updated separately, which seriously affects the loading speed of the BIM model. Based on this, it is urgent to propose a fast texture merging method for lightweight BIM models. Summary of the invention
[0004] The present invention aims at the deficiencies in the prior art and provides the following technical solutions:
[0005] The fast mapping merging method in BIM model lightweighting includes the following steps:
[0006] S10: traverse all original maps in the BIM model and obtain parameter information of each map.
[0007] S20: Map the position of each original texture on the model to the UV space according to the parameter information.
[0008] S30: Create a new map, and merge the original map into the new map based on the position information in the UV space.
[0009] S40: updating the parameter information of the new map into the model data structure to replace the parameter information of the original map.
[0010] As an improvement of the above technical solution, the parameter information in step S10 includes the position information, size information, UV coordinate information of each map and the texture mapping relationship on the model surface.
[0011] As an improvement of the above technical solution, step S20 includes the following steps:
[0012] S21: Establish a UV space with a coordinate range of [0, 1].
[0013] S22: Calculate the maximum and minimum values of the UV coordinates of all original textures mapped in the UV space.
[0014] S23: Re-determine the merged UV space range according to the maximum value and the minimum value.
[0015] S24: Map the position of each original texture into the UV space according to the UV coordinate information in the parameter information.
[0016] As an improvement of the above technical solution, the acquisition of the UV coordinates of the original map depends on the following formula:
[0017]
[0018] in, Indicates the horizontal coordinate after the original texture is mapped to the UV space. Indicates the vertical coordinate after the original texture is mapped to the UV space. The texture width is Height is The middle point in the map is
[0019] As an improvement of the above technical solution, the calculation of the UV space range depends on the following formula:
[0020]
[0021] in, Indicates the minimum value of the horizontal coordinate after the original texture is mapped to the UV space.
[0022] Indicates the maximum value of the horizontal coordinate after the original texture is mapped to the UV space. Indicates the minimum value of the horizontal coordinate after the original texture is mapped to the UV space. Indicates the maximum value of the horizontal coordinate after the original texture is mapped to the UV space, [u min ,u max ]×[v min , v max ] indicates the range of the re-determined UV space.
[0023] As an improvement of the above technical solution, step S30 includes the following steps:
[0024] S31: Create a new map according to the re-determined UV space range, and superimpose the original map on the new map.
[0025] S32: According to the position of the original map in the UV space and the UV coordinate range of the original map, the pixel position of the original map is obtained, and the pixel value of the original map is copied to the merged new map.
[0026] As an improvement of the above technical solution, the method for obtaining the pixel value of the original map depends on the following formula:
[0027]
[0028] Where (x, y) represents the pixel position of the original texture, (u, v) represents the coordinates of the original texture after being mapped to the UV space, N is the number of textures, and w i is the weight of the i-th texture at pixel position (x, y).
[0029] Beneficial effects of the present invention:
[0030] By merging the original textures into a new texture, the new texture is a whole and can be separated by coordinates and pixel positions. Since all the original textures are in one new texture, it is faster to load than to load all the original textures. And when storing and backing up, only one file needs to be processed, and the overall efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The figure is a flow chart of the fast texture merging method of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0033] When a large number of independent textures are used in a BIM model, the GPU memory usage will increase. Each texture needs to be loaded in memory, and frequent texture switching may cause performance degradation. In large projects, there may be hundreds or thousands of different texture files, which makes management and maintenance very complicated. Each file needs to be stored, backed up, and updated separately, which seriously affects the loading speed of the BIM model.
[0034] To solve the above problems, see Figure 1 , a fast mapping merging method in lightweight BIM model is provided, comprising the following steps:
[0035] S10: traverse all original maps in the BIM model and obtain parameter information of each map.
[0036] The parameter information in step S10 includes the position information, size information, UV coordinate information of each map and the texture mapping relationship on the model surface.
[0037] This step is to save the original information of the map, so that the original map can be located according to the original information after the subsequent merging. After the information is acquired, the original map needs to be mapped in terms of positional relationship, specifically in step S20.
[0038] S20: Map the position of each original texture on the model to the UV space according to the parameter information.
[0039] Specifically, step S20 includes the following steps:
[0040] S21: Establish a UV space with a coordinate range of [0, 1].
[0041] S22: Calculate the maximum and minimum values of the UV coordinates of all original textures mapped in the UV space.
[0042] S23: Re-determine the merged UV space range according to the maximum value and the minimum value.
[0043] S24: Map the position of each original texture into the UV space according to the UV coordinate information in the parameter information.
[0044] The acquisition of the UV coordinates of the original texture depends on the following formula:
[0045]
[0046] in, Indicates the horizontal coordinate after the original texture is mapped to the UV space. Indicates the vertical coordinate after the original texture is mapped to the UV space. The texture width is Height is The middle point in the map is
[0047] Among them, the calculation of the UV space range depends on the following formula:
[0048]
[0049] in, Indicates the minimum value of the horizontal coordinate after the original texture is mapped to the UV space.
[0050] Indicates the maximum value of the horizontal coordinate after the original texture is mapped to the UV space. Indicates the minimum value of the horizontal coordinate after the original texture is mapped to the UV space. Indicates the maximum value of the horizontal coordinate after the original texture is mapped to the UV space, [u min ,u max ]×[v min , v max] indicates the range of the re-determined UV space.
[0051] S30: Create a new map, and merge the original map into the new map based on the position information in the UV space.
[0052] Wherein, the step S30 includes the following steps:
[0053] S31: Create a new map according to the re-determined UV space range, and superimpose the original map on the new map.
[0054] S32: According to the position of the original map in the UV space and the UV coordinate range of the original map, the pixel position of the original map is obtained, and the pixel value of the original map is copied to the merged new map.
[0055] According to the bilinear interpolation principle, the method for obtaining the pixel value of the original map depends on the following formula:
[0056]
[0057] Where (x, y) represents the pixel position of the original texture, (u, v) represents the coordinates of the original texture after being mapped to the UV space, N is the number of textures, and w i is the weight of the i-th texture at pixel position (x, y).
[0058] S40: updating the parameter information of the new map into the model data structure to replace the parameter information of the original map.
[0059] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them.
Claims
1. A fast mapping merging method in lightweight BIM model, characterized in that: The steps include: S10: traverse all original maps in the BIM model and obtain parameter information of each map; S20: Map the position of each original texture on the model to the UV space according to the parameter information; S30: Create a new map, and merge the original map into the new map based on the position information in the UV space; S40: updating the parameter information of the new map into the model data structure to replace the parameter information of the original map.
2. The fast mapping merging method in BIM model lightweighting according to claim 1 is characterized by: The parameter information in step S10 includes the position information, size information, UV coordinate information of each map and the texture mapping relationship on the model surface.
3. The fast mapping merging method in BIM model lightweighting according to claim 2 is characterized in that: The step S20 comprises the following steps: S21: Establish a UV space with a coordinate range of [0, 1]; S22: Calculate the maximum and minimum values of the UV coordinates of all original textures mapped in the UV space; S23: Re-determine the combined UV space range according to the maximum value and the minimum value; S24: Map the position of each original texture into the UV space according to the UV coordinate information in the parameter information.
4. The method for rapid mapping merging in lightweight BIM model according to claim 3 is characterized in that: The acquisition of the UV coordinates of the original map depends on the following formula: in, Indicates the horizontal coordinate after the original texture is mapped to the UV space. Indicates the vertical coordinate after the original texture is mapped to the UV space. The texture width is Height is The middle point in the map is 5. The method for rapid mapping merging in lightweight BIM model according to claim 3 is characterized in that: The calculation of the UV space range depends on the following formula: in, Indicates the minimum value of the horizontal coordinate after the original texture is mapped to the UV space. Indicates the maximum value of the horizontal coordinate after the original texture is mapped to the UV space. Indicates the minimum value of the horizontal coordinate after the original texture is mapped to the UV space. Indicates the maximum value of the horizontal coordinate after the original texture is mapped to the UV space, [u min ,u max ]×[v min , v max ] indicates the range of the re-determined UV space.
6. The method for rapid mapping merging in lightweight BIM model according to claim 3 is characterized in that: The step S30 includes the following steps: S31: Create a new map according to the re-determined UV space range, and superimpose the original map on the new map. S32: According to the position of the original map in the UV space and the UV coordinate range of the original map, the pixel position of the original map is obtained, and the pixel value of the original map is copied to the merged new map.
7. The method for rapid mapping merging in lightweight BIM model according to claim 6, characterized in that: The method for obtaining the pixel value of the original map depends on the following formula: Where (x, y) represents the pixel position of the original texture, (u, v) represents the coordinates of the original texture after being mapped to the UV space, N is the number of textures, and w is the pixel position of the original texture. i is the weight of the i-th texture at pixel position (x, y).
Citation Information
Cited By
BIM (Building Information Modeling) model merging method and equipment based on chartlet, and computer program product
CN120765893A