Method for automatically generating 2D CAD stair construction drawings based on 3D stair data

The method automates the generation of two-dimensional CAD stair construction graphs from three-dimensional stair data, addressing inefficiencies in manual drawing by using geometric calculations to produce accurate and efficient stair representations, suitable for complex stair structures.

CN119379533BActive Publication Date: 2025-03-28TIANHUA ARCHITECTURE DESIGN COMPANY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411908292.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-03-28
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

Current methods for representing staircases in architectural designs rely heavily on manual drawing, leading to inefficiencies and errors in generating accurate stair plane graphs, as existing cut projection technologies fail to meet construction graph requirements.

Method used

A method for automatically generating two-dimensional CAD stair construction graphs from three-dimensional stair data, involving data preprocessing, axis-aligned bounding box generation, polygon face extraction, and geometric calculations to produce accurate stair step representations.

Benefits of technology

This approach significantly enhances design efficiency and accuracy by automating the generation of stair plane graphs, reducing manual labor and ensuring precise representation of stair steps and directions, capable of handling complex stair structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379533B_ABST
    Figure CN119379533B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of building data processing, and specifically relates to a method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data, aiming to solve the problem that the current generation of two-dimensional break lines usually relies on manual operation and is inefficient and prone to errors. The present invention includes: generating each axis-aligned boundary box based on the sectioning path of each stair in the transformed clipping data, and then extracting each polygonal face patch in each axis-aligned boundary box and the polygonal face patch to be cut; calculating the base of each step right triangle based on the direction of each stair, and further generating each step right triangle; cutting each face to be cut to obtain the cut face patch; after cutting, adjusting the face patch in the box to a triangular form suitable for the break line, writing the information of the triangular face patch into a file to obtain an svg file, and generating a stair construction drawing with a break line after reading. The present invention avoids errors and omissions that occur in the manual drawing process.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Stair breaklines are a graphical representation used in architectural designs and floor plans to indicate changes in direction or transitions between floors. On architectural drawings, stairs are usually represented in a specific way so that readers can clearly understand the design intent and structural characteristics of the stairs. Stair breaklines are widely used, not only in residential design, but also in commercial buildings, public facilities and other occasions where multi-layer spaces need to be connected.

[0003] The current cutting projection technology directly generates a horizontal section at the cutoff of the stair ramp, which cannot meet the requirements of the construction drawing expression. Therefore, when drawing the stair plan, the designer needs to combine the spatial imagination ability and the construction drawing expression requirements to manually draw the stair construction drawing, which is inefficient. To solve this problem, the present invention proposes a method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data. Summary of the invention

[0004] In order to solve the above-mentioned problem in the prior art, that is, the current stair design usually relies on manual operation to draw the stair plan break line, which is inefficient and prone to errors, the present invention provides a method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data, the method comprising:

[0005] Acquire three-dimensional staircase data, group and filter the three-dimensional staircase data to obtain pure staircase data, and convert the coordinates and value types of the pure staircase data to obtain transformed clipping data suitable for the staircase cutting position;

[0006] Generate each axis-aligned bounding box based on the cutting path of each stair in the transformed clipping data, and then extract each polygonal patch in each axis-aligned bounding box and the polygonal patch to be clipped;

[0007] Based on the transformed clipping data, the direction of each stair is obtained, the base of each step right triangle is calculated based on the direction of each stair, and each step right triangle is generated according to the base of each step triangle and the direction of each stair; each section surface is generated based on each step right triangle;

[0008] Use the faces of the axis-aligned bounding box to cut the face to be cut to obtain the cut face piece; the face to be cut includes the right-angled triangles of each step, the polygonal face pieces to be cut and the section faces; after cutting, adjust the face pieces in each axis-aligned bounding box to a triangular form suitable for the break line, write the information of the triangular face pieces into a file in svg format to obtain an svg file, read the svg file, and generate a stair plan with break lines.

[0009] In a preferred embodiment, the axis-aligned bounding box is composed of 6 faces, and the axis-aligned bounding box is used to extract stair data at the sectioning position of each staircase.

