CN113886937B - Rapid projection calculation method based on irregular three-dimensional space object - Google Patents

Rapid projection calculation method based on irregular three-dimensional space object Download PDF

Info

Publication number
CN113886937B
CN113886937B CN202111487745.1A CN202111487745A CN113886937B CN 113886937 B CN113886937 B CN 113886937B CN 202111487745 A CN202111487745 A CN 202111487745A CN 113886937 B CN113886937 B CN 113886937B
Authority
CN
China
Prior art keywords
points
matrix
shadow
irregular
building
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.)
Active
Application number
CN202111487745.1A
Other languages
Chinese (zh)
Other versions
CN113886937A (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.)
Shenzhen Xkool Technology Co Ltd
Original Assignee
Shenzhen Xkool Technology Co Ltd
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 Shenzhen Xkool Technology Co Ltd filed Critical Shenzhen Xkool Technology Co Ltd
Priority to CN202111487745.1A priority Critical patent/CN113886937B/en
Publication of CN113886937A publication Critical patent/CN113886937A/en
Application granted granted Critical
Publication of CN113886937B publication Critical patent/CN113886937B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/13Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Civil Engineering (AREA)
  • Structural Engineering (AREA)
  • Computational Mathematics (AREA)
  • Architecture (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a rapid projection calculation method based on an irregular three-dimensional space object, and relates to the technical field of data processing of urban planning; the method comprises the following steps: s10, obtaining the accurate longitude and latitude of the buildings in the appointed parcel through the open source map database; s20, simulating the light source vector; s30, modeling the 3D space object; s40, carrying out approximate processing on the special-shaped object; s50, grouping the objects; s60, extracting object shadow acquisition points, calculating detailed outlines for generating shadows, and completing sampling in the existing vector data; s70, merging occlusion enveloping bodies; s80, extracting the outline of the shielding object; s90, calculating a space shadow point; s100, calculating plane shadow, and obtaining the projection of the three-dimensional object in a plane through calculation; the invention has the beneficial effects that: the method can quickly calculate the shadow area of the special-shaped building.

Description

Rapid projection calculation method based on irregular three-dimensional space object
Technical Field
The invention relates to the technical field of data processing of urban planning, in particular to a rapid projection calculation method based on an irregular three-dimensional space object.
Background
In the prior art, a multi-beam projection image processing method, namely an image processing system and a method thereof for displaying multi-layer beam projection contents on an irregular projection surface, is provided, and is disclosed in patent No. KR102245223B 1. The solution is an image processing system and method for presenting multi-layer beam projection content on an irregular projection surface. A technique for obtaining a three-dimensional geometric model by photographing an irregular projection surface of an irregular object with a multi-angle stereo camera and projecting the corrected projection image onto the projection surface.
The scheme is mainly applied to the field of 3D imaging of an entity, multiple light sources are required to be used for irradiating and receiving equipment at the same time, the technology determines that the technology carries out multi-beam irradiation, data acquisition and final modeling imaging on a larger geographic space dimension, certain technical operation difficulty exists, the cost is higher, the acquired imaging does not include three-dimensional geographic coordinate information, the technology cannot be rapidly applied to the traditional city planning and building design industries, and the technology determines that the technology cannot be applied to modeling and projection calculation of a non-physical space structure.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a rapid projection calculation method based on an irregular three-dimensional space object, which can rapidly calculate the shadow area of a special-shaped building.
The technical scheme adopted by the invention for solving the technical problems is as follows: in a fast projection calculation method based on an irregular three-dimensional space object, the improvement comprising the steps of:
s10, obtaining the accurate longitude and latitude of the buildings in the appointed parcel through the open source map database;
s20, simulating the light source vector;
s30, modeling the 3D space object, including: the building is disassembled into four component layers: the building comprises a building layer, a balcony layer, a roof layer and a window layer, wherein all component layer information of the same building is combined into the same group;
s40, carrying out approximate processing on the irregular objects, and converting any irregular object into a plane curve L, a Z-axis coordinate Z of a plane where the plane curve L is located and a stretching height H corresponding to the plane curve L;
s50, grouping the objects, analyzing and classifying all the objects, and dividing the objects into A, B, C three types, wherein A type is illumination points needing to be checked and has shielding attributes, B type is illumination points not needing to be checked and has shielding attributes, and C type is illumination points not needing to be checked and does not have shielding attributes;
s60, extracting object shadow acquisition points, calculating detailed outlines for generating shadows, and completing sampling in the existing vector data;
s70, combining occlusion enveloping bodies, wherein the modeled information of the objects comprises a base layer geometric figure, and the occlusion enveloping bodies are combined if two objects have the same base layer geometric figure and the highest height of one object is connected with the ground clearance of the other object, namely the highest height of one object is the initial height of the other object;
s80, extracting the outline of the shelter, wherein the extracted outline comprises all points at the bottom and all points at the top, and when the outline is formed by line segments connected end to end, the extracted points are a collection of end points of all the line segments;
s90, calculating space shadow points, wherein the space shadow points are shelters generated on the surface of another object by the object to form shadows, and whether the sampling points are the space shadow points or not is judged by setting the number of target points and the number of the sampling points and combining illumination vectors;
and S100, calculating plane shadow, and obtaining the projection of the three-dimensional object in the plane through calculation.
Further, step S20 includes a step of determining an angle α between the light source and the ground plane, and a step of determining an angle β between a projection of the light source on the ground and the latitude line.
Further, in step S30, the group name is used to indicate the property of the building, and the components in the same building are stored in different layers with semantic tags according to the type of the components.
Further, in step S30,
the building layer is used for representing outer wall information and stair information in a building and is a solid geometric block stretched towards the z-axis direction on the ground level of the building;
the balcony layer and the window layer are used for representing balcony information and windowing information in the building, and the balcony protrudes out of the building body and is a regular cube; the window layer is attached to the building shape and is rectangular;
the roof layer is used for representing the roof structure of the building, wherein the regular parapet wall is expressed by the combination of solid geometric blocks, and the pitched roof is expressed by the splicing combination of a plurality of inclined surfaces.
Further, the step S40 of approximating the irregular object includes the steps of:
s401, traversing all components contained in all objects;
s402, calculating a Z-axis distribution interval [ Z1, Z2] of each assembly, performing cycle operation, and calculating an intersection line Li between an intersection plane Zi (Z1 + i) a and the assembly by taking specified precision a as a spacing in each cycle;
s403, if Li is approximate to the intersection line L (i-1) calculated in the last operation, ignoring the operation, and continuously increasing the serial number i; s404, if the Li is not similar to the L (i-1), storing the data related to the Li and the Zi, continuing to cycle until the Zi is larger than Z2, jumping out of the cycle, and ending the operation.
Further, in step S60, the sampling direction is extended to the planar space and the stereo space at the same time, and the sampling method is as follows:
s601, judging whether a next layer of contour exists, if so, entering a step S602, and if not, ending;
s602, acquiring the height of the next layer;
s603, extracting all line segments in the contour;
s604, dividing the length of the line segment by the sampling interval to obtain the number of sampling points on the line segment;
s605, gradually acquiring sampling points from the foremost end of the line segment by taking the sampling interval as step frequency and storing the sampling points;
s606, completing the sampling of the illumination point of the current height profile, and returning to the step S601.
Further, in step S70, the information of the modeled object further includes a self height and a ground clearance, and the algorithm for merging the occlusion envelopes includes the following steps:
and setting a minimum error value e, wherein when the component error of the coordinate of each turning point in the two profiles is less than e, and the error between the highest height of one object and the lowest height of the other object is less than e, the enveloping bodies of the two objects can be merged.
Further, in step S90, when the number of the target points is R and the number of the sampling points of the occlusion obtained from all the occlusions is N, R × N calculations are performed, and each calculation is combined with the illumination vector, if the connection line between the illumination vector and the occlusion passes through the corresponding point having the same plane coordinate as the sampling point and the sampling point is located below the point, the sampling point must have a shadow.
Further, in step S90, selecting the obstruction with the closest sampling point to perform GPU matrix calculation, where the calculation method is:
the coordinate values X1, Y1 and Z1 of the sampling points are substituted into the following space straight-line function, and whether the first part and the second part of the symmetrical formula are equal or not is judged;
Figure GDA0003499535330000021
wherein M (x)0,y0,z0) On the line of the above-mentioned straight line,
Figure GDA0003499535330000022
is a direction vector of a straight line;
then judging whether the Z1 is positioned below the space straight line, and when the value of the Z1 is smaller than the calculated point, the Z1 is positioned below the space straight line, and judging the sampling point to be a shadow;
and after filtering out the sampling points which are judged to be shadows, performing GPU matrix operation on the shielding buildings with longer distances until the operation of all the sampling points is completed.
Further, step S90 includes a step of performing a GPU optimization algorithm on the own point and the point of the occlusion:
constructing T matrixes A containing coordinates (X, Y), wherein the dimension of the matrix A is T X2, and constructing a matrix B with the dimension of T X2, and each row of the matrix B is formed by (X)0,Y0) The component matrix C is A-B, the first row point of the matrix C is multiplied by 1/m to form a C1 matrix, the second row point of the matrix C is multiplied by 1/n to form a C2 matrix, C1-C2 are calculated, the coordinates of the points of which the difference is less than the minimum error value e are taken, and the numerical value of the Z coordinate is judged to be a shadow point if the numerical value of the Z coordinate is less than Z0.
Further, in step S100, the calculation of the plane shadow includes the following steps:
s1001, constructing a height matrix A containing T points, wherein the dimension of the matrix A is T x1, multiplying the matrix A by a matrix B of a tangent value of a source vector, the dimension of the matrix B is T x1, multiplying the matrix B by a sine value and a cosine value respectively and performing connection operation to obtain a matrix C, adding X, Y axial values of the original T points of each point of the matrix C respectively to obtain a result matrix D, and the dimension of the matrix D is T x 2; the matrix D is the coordinates of all the plane shadow points;
s1002, all the cast shadow points are connected in a consistent manner with the original vertex direction, and then a shadow surface Sn can be framed;
s1003, performing set (Sn) on the shadow surface framed in the step S1002 and the bottom shadow surface occupied by the original building to obtain the projection of the final three-dimensional object in the plane.
Further, after step S100, the method further includes a step of calculating the shadow of the multi-floor plane, and the specific steps are as follows:
s2001, simulating a ground plane into a compact two-dimensional matrix;
s2002, the two-dimensional matrix corresponding to the area selected by the user is 1, and the two-dimensional matrix corresponding to the area not selected is 0;
s2003, selecting N secondary planes to finally form (filter1.. filterN), where the calculation result of each plane shadow is { matrix1... matrixN };
s2004, operating according to the following formula to obtain a final result: output 1 filter1+ matrix2 filter2+. said. + matrix xn filter, where ". is the Dot product operation.
Further, the method also comprises the following cutting optimization steps:
solving a minimum external matrix for each terrace, only considering three-dimensional objects in the external matrix and not considering objects outside the matrix; considering the branch and cut algorithm principle based on integral cutting, when solving the integer programming problem, if the upper limit value of a certain node is lower than the existing lower limit value, the node can be cut off;
the idea of clipping reduces the shadow calculation of spatial points by determining in advance whether a spatial stereo structure will produce shadows to a specific area.
The invention has the beneficial effects that: the method is mainly used for rapidly judging the industrial specifications of the space, lighting and shielding and the like of different objects in a space range in urban planning and real estate design industries at present.
Drawings
Fig. 1 is a schematic flow chart of a fast projection calculation method based on an irregular three-dimensional object according to the present invention.
Fig. 2 shows an embodiment of step S20 according to the present invention.
Fig. 3 shows an embodiment of step S40 according to the present invention.
FIG. 4 shows an embodiment of the present invention regarding step S60.
FIG. 5 shows an embodiment of the present invention regarding step S70.
FIG. 6 shows an embodiment of the present invention regarding step S90.
Fig. 7 shows an embodiment of step S100 according to the present invention.
Fig. 8 shows a specific embodiment of the steps of the multi-floor level shadow calculation according to the present invention.
Detailed Description
The invention is further illustrated with reference to the following figures and examples.
The conception, the specific structure, and the technical effects produced by the present invention will be clearly and completely described below in conjunction with the embodiments and the accompanying drawings to fully understand the objects, the features, and the effects of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments, and those skilled in the art can obtain other embodiments without inventive effort based on the embodiments of the present invention, and all embodiments are within the protection scope of the present invention. In addition, all the connection/connection relations referred to in the patent do not mean that the components are directly connected, but mean that a better connection structure can be formed by adding or reducing connection auxiliary components according to specific implementation conditions. All technical characteristics in the invention can be interactively combined on the premise of not conflicting with each other.
The invention discloses a rapid projection calculation method based on an irregular three-dimensional space object, which is capable of rapidly calculating a shadow area of a special-shaped building by combining a computer-aided design (CAD) and a cloud. Special-shaped buildings, namely paulo building blocks, balconies and roofs; the lubricating curved surface building can be modeled in 3D, and the 3D-shaped building can be simulated through approximate calculation of a regular geometric shape. And the space shadow carrying the shielding object in the 3D space can be rapidly calculated through the combined operation of the CPU and the GPU and the cutting algorithm.
Referring to fig. 1, a specific embodiment of the fast projection calculation method based on an irregular three-dimensional space object according to the present invention includes steps S10 to S100, which are as follows:
s10, obtaining the accurate longitude and latitude of the buildings in the appointed parcel through the open source map database;
at present, the accurate longitude and latitude are obtained according to city information by adopting rich geographic data and related ports provided by the prior art and an open source map library OpenStreetMap;
s20, simulating the light source vector;
as shown in fig. 2, the light can be regarded as a vector, and if the direction of the vector is to be determined in the 3D space, the included angle between the vector and the plane (height angle) and the included angle between the vector and the latitude line (azimuth angle) need to be determined. The light source vector is represented by two angles α and β shown in FIG. 2; alpha is the included angle between the light source and the ground plane, and beta is the included angle between the projection of the light source on the ground plane and the latitude line.
S30, modeling the 3D space object, including: the building is disassembled into four component layers: the building comprises a building layer, a balcony layer, a roof layer and a window layer, wherein all component layer information of the same building is combined into the same group;
in order to accurately represent the shape information of the building and the surface information characteristics of the building, the building and the space where the building is located need to be modeled. In the embodiment, the group name is used for representing the attribute of a building, and components in the same building are stored in different layers with semantic tags according to the type of the components;
the building layer is used for representing outer wall information and stair information in the building and is a solid geometric block stretched towards the z-axis direction on the ground level of the building; some buildings contain components such as bay windows, and because the bay windows belong to an outer wall structure, the bay window structure is also placed on the building floor, and is usually a regular cube (3-dimensional block); the balcony layer and the window layer are used for representing balcony information and windowing information in the building, and the balcony protrudes out of the building body and is a regular cube; the window layer is attached to the building shape and is rectangular; the window is usually attached to the roof form, usually rectangular (2 dimensional plane). The roof layer is used for representing the roof structure of the building, wherein the regular parapet wall is expressed by the combination of solid geometric blocks, and the pitched roof is expressed by the splicing combination of a plurality of inclined surfaces.
S40, carrying out approximate processing on the irregular objects, and converting any irregular object into a plane curve L, a Z-axis coordinate Z of a plane where the plane curve L is located and a stretching height H corresponding to the plane curve L;
in this embodiment, as shown in fig. 3, the step S40 of approximating the special-shaped object includes the following steps:
s401, traversing all components contained in all objects;
s402, calculating a Z-axis distribution interval [ Z1, Z2] of each assembly, performing cycle operation, and calculating an intersection line Li between an intersection plane Zi (Z1 + i) a and the assembly by taking specified precision a as a spacing in each cycle;
s403, if Li is approximate to the intersection line L (i-1) calculated in the last operation, ignoring the operation, and continuously increasing the serial number i; s404, if the Li is not similar to the L (i-1), storing the data related to the Li and the Zi, continuing to cycle until the Zi is larger than Z2, jumping out of the cycle, and ending the operation.
Finally, the component models (balcony, window, roof, outer wall) in all layers of any building group are converted into (L, Z, H) characterized data sets.
S50, grouping the objects, analyzing and classifying all the objects, and dividing the objects into A, B, C three types, wherein A type is illumination points needing to be checked and has shielding attributes, B type is illumination points not needing to be checked and has shielding attributes, and C type is illumination points not needing to be checked and does not have shielding attributes;
s60, extracting object shadow acquisition points, calculating detailed outlines for generating shadows, and completing sampling in the existing vector data;
in order to reduce the data transmission amount, the interactive data at the front and rear ends are vector data (only the positions of key contour points, the length, width, height and angle of edges are described), but the detailed contour needs to be calculated for the generation of shadow.
Referring to fig. 4, in step S60, the sampling direction is extended to the planar space and the stereo space at the same time, and the sampling method is as follows:
s601, judging whether a next layer of contour exists, if so, entering a step S602, and if not, ending;
wherein, the height direction (y axis) also has sampling precision, and the next layer of contour can be understood as advancing by one step frequency in height; for a typical building, it is understood to be an upper (or lower) floor;
s602, acquiring the height of the next layer;
s603, extracting all line segments in the contour;
s604, dividing the length of the line segment by the sampling interval to obtain the number of sampling points on the line segment;
s605, gradually acquiring sampling points from the foremost end of the line segment by taking the sampling interval as step frequency and storing the sampling points;
s606, completing the sampling of the illumination point of the current height profile, and returning to the step S601.
If the user has high precision requirement, the number of sampling points extracted from the horizontal and vertical coordinates is large; after a large number of sampling points are clear, a basis is provided for the GPU to calculate the shadow intensity of the sampling points in an accelerating mode.
S70, combining occlusion enveloping bodies, wherein the modeled information of the objects comprises a base layer geometric figure, and the occlusion enveloping bodies are combined if two objects have the same base layer geometric figure and the highest height of one object is connected with the ground clearance of the other object, namely the highest height of one object is the initial height of the other object;
in step S70, the information of the modeled object further includes the height of the object itself and the height above the ground, and the algorithm for merging the occlusion object envelopes includes the following steps: setting a minimum error value e, when the component error of the coordinates of each turning point in the two profiles is less than e, and the error between the highest height top of one object and the lowest height floor of the other object is less than e, the enveloping bodies of the two objects can be merged, and the specific algorithm is as shown in fig. 5
S80, extracting the outline of the shelter, wherein the extracted outline comprises all points at the bottom and all points at the top, and when the outline is formed by line segments connected end to end, the extracted points are a collection of end points of all the line segments;
after the simplified processing of the merged envelope is obtained in the previous step, the final output result is a plane geometric figure and a height, and the final output result cannot be directly used for calculating whether a sampling point is shielded or not. At this time, the occlusion needs to be subjected to contour extraction processing.
In the above scheme, contour extraction is simple, information (an, bn, cn) of all bottom points is already available, and the geometry (an, bn, cn + height) of all top contour points can be obtained by adding height to cn value of each point.
S90, calculating space shadow points, wherein the space shadow points are shelters generated on the surface of another object by the object to form shadows, and whether the sampling points are the space shadow points or not is judged by setting the number of target points and the number of the sampling points and combining illumination vectors;
referring to fig. 6, in this embodiment, as to step S90, the present invention provides a specific embodiment, in step S90, when the number of the target points is R and the number of the sampling points of the occlusion obtained from all the occlusions is N, R × N calculations are performed, and each calculation is performed in combination with the illumination vector, and if the connection line between the illumination vector and the occlusion passes through the corresponding point having the same plane coordinates as the sampling points and the sampling points are located below the point, the sampling points must have shadows.
In step S90, selecting the barrier with the closest sampling point to perform GPU matrix calculation, the calculation method is:
the coordinate values X1, Y1 and Z1 of the sampling points are substituted into the following space straight-line function, and whether the first part and the second part of the symmetrical formula are equal or not is judged;
Figure GDA0003499535330000051
wherein M (x)0,y0,z0) In order to be on the above-mentioned straight line,
Figure GDA0003499535330000061
is a direction vector of a straight line;
then judging whether the Z1 is positioned below the space straight line, and when the value of the Z1 is smaller than the calculated point, the Z1 is positioned below the space straight line, and judging the sampling point to be a shadow;
and after filtering out the sampling points which are judged to be shadows, performing GPU matrix operation on the shielding buildings with longer distances until the operation of all the sampling points is completed.
In step S90, the method further includes a step of performing a GPU optimization algorithm on the self point and the point of the occlusion:
constructing T matrixes A containing coordinates (X and Y), wherein the dimension of the matrix A is T X2, constructing a matrix B with the dimension of T X2, each row of the matrix B is composed of (X0 and Y0), the member matrix C is A-B, multiplying a first column point of the matrix C by 1/m to form a C1 matrix, multiplying a second column point of the matrix C by 1/n to form a C2 matrix, calculating C1-C2, taking the coordinates of points with difference values smaller than a minimum error value e, and judging that the Z coordinate values are shaded points if the Z coordinate values are smaller than Z0.
In addition, the middle tailorable optimization points are located on the same plane coordinate if the sampling point at the current height is judged to be a shadow, and the sampling points at the height lower than the current height are all shadow points. The optimization point is that the calculation is performed step by step through a CPU originally, the calculation is processed into a matrix form through a data process in advance, and the calculation performance is improved by calling a GPU for synchronous calculation; highly customized GPU calculation is required according to calculation; and (5) performing GPU optimization processing on the occlusion points.
S100, calculating plane shadow, and obtaining the projection of the three-dimensional object in a plane through calculation;
the planar shadow firstly acquires all top vertexes { t0... tn } and bottom vertexes (f0... fn). calculating a shadow point corresponding to each top vertex, then respectively calculating components of the distance on x and y axes, and adding the components of the distance on the x and y axes with components on the x and y axes of t0, so that the position calculation method of the shadow point can be positioned as the value of the height component (namely height) of the t0 point and the light source vector tangent, and then the distance between the shadow point and the projection point of the t0 on the plane can be calculated.
Referring to fig. 7, regarding step 100, the present invention provides a specific embodiment, in step S100, the calculating of the plane shadow includes the following steps:
s1001, constructing a height matrix A containing T points, wherein the dimension of the matrix A is T x1, multiplying the matrix A by a matrix B of a tangent value of a source vector, the dimension of the matrix B is T x1, multiplying the matrix B by a sine value and a cosine value respectively and performing connection operation to obtain a matrix C, adding X, Y axial values of the original M points of each point of the matrix C respectively to obtain a result matrix D, and the dimension of the matrix D is T x 2; the matrix D is the coordinates of all the plane shadow points; the concatenate operation is to stitch together the matrix a and the matrix B.
S1002, all the cast shadow points are connected in a consistent manner with the original vertex direction, and then a shadow surface Sn can be framed;
s1003, performing set (Sn) on the shadow surface framed in the step S1002 and the bottom shadow surface occupied by the original building to obtain the projection of the final three-dimensional object in the plane.
In the above embodiment, after step S100, the method further includes a step of calculating a shadow of the multi-floor plane, and as shown in fig. 8, the specific steps are as follows:
s2001, simulating a ground plane into a compact two-dimensional matrix;
s2002, the two-dimensional matrix corresponding to the area selected by the user is 1, and the two-dimensional matrix corresponding to the area not selected is 0;
s2003, selecting N secondary planes to finally form (filter1.. filterN), where the calculation result of each plane shadow is { matrix1... matrixN };
s2004, operating according to the following formula to obtain a final result: output 1 filter1+ matrix2 filter2+. said. + matrix xn filter, where ". is the Dot product operation.
In addition, the method also comprises the following cutting optimization steps:
solving a minimum external matrix for each terrace, only considering three-dimensional objects in the external matrix and not considering objects outside the matrix; considering the branch and cut algorithm principle based on integral cutting, when solving the integer programming problem, if the upper limit value of a certain node is lower than the existing lower limit value, the node can be cut off;
the idea of clipping reduces the shadow calculation of spatial points by determining in advance whether a spatial stereo structure will produce shadows to a specific area.
Further, in the above embodiment, the method finally includes the steps of post-processing and returning the data: after the above operations are completed, the final step is to further analyze and process the above results by using the prior art, such as methods of extracting the contour of the image element, optimizing the contour curve by machine learning in the OpenCV image processing library, and fitting out the contour line, the projection contour line, and the like of the field. On the basis, the contour lines and the projection contour lines are overlapped with the model built by the user, and finally the model and the projection of the model are visualized on a webpage interface, so that the user can conveniently view and operate. According to the embodiment, the method is mainly used for rapidly judging the space between different objects in a space range and lighting and shielding industry specifications in urban planning and real estate design industries at present.
The cloud 3D modeling and processing of irregular objects are realized, and complex building and site information is converted into computer-readable highly-informationized and structured model data. Through modeling of the cloud 3D modeling platform, different building buildings contain four component layers in a building group format: the building layer, the balcony layer, the roof layer and the window layer, and each layer has a plurality of 3-dimensional blocks and 2 is the combination of planar components, concatenation constitutes. Through the structural model representation, the computer can finally directly identify the information of each building and the components thereof, and the translation from physical common data to information and structural data is realized.
The invention adopts a large amount of calculation based on the GPU, utilizes linear algebra and space geometric knowledge, and combines the algorithm of the design described in the text, thereby improving the efficiency in the calculation of a plurality of sampling points and space geometric figures. The custom algorithm flow is adopted, the conventional geometric space algorithms are connected in series to form a whole set of functions, and appropriate cutting and optimization are carried out, so that the aim of quickly calculating the 3D space shadow is fulfilled.
As the three-dimensional space is scattered into a plurality of sampling points, the shielding algorithm of each sampling point is similar, and the number of the sampling points is exponentially increased along with the requirement of a user on the precision, the condition is suitable for adopting the GPU to carry out a large amount of parallel lightweight operation. Meanwhile, the algorithm internally comprises part of service processing, so that the common requirements of service and performance can be met only by simultaneously supporting the CPU and the GPU; the invention adopts data matrixing and GPU accelerated operation in multiple algorithm flow calculations. And different strategies and processes are adopted for the calculation of the plane shadow and the calculation of the space shadow. By analyzing the space geometric relationship, the points which do not need to be calculated are cut in advance, and effective calculation output is guaranteed.
Through cloud 3D modeling, irregular model information is rapidly identified and is approximately processed, so that the irregular model information is converted into a standardized data expression form: the method comprises the steps of constructing a cloud 3D modeling platform, carrying out approximate processing on all component information contained in all objects in a model, converting the component information into a data expression form (a plane curve L, a curve height Z and a curve stretching height H), and converting special-shaped components into a structured data combination; in addition, by naming and using the groups and layers in the modeling platform, the program can quickly identify the model data of each building object and various components contained in the building object, so that the algorithm can quickly and accurately operate and process model information with various semantics.
Compared with the existing projection calculation method, the scheme adopts heterogeneous calculation of the CPU and the GPU, improves the efficiency of the original CPU calculation mode by more than 10 times, has higher calculation speed and higher efficiency, and saves the time cost for waiting for the calculation result; the method supports processing of various complex shapes, and has stronger controllability and higher precision of projection calculation quality.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (13)

