AI-based automatic tatami design method

CN121834977BActive Publication Date: 2026-09-04北京轻而易举智能科技有限责任公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202512052771.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-09-04
Estimated Expiration
2045-12-31

AI Technical Summary

Technical Problem

[0004]本发明的一个目的是提供一种基于AI的榻榻米自动设计方法,能够帮助提升榻榻米设计的自动化与智能化水平,有效解决现有自动设计技术适配性不足、效率低下等问题

Benefits of technology

本发明能够帮助显著提升榻榻米设计的自动化与智能化水平,有效解决现有自动设计技术适配性不足、效率低下等问题。可自动精准获取房间轮廓并完成区域离散化,结合设计约束生成最优布局,无需人工大量干预,大幅缩短设计周期。针对异形等复杂户型,能精准匹配榻榻米模块放置需求,提升空间利用率,减少材料切割浪费。可直接输出适配生产施工的文件,实现设计与生产、施工的无缝衔接,降低人工标注误差与返工风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121834977B_ABST
    Figure CN121834977B_ABST
Patent Text Reader

Abstract

The application discloses an AI-based automatic tatami design method, relates to the whole house customization related field, and aims to solve the problems of tatami design adaptability and low efficiency, and comprises the following steps: obtaining the plane contour data of a room to be paved; constructing a closed polygon representing the internal area of the room according to the coordinates of all contour vertices; discretizing the continuous area in the closed polygon into a discretized grid composed of standard cells; constructing a design constraint vector; inputting the topological structure data of the discretized grid and the design constraint vector into a pre-trained generative neural network model to output a layout matrix; and analyzing the layout matrix, generating a file for guiding production and construction according to the actual physical size and splicing relationship corresponding to the type number of the tatami module. The application can help improve the automation and intelligent level of tatami design, and effectively solve the problems of insufficient adaptability and low efficiency of existing automatic design technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of whole-house customization. More specifically, this invention relates to an AI-based automatic tatami design method. Background Technology

[0002] With the increasing demand for efficient use of living space, tatami mats, which combine storage, relaxation, and aesthetic enhancement, are becoming increasingly widely used in residential decoration and guesthouse design. While existing tatami automatic design software offers basic intelligent assistance functions, such as a built-in standardized tatami module library, support for importing floor plan parameters, and one-click generation of basic layouts, thus reducing the tediousness of traditional manual drawing and improving design efficiency, these software programs still have significant limitations. For example, their core logic relies on preset templates and lacks depth-adaptive capabilities. When faced with rooms with concave corners, irregular corners, or other irregular structures, they struggle to automatically generate layouts that balance space utilization and rational assembly, requiring designers to make numerous manual adjustments. Furthermore, they cannot optimize layouts based on room boundary characteristics and construction process requirements, often resulting in wasteful material cutting and poor construction feasibility. In addition, existing automated design software has shortcomings in the seamless integration of the entire process: before design, room outline dimensions need to be accurately entered manually, which is easily affected by measurement errors, leading to deviations in subsequent design schemes; after the design is completed, the generated construction documents often have missing or inaccurate details, making it difficult to directly connect with the production and construction stages, and still requiring manual supplementation and improvement, increasing the risk of rework and communication costs, and the overall design and construction cycle has not been fundamentally shortened.

[0003] Therefore, it is necessary to design a technical solution that can overcome the above-mentioned defects. Summary of the Invention

[0004] One objective of this invention is to provide an AI-based automatic tatami design method that can help improve the automation and intelligence level of tatami design and effectively solve the problems of insufficient adaptability and low efficiency of existing automatic design technologies.

[0005] To achieve these objectives and other advantages of the present invention, according to one aspect of the present invention, an AI-based automatic tatami design method is provided, comprising: S1: acquiring planar contour data of the room to be laid, the planar contour data including the coordinates of several contour vertices; S2: constructing a closed polygon representing the internal area of ​​the room based on the coordinates of all contour vertices; S3: discretizing the continuous area inside the closed polygon into a discretized grid composed of standard cells based on the preset standard bounding rectangle size of the tatami module, wherein each standard cell corresponds to a potential placement position of a tatami module; S4: constructing a design constraint vector, the design constraint vector including the positional relationship information between each standard cell in the discretized grid and the boundary of the closed polygon; S5: inputting the topological structure data of the discretized grid and the design constraint vector together into a pre-trained generative neural network model, the generative neural network model iteratively performing layout generation and evaluation, and outputting a layout matrix, wherein each element value in the layout matrix represents the type number of the tatami module placed in its corresponding standard cell; S6: parsing the layout matrix, and generating a document for guiding production and construction based on the actual physical size and splicing relationship corresponding to the type number of the tatami module.

[0006] Furthermore, in S1, three-dimensional point cloud data of the room to be tiled is acquired using a laser scanner or depth camera; the three-dimensional point cloud data is denoised and filtered, and horizontal slice point cloud within a preset height range from the ground is extracted; the horizontal slice point cloud is projected onto a two-dimensional plane, and the continuous two-dimensional point sequence constituting the base line of the room is identified and sorted using edge detection and contour tracking algorithms; the Douglas-Puk algorithm is used to adaptively thin the continuous two-dimensional point sequence, and under the premise of meeting the preset contour fitting error threshold, the continuous two-dimensional point sequence is simplified into the coordinates of several contour vertices.

[0007] Further, in S2, the coordinates of several contour vertices are sorted according to their physical connection order on the room's baseboard to form an ordered vertex sequence; the concavity / convexity of the polygons defined by the ordered vertex sequence is detected. If a concave point is identified, a virtual dividing line is generated along the inner corner direction corresponding to the concave point, dividing the closed polygon into two or more convex polygon sub-regions; for each convex polygon sub-region, its minimum area bounding rectangle is calculated, and the boundary of the minimum area bounding rectangle is finely aligned and adjusted according to the standard bounding rectangle size to form an optimized bounding rectangle; the optimized bounding rectangle is subjected to Boolean intersection with the corresponding convex polygon sub-region to accurately cut out the actual tilable contour of the sub-region, and the actual tilable contours of all sub-regions are merged to form the final closed polygon used for discretization.

[0008] Further, in S3, a reference point is determined inside the closed polygon as the starting alignment point of the discretized mesh. The starting alignment point is set as the projection point of the midpoint of the longest side inside the closed polygon in its vertical direction. With the starting alignment point as the origin and the length and width of the standard circumscribed rectangle as the unit step size, a two-dimensional basic mesh covering the entire circumscribed rectangle of the closed polygon is established along the main direction parallel to the closed polygon. Each standard cell in the two-dimensional basic mesh is traversed, its geometric center coordinates are calculated, and the point-in-polygon algorithm is used to determine whether the geometric center is located inside the closed polygon. All standard cells whose geometric centers are located inside the closed polygon are selected, marked as valid cells, and their row and column indices in the two-dimensional basic mesh are recorded. The set of all valid cells constitutes the initial discretized mesh. The position of the starting alignment point within the range of the standard circumscribed rectangle is fine-tuned, and the above steps of establishing the two-dimensional basic mesh and selecting valid cells are repeated to find an optimized alignment scheme that maximizes the total number of valid cells and whose total area is closest to the area of ​​the closed polygon. The set of valid cells under this scheme is used as the final discretized mesh.

