A building plan meta-position transformation method, device, medium, equipment and product based on double positioning lines

By setting a reference axis and the axis to be transformed in the building plan, a target transformation matrix is ​​generated, which solves the problems of cumbersome alignment operations and error accumulation in traditional building plan elements. It realizes batch alignment and position transformation of elements, and improves the accuracy and efficiency of construction layout.

CN122368417APending Publication Date: 2026-07-10GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU URBAN PLANNING & DESIGN SURVEY RES INST
Filing Date
2026-06-10
Publication Date
2026-07-10

Smart Images

  • Figure CN122368417A_ABST
    Figure CN122368417A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on double positioning line's building planar graph element position transformation method, device, medium, equipment and product, the method includes, determining reference axis in building plane, and determining a plurality of to be transformed axis in turn;According to the position relation between the reference point of target to be transformed graph element and each to be transformed axis, determine the target to be transformed axis corresponding to the target to be transformed graph element;With the reference axis as transformation reference, the position of the target to be transformed axis is transformed, and target transformation matrix is obtained, and the target to be transformed graph element is subjected to the target transformation matrix, to carry out the position transformation of the target to be transformed graph element.The application realizes the batch alignment processing of graph element and effectively improves the accuracy of graph element alignment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graphic data reading and image data processing technology, and in particular to a method, device, medium, equipment and product for transforming the position of architectural plan elements based on dual positioning lines. Background Technology

[0002] In architectural planning and surveying, layout plans are a crucial technical basis for construction layout. Traditionally, the creation of layout plans requires analysis of planning and approval drawings, overlaying multiple layered plans onto the same coordinate system to determine the precise location and axial relationships of the building.

[0003] Currently, CAD software such as AutoCAD provides basic graphic editing and transformation functions, including commands for moving, rotating, and aligning. However, when performing alignment operations on complex architectural floor plans, these commands typically require operators to manually select the elements to be processed and, based on the axes, positioning lines, or architectural outlines in the drawing, determine the target position where each element should be aligned before performing move, rotate, or other operations. For architectural floor plans containing multiple architectural outlines, multiple layered floor plans, or multiple elements to be aligned, the above processing method is not only cumbersome but also makes it difficult to achieve batch alignment of elements.

[0004] Furthermore, during manual alignment, the correspondence between the elements to be transformed and the reference axes usually relies on the operator's experience, which can easily lead to problems such as incorrect element matching, inconsistent reference point selection, and deviations in rotation angles. Especially when multiple elements need to be moved and rotated continuously, errors generated by manual operation may gradually accumulate, causing the original positional relationships between the building outlines to shift. This results in inaccurate relative positions of building outlines, positioning axes, or layered elements in the generated layout plan, thus affecting the accuracy of subsequent construction layout. Summary of the Invention

[0005] The purpose of this invention is to propose a method, device, medium, equipment, and product for transforming the position of architectural plan elements based on dual positioning lines. By setting a reference axis and a target axis to be transformed in the architectural plan, and using the reference axis as the transformation reference, the target target axis to be transformed is transformed to obtain a target transformation matrix. The target transformation matrix is ​​then applied to the target element to be transformed, thereby realizing batch alignment processing of elements and effectively improving the accuracy of element alignment.

[0006] To achieve the above objectives, a first aspect of the present invention provides a method for transforming the position of architectural plan elements based on dual positioning lines, the method comprising: Determine the reference axis in the building plan, and then determine several axes to be transformed in sequence; Based on the positional relationship between the reference point of the target graphic element to be transformed and each of the axes to be transformed, the target axis to be transformed corresponding to the target graphic element is determined; Using the reference axis as the transformation reference, the target axis to be transformed is transformed to obtain a target transformation matrix, and the target transformation matrix is ​​applied to the target primitive to be transformed to transform the target primitive.

[0007] In this embodiment, a target transformation matrix is ​​generated based on the positional transformation relationship between the target axis to be transformed and the reference axis, so that the primitives at different positions can be automatically matched and uniformly transformed according to their respective corresponding axes to be transformed, thereby improving the processing efficiency and accuracy of primitive position transformation.