1. A fast projection calculation method based on an irregular three-dimensional space object is characterized by comprising the following steps:
s10, obtaining the accurate longitude and latitude of the buildings in the appointed parcel through the open source map database;
s20, simulating the light source vector;
s30, modeling the 3D space object, including: the building is disassembled into four component layers: the building comprises a building layer, a balcony layer, a roof layer and a window layer, wherein all component layer information of the same building is combined into the same group;
s40, carrying out approximate processing on the irregular objects, and converting any irregular object into a plane curve L, a Z-axis coordinate Z of a plane where the plane curve L is located and a stretching height H corresponding to the plane curve L;
s50, grouping the objects, analyzing and classifying all the objects, and dividing the objects into A, B, C three types, wherein A type is illumination points needing to be checked and has shielding attributes, B type is illumination points not needing to be checked and has shielding attributes, and C type is illumination points not needing to be checked and does not have shielding attributes;
s60, extracting object shadow acquisition points, calculating detailed outlines for generating shadows, and completing sampling in the existing vector data;
s70, merging the occlusion enveloping bodies, wherein the information of the modeled objects comprises a base layer geometric figure, and merging the occlusion enveloping bodies by judging whether two objects have the same base layer geometric figure and simultaneously judging whether the highest height of one object is connected with the ground clearance of the other object or not and if the two conditions are met simultaneously;
s80, extracting the outline of the shelter, wherein the extracted outline comprises all points at the bottom and all points at the top, and when the outline is formed by line segments connected end to end, the extracted points are a collection of end points of all the line segments;
s90, calculating spatial shadow points, wherein the spatial shadow points are shadows generated on the surface of a shielded object by the shielded object, and judging whether sampling points are the spatial shadow points or not by setting the number of target points of the shielded object and the number of sampling points of the shielded object and combining illumination vectors;
and S100, calculating plane shadow, and obtaining the projection of the three-dimensional object in the plane through calculation.
2. The method for calculating the fast projection based on the irregular three-dimensional space object according to claim 1, wherein the step S20 comprises a step of determining an included angle α between the light source and the ground plane and a step of determining an included angle β between the projection of the light source on the ground and the latitude line.
3. The method for computing a fast projection based on an irregular three-dimensional object according to claim 1, wherein in step S30, the attributes of a building are represented by group names, and the components in the same building are stored in different layers with semantic tags according to the type of the components.
4. The irregular three-dimensional space object-based fast projection calculation method according to claim 1, wherein, in step S30,
the building layer is used for representing outer wall information and stair information in a building and is a solid geometric block stretched towards the z-axis direction on the ground level of the building;
the balcony layer and the window layer are used for representing balcony information and windowing information in the building, and the balcony protrudes out of the building body and is a regular cube; the window layer is attached to the building shape and is rectangular;
the roof layer is used for representing the roof structure of the building, wherein the regular parapet wall is expressed by the combination of solid geometric blocks, and the pitched roof is expressed by the splicing combination of a plurality of inclined surfaces.
5. The irregular three-dimensional space object-based fast projection calculation method according to claim 1, wherein the step S40 of approximating the irregular object comprises the following steps:
s401, traversing all components contained in all objects;
s402, calculating a Z-axis distribution interval [ Z1, Z2] of each assembly, performing cycle operation, and calculating an intersection line Li between an intersection plane Zi (Z1 + i) a and the assembly by taking specified precision a as a spacing in each cycle;
s403, if Li is approximate to the intersection line L (i-1) calculated in the last operation, ignoring the operation, and continuously increasing the serial number i;
s404, if the Li is not similar to the L (i-1), storing the data related to the Li and the Zi, continuing to cycle until the Zi is larger than Z2, jumping out of the cycle, and ending the operation.
6. The method for computing a fast projection based on an irregular three-dimensional space object according to claim 1, wherein in step S60, the sampling direction extends to the planar space and the stereo space at the same time, and the sampling method is as follows:
s601, judging whether a next layer of contour exists, if so, entering a step S602, and if not, ending;
s602, acquiring the height of the next layer;
s603, extracting all line segments in the contour;
s604, dividing the length of the line segment by the sampling interval to obtain the number of sampling points on the line segment;
s605, gradually acquiring sampling points from the foremost end of the line segment by taking the sampling interval as step frequency and storing the sampling points;
s606, completing the sampling of the illumination point of the current height profile, and returning to the step S601.
7. The method for computing the fast projection based on the irregular three-dimensional space object according to claim 1, wherein in step S70, the modeled information of the object further includes self height and ground clearance, and the algorithm for merging the occlusion envelopes comprises the following steps:
and setting a minimum error value e, wherein when the component error of the coordinate of each turning point in the two profiles is less than e, and the error between the highest height of one object and the lowest height of the other object is less than e, the enveloping bodies of the two objects can be merged.
8. The method according to claim 1, wherein in step S90, when the number of target points is R and the number of sampling points for occlusion obtained from all the occlusions is N, R × N calculations are performed, and each calculation is combined with an illumination vector, and if a connection line between the illumination vector and the occlusion passes through a corresponding point having the same plane coordinates as the sampling points and the sampling points are located below the point, the sampling points must have shadows.
9. The method for computing the fast projection based on the irregular three-dimensional space object according to claim 8, wherein in step S90, the method for selecting the obstruction with the closest sampling point to perform the GPU matrix computation comprises:
the coordinate values X1, Y1 and Z1 of the sampling points are substituted into the following space straight-line functions, and whether the left part and the right part of the first equal sign in the following symmetrical formula are equal or not is judged:
Figure FDA0003499535320000041
where M is a point on a spatial line, M (x)0,y0,z0) On the line of the above-mentioned straight line,
Figure FDA0003499535320000042
is a direction vector of a straight line;
if the left part and the right part of the first equal sign in the symmetrical formula are equal, then judging whether Z1 is positioned below the space straight line, and when the value of Z1 is smaller than the calculated point, Z1 is positioned below the space straight line, and judging that the sampling point is a shadow;
and after filtering out the sampling points which are judged to be shadows, performing GPU matrix operation on the shielding buildings with longer distances until the operation of all the sampling points is completed.
10. The method for computing a fast projection based on an irregular three-dimensional space object according to claim 9, wherein the step S90 further comprises the step of performing a GPU optimization algorithm on the self point and the point of the occlusion:
constructing T matrixes A containing coordinates (X, Y), wherein the dimension of the matrix A is T X2, constructing a matrix B with the dimension of T X2, each row of the matrix B is composed of (X0, Y0), the member matrix C is A-B, multiplying a first column of points of the matrix C by 1/m to form a C1 matrix, multiplying a second column of points of the matrix C by 1/n to form a C2 matrix, calculating C1-C2, taking the coordinates of points of which the difference is smaller than a minimum error value e, judging the Z0 value of the point corresponding to the expected Z coordinate value of the group of target points, and if the Z coordinate value is smaller than Z0, judging the points are shaded points.
11. The irregular three-dimensional space object-based fast projection calculation method according to claim 9, wherein the calculation of the plane shadow in step S100 comprises the following steps:
s1001, constructing a height matrix A containing M points, wherein the dimension of the matrix A is T x1, multiplying the matrix A by a matrix B of light source vector tangent values, the dimension of the matrix B is T x1, multiplying the matrix B by sine values and cosine values respectively and performing connection operation to obtain a matrix C, adding X, Y axial values of the original T points of each point of the matrix C respectively to obtain a result matrix D, and the dimension of the matrix D is T2; the matrix D is the coordinates of all the plane shadow points;
s1002, all the cast shadow points are connected in a consistent manner with the original vertex direction, and then a shadow surface Sn can be framed;
s1003, performing set (Sn) on the shadow surface framed in the step S1002 and the bottom shadow surface occupied by the original building to obtain the projection of the final three-dimensional object in the plane.
12. The irregular three-dimensional space object-based fast projection calculation method according to claim 1, further comprising a step of calculating a multi-floor plane shadow after the step S100, and the specific steps are as follows:
s2001, simulating a ground plane into a compact two-dimensional matrix;
s2002, the two-dimensional matrix corresponding to the area selected by the user is 1, and the two-dimensional matrix corresponding to the area not selected is 0;
s2003, selecting N secondary planes to finally form (filter1.. filterN), where the calculation result of each plane shadow is { matrix1... matrixN };
s2004, operating according to the following formula to obtain a final result: output 1 filter1+ matrix2 filter2+. said. + matrix xn filter, where ". is the Dot product operation.
13. The irregular three-dimensional space object-based fast projection calculation method according to claim 12, further comprising the step of clipping optimization:
solving a minimum external matrix for each terrace, only considering three-dimensional objects in the external matrix and not considering objects outside the matrix;
considering the branch and cut algorithm principle based on integral cutting, when solving the integer programming problem, if the upper limit value of a certain node is lower than the existing lower limit value, the node can be cut off; the idea of clipping reduces the shadow calculation of spatial points by determining in advance whether a spatial stereo structure will produce shadows to a specific area.
CN202111487745.1A 2021-12-08 2021-12-08 Rapid projection calculation method based on irregular three-dimensional space object Active CN113886937B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111487745.1A CN113886937B (en) 2021-12-08 2021-12-08 Rapid projection calculation method based on irregular three-dimensional space object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111487745.1A CN113886937B (en) 2021-12-08 2021-12-08 Rapid projection calculation method based on irregular three-dimensional space object