[0009] Further, in S4, for each valid cell in the discretized grid, the shortest Euclidean distance from its geometric center to all edge segments of the closed polygon boundary is calculated, and this distance value is normalized and used as the first constraint component representing the laying freedom of the cell; it is determined whether the four edges of each valid cell overlap with the boundary segments of the closed polygon or the distance is less than a preset threshold; if so, the cell is marked as an adjacent cell, and a second constraint component is generated to indicate that it is an adjacent cell; corner cells are identified and marked. If a valid cell is marked as adjacent to two non-contiguous closed polygon boundaries, it is determined to be a corner cell, and a third constraint component is generated to indicate that it is a corner cell; based on the first constraint component, the second constraint component, and the third constraint component, a comprehensive priority weight is calculated for each valid cell. The comprehensive priority weight is inversely proportional to the distance to the boundary, and adjacent cells and corner cells are assigned higher basic weight values; according to the predetermined index order of the valid cells in the discretized grid, the first constraint component, the second constraint component, the third constraint component, and the comprehensive priority weight corresponding to each cell are concatenated to form the design constraint vector.

[0010] Furthermore, in S5, the topological structure data of the discretized grid is converted into a three-dimensional feature tensor. The first and second dimensions correspond to the number of rows and columns of the discretized grid, respectively. The third dimension, channel data, includes the preset initial type encoding, row and column index values, and a mask used to mark whether the cell is a valid cell for each standard cell. The design constraint vector is reconstructed according to the predetermined index order of the valid cells in the discretized grid to form a two-dimensional constraint matrix. Its row and column dimensions match those of the discretized grid. Each element in the matrix is ​​a multi-dimensional vector containing the first constraint component, second constraint component, third constraint component, and comprehensive priority weight corresponding to that position. The three-dimensional feature tensor and the two-dimensional constraint matrix are concatenated along the channel dimension to form a joint input tensor that integrates topological and constraint conditions. The pre-trained generative neural network model is a conditional variational autoencoder based on the U-Net architecture. Its encoder part downsamples and extracts features from the joint input tensor, and its decoder part upsamples and performs pixel-by-pixel regression under the condition of latent spatial variables, finally outputting a layout matrix with the same size as the discretized grid.

[0011] Furthermore, the encoder consists of multiple downsampling blocks cascaded together. Each downsampling block contains a convolutional layer, a normalization layer, and an activation function, used to extract and compress features from the joint input tensor and output the mean vector and logarithmic variance vector of the latent space distribution. Based on the mean vector and logarithmic variance vector, a latent space variable is obtained by sampling using a reparameterization technique. The decoder consists of multiple upsampling blocks cascaded together. Each upsampling block contains a transposed convolutional layer, a normalization layer, and an activation function. It takes the latent space variable and the feature map skip connections corresponding to the encoder layers as input, and gradually recovers the spatial distribution of the feature maps. Resolution; The last layer of the decoder is a convolutional layer with a softmax activation function, which maps the final feature map to a multi-channel probability map with the same size as the discretized grid. Each channel corresponds to a type of tatami module. The final layout matrix is ​​generated by taking the index of the channel with the highest probability. During the training phase, the conditional variational autoencoder is trained by optimizing a combined loss function, which includes the reconstruction loss between the layout matrix and the true label, the KL divergence loss between the latent spatial distribution and the standard normal distribution, and the physical constraint loss based on the tatami tiling design rules.

[0012] Furthermore, in S6, based on the type number of the tatami module corresponding to each valid cell in the layout matrix, the actual physical size, standard geometry, and allowed splicing relationship with other types of modules corresponding to that type number are retrieved from the preset module database to generate a module information set. Based on the geometric center coordinates and row and column index order of each valid cell in the discretized grid, combined with the corresponding actual physical size of the module, adjacent valid cells with the same type number are merged. When the size of the largest rectangular area formed after merging matches the size of a standard module or an integer multiple of the size of a standard module, that rectangular area is marked as a combination. Lay out the units and update the module type number in the area to the corresponding combined module number; based on the edge and corner cell information marked in the design constraint vector, perform compliance verification and automatic correction on the module type numbers located at the boundary and corner to ensure that the module size and splicing method at that location comply with the physical installation constraints; based on the finally determined type number and geometric position of each valid cell or combined laying unit, generate a two-dimensional vector file containing the outline, size, type identification and relative positional relationship of all tatami modules; based on the two-dimensional vector file, extract the cutting path, dimension annotation and overall laying sequence guide for each independent tatami module.

[0013] The present invention has at least the following beneficial effects: This invention significantly improves the automation and intelligence of tatami design, effectively solving problems such as insufficient adaptability and low efficiency in existing automatic design technologies. It can automatically and accurately acquire room outlines and perform area discretization, generating optimal layouts based on design constraints without extensive manual intervention, thus greatly shortening the design cycle. For complex floor plans such as irregular shapes, it can accurately match the placement requirements of tatami modules, improving space utilization and reducing material cutting waste. It can directly output files adapted for production and construction, achieving seamless integration of design, production, and construction, reducing errors from manual annotation and the risk of rework.

[0014] Other advantages, objectives and features of the present invention will become apparent in part from the following description, and in part from those skilled in the art through study and practice of the invention. Attached Figure Description

[0015] Figure 1 This is a flowchart of one embodiment of this application. Detailed Implementation

[0016] The present invention will now be described in further detail so that those skilled in the art can implement it based on the description.

[0017] It should be understood that terms such as "having," "comprising," and "including" used in the embodiments of this application do not exclude the presence or addition of one or more other elements or combinations thereof. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of components in a specific posture. If the specific posture changes, the directional indication will also change accordingly. When an element is referred to as "fixed to" or "set on" another element, it can be directly on the other element or may have an intervening element present. When an element is referred to as "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element through an intervening element. Descriptions involving "first," "second," etc., in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features.

[0018] It should be noted that the technical solutions of the various embodiments of this application can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by this application.

[0019] like Figure 1 As shown, embodiments of this application provide an AI-based automatic tatami design method, including: S1: acquiring the planar contour data of the room to be laid, the planar contour data including the coordinates of several contour vertices; S2: constructing a closed polygon representing the internal area of ​​the room based on the coordinates of all contour vertices; S3: discretizing the continuous area inside the closed polygon into a discretized grid composed of standard cells based on the preset standard bounding rectangle size of the tatami module, wherein each standard cell corresponds to a potential placement position of a tatami module; S4: constructing a design constraint vector, the design constraint vector including the positional relationship information between each standard cell in the discretized grid and the boundary of the closed polygon; S5: inputting the topological structure data of the discretized grid and the design constraint vector into a pre-trained generative neural network model, the generative neural network model iteratively performs layout generation and evaluation, and outputs a layout matrix, where each element value in the layout matrix represents the type number of the tatami module placed in its corresponding standard cell; S6: parsing the layout matrix, and generating a document to guide production and construction based on the actual physical size and splicing relationship corresponding to the type number of the tatami module.