[0008] Furthermore, the process of determining a reference axis in the building plan and sequentially determining a plurality of axes to be transformed includes: A first positioning line and a second positioning line are set in the building plan. The first positioning line and the second positioning line are both polysegment lines, and the first positioning line and the second positioning line each include a number of segments that are of the same number and in corresponding order. A reference starting point is determined from the segment points of the first positioning line, and a reference ending point is determined from the segment points of the second positioning line; the reference axis is determined based on the reference starting point and the reference ending point; According to the arrangement order of the segment points in the first positioning line and the second positioning line, the i-th segment point in the first positioning line is determined as the starting point of the i-th axis to be transformed, and the i-th segment point in the second positioning line is determined as the ending point of the i-th axis to be transformed; the i-th axis to be transformed is determined based on the starting point and ending point of the i-th axis to be transformed, until several axes to be transformed are determined, where i is a positive integer.

[0009] In this embodiment, by setting a first positioning line and a second positioning line with the same number of segments and corresponding segment order, the corresponding segments in the two positioning lines can form a stable axis correspondence relationship. Thus, several axes to be transformed are automatically generated according to the segment arrangement order, ensuring the consistency of axis generation rules and improving the stability of subsequent primitive matching and position transformation.

[0010] Further, determining the target axis to be transformed corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element and each of the axes to be transformed includes: Based on the starting point, ending point, and preset outward distance value of each axis to be transformed, the axis association region of each axis to be transformed is determined respectively; Based on the positional relationship between the reference point of the target graphic element to be transformed and the axis-associated region of each of the axes to be transformed, the target axis to be transformed corresponding to the target graphic element is determined.

[0011] In this embodiment, by setting an axis association area for each axis to be transformed, the axis to be transformed can cover a certain range of matching areas around it, thereby adapting to actual drawing scenarios where there is a certain offset distance between architectural elements and positioning axes.

[0012] Further, determining the target axis to be transformed corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element and the axis association region of each of the axes to be transformed includes: Calculate the geometric center coordinates of the target primitive to be transformed; When the geometric center coordinates fall into only one axis-related region, the axis to be transformed corresponding to the axis-related region is determined as the target axis to be transformed corresponding to the target primitive to be transformed. When the geometric center coordinates fall into multiple axis-related regions, the Euclidean distance between the geometric center coordinates and the regional center point of each of the multiple axis-related regions is calculated respectively; and the axis to be transformed corresponding to the axis-related region with the smallest Euclidean distance is determined as the target axis to be transformed corresponding to the target primitive.

[0013] In this embodiment, by using the geometric center coordinates of the target graphic element to be transformed to represent the overall position of the graphic element, the effectiveness of determining the axis to which the graphic element belongs can be improved. Furthermore, by determining the target axis to be transformed through preset rules, an accurate axis matching basis can be provided for subsequent graphic element position transformations.

[0014] Further, the step of using the reference axis as a transformation reference to perform position transformation on the target axis to be transformed, to obtain the target transformation matrix, includes: Calculate the translation vector between the starting point of the target axis to be transformed and the starting point of the reference axis, and construct a translation transformation matrix based on the translation vector; Calculate the direction angle difference between the direction angle of the target axis to be transformed and the direction angle of the reference axis, and construct a rotation transformation matrix based on the direction angle difference; The target transformation matrix is ​​generated based on the translation transformation matrix and the rotation transformation matrix.

[0015] In this embodiment, the primitive position transformation process is decomposed into two quantifiable steps: translation transformation and rotation transformation, by calculating the translation vector and direction angle difference between the target axis to be transformed and the reference axis. Then, a target transformation matrix is ​​generated based on the translation and rotation transformation matrices, which can describe the complete position transformation relationship in a unified matrix form, achieving consistency in primitive position transformation.

[0016] Further, applying the target transformation matrix to the target primitive to be transformed to perform a positional transformation on the target primitive includes: Obtain the coordinates of each vertex of the target primitive to be transformed; The target transformation matrix is ​​applied to the coordinates of each vertex to obtain the target vertex coordinates corresponding to each vertex, and the position transformation of the target primitive to be transformed is performed based on the target vertex coordinates.