[0010] In a preferred embodiment, generating each section surface based on each step right triangle includes: the two points of the longest hypotenuse of each step right triangle are the starting point and end point of each break line; and then forming each section surface based on the two points and direction of each break line.

[0011] In a preferred embodiment, extracting each polygonal patch in each axis-aligned bounding box Extracting the polygonal patch contained in the axis-aligned bounding box includes:

[0012] Use the extractClip function to traverse each polygon patch and call isInside to determine whether the polygon patch is completely inside the axis-aligned bounding box. If the polygon patch is inside the box, it is stored in the result list; if the polygon patch is not completely inside the box, the polygon patch will be put back into the original list and used as the polygon patch to be cut.

[0013] In a preferred embodiment, the method of generating each step right triangle includes:

[0014] The base of the right triangle of each step is calculated based on the direction of each staircase, and the length of the base of each step triangle is consistent with the horizontal projection length of each step;

[0015] Each right triangle is generated based on the base of each step triangle and the direction of the stairs; the step length side of each right triangle corresponds to the step direction of the stair segment, the base of each right triangle is perpendicular to the step direction of the stair segment, and the area of ​​each right triangle represents half of the area of ​​a stair step area.

[0016] In a preferred embodiment, calculating the base of each right triangle of each step based on the direction of each staircase includes:

[0017] By calculating the dot product of each edge of the polygon in the transformed clipping data and the direction of the stair step, the edges perpendicular to the stair step direction are screened out; then, the edge farthest from the opposite direction of the stair step among the edges perpendicular to the stair step direction is calculated using a geometric method, and the edge is selected as the bottom edge of the stairs; finally, the direction of the bottom edge of the selected stairs is adjusted so that the direction of the bottom edge conforms to the order from the right side to the left side of the center line.

[0018] In a preferred embodiment, each step right triangle comprises:

[0019] The short side of the two right-angled sides of the right-angled triangle of each step is consistent with the direction of the step of the stair section, and the short side indicates the extension direction of the step; the long side of the two right-angled sides is perpendicular to the direction of the step of the stair section.

[0020] In a preferred embodiment, using each face of the axis-aligned bounding box to cut the face to be cut to obtain the cut face piece includes:

[0021] First, traverse each surface to be clipped to check whether it needs to be clipped. If the surface to be clipped does not need to be clipped, skip it directly. For the surface to be clipped that needs to be clipped, get its vertex list and check the position of each vertex relative to the clipping plane one by one. Use the plane.checkSignedDir function to determine whether each vertex is inside or outside the plane.

[0022] When it is found that one vertex of the surface to be clipped is in the plane and the next vertex is outside the plane, the code calculates the intersection of these two vertices and the clipping plane and adds the intersection to the clipping path; if all the vertices of the surface to be clipped are in the plane, they are directly retained;

[0023] Finally, check whether the generated clipping path contains more than three intersection points. If it contains more than three intersection points, calculate the normal direction of the clipped face. If the normal direction meets the expectations, retain the clipping result of the polygon. If the normal direction does not meet the expectations, readjust the clipping path.

[0024] In a second aspect of the present invention, a system for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data is provided, the system comprising:

[0025] A data acquisition module, used to acquire three-dimensional staircase data, group and filter the three-dimensional staircase data to obtain pure staircase data, and perform coordinate and value type conversion on the pure staircase data to obtain transformed clipping data suitable for staircase sectioning positions;

[0026] A patch extraction module, used for generating each axis-aligned bounding box based on the cutting path of each stair in the transformed clipping data, and then extracting each polygon patch in each axis-aligned bounding box and the polygon patch to be clipped;

[0027] A triangle generation module is used to obtain the direction of each stair based on the transformed clipping data, calculate the base of each step right triangle based on the direction of each stair, generate each step right triangle according to the base of each step triangle and the direction of each stair; and generate each section surface based on each step right triangle;

[0028] A break line generation module is used to use the faces of the axis-aligned bounding box to cut each step right triangle, each polygonal face and each section surface to obtain the cut face piece; the surface to be cut includes each step right triangle, each polygonal face and each section surface; the cut face piece is adjusted to a triangular form suitable for the break line, the information of the triangular face piece is written into a file in svg format to obtain an svg file, the svg file is read, and a stair plan with break lines is generated.