[0020] For example, the first step is to obtain the planar outline data of the room to be paved, where the room refers to the indoor space where tatami mats will be installed. The planar outline data is the relevant data of the outer boundary of the floor surface of this space. It includes the coordinates of several outline vertices, which are the position information of key points constituting the boundary in a preset two-dimensional coordinate system. This two-dimensional coordinate system can be established with the lower left corner of the room floor as the origin, the horizontal direction to the right as the X-axis, and the vertical direction upward as the Y-axis. For example, the coordinates of the outline vertices can be (100cm, 200cm). Next, a closed polygon representing the internal area of ​​the room is constructed based on the coordinates of all outline vertices. The specific execution process is to sort all outline vertices in order of their connection on the actual boundary of the room, then connect adjacent vertices in sequence with straight line segments, and finally connect the last vertex with the first vertex to form a closed polygon structure. The calculation process is to determine the expression of each connecting line segment in sequence using the two-point straight line equation, thereby forming a complete closed area. Next, based on the preset standard circumscribed rectangle size of the tatami module, the continuous region inside the closed polygon is discretized into a discretized grid composed of standard cells. The standard circumscribed rectangle size of the tatami module refers to the length and width of the circumscribed rectangle of the finished tatami module, which can be 90cm × 180cm or 80cm × 160cm. A standard cell is a virtual rectangular unit with the same dimensions as the circumscribed rectangle. Each standard cell corresponds to a potential placement position of a tatami module. The discretization process involves dividing the closed polygon into several standard cells with a preset step size. Subsequently, a design constraint vector is constructed. This design constraint vector is vector data containing information about the positional relationship between each standard cell in the discretized grid and the boundary of the closed polygon. Positional relationship information can include the distance from the cell to the boundary, whether it is adjacent to the boundary, etc. The calculation process involves calculating the shortest distance from the geometric center of each cell to each side of the boundary using the Euclidean distance formula, and then marking whether the cell overlaps with the boundary or the distance is less than a preset threshold, which can be 5cm.The topological data of the discretized grid and the design constraint vector are then input into a pre-trained generative neural network model. The topological data refers to the row and column distribution and adjacency relationships of the cells in the grid. The generative neural network model can be a conditional variational autoencoder based on the U-Net architecture. Its operation method is to downsample and extract features from the input data through the encoder, and upsample and recover features through the decoder. Iteratively, layout generation and evaluation are performed. That is, after each layout is generated, the rationality of the layout is judged by a preset evaluation function. If it is not reasonable, the parameters are adjusted and regenerated. Finally, a layout matrix is ​​output. Each element in the layout matrix represents the type number of the tatami module placed in its corresponding standard cell. The type number can be an integer from 1 to 9, with different numbers corresponding to different sizes or styles of tatami modules. For example, number 1 corresponds to a 90cm x 180cm standard flat module, number 2 to an 80cm x 160cm standard flat module, number 3 to a 90cm x 90cm module with storage drawers, number 4 to an 80cm x 80cm corner-fitting module, and number 5 to a 90cm x 180cm module with flip-top storage, etc. Finally, the layout matrix is ​​parsed, and based on the actual physical dimensions and splicing relationships corresponding to the tatami module type numbers, a document is generated to guide production and construction. The parsing process involves retrieving information such as dimensions and splicing rules corresponding to each type number from a pre-set module database. The document generation process involves converting this information into a two-dimensional vector graphic or text description file containing module cutting paths and laying order. This file can be directly read by production equipment or used as a reference by construction personnel.

[0021] In existing technologies, tatami design largely relies on manual labor combined with basic design software. This involves manually measuring room dimensions on-site, drawing outlines, placing tatami modules based on experience, manually verifying the fit and construction details, and repeatedly adjusting for irregularly shaped rooms, resulting in low efficiency and a high risk of errors. This embodiment achieves full automation through AI-driven processes, eliminating the need for extensive manual intervention. Precise acquisition equipment is used to obtain outline data, and rigorous calculations ensure accuracy when constructing closed polygons and discretized meshes. The introduction of design constraint vectors makes the layout more closely match the actual room conditions, and a pre-trained neural network model efficiently generates a reasonable layout, ultimately outputting files suitable for production and construction. Compared to existing technologies, this embodiment effectively solves the problems of low efficiency, poor accuracy, and insufficient adaptability in traditional design, especially when dealing with complex floor plans. Through the organic combination of multiple steps and the rational application of AI technology, the design process is more standardized, the results more reliable, and the precision and efficiency requirements of practical applications are met.

[0022] In another embodiment, in S1, three-dimensional point cloud data of the room to be tiled is acquired by a laser scanner or depth camera; the three-dimensional point cloud data is denoised and filtered, and horizontal slice point cloud within a preset height range from the ground is extracted; the horizontal slice point cloud is projected onto a two-dimensional plane, and the continuous two-dimensional point sequence constituting the base line of the room is identified and sorted by edge detection and contour tracking algorithms; the Douglas-Puk algorithm is used to adaptively thin the continuous two-dimensional point sequence, and under the premise of meeting the preset contour fitting error threshold, the continuous two-dimensional point sequence is simplified into the coordinates of several contour vertices.

[0023] For example, in the step of acquiring the planar contour data of the room to be tiled, three-dimensional point cloud data of the room is collected using a laser scanner or a depth camera. The laser scanner can be a phase-detection laser scanner, which emits laser signals into the room from all directions, receives the reflected laser signals and records the signal propagation time, calculates the distance from the scanning point to the device, and determines the three-dimensional coordinates of each scanning point by combining the device's position parameters, thereby forming three-dimensional point cloud data. The depth camera can be a structured light depth camera, which projects an coded light pattern onto the surface of the room, captures the pattern distortion information, and calculates the depth of each point to generate three-dimensional point cloud data. The three-dimensional point cloud data is then subjected to noise reduction and filtering. Noise reduction can be achieved using a statistical filtering algorithm, which calculates the mean and variance of the distance between each point and its neighboring points, and identifies points with a mean distance greater than three times the variance as noise points and removes them. Filtering can be achieved using a Gaussian filtering algorithm, which calculates a weighted average of the coordinates of each point using a preset Gaussian kernel function to smooth the point cloud data. Next, extract horizontal slices of point cloud data within a preset height range from the ground. This preset height range can be 5cm to 15cm. The extraction process involves filtering out all point cloud data whose Z-axis values ​​fall within this range in the 3D coordinate system. Project the horizontal slices of point cloud data onto a 2D plane. The projection process involves retaining the X and Y axis coordinates of each point while discarding the Z-axis coordinates, resulting in 2D point cloud data. Then, identify and sort the continuous 2D point sequence that forms the baseline of the room using edge detection and contour tracking algorithms. The edge detection algorithm can use the Canny algorithm, which determines edge points by calculating the gradient values ​​of the point cloud data. The contour tracking algorithm can use the chain code tracking algorithm, which starts from the initial edge point and sequentially finds adjacent edge points to form a continuous 2D point sequence, which is then sorted clockwise. The Douglas-Puk algorithm is used to adaptively thin out a continuous two-dimensional point sequence. The algorithm works by connecting the start and end points of the sequence to form a straight line, calculating the vertical distance from each intermediate point in the sequence to this straight line, retaining points whose distance is greater than a preset contour fitting error threshold, and discarding the rest. The above process is then repeated for the retained points in segments. The preset contour fitting error threshold can be 2 mm. Under the premise of meeting this threshold, the continuous two-dimensional point sequence is simplified into the coordinates of several contour vertices.