[0017] In this embodiment, by applying the target transformation matrix to each vertex of the target primitive to be transformed, all vertices of the same primitive are transformed synchronously according to the same translation and rotation relationships, thereby improving the accuracy of primitive transformation.

[0018] To achieve the above objectives, a second aspect of the present invention also provides a device for transforming the position of architectural plan elements based on dual positioning lines, used to implement the method for transforming the position of architectural plan elements based on dual positioning lines as described in any of the first aspects, the device comprising: The axis generation module is used to determine the reference axis in the building plan and sequentially determine several axes to be transformed; The transformation axis determination module is used to determine the target transformation axis corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element to be transformed and each of the transformation axes; The primitive position transformation module is used to perform position transformation on the target axis to be transformed using the reference axis as the transformation reference, to obtain a target transformation matrix, and to apply the target transformation matrix to the target primitive to be transformed in order to perform position transformation on the target primitive to be transformed.

[0019] A third aspect of the present invention also provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the method for transforming the position of architectural plan elements based on dual positioning lines as described in any of the first aspects above.

[0020] A fourth aspect of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the method for transforming the position of architectural plan elements based on dual positioning lines as described in any of the first aspects above.

[0021] The fifth aspect of the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for transforming the position of architectural plan elements based on dual positioning lines as described in any of the first aspects above. Attached Figure Description

[0022] Figure 1 This is a flowchart of a preferred embodiment of a method for transforming the position of architectural plan elements based on dual positioning lines provided in the first aspect of the present invention; Figure 2 This is a schematic diagram of the correspondence between the double positioning lines and vertices of another preferred embodiment of the architectural plan element position transformation method based on double positioning lines provided in the first aspect of the present invention; Figure 3 This is a schematic diagram of the axis association area and element matching relationship of the axis to be transformed, which is another preferred embodiment of the architectural plan element position transformation method based on dual positioning lines provided in the first aspect of the present invention. Figure 4 This is a structural block diagram of a preferred embodiment of a building plan element position transformation device based on dual positioning lines provided in the second aspect of the present invention; Figure 5 This is a structural block diagram of a preferred embodiment of a terminal device provided in the fourth aspect of the present invention. Detailed Implementation

[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] It should be noted that the data involved in this invention (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0025] In this embodiment of the invention, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplarily" or "for example" in this invention should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0026] In this invention description, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In this invention description, unless otherwise stated, "a plurality of" means two or more. In this invention description, the term "comprising" and its variations are open-ended, meaning "including but not limited to." The term "based on" means "at least partially based on." The term "according to" means "at least partially according to." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments."

[0027] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0028] In the description of this invention, it should be noted that, unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing specific embodiments only and is not intended to limit the invention. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0029] The technical solution of the present invention will be further described below with reference to specific embodiments: The first aspect of this invention provides a method for transforming the position of architectural plan elements based on dual positioning lines, see [link to relevant documentation]. Figure 1 The diagram shown is a flowchart of a preferred embodiment of a method for transforming the position of architectural plan elements based on dual positioning lines provided in the first aspect of the present invention. The method includes steps S1 to S3, as follows: Step S1: Determine the reference axis in the building plan, and then determine several axes to be transformed in sequence; The building plan can be a layout plan, planning and approval plan, floor plan, building outline, or other two-dimensional plan containing building elements, used in architectural planning and surveying. The reference axis refers to an axis in the building plan that serves as a reference for position transformation, providing the reference position and direction for the target element to be transformed. The axis to be transformed refers to an axis that has a preset correspondence with the reference axis and is used to determine the position and direction of the element before transformation. Several axes to be transformed can be generated sequentially based on double positioning lines in the building plan, or determined sequentially based on pre-set positioning lines, axes, or auxiliary lines in the building plan.

[0030] In one example, a first positioning line and a second positioning line are set on the building plan. Both the first and second positioning lines are polylines, and each includes the same number of sequentially corresponding segment points. The system can determine a reference starting point from the segment points of the first positioning line and a reference ending point from the segment points of the second positioning line, connecting the reference starting point and the reference ending point to form a reference axis. Then, according to the arrangement order of the segment points in the first and second positioning lines, the system uses the i-th segment point in the first positioning line as the starting point of the i-th axis to be transformed and the i-th segment point in the second positioning line as the ending point of the i-th axis to be transformed, thereby sequentially determining several axes to be transformed. Thus, a set of axes can be automatically generated from sequentially corresponding segment points in the two positioning lines.