[0029] The third aspect of the present invention proposes an electronic device, which includes: at least one processor; and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned method of automatically generating two-dimensional CAD stair construction drawings based on three-dimensional stair data.

[0030] Beneficial effects of the present invention:

[0031] (1) The present invention aims to solve the problem of automatically generating a two-dimensional stair construction drawing from a three-dimensional stair model by using the sectioning + projection technology. It solves the technical difficulty of converting the horizontal section surface at the intersection of the sectioning box and the stair inclined plate into a vertical section surface with a non-orthogonal angle to the stair walking direction, and using a broken line to indicate it in the generated two-dimensional stair construction drawing. A method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data is proposed.

[0032] (2) The present invention proposes a method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data. By processing the three-dimensional information of the stair, the break line diagram in the plan view is automatically generated. This method not only supports the simultaneous generation of multiple staircases, but also can automatically cut out useless parts through intelligent geometric operations, greatly improving the design efficiency and accuracy. In practical applications, this solution provides an effective tool for architectural designers and engineers, reduces the complexity of manually drawing stair drawings, and has broad application prospects;

[0033] (3) The present invention improves design efficiency; the present invention significantly improves the efficiency of the design process by automatically generating stair plan drawings. The traditional method requires designers to draw manually, which is time-consuming and error-prone. The present invention automatically generates stair plan drawings according to the cutting height specified by the designer by processing three-dimensional data and geometric calculations, reducing human involvement and greatly accelerating the automation of stair plan drawings;

[0034] (4) The present invention has high accuracy. The present invention uses the three-dimensional stair model data to form a two-dimensional stair plane construction drawing based on the spatial information of the actual stair, and ensures that the generated break line diagram is consistent with the cutting height input by the designer. Through cutting and calculation based on geometric algorithms, key information such as the steps and direction of the stairs can be accurately described, avoiding errors caused by manual drawing due to the complex spatial relationship between the upper and lower stairs;

[0035] (5) The present invention supports complex staircase structures. The present invention can simultaneously process complex staircase structures containing multiple staircases and multiple types of staircases, and automatically generate staircase plan construction drawings. When designing a building containing multiple staircase flights, this method can calculate the break lines of each staircase based on the three-dimensional information of each staircase, which significantly simplifies the workflow for processing complex staircases. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0037] Figure 1 It is a schematic diagram of a method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to an embodiment of the present invention;

[0038] Figure 2 It is a schematic diagram of a double-flight staircase generated by the method of automatically generating a two-dimensional CAD staircase construction drawing based on three-dimensional staircase data of the present invention;

[0039] Figure 3 It is a schematic diagram of a turning and splicing staircase generated by the method of automatically generating a two-dimensional CAD staircase construction drawing based on three-dimensional staircase data of the present invention;

[0040] Figure 4 It is a schematic diagram of a scissor ladder generated by the method of automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data of the present invention;

[0041] Figure 5 It is a structural diagram of a computer system of a server for implementing the method, system, and device embodiments of the present application. DETAILED DESCRIPTION

[0042] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0043] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0044] The present invention provides a method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data, the method comprising:

[0045] Acquire three-dimensional staircase data, group and filter the three-dimensional staircase data to obtain pure staircase data, and convert the coordinates and value types of the pure staircase data to obtain transformed clipping data suitable for the staircase cutting position;

[0046] Generate each axis-aligned bounding box based on the cutting path of each stair in the transformed clipping data, and then extract each polygonal patch in each axis-aligned bounding box and the polygonal patch to be clipped;

[0047] Based on the transformed clipping data, the direction of each stair is obtained, the base of each step right triangle is calculated based on the direction of each stair, and each step right triangle is generated according to the base of each step triangle and the direction of each stair; each section surface is generated based on each step right triangle;