[0024] In existing technologies, room outline data acquisition often involves manual measurement with a measuring tape, marking key vertex coordinates, and manual input into design software. This method is prone to inaccuracy due to differences in measurement techniques or reading errors. The thinning process is also mostly done manually, resulting in low efficiency and difficulty in guaranteeing fitting accuracy. This embodiment uses a laser scanner or depth camera to acquire 3D point cloud data, combined with noise reduction and filtering to ensure data quality. Edge detection and outline tracking algorithms automatically identify baseboard sequences, and the Douglas-Puk algorithm enables adaptive thinning. Compared to existing technologies, this embodiment eliminates the need for manual measurement and filtering, effectively reducing human error and improving the accuracy and efficiency of outline data acquisition. The automation of the thinning process also makes the outline fitting more closely match the actual room structure, providing accurate basic data for subsequent tatami layout design and solving the problems of low accuracy and poor efficiency in outline data acquisition in existing technologies.

[0025] In another embodiment, in S2, the coordinates of several contour vertices are sorted according to their physical connection order on the room's baseboard to form an ordered vertex sequence; the concavity / convexity of the polygon defined by the ordered vertex sequence is detected, and if a concave point is identified, a virtual dividing line is generated along the inner corner direction corresponding to the concave point to divide the closed polygon into two or more convex polygon sub-regions; for each convex polygon sub-region, its minimum area bounding rectangle is calculated, and the boundary of the minimum area bounding rectangle is aligned and fine-tuned according to the standard bounding rectangle size to form an optimized bounding rectangle; the optimized bounding rectangle is subjected to a Boolean intersection operation with the corresponding convex polygon sub-region to accurately cut out the actual pavable contour of the sub-region, and the actual pavable contours of all sub-regions are merged to form the final closed polygon used for discretization.

[0026] For example, in the step of constructing a closed polygon representing the interior area of ​​a room, the coordinates of several contour vertices are sorted according to their physical connection order on the room's baseboard. The physical connection order refers to the order in which the vertices are connected on the actual room's baseboard. The sorting process involves combining the spatial positions corresponding to the point cloud data collected on-site, arranging the vertices at the intersection of adjacent walls in sequence to form an ordered vertex sequence. The concavity / convexity of the polygon defined by the ordered vertex sequence is detected. The detection method can be a vector cross product algorithm. Take three consecutive vertices A, B, and C in the sequence, construct vectors AB and BC, and calculate the cross product AB×BC. If the result is greater than 0, vertex B is a convex point; if it is less than 0, it is a concave point. If a concave point is identified, a virtual dividing line is generated along the direction of the inner corner of the wall corresponding to the concave point. The direction of the inner corner of the wall refers to the direction of the angle bisector of the inner angle formed by the two adjacent walls at the concave point. The virtual dividing line can be a straight line extending from the concave point into the interior of the polygon, with a length of 50cm. This dividing line divides the closed polygon into two or more convex polygon sub-regions. For each convex polygon sub-region, calculate its minimum area bounding rectangle. The calculation process involves traversing all vertices of the sub-region, determining the maximum and minimum values ​​of each vertex along the X and Y axes, and constructing an initial rectangle using these values ​​as boundaries. Then, rotate this rectangle and calculate the area under different rotation angles, with rotation increments of 1°. Select the rectangle with the smallest area as the minimum area bounding rectangle. Align and fine-tune the boundary of the minimum area bounding rectangle according to the standard bounding rectangle size. The standard bounding rectangle size is the same as the bounding rectangle size of the tatami module. The alignment and fine-tuning process involves adjusting the boundary coordinates of the minimum area bounding rectangle to integer multiples of the standard bounding rectangle's side length, ensuring that the subsequent discretized mesh matches the module size, forming the optimized bounding rectangle. The optimized circumscribed rectangle and the corresponding convex polygon sub-region are subjected to Boolean intersection operation. Boolean intersection operation refers to finding the overlapping part of the two graphics. The calculation process is to determine the region that belongs to both the circumscribed rectangle and the convex polygon sub-region through graphics operation algorithm, accurately cut out the actual tiling contour of the sub-region, and merge the actual tiling contours of all sub-regions. The merging process is to connect the contour boundaries of each sub-region, remove the overlapping part, and jointly form the final closed polygon used for discretization.

[0027] This embodiment identifies concave points and segments regions through concavity / convexity detection, accurately calculates the minimum area circumscribed rectangle and performs fine-tuning of alignment, and combines Boolean intersection operations to trim the tiling contour. Compared with existing technologies, this embodiment can effectively handle the contour construction problem of irregularly shaped rooms, ensuring that the closed polygon accurately reflects the actual tiling area. The fine-tuning of the circumscribed rectangle also lays a good foundation for the subsequent construction of discretized meshes, solving the problems of inaccurate contour construction of irregularly shaped rooms and difficulty in adapting to module sizes in existing technologies.

[0028] In another embodiment, in S3, a reference point is determined inside the closed polygon as the starting alignment point of the discretized mesh. The starting alignment point is set as the projection point of the midpoint of the longest side inside the closed polygon in its vertical direction. With the starting alignment point as the origin and the length and width of the standard circumscribed rectangle as the unit step size, a two-dimensional basic mesh covering the entire circumscribed rectangle of the closed polygon is established along the main direction parallel to the closed polygon. Each standard cell in the two-dimensional basic mesh is traversed, its geometric center coordinates are calculated, and the point-in-polygon algorithm is used to determine whether the geometric center is located inside the closed polygon. All standard cells whose geometric centers are located inside the closed polygon are selected, marked as valid cells, and their row and column indices in the two-dimensional basic mesh are recorded. The set of all valid cells constitutes the initial discretized mesh. The position of the starting alignment point within the range of the standard circumscribed rectangle is fine-tuned, and the above steps are repeated to find an optimized alignment scheme that maximizes the total number of valid cells and whose total area is closest to the area of ​​the closed polygon. The set of valid cells under this scheme is used as the final discretized mesh.