[0031] Step S2: Determine the target axis to be transformed corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element to be transformed and each of the axes to be transformed; The target graphic element to be transformed refers to a graphic object in the building plan that needs to undergo positional transformation, such as a building outline, building outer boundary, polyline graphic element, closed graphic element, or other graphic element that can be represented by vertex coordinates. The reference point refers to a point used to characterize the overall position of the target graphic element to be transformed, which can be the geometric center point, the center point of the circumscribed rectangle, the centroid point, or a pre-specified graphic element positioning point. The target axis to be transformed refers to the axis to be transformed corresponding to the target graphic element, determined from a plurality of axes to be transformed, and is used as the axis for positional transformation of the target graphic element.

[0032] In one example, the system can determine the axis association region for each axis to be transformed based on its start point, end point, and a preset outward distance value. The axis association region can be understood as the effective matching area around the axis to be transformed. Then, the system calculates the geometric center coordinates of the target primitive to be transformed and determines the positional relationship between these coordinates and each axis association region. When the geometric center coordinates fall within one axis association region, the axis to be transformed corresponding to that region is determined as the target axis to be transformed. When the geometric center coordinates fall within multiple axis association regions simultaneously, the Euclidean distance between the geometric center coordinates and the regional center points of each axis association region can be further calculated, and the axis to be transformed corresponding to the axis association region with the smallest Euclidean distance is determined as the target axis to be transformed.

[0033] Step S3: Using the reference axis as the transformation reference, perform position transformation on the target axis to be transformed to obtain the target transformation matrix, and apply the target transformation matrix to the target primitive to be transformed to perform position transformation on the target primitive to be transformed.

[0034] The target transformation matrix refers to a matrix used to describe the positional transformation relationship required for the target axis to be transformed to the reference axis. The target transformation matrix may include translation transformation information and rotation transformation information, used to transform the target primitive to be transformed from its current position and direction corresponding to the axis to the position and direction corresponding to the reference axis.

[0035] In one example, the system first calculates the translation vector between the starting point of the target axis to be transformed and the starting point of the reference axis, and constructs a translation transformation matrix based on the translation vector. Next, it calculates the direction angle difference between the direction angle of the target axis to be transformed and the direction angle of the reference axis, and constructs a rotation transformation matrix based on the direction angle difference. Finally, it generates a target transformation matrix based on the translation and rotation transformation matrices. Afterward, the system obtains the vertices of each primitive to be transformed, applies the target transformation matrix to each primitive vertex, and obtains the target vertex coordinates corresponding to each primitive vertex, thereby completing the position transformation of the target primitive.

[0036] For example, a building plan may include multiple building outline elements, each located near a different axis to be transformed. The system automatically determines the corresponding target axis to be transformed based on the geometric center coordinates of each building outline element. Then, it calculates the translation and rotation relationships between each target axis to be transformed and the reference axis, and applies the corresponding target transformation matrix to each vertex of the building outline element. In this way, building outline elements distributed in different locations and directions can be batch-transformed to positions and directions corresponding to the reference axis, achieving automatic alignment of building plan elements.

[0037] In another preferred embodiment, determining a reference axis in the building plan and sequentially determining a plurality of axes to be transformed includes: A first positioning line and a second positioning line are set in the building plan. The first positioning line and the second positioning line are both polysegment lines, and the first positioning line and the second positioning line each include a number of segments that are of the same number and in corresponding order. A reference starting point is determined from the segment points of the first positioning line, and a reference ending point is determined from the segment points of the second positioning line; the reference axis is determined based on the reference starting point and the reference ending point; According to the arrangement order of the segment points in the first positioning line and the second positioning line, the i-th segment point in the first positioning line is determined as the starting point of the i-th axis to be transformed, and the i-th segment point in the second positioning line is determined as the ending point of the i-th axis to be transformed; the i-th axis to be transformed is determined based on the starting point and ending point of the i-th axis to be transformed, until several axes to be transformed are determined, where i is a positive integer.