[0048] Use the faces of the axis-aligned bounding box to cut the face to be cut to obtain the cut face piece; the face to be cut includes the right-angled triangles of each step, the polygonal face pieces to be cut and the section faces; after cutting, adjust the face pieces in each axis-aligned bounding box to a triangular form suitable for the break line, write the information of the triangular face pieces into a file in svg format to obtain an svg file, read the svg file, and generate a stair plan with break lines.

[0049] In order to more clearly illustrate the method of automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data of the present invention, the following is combined with Figure 1 Each step in the embodiment of the present invention is described in detail.

[0050] The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data in the first embodiment of the present invention, each step is described in detail as follows:

[0051] Acquire three-dimensional staircase data, group and filter the three-dimensional staircase data to obtain pure staircase data, and convert the coordinates and value types of the pure staircase data to obtain transformed clipping data suitable for the staircase cutting position;

[0052] In this implementation, the 3D staircase data is grouped and processed according to the staircase position or structure to obtain the association between each staircase section and the staircase building to which it belongs. By grouping, the 3D information of the stairs can be analyzed and processed more efficiently. Filter out the 3D data not related to the stairs, and retain the geometric information related to the stairs, such as the staircase section, staircase surface layer, and platform plate. This step reduces the interference of redundant data and provides pure staircase data for subsequent calculations. Based on the original sectioning result (clip_polygon), coordinate and numerical type conversion is performed to generate transformed clipping data suitable for the current staircase sectioning position. This step ensures that all geometric objects in subsequent calculations are processed in the same coordinate system.

[0053] Generate each axis-aligned bounding box based on the cutting path of each stair in the transformed clipping data, and then extract each polygonal patch in each axis-aligned bounding box and the polygonal patch to be clipped;

[0054] In this embodiment, an axis-aligned bounding box (AABB) is generated for each stair cutting path. The AABB is composed of 6 faces and is used to extract the stair data at the cutting position of each staircase, which is named boxes. This can effectively simplify complex three-dimensional geometric operations. The polygonal patches that intersect with the stair geometry or are contained in the boxes are recorded and extracted to provide basic data for the clipping operation in the subsequent steps. This step greatly reduces the amount of calculation while ensuring accuracy, and more importantly, deletes some data that affects the correct result.

[0055] In this embodiment, extracting polygonal patches contained in an axis-aligned bounding box includes: using the extractClip function to traverse each polygonal patch, calling isInside to determine whether the polygonal patch is completely within the axis-aligned bounding box, if the polygonal patch is within the box, it is stored in the result list; if the polygon is not completely within the box, the polygon will be put back to the original list, and a flag will be set for it to indicate that it needs to be clipped. extractClip implements a judgment for judging the spatial relationship between a plane polygon and a three-dimensional box, and divides the polygons into three categories according to the results: one is inside the box, one is outside the box, one is partially inside the box, and the other is partially outside the box. Specifically, the extractClip function receives a set of polygonal patches and classifies them. It traverses each polygonal patch and calls isInside to determine whether the polygonal patch is completely within the box. If the polygonal patch is within the box, it will be stored in the result list; if it is not completely within the box, it will be put back to the original list, and a flag will be set as a polygonal patch to be clipped. ClipFlag indicates that clipping is required, and the subsequent steps will determine whether to perform a clipping operation based on this flag. isInside is used to check the entire polygon patch. It calculates the minimum and maximum coordinates of the polygon patch and compares them with the minimum and maximum coordinates of the box to determine whether they have overlapping areas. If there is an overlap, the polygon patch is considered to intersect with the box or partially inside. For a single point, check whether a single point is inside the box. The coordinates of the point are transformed into the local coordinate system of the box through the rotation matrix, and then check whether the coordinates of the point fall within the range of the box.

[0056] Based on the transformed clipping data, the direction of each stair is obtained, the base of each step right triangle is calculated based on the direction of each stair, and each step right triangle is generated according to the base of each step triangle and the direction of each stair; each section surface is generated based on each step right triangle;

[0057] In this embodiment, the directions of the stairs and steps to be cut are determined according to the design information of the stairs. The determination of the directions provides a basic geometric basis for generating the step triangles.