[0029] For example, in the step of discretizing the continuous region inside the closed polygon into a discretized mesh, a reference point is determined inside the closed polygon as the starting alignment point of the discretized mesh. The starting alignment point is set as the projection point of the midpoint of the longest side inside the closed polygon in its vertical direction. The process of determining the longest side is to calculate the length of each side of the closed polygon. The length of the side is calculated using the distance formula between two points. The side with the longest length is selected as the longest side. The coordinates of the midpoint of this side are calculated using the midpoint formula. The vertical direction can be the direction that makes an angle of 90° with the longest side. The process of calculating the projection point is to draw a line segment perpendicular to the longest side from the midpoint into the interior of the closed polygon. The intersection of the line segment and the interior of the polygon is the starting alignment point. Using the initial alignment point as the origin and the length and width of the standard circumscribed rectangle as the unit step size, a 2D basic mesh covering the entire circumscribed rectangle of the closed polygon is established along the main direction parallel to the closed polygon. The standard circumscribed rectangle size can be 90cm × 180cm, and the corresponding unit step size is 90cm and 180cm. The main direction of the closed polygon refers to the direction of its longest side. The construction process of the 2D basic mesh starts from the origin and divides the grid sequentially along the main direction and its perpendicular direction according to the unit step size, forming several regular rectangular cells. Each standard cell in the 2D basic mesh is traversed, and its geometric center coordinates are calculated. The geometric center coordinates are calculated using the formula ((x_left + x_right) / 2, (y_down + y_up) / 2). The point-in-polygon algorithm is used to determine whether the geometric center is inside the closed polygon. The algorithm's operation involves drawing a ray from the geometric center in the positive X-axis direction and counting the number of intersections between the ray and the boundary of the closed polygon. If the number of intersections is odd, the point is inside; if it is even, it is outside. All standard cells whose geometric centers are located inside the closed polygon are selected and marked as valid cells. Their row and column indices in the 2D basic grid are recorded. The row and column indices are set with the cell containing the origin (0,0), with the column index increasing to the right and the row index increasing upwards. The set of all valid cells constitutes the initial discretized grid. The position of the initial alignment point within the size range of the standard circumscribed rectangle is fine-tuned. The fine-tuning range can be from 0 to 90 cm, i.e., no more than the side length of one standard cell. The steps of constructing the 2D basic grid and selecting valid cells are repeated to find an optimized alignment scheme that maximizes the total number of valid cells and whose total area is closest to the area of ​​the closed polygon. The area calculation process is that the area of ​​each valid cell is the area of ​​the standard circumscribed rectangle, and the total area is the sum of the areas of all valid cells. The set of valid cells under this scheme is used as the final determined discretized grid.

[0030] In existing technologies, discretized mesh construction often uses a fixed origin without alignment fine-tuning, which easily leads to a small number of effective cells and low space utilization, especially when the room outline is irregular, making it difficult to balance the number of cells with the area. This embodiment determines a specific starting alignment point, constructs a mesh based on standard module dimensions, and optimizes the alignment fine-tuning scheme. Compared with existing technologies, this embodiment can maximize the number of effective cells, making the total area of ​​effective cells more closely match the actual paved area, improving space utilization, and solving the problems of unreasonable discretized mesh construction and low space utilization in existing technologies.

[0031] In another embodiment, in S4, for each valid cell in the discretized grid, the shortest Euclidean distance from its geometric center to all edge segments of the closed polygon boundary is calculated, and the distance value is normalized and used as the first constraint component representing the laying freedom of the cell; it is determined whether the four edges of each valid cell overlap with the boundary segments of the closed polygon or the distance is less than a preset threshold; if so, the cell is marked as an adjacent cell, and a second constraint component is generated to indicate that it is an adjacent cell; corner cells are identified and marked. If a valid cell is marked as adjacent to two non-contiguous closed polygon boundaries, it is determined to be a corner cell, and a third constraint component is generated to indicate that it is a corner cell; based on the first constraint component, the second constraint component, and the third constraint component, a comprehensive priority weight is calculated for each valid cell. The comprehensive priority weight is inversely proportional to the distance to the boundary, and adjacent cells and corner cells are given higher basic weight values; according to the predetermined index order of the valid cells in the discretized grid, the first constraint component, the second constraint component, the third constraint component, and the comprehensive priority weight corresponding to each cell are concatenated to form a design constraint vector.

[0032] For example, in the step of constructing design constraint vectors, for each valid cell in the discretized grid, the shortest Euclidean distance from its geometric center to all edge segments of the closed polygon boundary is calculated. The edge segments are determined by connecting adjacent vertices of the closed polygon in sequence. The Euclidean distance is calculated as follows: for the geometric center P(x0,y0) and edge segments AB (A(x1,y1), B(x2,y2)), first calculate vectors PA and PB. If vector PA·vector AB≤0, the shortest distance is the length of PA. If vector PB·vector AB≤0, the shortest distance is the length of PB. Otherwise, the shortest distance is |(BA)×(AP)| / |BA|. Then, the minimum value is selected from the distances corresponding to all edge segments as the shortest Euclidean distance. This distance value is normalized and used as the first constraint component representing the degree of freedom of the cell. The normalization process can use the min-max normalization algorithm to make the normalized value between 0 and 1. The algorithm determines whether the four sides of each valid cell overlap with the boundary segments of a closed polygon or are less than a preset threshold (3cm). Overlap determination involves checking if the cell's side segments and the boundary segments share a common point. Distance calculation uses the shortest distance between two non-overlapping segments. If they do, the cell is marked as an adjacent cell, and a second constraint component is generated to indicate it as an adjacent cell. The second constraint component can be 1 for adjacent and 0 for non-adjacent. The algorithm also identifies and marks corner cells. If a valid cell is simultaneously marked as adjacent to two non-contiguous closed polygon boundaries, it is determined to be a corner cell. Non-contiguous closed polygon boundaries refer to two boundaries that are not adjacent and form an angle. Adjacency determination involves checking if the distance between the cell and the boundary segment is less than the preset threshold. A third constraint component is generated to indicate it as a corner cell. The third constraint component can be 2 for corner and 0 for non-corner. Based on the first, second, and third constraint components, a comprehensive priority weight is calculated for each valid cell. The comprehensive priority weight is inversely proportional to the distance to the boundary; that is, the closer the distance, the higher the weight. Cells adjacent to the boundary and those in corners are assigned higher base weight values. The calculation can be performed using the formula: Comprehensive Priority Weight = (1 - First Constraint Component) × Base Weight + Second Constraint Component × 0.2 + Third Constraint Component × 0.3, where the base weight can be 0.5 or 0.6. Following the predetermined index order of the valid cells in the discretized grid (which is the previously recorded row and column index order), the first, second, and third constraint components and the comprehensive priority weight corresponding to each cell are concatenated. The concatenation process involves combining each component into a vector according to its cell index, forming the design constraint vector.

[0033] In existing technologies, design constraints often only consider whether a cell is within a layable area, neglecting details such as distance from boundaries and whether it is a corner. This leads to problems like unreasonable boundary splicing and poor corner module adaptation in subsequent layout generation. This embodiment comprehensively characterizes the cell laying constraints by calculating multi-dimensional constraint components and setting comprehensive priority weights. Compared with existing technologies, the design constraint vector in this embodiment better matches actual construction needs, providing accurate constraint basis for subsequent layout generation, effectively avoiding unreasonable layout problems at boundaries and corners, and solving the problems of incomplete design constraints and low layout generation accuracy in existing technologies.