[0038] See Figure 2 This is a schematic diagram of the correspondence between two positioning lines and vertices, representing another preferred embodiment of a method for transforming the position of architectural plan elements based on two positioning lines provided in the first aspect of the present invention. A two-dimensional coordinate system is established in the architectural plan, with the horizontal axis being the X-axis and the vertical axis being the Y-axis. A first positioning line L1 and a second positioning line L2 are set in the architectural plan. The first positioning line L1 is a blue polyline in the diagram, and the second positioning line L2 is a red polyline in the diagram. Both L1 and L2 include a number of segments arranged in sequence, and the number of segments in L1 and L2 is the same.

[0039] In one example, let the first positioning line and the second positioning line be respectively and Both include Each segment point, and The segment points of the two positioning lines correspond one-to-one according to their serial numbers:

[0040] in, .

[0041]

[0042] in, , For segment number, Indicates the first positioning line The Each segment point, Indicates the second positioning line The Each segment point; They are respectively exist Coordinates in direction They are respectively exist Coordinates in the direction.

[0043] Generate the first segment based on the corresponding segment point. Axis :

[0044] in, Indicated by Starting from, with The line segment whose endpoint is [the ... As a reference axis; in other embodiments, the user may also specify any axis formed by corresponding segment points as the reference axis.

[0045] To accommodate user-specified reference axes, the starting point of the reference axis is set as:

[0046] The endpoint of the reference axis is:

[0047] By default, The direction vector of the reference axis Represented as:

[0048] in:

[0049] In architectural floor plan alignment scenarios, the axis direction is typically calculated in the XY plane; therefore, the direction angle of the reference axis relative to the positive X-axis direction is... Represented as:

[0050] For the Current axis Its direction vector and direction angle are as follows:

[0051]

[0052] in:

[0053] In yet another preferred embodiment, determining the target axis to be transformed corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element and each of the axes to be transformed includes: Based on the starting point, ending point, and preset outward distance value of each axis to be transformed, the axis association region of each axis to be transformed is determined respectively; Based on the positional relationship between the reference point of the target graphic element to be transformed and the axis-associated region of each of the axes to be transformed, the target axis to be transformed corresponding to the target graphic element is determined.

[0054] In one example, for the first Axis Let its starting point be:

[0055] The destination is:

[0056] To determine whether a candidate primitive belongs to the axis, the axis is constructed in the XY plane. Corresponding extended rectangular area .

[0057] set up This refers to the outward expansion distance parameter, in millimeters. This can be set by the user; the default value is 5000mm. This expands the rectangular area. The boundary is:

[0058] Therefore, the rectangular area is expanded. It can be represented as:

[0059] The formula outputs not a single coordinate point, but a two-dimensional rectangular region. This rectangular region can be defined by its lower left corner point. and the top right corner The only certainty.

[0060] In yet another preferred embodiment, determining the target axis to be transformed corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element to be transformed and the axis association region of each of the axes to be transformed includes: Calculate the geometric center coordinates of the target primitive to be transformed; When the geometric center coordinates fall into only one axis-related region, the axis to be transformed corresponding to the axis-related region is determined as the target axis to be transformed corresponding to the target primitive to be transformed. When the geometric center coordinates fall into multiple axis-related regions, the Euclidean distance between the geometric center coordinates and the regional center point of each of the multiple axis-related regions is calculated respectively; and the axis to be transformed corresponding to the axis-related region with the smallest Euclidean distance is determined as the target axis to be transformed corresponding to the target primitive.

[0061] In one example, let the first... The geometric center points of the candidate primitives are:

[0062] like satisfy and If the candidate primitive falls into the first position, then it is determined that the candidate primitive falls into the first position. An extended rectangular region along the axis.

[0063] When a candidate primitive falls into multiple extended rectangular regions simultaneously, calculate the geometric center point of each candidate primitive. Center point of each candidate extended rectangular region The distance between them is determined, and the axis with the smallest distance is selected as the target axis.

[0064] Expanding rectangular area center point Represented as:

[0065] set up Euclidean distance between candidate primitives and the center point of the extended rectangular region Represented as:

[0066] in, and The center point The X and Y coordinates. In the... If multiple extended rectangular regions simultaneously fall into multiple candidate primitives, if If the minimum distance value is obtained, then the first... The candidate primitive was matched to the first... A single axis line.

[0067] See Figure 3 This is a schematic diagram of the axis association region and element matching relationship of an axis to be transformed, which is another preferred embodiment of a method for transforming the position of architectural plan elements based on dual positioning lines provided in the first aspect of the present invention. The diagram shows an axis to be transformed. For example, the axis to be transformed starts from the starting point. and the end point Confirmed. Based on the start and end points of the axis to be transformed and the preset outward distance value offset, an axis-related region is constructed around the axis to be transformed. The range of the axis-related region is shown in the figure with a blue dashed box, where offset represents the outward distance of the axis to be transformed in the preset direction.

[0068] Within the area associated with this axis, several candidate graphic elements are set, such as the candidate graphic elements in the figure. , and The orange dots inside each candidate primitive represent the geometric center point of the corresponding candidate primitive. Because the candidate primitives... , and Since the geometric center points of all elements fall within the area associated with the axis, the candidate primitives can be determined. , and With the axis to be transformed Match successful. The successfully matched candidate elements are indicated by a yellow border in the figure. Additionally, unmatched candidate elements are also shown in the figure. and Among them, candidate primitives Candidate primitives located outside the area associated with the axis The geometric center point also does not fall within the area associated with the axis; therefore, the candidate primitive can be determined. and With the axis to be transformed Mismatch. The gray borders in the diagram indicate the unmatched candidate elements.

[0069] In yet another preferred embodiment, the step of using the reference axis as a transformation reference to perform a position transformation on the target axis to be transformed, thereby obtaining a target transformation matrix, includes: Calculate the translation vector between the starting point of the target axis to be transformed and the starting point of the reference axis, and construct a translation transformation matrix based on the translation vector; Calculate the direction angle difference between the direction angle of the target axis to be transformed and the direction angle of the reference axis, and construct a rotation transformation matrix based on the direction angle difference; The target transformation matrix is ​​generated based on the translation transformation matrix and the rotation transformation matrix.

[0070] In one example, for the match to the Axis Candidate primitives need to be calculated from the current axis. To the reference axis The coordinate transformation includes translation and rotation.

[0071] For translation transformations, first calculate the starting point of the current axis. To the reference starting point Translation vector :

[0072] in:

[0073] and These represent the current axis starting point relative to the reference starting point. The distances to be translated in three directions. Based on the translation vectors. Construct translation matrix :

[0074] For rotational transformations, calculate the... Direction angle of the bar axis Angle with respect to the reference axis The angle difference between them:

[0075] in, The rotation angle; A positive value indicates counterclockwise rotation. A negative value indicates clockwise rotation. (Based on the reference starting point) Rotate around the Z-axis with the Z-axis as the center of rotation. The rotation matrix is ​​obtained. In two-dimensional planar representation, its equivalent transformation relationship is:

[0076] The above expression indicates that the point Rotate in the XY plane around the reference starting point A new point was obtained later. In actual matrix calculations, the rotation matrix... It can be determined by the rotation angle Rotation axis Z-axis and rotation center The only certainty.

[0077] Multiply the translation and rotation matrices to obtain the combined transformation matrix. :

[0078] This embodiment uses column vectors to represent point coordinates and performs coordinate transformation by multiplying the column vectors by a transformation matrix on the left. Therefore... This means that a translation transformation is performed on the point first, followed by a rotation transformation.

[0079] In yet another preferred embodiment, applying the target transformation matrix to the target primitive to be transformed to perform a positional transformation on the target primitive includes: Obtain the coordinates of each vertex of the target primitive to be transformed; The target transformation matrix is ​​applied to the coordinates of each vertex to obtain the target vertex coordinates corresponding to each vertex, and the position transformation of the target primitive to be transformed is performed based on the target vertex coordinates.

[0080] In one example, let any vertex in the candidate primitives be:

[0081] Represented in homogeneous coordinates as follows:

[0082] Then the aligned vertices homogeneous coordinates It can be represented as:

[0083] in:

[0084] These are the homogeneous coordinates of the vertices after the transformation. These are the 3D coordinates of the transformed vertices. Performing the above transformation on all vertices of the candidate primitive yields the aligned new primitive.

[0085] A second aspect of the present invention provides a device for transforming the position of architectural plan elements based on dual positioning lines, used to implement the method for transforming the position of architectural plan elements based on dual positioning lines described in any of the embodiments of the first aspect above. See also... Figure 4 The diagram shown is a structural block diagram of a preferred embodiment of a building plan element position transformation device based on dual positioning lines provided in the second aspect of the present invention. The device includes: The axis generation module 11 is used to determine the reference axis in the building plan and to determine several axes to be transformed in sequence. The transformation axis determination module 12 is used to determine the target transformation axis corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element to be transformed and each of the transformation axes; The primitive position transformation module 13 is used to perform position transformation on the target axis to be transformed using the reference axis as the transformation reference, to obtain a target transformation matrix, and to apply the target transformation matrix to the target primitive to be transformed in order to perform position transformation on the target primitive to be transformed.

[0086] It should be noted that the architectural plan element position transformation device based on dual positioning lines provided in the second aspect embodiment of the present invention can realize all the processes of the architectural plan element position transformation method based on dual positioning lines described in the first aspect. The functions and technical effects of each module and unit in the device are the same as those of the architectural plan element position transformation method based on dual positioning lines described in the first aspect embodiment, and will not be repeated here.

[0087] A third aspect of the present invention also provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a method for transforming the position of architectural plan elements based on dual positioning lines as described in any of the first aspects of the present invention.

[0088] The fourth aspect of the present invention also provides a terminal device, see [link to documentation]. Figure 5 The diagram shown is a structural block diagram of a preferred embodiment of a terminal device provided in the fourth aspect of the present invention. The terminal device includes a processor 10, a memory 20, and a computer program stored in the memory 20 and configured to be executed by the processor 10. When executing the computer program, the processor 10 implements a method for transforming the position of architectural plan elements based on dual positioning lines as described in any of the above embodiments.

[0089] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 20 and executed by the processor 10 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0090] The processor 10 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor 10 may be any conventional processor. The processor 10 is the control center of the terminal device, connecting various parts of the terminal device through various interfaces and lines.