[0058] In this embodiment, calculating the base of each right triangle of each step based on the direction of each stair includes: traversing the polygons in the transformed clipping data, and determining a side of the polygon that is perpendicular to the stair direction and closest to the center line of the stairs; specifically, by calculating the dot product of each side of the polygon in the transformed clipping data and the stair direction, the side perpendicular to the stair step direction is screened out; then, using a geometric method to calculate the side of the side perpendicular to the stair step direction that is farthest from the opposite direction of the step direction as the base of the stairs; finally, adjusting the direction of the selected base so that the direction of the base conforms to the order from the right side to the left side of the center line.

[0059] In this embodiment, each step right triangle comprises: the short side of the two right-angled sides of each step right triangle is consistent with the step direction of the stair section, indicating the extension direction of the step; the long side of the two right-angled sides is perpendicular to the step direction of the stair section. The two points of the longest hypotenuse of each step right triangle are the starting point and end point of each break line; then a section surface is formed based on the two points and direction of the break line;

[0060] Use the faces of the axis-aligned bounding box to cut the face to be cut to obtain the cut face piece; the face to be cut includes the right-angled triangles of each step, the polygonal face pieces to be cut and the section faces; after cutting, adjust the face pieces in each axis-aligned bounding box to a triangular form suitable for the break line, write the information of the triangular face pieces into a file in svg format to obtain an svg file, read the svg file, and generate a stair plan with break lines.

[0061] In this embodiment, the surface to be cut is cut with each face of the axis-aligned bounding box to obtain the cut face piece; specifically, the criteria for judging whether to cut are as follows: whether the cut face is within the axis-aligned bounding box, if it is completely within the axis-aligned bounding box, it is not cut; if part of it is within the axis-aligned bounding box and part of it is not within the axis-aligned bounding box, it is considered that it needs to be cut. The surface to be cut includes each step right triangle, each polygon face piece and each section face: first traverse each face piece to be cut to check whether it needs to be cut, if the face piece to be cut does not need to be cut, skip it directly, for the face piece to be cut that needs to be cut, obtain its vertex list, and check the position of each vertex relative to the clipping plane one by one, and use the plane.checkSignedDir function to judge whether each vertex is inside or outside the plane;

[0062] When it is found that one vertex of the surface to be clipped is in the plane and the next vertex is outside the plane, the code calculates the intersection of these two vertices and the clipping plane and adds the intersection to the clipping path; if all the vertices of the surface to be clipped are in the plane, they are directly retained;

[0063] Finally, check whether the generated clipping path contains more than three intersection points. If it contains more than three intersection points, calculate the normal direction of the clipped face. If the normal direction meets the expectation, keep the clipping result of the polygon. If the normal direction does not meet the expectation, readjust the clipping path. Cut off the geometric parts that are not related to the stair structure and only keep the geometric shapes related to the stair steps. After the clipping is completed, return the result and store the clipped geometric shapes.

[0064] In this embodiment, the break line data is written in svg; the generated break line information is written into the file in SVG format, which is convenient for subsequent visualization and further processing in the CAD tool. After the final break line information is written into the SVG file, the break line representation of the stair plan is generated. These data can be directly imported into the CAD tool for display and editing.

[0065] Although the various steps in the above embodiment are described in the above-mentioned order, those skilled in the art can understand that in order to achieve the effect of this embodiment, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in a reverse order. These simple changes are within the scope of protection of the present invention.

[0066] Based on this solution, this solution can automatically generate accurate stair plan according to the three-dimensional information of the stairs and the plane section position. In addition, this solution supports the simultaneous generation of multiple and multi-type complex stairs in a single plane drawing process, such as Figure 2 As shown, a double-flight staircase is generated using the method of automatically generating a two-dimensional CAD staircase construction drawing based on three-dimensional staircase data of the present invention. Figure 3 A turning splicing staircase generated by the method of automatically generating a two-dimensional CAD staircase construction drawing based on three-dimensional staircase data of the present invention; Figure 4 The figure shows a scissor ladder generated by the method of automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data of the present invention;

[0067] The second embodiment of the present invention is a system for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data, the system comprising:

[0068] A data acquisition module, used to acquire three-dimensional staircase data, group and filter the three-dimensional staircase data to obtain pure staircase data, and perform coordinate and value type conversion on the pure staircase data to obtain transformed clipping data suitable for staircase sectioning positions;

[0069] A patch extraction module, used for generating each axis-aligned bounding box based on the cutting path of each stair in the transformed clipping data, and then extracting each polygon patch in each axis-aligned bounding box and the polygon patch to be clipped;

[0070] A triangle generation module is used to obtain the direction of each stair based on the transformed clipping data, calculate the base of each step right triangle based on the direction of each stair, generate each step right triangle according to the base of each step triangle and the direction of each stair; and generate each section surface based on each step right triangle;

[0071] The break line generation module is used to cut the surface to be cut with each face of the axis-aligned bounding box to obtain the cut surface piece; the surface to be cut includes each step right triangle, each polygonal surface piece to be cut and each section surface; after cutting, the surface pieces in each axis-aligned bounding box are adjusted to a triangular form suitable for the break line, the information of the triangular surface piece is written into a file in svg format to obtain an svg file, the svg file is read, and a stair plan with break lines is generated.

[0072] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0073] It should be noted that the system for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be decomposed or combined. For example, the modules in the above embodiment can be combined into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the modules or steps, and are not regarded as improper limitations of the present invention.

[0074] An electronic device according to the third embodiment of the present invention comprises: at least one processor; and a memory connected in communication with at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned method of automatically generating two-dimensional CAD stair construction drawings based on three-dimensional stair data.

[0075] A computer-readable storage medium according to a fourth embodiment of the present invention stores computer instructions, and the computer instructions are used to be executed by the computer to implement the above-mentioned method of automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data.

[0076] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the electronic device and storage medium described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0077] Those skilled in the art should be able to appreciate that the modules and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two, and the programs corresponding to the software modules and method steps can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the technical field. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0078] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system of a server for implementing the method, system, and device embodiments of the present application. Figure 5 The server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0079] like Figure 5 As shown, the computer system includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603. Various programs and data required for system operation are also stored in the RAM 603. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0080] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0081] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the method of the present application are executed. It should be noted that the above-mentioned computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0082] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0083] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0084] The terms "first", "second", etc. are used to distinguish similar objects rather than to describe or indicate a particular order or sequence.

[0085] The term "comprise" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus / device.

[0086] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data, characterized in that: The method comprises: Acquire three-dimensional staircase data, group and filter the three-dimensional staircase data to obtain pure staircase data, and convert the coordinates and value types of the pure staircase data to obtain transformed clipping data suitable for the staircase cutting position; Generate each axis-aligned bounding box based on the cutting path of each stair in the transformed clipping data, and then extract each polygonal patch in each axis-aligned bounding box and the polygonal patch to be clipped; Based on the transformed clipping data, the direction of each stair is obtained, the base of each step right triangle is calculated based on the direction of each stair, and each step right triangle is generated according to the base of each step triangle and the direction of each stair; each section surface is generated based on each step right triangle; Use the faces of the axis-aligned bounding box to cut the face to be cut to obtain the cut face piece; the face to be cut includes the right-angled triangles of each step, the polygonal face pieces to be cut and the section faces; after cutting, adjust the face pieces in each axis-aligned bounding box to a triangular form suitable for the break line, write the information of the triangular face pieces into a file in svg format to obtain an svg file, read the svg file, and generate a stair plan with break lines.

2. The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to claim 1, characterized in that: The axis-aligned bounding box is composed of 6 faces, and the axis-aligned bounding box is used to extract stair data at the sectioning position of each staircase.

3. The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to claim 2, characterized in that: Generating each section surface based on each step right triangle includes: the two points of the longest hypotenuse of each step right triangle are the starting point and end point of each break line; and then forming each section surface based on the two points and direction of each break line.