[0034] In another embodiment, in S5, the topological structure data of the discretized grid is converted into a three-dimensional feature tensor, where the first and second dimensions correspond to the number of rows and columns of the discretized grid, respectively, and the third dimension of the channel data includes the preset initial type encoding, row and column index values, and a mask used to mark whether the cell is a valid cell for each standard cell. The design constraint vector is reconstructed according to the predetermined index order of the valid cells in the discretized grid to form a two-dimensional constraint matrix whose row and column dimensions match the discretized grid. Each element in the matrix is ​​a multi-dimensional vector containing the first constraint component, second constraint component, third constraint component, and comprehensive priority weight corresponding to that position. The three-dimensional feature tensor and the two-dimensional constraint matrix are concatenated in the channel dimension to form a joint input tensor that integrates topology and constraint conditions. The pre-trained generative neural network model is a conditional variational autoencoder based on the U-Net architecture. Its encoder part downsamples and extracts features from the joint input tensor, and its decoder part upsamples and performs pixel-by-pixel regression under the condition of latent space variables, finally outputting a layout matrix with the same size as the discretized grid.

[0035] For example, in the step of generating the layout matrix, the topological structure data of the discretized grid is converted into a three-dimensional feature tensor. The first and second dimensions correspond to the number of rows and columns of the discretized grid, respectively. The third dimension, channel data, includes a preset initial type code, row and column index values, and a mask indicating whether the cell is valid. The preset initial type code can be 0 or 1, and the mask can be 1 for valid cells and 0 for invalid cells. The conversion process involves arranging the above data of each cell in row and column order to form a three-dimensional tensor with dimensions of (number of rows, number of columns, number of channels). The number of channels can be 3 or 4. The design constraint vectors are reconstructed according to the predetermined index order of the valid cells in the discretized grid to form a two-dimensional constraint matrix whose row and column dimensions match the discretized grid. Each element in the matrix is ​​a multi-dimensional vector containing the first constraint component, second constraint component, third constraint component, and comprehensive priority weight corresponding to that position. The reconstruction process involves setting the element vector of an invalid cell to all zeros to ensure that the matrix size is consistent with the grid. The three-dimensional feature tensor and the two-dimensional constraint matrix are concatenated along the channel dimension. The concatenation process involves expanding the two-dimensional constraint matrix into a three-dimensional tensor, with the expanded dimensions being (number of rows, number of columns, and constraint vector dimension). This expanded tensor is then merged with the three-dimensional feature tensor in the third dimension to form a joint input tensor that integrates topology and constraints. The number of channels in the joint input tensor is the sum of the number of channels in the three-dimensional feature tensor and the constraint vector dimension. The pre-trained generative neural network model is a conditional variational autoencoder based on the U-Net architecture. Its encoder part downsamples and extracts features from the joint input tensor. The downsampling process is implemented through convolutional layers, with kernel sizes of 3×3 or 5×5 and strides of 2. Each convolutional layer is followed by a normalization layer and an activation function, which can be ReLU or LeakyReLU, to extract and compress features from the joint input tensor and output the mean vector and logarithmic variance vector of the latent space distribution. Its decoder part upsamples and performs pixel-by-pixel regression under the condition of latent space variables. The upsampling process is implemented through transposed convolutional layers, with kernel sizes of 3×3 and strides of 2. The final output is a layout matrix with the same size as the discretized grid.

[0036] In existing technologies, layout generation often employs template matching or simple rule mapping, which struggles to integrate mesh topology and multi-dimensional constraints. This results in layouts prone to module splicing conflicts or poor adaptability, particularly under complex constraints. This embodiment addresses this issue by fusing topological data and constraint vectors into a joint input tensor, using a specific neural network model for layout generation. Compared to existing technologies, this embodiment fully utilizes mesh topology and constraint information, generating layouts that better meet practical needs and effectively solving the problems of poor adaptability and difficulty in handling multiple constraints in existing layout generation methods.

[0037] In another embodiment, the encoder consists of multiple downsampling blocks cascaded together. Each downsampling block contains a convolutional layer, a normalization layer, and an activation function, used to extract and compress features from the joint input tensor and output the mean vector and logarithmic variance vector of the latent space distribution. Based on the mean vector and logarithmic variance vector, a latent space variable is obtained by sampling using a reparameterization technique. The decoder consists of multiple upsampling blocks cascaded together. Each upsampling block contains a transposed convolutional layer, a normalization layer, and an activation function. It takes the latent space variable and the feature map skip connections corresponding to the encoder level as input, and gradually recovers the space of the feature map. Inter-resolution; the last layer of the decoder is a convolutional layer with a softmax activation function, which maps the final feature map to a multi-channel probability map with the same size as the discretized grid. Each channel corresponds to a type of tatami module. The final layout matrix is ​​generated by taking the index of the channel with the highest probability. During the training phase, the conditional variational autoencoder is trained by optimizing a combined loss function, which includes the reconstruction loss between the layout matrix and the true label, the KL divergence loss between the latent spatial distribution and the standard normal distribution, and the physical constraint loss based on the tatami tiling design rules.

[0038] For example, the encoder of a generative neural network model consists of multiple downsampling blocks cascaded together. Each downsampling block contains a convolutional layer, a normalization layer, and an activation function. The convolutional layer can use a 3×3 kernel with a stride of 2, used for feature extraction and compression of the joint input tensor. The normalization layer can be a batch normalization layer used to stabilize the training process. The activation function can be the LeakyReLU function, which is calculated by outputting the input value when it is greater than 0 and multiplying it by 0.01 when it is less than 0. The encoder ultimately outputs the mean vector and the logarithm vector of the latent space distribution. Based on the mean vector and the logarithm vector of the logarithm, a latent space variable is obtained by sampling using the reparameterization technique. The reparameterization technique is calculated as: latent space variable = mean vector + exp(logarithm vector of variance / 2) × ε, where ε is a random vector following a standard normal distribution, ensuring that the gradient can propagate backward. The decoder consists of multiple upsampling blocks cascaded together. Each upsampling block contains a transposed convolutional layer, a normalization layer, and an activation function. The transposed convolutional layer can use a 3×3 kernel with a stride of 2 to restore the spatial resolution of the feature map. The normalization layer can be a batch normalization layer, and the activation function can be the ReLU function, which is calculated by finding the maximum value between the input and output values ​​and 0. The decoder takes the latent spatial variables and skip connections to the feature maps of the corresponding layers of the encoder as input. The skip connection process involves concatenating the feature maps output by each downsampling block of the encoder with the feature maps output by the corresponding upsampling block of the decoder along the channel dimension, gradually restoring the spatial resolution of the feature map. The last layer of the decoder is a convolutional layer with a Softmax activation function. The kernel size can be 1×1, used to map the final feature map into a multi-channel probability map with the same size as the discretized grid. Each channel corresponds to a type of tatami module. The Softmax activation function is calculated by taking the channel value at each pixel location, calculating the ratio of the exponent of that value to the sum of the exponents of all channel values, and obtaining the probability of each channel. The final layout matrix is ​​generated by taking the index of the channel with the highest probability. During the training phase, the conditional variational autoencoder is trained by optimizing a combined loss function. This combined loss function includes the reconstruction loss between the layout matrix and the true labels, the KL divergence loss between the latent spatial distribution and the standard normal distribution, and the physical constraint loss based on the tatami tiling design rules. The reconstruction loss can be achieved using the cross-entropy loss function, calculated by taking the average cross-entropy between the predicted layout matrix and the true label matrix. The KL divergence loss is calculated by taking the KL divergence between the distribution represented by the mean vector and the logarithm of the variance vector and the standard normal distribution. The physical constraint loss can be achieved using the L1 loss function, calculated by taking the average absolute value of the dimensional deviations at the splicing points of the modules in the predicted layout. The combined loss function is calculated as follows: Total Loss = 0.6 × Reconstruction Loss + 0.2 × KL Divergence Loss + 0.2 × Physical Constraint Loss.