[0091] The memory 20 mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., while the data storage area can store related data, etc. Furthermore, the memory 20 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard drive, a smart media card (SMC), a secure digital card (SD), and a flash card, or other volatile solid-state storage devices.

[0092] It should be noted that the aforementioned terminal device may include, but is not limited to, processors and memory. Those skilled in the art will understand that the above content is merely an example describing the structure of the terminal device and does not constitute a limitation on the structure of the aforementioned terminal device. The aforementioned terminal device may include more or fewer components than those described above, or combine certain components, or different components.

[0093] A fifth aspect embodiment of the present invention also provides a computer program product, including a computer program that, when executed by a processor 10, implements a method for transforming the position of architectural plan elements based on dual positioning lines as described in any of the first aspects embodiments above.

[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary hardware platforms, and of course, it can also be implemented entirely by hardware. Based on this understanding, all or part of the technical solution of the present invention that contributes to the background technology can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.

[0095] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0096] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for transforming the position of architectural plan elements based on dual positioning lines, characterized in that, include: Determine the reference axis in the building plan, and then determine several axes to be transformed in sequence; Based on the positional relationship between the reference point of the target graphic element to be transformed and each of the axes to be transformed, the target axis to be transformed corresponding to the target graphic element is determined; Using the reference axis as the transformation reference, the target axis to be transformed is transformed to obtain a target transformation matrix, and the target transformation matrix is ​​applied to the target primitive to be transformed to transform the target primitive.