Publications (2)

Publication Number Publication Date
CN113886937A CN113886937A (en) 2022-01-04
CN113886937B true CN113886937B (en) 2022-04-05

Family

ID=79016495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111487745.1A Active CN113886937B (en) 2021-12-08 2021-12-08 Rapid projection calculation method based on irregular three-dimensional space object

Country Status (1)

Country Link
CN (1) CN113886937B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11187035B2 (en) * 2004-05-06 2021-11-30 Mechoshade Systems, Llc Sky camera virtual horizon mask and tracking solar disc
CN103942095B (en) * 2014-03-18 2017-02-15 中国科学院软件研究所 Two-dimensional phase position unwrapping method based on heterogeneous accelerating platform
CN105574933B (en) * 2015-12-03 2018-11-30 广州博进信息技术有限公司 The comprehensive profile accurate Drawing method of object
CN107679441B (en) * 2017-02-14 2020-06-02 郑州大学 Method for extracting height of urban building based on multi-temporal remote sensing image shadow
CN112258649A (en) * 2020-10-27 2021-01-22 中国科学院空天信息创新研究院 Three-dimensional urban solar radiation calculation method based on ray projection
CN113221355A (en) * 2021-05-10 2021-08-06 中国计量大学上虞高等研究院有限公司 Arrangement method of irregular roof photovoltaic panels of complex building