4. The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to claim 3, characterized in that: Extracting each polygonal patch within each axis-aligned bounding box consists of: Use the extractClip function to traverse each polygon patch and call isInside to determine whether the polygon patch is completely inside the axis-aligned bounding box. If the polygon patch is inside the box, it is stored in the result list; if the polygon patch is not completely inside the box, the polygon patch will be put back into the original list and used as the polygon patch to be cut.

5. The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to claim 4, characterized in that: Methods for generating the right triangles of each step include: The base of the right triangle of each step is calculated based on the direction of each staircase, and the length of the base of each step triangle is consistent with the horizontal projection length of each step; Each right triangle is generated based on the base of each step triangle and the direction of the stairs; the step length side of each right triangle corresponds to the step direction of the stair segment, the base of each right triangle is perpendicular to the step direction of the stair segment, and the area of ​​each right triangle represents half of the area of ​​a stair step area.

6. The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to claim 5, characterized in that: The base of the right triangle for each step is calculated based on the direction of each staircase, including: By calculating the dot product of each edge of the polygon in the transformed clipping data and the direction of the stair step, the edges perpendicular to the stair step direction are screened out; then, the edge farthest from the opposite direction of the stair step direction among the edges perpendicular to the stair step direction is calculated using a geometric method, and the edge is selected as the bottom edge of the stairs; finally, the direction of the bottom edge of the selected stairs is adjusted so that the direction of the bottom edge conforms to the order from the right side to the left side of the center line.

7. The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to claim 6, characterized in that: Each of the step right triangles comprises: The short side of the two right-angled sides of the right-angled triangle of each step is consistent with the direction of the step of the stair section, and the short side indicates the extension direction of the step; the long side of the two right-angled sides is perpendicular to the direction of the step of the stair section.

8. The method for automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data according to claim 7, characterized in that: The clipped faces obtained by clipping the faces to be clipped using the faces of the axis-aligned bounding box include: First, traverse each surface to be clipped to check whether it needs to be clipped. If the surface to be clipped does not need to be clipped, skip it directly. For the surface to be clipped that needs to be clipped, get its vertex list and check the position of each vertex relative to the clipping plane one by one. Use the plane.checkSignedDir function to determine whether each vertex is inside or outside the plane. When it is found that one vertex of the surface to be clipped is in the plane and the next vertex is outside the plane, the code calculates the intersection of these two vertices and the clipping plane and adds the intersection to the clipping path; if all the vertices of the surface to be clipped are in the plane, they are directly retained; Finally, check whether the generated clipping path contains more than three intersection points. If it contains more than three intersection points, calculate the normal direction of the clipped face. If the normal direction meets the expectations, retain the clipping result of the polygon. If the normal direction does not meet the expectations, readjust the clipping path.

9. A system for automatically generating two-dimensional CAD stair construction drawings based on three-dimensional stair data, characterized in that: The system comprises: A data acquisition module, used to acquire three-dimensional staircase data, group and filter the three-dimensional staircase data to obtain pure staircase data, and perform coordinate and value type conversion on the pure staircase data to obtain transformed clipping data suitable for staircase sectioning positions; A patch extraction module, used for generating each axis-aligned bounding box based on the cutting path of each stair in the transformed clipping data, and then extracting each polygon patch in each axis-aligned bounding box and the polygon patch to be clipped; A triangle generation module is used to obtain the direction of each stair based on the transformed clipping data, calculate the base of each step right triangle based on the direction of each stair, generate each step right triangle according to the base of each step triangle and the direction of each stair; and generate each section surface based on each step right triangle; The break line generation module is used to cut the surface to be cut with each face of the axis-aligned bounding box to obtain the cut surface piece; the surface to be cut includes each step right triangle, each polygonal surface piece to be cut and each section surface; after cutting, the surface pieces in each axis-aligned bounding box are adjusted to a triangular form suitable for the break line, the information of the triangular surface piece is written into a file in svg format to obtain an svg file, the svg file is read, and a stair plan with break lines is generated.

10. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the method of automatically generating a two-dimensional CAD stair construction drawing based on three-dimensional stair data as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Building three-dimensional model drawing generation method and device, equipment and medium

    CN117708942A

  • Building and structure mapping system and method based on IFC three-dimensional model

    CN118821300A