2. The method for transforming the position of architectural plan elements based on dual positioning lines as described in claim 1, characterized in that, The process of determining a reference axis in the building plan and sequentially determining several axes to be transformed includes: A first positioning line and a second positioning line are set in the building plan. The first positioning line and the second positioning line are both polysegment lines, and the first positioning line and the second positioning line each include a number of segments that are of the same number and in corresponding order. A reference starting point is determined from the segment points of the first positioning line, and a reference ending point is determined from the segment points of the second positioning line; the reference axis is determined based on the reference starting point and the reference ending point; According to the arrangement order of the segment points in the first positioning line and the second positioning line, the i-th segment point in the first positioning line is determined as the starting point of the i-th axis to be transformed, and the i-th segment point in the second positioning line is determined as the ending point of the i-th axis to be transformed; the i-th axis to be transformed is determined based on the starting point and ending point of the i-th axis to be transformed, until several axes to be transformed are determined, where i is a positive integer.

3. The method for transforming the position of architectural plan elements based on dual positioning lines as described in claim 2, characterized in that, The step of determining the target axis to be transformed corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element and each of the axes to be transformed includes: Based on the starting point, ending point, and preset outward distance value of each axis to be transformed, the axis association region of each axis to be transformed is determined respectively; Based on the positional relationship between the reference point of the target graphic element to be transformed and the axis-associated region of each of the axes to be transformed, the target axis to be transformed corresponding to the target graphic element is determined.