[0039] This embodiment constructs a model using concatenated downsampling and upsampling blocks, introduces skip connections to transfer features, and employs a combined loss function to optimize training. Compared to existing technologies, the model in this embodiment can extract input features more fully, resulting in a more stable layout that better conforms to construction rules. This solves the problems of incomplete model training, poor layout generation stability, and low construction feasibility in existing technologies.

[0040] In another embodiment, in S6, based on the type number of the tatami module corresponding to each valid cell in the layout matrix, the actual physical size, standard geometry, and allowed splicing relationship with other types of modules corresponding to that type number are retrieved from a preset module database to generate a module information set; based on the geometric center coordinates and row and column index order of each valid cell in the discretized grid, combined with the corresponding actual physical size of the module, adjacent valid cells with the same type number are merged and calculated; when the size of the largest rectangular area formed after merging matches the size of a standard module or an integer multiple of the size of a standard module, the rectangular area is marked as a module. Combine and lay the units, and update the module type number in the area to the corresponding combined module number; based on the edge cell and corner cell information marked in the design constraint vector, perform compliance verification and automatic correction on the module type number located at the boundary and corner to ensure that the module size and splicing method at that location comply with the physical installation constraints; based on the finally determined type number and geometric position of each valid cell or combined laying unit, generate a two-dimensional vector file containing the outline, size, type identification and relative positional relationship of all tatami modules; based on the two-dimensional vector file, extract the cutting path, dimension annotation and overall laying sequence guide for each independent tatami module.

[0041] For example, in the step of generating documents to guide production and construction, based on the type number of the tatami module corresponding to each valid cell in the layout matrix, the actual physical size, standard geometry, and allowed splicing relationship with other types of modules corresponding to that type number are retrieved from a preset module database. The preset module database is a database that stores information on various types of tatami modules. The retrieval process involves matching the corresponding records in the database using the type number as a keyword to generate a set of module information. For example, if the retrieved item number 1 corresponds to a 90cm×180cm flat standard module, it is allowed to be spliced ​​horizontally with modules numbered 2 and 3; if the retrieved item number 3 corresponds to a 90cm×90cm module with storage drawers, it is only allowed to be spliced ​​vertically with flat standard modules, etc. Based on the geometric center coordinates and row and column index order of each valid cell in the discretized grid, and combined with the actual physical size of the corresponding module, adjacent valid cells with the same type number are merged. Adjacent means that the cells are adjacent in row and column index in the grid, that is, adjacent in the horizontal or vertical direction. The merging calculation process is to determine whether the type numbers of adjacent cells are consistent. If they are consistent, they are regarded as a whole area. The boundary coordinates of the area are calculated. When the size of the largest rectangular area formed after merging matches the size of a standard module or an integer multiple of the size of the standard module, the standard module size can be 90cm×180cm, and the integer multiple size can be 180cm×180cm or 90cm×360cm. Then the rectangular area is marked as a combined laying unit, and the module type number in the area is updated to the corresponding combined module number. The combined module number can be 10 or 11. For example, number 10 can correspond to a 180cm×180cm combined module formed by merging two 90cm×180cm planar standard modules, and number 11 can correspond to a 90cm×540cm combined module formed by merging three 90cm×180cm planar standard modules. Based on the information of adjacent and corner cells marked in the design constraint vector, the module type numbers located at the boundaries and corners are subject to compliance verification and automatic correction. The compliance verification process determines whether the module size matches the boundary length and whether the splicing method conforms to construction specifications. The automatic correction process replaces the module type number with a more suitable size when the verification fails. For example, the original 90cm×180cm module numbered 1 at the boundary is corrected to an 80cm×80cm chamfered module numbered 4, ensuring that the module size and splicing method at that location conform to the physical installation constraints. Based on the finally determined type number and geometric position of each valid cell or combined laying unit, a two-dimensional vector file containing the outline, size, type identification, and relative positional relationship of all tatami modules is generated. The generation process involves drawing the geometric information of each module onto a two-dimensional coordinate system according to its relative position to form a vector graphic.Based on 2D vector graphics files, the cutting path, dimension annotations, and overall laying sequence guide for each independent tatami module are extracted. The cutting path extraction process involves generating the tool cutting trajectory coordinates based on the module's outline information. The dimension annotation extraction process involves retrieving dimension data from the module information and annotating it next to the corresponding module. The laying sequence guide extraction process involves determining the laying priority based on the module's positional relationship, either from the inside out or from left to right, to form text or graphic guidance information.

[0042] In existing technologies, generating construction documents often requires manual extraction of module information from the design layout. Cell merging and verification corrections also need to be done manually, which can easily lead to errors in cutting path annotations and disordered laying sequences, making direct integration with production construction difficult. This embodiment automatically retrieves module information, merges and calculates cells, and performs compliance verification corrections, ultimately generating a complete 2D vector file and extracting construction guidelines. Compared to existing technologies, this embodiment achieves automated conversion from layout to construction documents, reducing manual intervention, lowering the error rate, and achieving seamless integration between design and production construction. It solves the problems of low efficiency, large errors, and difficulty in adapting to production construction in existing technologies.

[0043] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. They can be applied to various fields suitable for the present invention. For those skilled in the art, other modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and embodiments shown and described herein.

Claims