Also Published As

Publication number Publication date
CN113886937A (en) 2022-01-04

Similar Documents

Publication Publication Date Title
Dore et al. Semi-automatic modelling of building facades with shape grammars using historic building information modelling
CN104616345A (en) Octree forest compression based three-dimensional voxel access method
CN112633657B (en) Construction quality management method, device, equipment and storage medium
CN106127857A (en) Synthetic data drives the on-board LiDAR data modeling method with model-driven
CN112465968B (en) Building map mixed data model construction method for positioning navigation
CN115661374B (en) Rapid retrieval method based on space division and model voxelization
KR20140062831A (en) Method for acquiring and processing a variety of three-dimensional data to product a precise wide-area scale model
Abou Diakité et al. Topological reconstruction of complex 3D buildings and automatic extraction of levels of detail
CN111553964A (en) BIM technology-based design drawing method
CN109522381A (en) The hidden installation security detection method of building based on 3DGIS+BIM
Wang et al. BIM voxelization method supporting cell-based creation of a path-planning environment
Qiu et al. An adaptive down-sampling method of laser scan data for scan-to-BIM
CN112991424A (en) Fractal dimension calculation method and device based on octree algorithm
Palestini et al. Integrated photogrammetric survey and bim modelling for the protection of school heritage, applications on a case study
CN112837328A (en) Rectangular window clipping and drawing method for two-dimensional polygonal graphic primitive
Kıvılcım et al. A semi-automated point cloud processing methodology for 3D cultural heritage documentation
Huhnt Reconstruction of edges in digital building models
CN113886937B (en) Rapid projection calculation method based on irregular three-dimensional space object
Horna et al. Building 3D indoor scenes topology from 2D architectural plans
US9697646B2 (en) Converting a 3D model into multiple matrices
Huang et al. From bim to pointcloud: automatic generation of labeled indoor pointcloud
CN110136261B (en) Roadway virtual reality rapid modeling method
Dore Procedural Historic Building Information Modelling (HBIM) for recording and documenting European classical architecture
Peng et al. Automated 3D Scenes Reconstruction Using Multiple Stereo Pairs from Portable Four‐Camera Photographic Measurement System
Ulm Improved 3D city modeling with CyberCity-Modeler (CC-Modeler) using aerial-satellite imagery and laserscanner data

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