4. The method for transforming the position of architectural plan elements based on dual positioning lines as described in claim 3, characterized in that, The step of determining the target axis to be transformed corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element and the axis association region of each axis to be transformed includes: Calculate the geometric center coordinates of the target primitive to be transformed; When the geometric center coordinates fall into only one axis-related region, the axis to be transformed corresponding to the axis-related region is determined as the target axis to be transformed corresponding to the target primitive to be transformed. When the geometric center coordinates fall into multiple axis-related regions, the Euclidean distance between the geometric center coordinates and the regional center point of each of the multiple axis-related regions is calculated respectively; and the axis to be transformed corresponding to the axis-related region with the smallest Euclidean distance is determined as the target axis to be transformed corresponding to the target primitive.

5. The method for transforming the position of architectural plan elements based on dual positioning lines as described in claim 4, characterized in that, The step of using the reference axis as the transformation reference to perform position transformation on the target axis to be transformed, to obtain the target transformation matrix, includes: Calculate the translation vector between the starting point of the target axis to be transformed and the starting point of the reference axis, and construct a translation transformation matrix based on the translation vector; Calculate the direction angle difference between the direction angle of the target axis to be transformed and the direction angle of the reference axis, and construct a rotation transformation matrix based on the direction angle difference; The target transformation matrix is ​​generated based on the translation transformation matrix and the rotation transformation matrix.

6. The method for transforming the position of architectural plan elements based on dual positioning lines as described in claim 5, characterized in that, The step of applying the target transformation matrix to the target primitive to be transformed, in order to perform a position transformation on the target primitive to be transformed, includes: Obtain the coordinates of each vertex of the target primitive to be transformed; The target transformation matrix is ​​applied to the coordinates of each vertex to obtain the target vertex coordinates corresponding to each vertex, and the position transformation of the target primitive to be transformed is performed based on the target vertex coordinates.

7. A device for changing the position of architectural plan elements based on dual positioning lines, characterized in that, The apparatus for implementing the method for transforming the position of architectural plan elements based on dual positioning lines as described in any one of claims 1 to 6 includes: The axis generation module is used to determine the reference axis in the building plan and sequentially determine several axes to be transformed; The transformation axis determination module is used to determine the target transformation axis corresponding to the target graphic element based on the positional relationship between the reference point of the target graphic element to be transformed and each of the transformation axes; The primitive position transformation module is used to perform position transformation on the target axis to be transformed using the reference axis as the transformation reference, to obtain a target transformation matrix, and to apply the target transformation matrix to the target primitive to be transformed in order to perform position transformation on the target primitive to be transformed.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform a method for transforming the position of architectural plan elements based on dual positioning lines as described in any one of claims 1 to 6.

9. A terminal device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a method for transforming the position of architectural plan elements based on dual positioning lines as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements a method for transforming the position of architectural plan elements based on dual positioning lines as described in any one of claims 1 to 6.