1. An AI-based automatic tatami design method, characterized in that, include: S1: Obtain the planar outline data of the room to be tiled, which includes the coordinates of several outline vertices; S2: Based on the coordinates of all contour vertices, construct a closed polygon representing the interior area of ​​the room; S3: Based on the preset standard outer rectangle size of the tatami module, the continuous area inside the closed polygon is discretized into a discretized grid composed of standard cells, where each standard cell corresponds to a potential placement position of a tatami module. S4: Construct a design constraint vector, which includes the positional relationship information between each standard cell in the discretized grid and the boundary of the closed polygon; S5: Input the topological data of the discretized mesh and the design constraint vector into a pre-trained generative neural network model. The generative neural network model iteratively performs layout generation and evaluation, and outputs a layout matrix. Each element value in the layout matrix represents the type number of the tatami module placed in its corresponding standard cell. S6: Analyze the layout matrix and generate documents to guide production and construction based on the actual physical dimensions and splicing relationships corresponding to the type numbers of the tatami modules; In S4, for each valid cell in the discretized grid, the shortest Euclidean distance from its geometric center to all edge segments of the closed polygon boundary is calculated, and the distance value is normalized and used as the first constraint component characterizing the laying degree of freedom of the cell. Determine whether the four sides of each valid cell overlap with the boundary segments of the closed polygon or are less than a preset threshold. If so, mark the cell as an adjacent cell and generate a second constraint component to indicate that it is an adjacent cell; Identify and mark corner cells. If a valid cell is marked as being adjacent to two non-contiguous closed polygon boundaries, it is determined to be a corner cell, and a third constraint component is generated to indicate that it is a corner cell. Based on the first constraint component, the second constraint component, and the third constraint component, a comprehensive priority weight is calculated for each valid cell. The comprehensive priority weight is inversely proportional to the distance to the boundary, and adjacent cells and corner cells are assigned higher basic weight values. According to the predetermined index order of the valid cells in the discretized grid, the first constraint component, the second constraint component, the third constraint component and the comprehensive priority weight corresponding to each cell are concatenated to form the design constraint vector. In S5, the topological structure data of the discretized grid is converted into a three-dimensional feature tensor. The first and second dimensions correspond to the number of rows and columns of the discretized grid, respectively. The third dimension, channel data, includes the preset initial type encoding, row and column index values, and a mask to indicate whether the cell is a valid cell for each standard cell. The design constraint vector is reconstructed according to the predetermined index order of the valid cells in the discretized grid to form a two-dimensional constraint matrix. Its row and column dimensions match those of the discretized grid. Each element in the matrix is ​​a multi-dimensional vector containing the first constraint component, second constraint component, third constraint component, and comprehensive priority weight corresponding to that position. The three-dimensional feature tensor and the two-dimensional constraint matrix are concatenated along the channel dimension to form a joint input tensor that integrates topology and constraint conditions. The pre-trained generative neural network model is a conditional variational autoencoder based on the U-Net architecture. Its encoder part downsamples and extracts features from the joint input tensor, and its decoder part upsamples and performs pixel-by-pixel regression under the condition of latent space variables, finally outputting a layout matrix with the same size as the discretized grid. The encoder consists of multiple downsampling blocks cascaded together. Each downsampling block contains a convolutional layer, a normalization layer, and an activation function, used to extract and compress features from the joint input tensor and output the mean vector and logarithmic variance vector of the latent space distribution. Based on the mean vector and logarithmic variance vector, a latent space variable is obtained by sampling using a reparameterization technique. The decoder consists of multiple upsampling blocks cascaded together. Each upsampling block contains a transposed convolutional layer, a normalization layer, and an activation function. It takes the latent space variable and skip connections of the feature maps corresponding to the encoder layers as input, and gradually restores the spatial resolution of the feature maps. The last layer of the decoder is a convolutional layer with a Softmax activation function, which maps the final feature map to a multi-channel probability map with the same size as the discretized grid. Each channel corresponds to a type of tatami module. The final layout matrix is ​​generated by taking the index of the channel with the highest probability. During the training phase, the conditional variational autoencoder is trained by optimizing a combined loss function. The combined loss function includes the reconstruction loss between the layout matrix and the true label, the KL divergence loss between the latent spatial distribution and the standard normal distribution, and the physical constraint loss based on the tatami tiling design rules.

2. The AI-based automatic tatami design method as described in claim 1, characterized in that, In S1, three-dimensional point cloud data of the room to be covered is collected using a laser scanner or depth camera; The 3D point cloud data is denoised and filtered, and horizontal slices of point cloud are extracted within a preset height range from the ground. The horizontal slice point cloud is projected onto a two-dimensional plane, and the continuous two-dimensional point sequence that constitutes the baseboard of the room is identified and sorted through edge detection and contour tracking algorithms. The Douglas-Puk algorithm is used to adaptively thin the continuous two-dimensional point sequence. Under the premise of meeting the preset contour fitting error threshold, the continuous two-dimensional point sequence is simplified into the coordinates of several contour vertices.

3. The AI-based automatic tatami design method as described in claim 1, characterized in that, In S2, the coordinates of several contour vertices are sorted according to their physical connection order on the baseboard of the room to form an ordered vertex sequence. The concavity and convexity of the polygon defined by the ordered vertex sequence are detected. If a concave point is identified, a virtual dividing line is generated along the direction of the inner corner of the concave point to divide the closed polygon into two or more convex polygon sub-regions. For each convex polygon sub-region, calculate its minimum area bounding rectangle, and fine-tune the boundary of the minimum area bounding rectangle according to the standard bounding rectangle size to form the optimized bounding rectangle; The optimized bounding rectangle is subjected to Boolean intersection with the corresponding convex polygon sub-region to accurately cut out the actual tiling contour of the sub-region. The actual tiling contours of all sub-regions are then merged to form the final closed polygon used for discretization.

4. The AI-based automatic tatami design method as described in claim 1, characterized in that, In S3, a reference point is determined inside the closed polygon as the starting alignment point of the discretized mesh. The starting alignment point is set as the projection point of the midpoint of the longest side inside the closed polygon in its vertical direction. Using the initial alignment point as the origin and the length and width of the standard bounding rectangle as the unit step size, a two-dimensional basic mesh covering the entire bounding rectangle of the closed polygon is established along the main direction parallel to the closed polygon. Traverse each standard cell in the two-dimensional basic grid, calculate its geometric center coordinates, and use the point-in-polygon algorithm to determine whether the geometric center is located inside the closed polygon. Select all standard cells whose geometric centers are located inside closed polygons, mark them as valid cells, and record their row and column indices in the two-dimensional base grid. The set of all valid cells constitutes the initial discretized grid. Fine-tune the position of the starting alignment point within the standard bounding rectangle size range, and repeat the steps of establishing a two-dimensional basic grid and filtering valid cells to find an optimized alignment scheme that maximizes the total number of valid cells and whose total area of ​​all valid cells is closest to the area of ​​the closed polygon. The set of valid cells under this scheme is then used as the final discretized grid.

5. The AI-based automatic tatami design method as described in claim 1, characterized in that, In S6, based on the type number of the tatami module corresponding to each valid cell in the layout matrix, the actual physical size, standard geometry, and allowed splicing relationship with other types of modules corresponding to that type number are retrieved from the preset module database to generate a module information set. Based on the geometric center coordinates and row and column index order of each valid cell in the discretized grid, and combined with the actual physical size of the corresponding module, adjacent valid cells with the same type number are merged and calculated. When the size of the largest rectangular area formed after merging matches the size of a standard module or an integer multiple of the size of a standard module, the rectangular area is marked as a combined laying unit, and the module type number in the area is updated to the corresponding combined module number. Based on the information of adjacent and corner cells marked in the design constraint vector, the module type number located at the boundary and corner is verified for compliance and automatically corrected to ensure that the module size and splicing method at that location comply with the physical installation constraints. Based on the type number and geometric position of each valid cell or combined laying unit, generate a two-dimensional vector file containing the outline, size, type identifier and relative positional relationship of all tatami modules; Based on 2D vector graphics files, the cutting path, dimension annotations, and overall laying sequence guidelines for each individual tatami module are extracted.

Citation Information

Patent Citations

  • Automatic layout method and system based on house type image splicing

    CN111177821A

  • Indoor layout automatic generation method based on deep neural network and simulated annealing optimization

    CN120372746A