Method and device for adjusting outer contour of table top
By sorting and judging the line segments of the outer contour of the mesa, the target line segments are determined for processing, which solves the problem of low efficiency and accuracy in adjusting the outer contour of the mesa, and achieves fast and accurate outer contour adjustment.
Patent Information
- Application Number
- CN202410796771.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-20
AI Technical Summary
When generating countertops from multiple 3D models, due to subtle size differences, the generated countertops do not meet the requirements and require manual adjustment of the outer contour, which is inefficient and inaccurate.
By sorting multiple line segments to be processed based on the outer contour of the table, the current line segment and the reference line segment are determined, their parallelism and distance threshold are determined, and then the target line segment is determined, and the target line segment is processed to adjust the outer contour.
It achieves rapid and accurate adjustment of the outer contour of the table, avoids manual processing, and improves efficiency and accuracy.
Smart Images

Figure CN118365841B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for adjusting the outer contour of a table. Background Art
[0002] When using multiple 3D models to generate a countertop, there may be slight size differences between the multiple 3D models, resulting in the generated countertop not meeting the requirements of product production. In this case, it is usually necessary to manually adjust the outer contour of the countertop. However, manual adjustment of the outer contour of the countertop may result in low efficiency and poor accuracy. Summary of the invention
[0003] The present disclosure provides a method, a device, an electronic device and a storage medium for adjusting the outer contour of a table.
[0004] According to one aspect of the present disclosure, a method for adjusting the outer contour of a table top is provided, comprising:
[0005] Based on the order of a plurality of line segments to be processed that constitute the outer contour of the current tabletop to be processed, determine a current line segment from the plurality of line segments to be processed;
[0006] When the current line segment is a straight line and is not the last one in the order of the multiple line segments to be processed, determine a first reference line segment and a second reference line segment of the current line segment, wherein the first reference line segment is adjacent to the current line segment and is located after the current line segment, and the second reference line segment is adjacent to the first reference line segment and is located after the first reference line segment;
[0007] In a case where the current line segment and the second reference line segment are parallel and the relative distance is less than a distance threshold, determining a first target line segment and a second target line segment among the current line segment, the first reference line segment and the second reference line segment;
[0008] The first target line segment and the second target line segment are processed to obtain an adjusted outer contour of the current table top.
[0009] According to another aspect of the present disclosure, there is provided a device for adjusting the outer contour of a table top, comprising:
[0010] A current line segment determination module, configured to determine a current line segment from a plurality of line segments to be processed based on the order of the plurality of line segments to be processed that constitute the outer contour of the current tabletop to be processed;
[0011] A reference line segment determination module, configured to determine, when the current line segment is a straight line and is not the last one in the order of the multiple line segments to be processed, a first reference line segment and a second reference line segment of the current line segment, wherein the first reference line segment is adjacent to the current line segment and is located after the current line segment, and the second reference line segment is adjacent to the first reference line segment and is located after the first reference line segment;
[0012] a target line segment determination module, configured to determine a first target line segment and a second target line segment from among the current line segment, the first reference line segment and the second reference line segment, when the current line segment and the second reference line segment are parallel and a relative distance is less than a distance threshold;
[0013] The outer contour adjustment module is used to process the first target line segment and the second target line segment to obtain an adjusted outer contour of the current table top.
[0014] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any embodiment of the present disclosure.
[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to any embodiment of the present disclosure.
[0019] By adopting the above scheme, the current line segment can be determined from multiple line segments to be processed that constitute the outer contour of the current table top to be processed. When the current line segment is a straight line and is not the last one, two reference line segments of the current line segment can be determined. Then, when the current line segment and the second reference line segment are parallel and the relative distance is less than a distance threshold, a first target line segment and a second target line segment are determined from the current line segment and the two reference line segments. By processing the first target line segment and the second target line segment, the outer contour of the adjusted current table top is obtained. In this way, the target line segment to be processed can be quickly and accurately determined in the outer contour of the current table top to be processed. Then, the outer contour of the table top after this adjustment can be obtained by processing the table top through the target line segment. In this way, it is possible to avoid adjusting the outer contour of the table top by manual processing, thereby improving the efficiency and accuracy of adjusting the outer contour of the table top.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0022] Figure 1 is a schematic flow chart of a method for adjusting the outer contour of a table according to an embodiment of the present disclosure;
[0023] Figure 2 is a schematic diagram of a scene of a table surface to be processed currently according to an embodiment of the present disclosure;
[0024] Figure 3 is another schematic diagram of a scene of a table to be processed according to an embodiment of the present disclosure;
[0025] Figure 4 is a scene schematic diagram of the outer contour of the current table according to an embodiment of the present disclosure;
[0026] Figure 5 is another schematic diagram of the outer contour of the current table according to an embodiment of the present disclosure;
[0027] Figure 6 is another schematic flow chart of a method for adjusting the outer contour of a table according to an embodiment of the present disclosure;
[0028] Figure 7 is another schematic flow chart of a method for adjusting the outer contour of a table according to an embodiment of the present disclosure;
[0029] Figure 8 is a schematic block diagram of a device for adjusting the outer contour of a table according to an embodiment of the present disclosure;
[0030] Fig. 9 is a schematic block diagram of a device for adjusting the outer contour of a table according to another embodiment of the present disclosure;
[0031] Fig.10 is a schematic block diagram of a device for adjusting the outer contour of a table according to another embodiment of the present disclosure;
[0032] Fig.11 The block diagram is a block diagram of an electronic device for implementing the method for adjusting the outer contour of a table according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0034] The first aspect of the present disclosure provides a method for adjusting the outer contour of a table top, such as Figure 1 As shown, including:
[0035] S110, based on the order of multiple to-be-processed line segments constituting the outer contour of the current to-be-processed table surface, determining a current line segment from the multiple to-be-processed line segments;
[0036] S120, when the current line segment is a straight line and is not the last one in the order of the multiple line segments to be processed, determine a first reference line segment and a second reference line segment of the current line segment, wherein the first reference line segment is adjacent to the current line segment and is located after the current line segment, and the second reference line segment is adjacent to the first reference line segment and is located after the first reference line segment;
[0037] S130, when the current line segment and the second reference line segment are parallel and the relative distance is less than a distance threshold, determining a first target line segment and a second target line segment from among the current line segment, the first reference line segment and the second reference line segment;
[0038] S140: Process the first target line segment and the second target line segment to obtain an adjusted outer contour of the current table top.
[0039] The method for adjusting the outer contour of the table in the embodiment of the present disclosure can be executed by an electronic device. The electronic device can be a terminal or a server. Exemplarily, the electronic device can be a terminal device with computing capabilities. Exemplarily, the electronic device can be a server in the cloud; the server can be a single server, or can be one or more servers in a server cluster, or can be a server in a distributed system (or can be called a computing node). It should be understood that the above is only an exemplary description of an electronic device, and the actual processing may not be limited to the devices mentioned in the above examples. As long as the electronic device can execute the method for adjusting the outer contour of the table provided in this embodiment, it is within the protection scope of this embodiment.
[0040] By adopting the above scheme, the current line segment can be determined from multiple line segments to be processed that constitute the outer contour of the current table top to be processed. When the current line segment is a straight line and is not the last one, two reference line segments of the current line segment can be determined. Then, when the current line segment and the second reference line segment are parallel and the relative distance is less than a distance threshold, a first target line segment and a second target line segment are determined from the current line segment and the two reference line segments. By processing the first target line segment and the second target line segment, the outer contour of the adjusted current table top is obtained. In this way, the target line segment to be processed can be quickly and accurately determined in the outer contour of the current table top to be processed. Then, the outer contour of the table top after this adjustment can be obtained by processing the table top through the target line segment. In this way, it is possible to avoid adjusting the outer contour of the table top by manual processing, thereby improving the efficiency and accuracy of adjusting the outer contour of the table top.
[0041] In some embodiments, a method for initially obtaining multiple unprocessed line segments that constitute the outer contour of the current table top to be processed may include: obtaining multiple outer contours of models corresponding to multiple target objects; when there are overlapping parts among the multiple outer contours, deleting the line segments corresponding to the overlapping parts of the multiple outer contours to obtain multiple outer contour line segments of the non-overlapping parts of the multiple outer contours; connecting the multiple outer contour line segments at the intersection to obtain the initial outer contour of the table top; when the initial outer contour of the table top is a closed contour, using the multiple initial line segments that constitute the initial outer contour of the table top as the multiple unprocessed line segments that are initially generated to constitute the outer contour of the current table top to be processed.
[0042] In addition, the method may further include: when the initial outer contour of the table top is not a closed contour, ending the processing.
[0043] The method of obtaining multiple outer contours of models corresponding to multiple target objects includes: obtaining models corresponding to multiple target objects and positions of the models corresponding to the multiple target objects, and generating multiple outer contours of the models corresponding to the multiple target objects based on the models corresponding to the multiple target objects and their positions.
[0044] Wherein, obtaining the models corresponding to the multiple target objects and the positions of the models corresponding to the multiple target objects may include: receiving a request for generating an initial table surface from a user, and extracting the models corresponding to the multiple target objects and the positions of the models corresponding to the multiple target objects from the request for generating the initial table surface. Here, the position of the model corresponding to any one of the target objects may refer to the relative position of the model corresponding to any one of the target objects within the current view range.
[0045] Any one of the multiple target objects may refer to at least one of the items, categories, and types involved in any decoration design, such as furniture, cabinets, home appliances, wash basins, etc., which are not limited or exhaustive here.
[0046] The type of the model corresponding to any target object may be a three-dimensional model or a two-dimensional model. Preferably, the model corresponding to the target object is a three-dimensional model.
[0047] Preferably, generating multiple outer contours of the models corresponding to the multiple target objects based on the models corresponding to the multiple target objects and their positions may include: when the models corresponding to the multiple target objects are three-dimensional models, generating multiple outer contours of the models corresponding to the multiple target objects based on the designated faces of the three-dimensional models corresponding to the multiple target objects and the positions of the three-dimensional models corresponding to the multiple target objects. The designated faces may be configured according to actual conditions, such as the upper surface or a non-hidden surface. For example, if any one of the target objects is a cabinet, the model corresponding to the target object may refer to the three-dimensional model of the cabinet, and the upper plane of the three-dimensional model of the cabinet may be the outer contour of a model corresponding to a target object.
[0048] Optionally, generating multiple outer contours of the models corresponding to the multiple target objects based on the models corresponding to the multiple target objects and their positions may include: when the models corresponding to the multiple target objects are two-dimensional models, generating multiple outer contours of the models corresponding to the multiple target objects based on the two-dimensional models corresponding to the multiple target objects and the positions of the two-dimensional models corresponding to the multiple target objects.
[0049] The method for determining whether a plurality of initial line segments can form a closed contour may include determining whether the contour formed by the plurality of initial line segments is continuous and has no gaps.
[0050] It should be noted that any initial line segment, that is, any line segment to be processed, may be a straight line segment without curvature (hereinafter referred to as a straight line), or may be a curved line segment or a curved line with curvature (hereinafter referred to as a curve).
[0051] Specifically, among the multiple line segments to be processed that constitute the outer contour of the current tabletop to be processed, when two adjacent line segments to be processed are straight lines, there is an angle between the two line segments to be processed, and the angle is not equal to 180 degrees. Figure 2 , the multiple line segments to be processed in this embodiment are exemplarily described: the outer contour of the current table surface 201 to be processed can be composed of line segment A, line segment B, line segment C, line segment D, line segment E, and line segment F, that is, line segment A to line segment F are multiple line segments to be processed. Among them, the previous table surface to be processed can be a plane or a curved surface.
[0052] The ordering method of the plurality of line segments to be processed that constitute the outer contour of the current table to be processed may include: taking any one of the plurality of line segments to be processed that constitute the outer contour of the current table to be processed as a starting line segment, and sequentially ordering the remaining line segments to be processed from the starting line segment based on a specified direction. The specified direction may be configured according to actual conditions, such as a clockwise direction or a counterclockwise direction.
[0053] Combination Figure 2 , taking the line segment A among the multiple line segments to be processed that constitute the outer contour of the current table 201 to be processed as the starting line segment as an example, if the specified direction is clockwise, the remaining line segments are sorted in sequence from line segment A in the clockwise direction, such as Figure 2 As shown, the arrow directions marked on line segments A to F respectively indicate the clockwise direction, and finally line segment A is sorted as sequence 1, line segment B is sorted as sequence 2, line segment C is sorted as sequence 3, line segment D is sorted as sequence 4, line segment E is sorted as sequence 5, and line segment F is sorted as sequence 6. This is only an exemplary description, and the specific sorting method can be set according to the actual situation, which will not be exhaustively listed or repeated here.
[0054] In one embodiment, the determining the current line segment from the multiple line segments to be processed based on the order of the multiple line segments to be processed that constitute the outer contour of the current tabletop to be processed includes: determining one or more untraversed line segments to be processed from the multiple line segments to be processed that constitute the outer contour of the current tabletop to be processed; and determining the line segment to be processed with the smallest order from the one or more untraversed line segments to be processed as the current line segment based on the order of the multiple line segments to be processed.
[0055] In one embodiment, when the current line segment is a straight line and is not the last one in the ranking of the multiple line segments to be processed, determining the first reference line segment and the second reference line segment of the current line segment may include: judging whether the current line segment is the last one in the ranking of the multiple line segments to be processed, and when the current line segment is not the last one in the ranking of the multiple line segments to be processed, judging whether the current line segment is a straight line or a curve; and when the current line segment is a straight line, determining the first reference line segment and the second reference line segment of the current line segment.
[0056] Among them, the determining of the first reference line segment and the second reference line segment of the current line segment may be: determining, from the multiple line segments to be processed, a line segment to be processed that is adjacent to the position of the current line segment and is sorted after the current line segment as the first reference line segment; determining, from the multiple line segments to be processed, a line segment to be processed that is adjacent to the position of the first reference line segment and is sorted after the first reference line segment as the second reference line segment.
[0057] Determining a line segment to be processed that is adjacent to the current line segment and ranked after the current line segment from the multiple line segments to be processed as the first reference line segment may include: determining two line segments to be processed that are adjacent to the current line segment from the multiple line segments to be processed, and selecting a line segment to be processed that is ranked after the current line segment from the two line segments to be processed that are adjacent to the current line segment from the two line segments to be processed that are adjacent to the current line segment as the first reference line segment. Figure 2 For example, there are multiple line segments to be processed of the outer contour of the table top 201 to be processed, namely line segments A to F, and the order of the line segments A to F is line segment A in order 1, line segment B in order 2, line segment C in order 3, line segment D in order 4, line segment E in order 5, and line segment F in order 6. When the current line segment is line segment A, there are line segments F and line segment B that are adjacent to each other in front and back positions of line segment A, and line segment B is ordered after line segment A, so line segment B is used as the first reference line segment.
[0058] Determining from the plurality of line segments to be processed a line segment to be processed that is adjacent to the first reference line segment and ranked after the first reference line segment as the second reference line segment may include: determining from the plurality of line segments to be processed two line segments to be processed that are adjacent to the first reference line segment; when the first reference line segment is ranked last among the plurality of line segments to be processed, selecting from the two line segments to be processed that are adjacent to the first reference line segment and ranked first among the plurality of line segments to be processed as the second reference line segment; when the first reference line segment is not ranked last among the plurality of line segments to be processed, selecting from the two line segments to be processed that are adjacent to the first reference line segment and ranked after the first reference line segment as the second reference line segment. Still combined Figure 2 For example, when the current line segment is E, the first reference line segment is line segment F, and the second reference line segment is line segment A which is adjacent to the first reference line segment F and is ranked first among multiple line segments to be processed (line segments A to F).
[0059] In one embodiment, after determining the current line segment from the multiple line segments to be processed, it may also include: when the current line segment is a curve and is not the last one in the ranking of the multiple line segments to be processed, based on the ranking of the multiple line segments to be processed, determining a new current line segment from the multiple line segments to be processed.
[0060] Specifically, when the current line segment is a curve and is not the last one in the ranking of the multiple line segments to be processed, determining a new current line segment from the multiple line segments to be processed based on the ranking of the multiple line segments to be processed may include: judging whether the ranking of the current line segment among the multiple line segments to be processed is the last one, and when the current line segment is not the last one in the ranking of the multiple line segments to be processed, judging whether the current line segment is a straight line or a curve; and when the current line segment is a curve, determining a new current line segment from the multiple line segments to be processed based on the ranking of the multiple line segments to be processed.
[0061] That is to say, if the current line segment is a curve, the current line segment will not be processed subsequently. Instead, multiple line segments to be processed will be traversed continuously to find the next line segment to be processed that is located after the current line segment is sorted. The next line segment to be processed will be used as the new current line segment, and subsequent processing such as determining whether the new current line segment is the last one in the multiple line segments to be processed and determining whether the new current line segment is a straight line or a curve will be executed again. These will not be elaborated here.
[0062] For example: multiple line segments to be processed include line segments 1 to line segment 6, and multiple line segments to be processed and their order include line segment 1, line segment 2, line segment 3, line segment 4, line segment 5, and line segment 6. In the case of the first traversal, line segments 1 to 6 are all untraversed line segments, and line segment 1 is used as the current line segment; when line segment 1 is a curve, during the second traversal, line segments 2 to 6 are untraversed line segments, line segment 2 is used as the new current line segment, and subsequent steps are performed on the new current line segment.
[0063] By adopting the above solution, when the current line segment is a curve and is not the last one in the order of the multiple line segments to be processed, a new current line segment is determined from the multiple line segments to be processed based on the order of the multiple line segments to be processed. In this way, the processing of the current curve can be skipped, thereby improving the efficiency of adjusting the outer contour of the table top.
[0064] In one embodiment, after determining the current line segment from the multiple line segments to be processed, the method may further include: when the current line segment is ranked last among the multiple line segments to be processed, using the outer contour of the current table top to be processed as the outer contour of the target table top.
[0065] That is to say, when traversing multiple line segments to be processed and the current line segment is the last one of all the line segments to be processed, no matter the current line segment is a curve or a straight line, there is no need to perform subsequent processing on the current line segment; further, the current line segment is the last one of all the line segments to be processed in traversing the outer contour of the current table top to be processed, which proves that none of the line segments to be processed of the outer contour of the current table top to be processed that are located before the current line segment in the traversal order have been adjusted, and therefore the outer contour of the current table top to be processed (i.e., the outer contour of the current table top to be processed formed by multiple line segments to be processed) can be used as the outer contour of the target table top, and thus the target table top after this processing can be obtained.
[0066] By adopting the above scheme, when the current line segment is ranked last among the multiple line segments to be processed, the outer contour of the current tabletop to be processed is directly used as the outer contour of the target tabletop. In this way, the outer contour of the target tabletop is determined by traversing and analyzing each of the line segments to be processed of the outer contour of the current tabletop to be processed, thereby ensuring the accuracy of the outer contour of the target tabletop.
[0067] In some embodiments, when the current line segment and the second reference line segment are parallel and the relative distance is less than a distance threshold, determining the first target line segment and the second target line segment among the current line segment, the first reference line segment and the second reference line segment may specifically include: judging whether the current line segment and the second reference line segment are parallel; when the current line segment and the second reference line segment are parallel, obtaining the relative distance between the current line segment and the second reference line segment; judging whether the relative distance between the current line segment and the second reference line segment is less than a distance threshold; and when the relative distance between the current line segment and the second reference line segment is less than the distance threshold, determining the first target line segment and the second target line segment among the current line segment, the first reference line segment and the second reference line segment.
[0068] Among them, the judging whether the current line segment and the second reference line segment are parallel may include one of the following: when the second reference line segment is a straight line, if the extension line of the current line segment and the extension line of the second reference line segment intersect, then it is determined that the current line segment and the second reference line segment are not parallel; when the second reference line segment is a straight line, if the extension line of the current line segment and the extension line of the second reference line segment do not intersect, then it is determined that the current line segment and the second reference line segment are parallel; when the second reference line segment is a curve, it is determined that the current line segment and the second reference line segment are not parallel.
[0069] Optionally, before determining whether the current line segment and the second reference line segment are parallel, the method further includes: determining whether the first reference line segment is a curve or a straight line, and if the first reference line segment is a curve, determining not to perform subsequent processing on the current line segment, and re-determining a new current line segment from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed; and if the first reference line segment is a straight line, performing subsequent processing (i.e., determining whether the current line segment and the second reference line segment are parallel). In other words, when the next line segment of the current line segment (i.e., the first reference line segment) is a curve, there is no need to perform subsequent processing on the current line segment; and further traversing the multiple line segments to be processed to find the next line segment to be processed after the sorting of the current line segment, taking the next line segment to be processed as the new current line segment, and performing subsequent processing such as determining whether the new current line segment is the last one in the sorting of the multiple line segments to be processed and determining whether the new current line segment is a straight line or a curve, which will not be described in detail here.
[0070] Optionally, before determining whether the current line segment and the second reference line segment are parallel, the process of determining whether the first reference line segment is a curve or a straight line is not performed. That is, regardless of whether the first reference line segment is a curve or a straight line, the subsequent process of determining whether the current line segment and the second reference line segment are parallel is performed.
[0071] The relative distance between the current line segment and the second reference line segment may be obtained by: when the current line segment and the second reference line segment are parallel, obtaining the relative distance between the current line segment and the second reference line segment. The relative distance between the current line segment and the second reference line segment may be: the perpendicular distance between any point of the current line segment and the second reference line segment, or the perpendicular distance between any point of the second reference line segment and the current line segment.
[0072] Determining the first target line segment and the second target line segment among the current line segment, the first reference line segment and the second reference line segment includes one of the following: when the angle between the current line segment and the first reference line segment is a yang angle, determining the first reference line segment as the first target line segment and the second reference line segment as the second target line segment; when the angle between the current line segment and the first reference line segment is a yin angle, determining the current line segment as the first target line segment and the first reference line segment as the second target line segment.
[0073] By adopting the above scheme, different first target line segments and second target line segments are determined according to whether the angle between the current line segment and the first reference line segment is a positive angle or a negative angle. In this way, the first target line segment and the second target line segment can be determined more accurately, thereby improving the accuracy of adjusting the outer contour of the table top.
[0074] In some preferred examples, the method of determining the angle between the current line segment and the first reference line segment may include: calculating the dot product of the current line segment and the first reference line segment based on the normal vector of the current line segment and the direction vector of the first reference line segment; and determining the angle between the current line segment and the first reference line segment based on the dot product of the current line segment and the first reference line segment.
[0075] The normal vector of the current line segment may be a vector perpendicular to the current line segment.
[0076] The direction vector of the first reference line segment can also be called the unit vector of the first reference line segment. Optionally, the first reference line segment can be a straight line, and accordingly, the direction vector of the first reference line segment can be determined by the coordinate difference between any two points of the first reference line segment, for example: the coordinates of any two points of the first reference line segment are (x1, y1) and (x2, y2), and the direction vector of the first reference line segment is (x1-x2, y1-y2). Another example: the unit vector obtained by normalizing the direction vector (that is, the direction vector divided by the modulus). Optionally, the first reference channel can be a curve, and accordingly, the direction vector of the first reference line segment can be determined by the difference between the starting point and the end point of the first reference line segment.
[0077] Determining the angle between the current line segment and the first reference line segment based on the dot product of the current line segment and the first reference line segment includes one of the following: when the dot product of the current line segment and the first reference line segment is greater than a dot product threshold, determining that the angle between the current line segment and the first reference line segment is a concave angle; when the dot product of the current line segment and the first reference line segment is less than a dot product threshold, determining that the angle attribute between the current line segment and the first reference line segment is a yang angle. The dot product threshold may be configured according to actual conditions. In a preferred example, the dot product threshold may be 0.
[0078] In the above processing, the situation where the dot product of the current line segment and the first reference line segment is equal to the dot product threshold does not occur. This is because when the current line segment and the first reference line segment are straight lines, if the dot product is equal to the dot product threshold (for example, 0), it means that the angle between the current line segment and the first reference line segment is 180 degrees, and there are no two adjacent straight lines with an angle of 180 degrees in the multiple line segments to be processed that constitute the outer contour of the current table to be processed. Therefore, when the current line segment and the first reference line segment are straight lines, the situation where the dot product of the current line segment and the first reference line segment is equal to the dot product threshold will not occur; when the first reference line segment is a curve, if the dot product of the current line segment and the first reference line segment is equal to the dot product threshold, it means that the line connecting the two endpoints of the current line segment and the first reference line segment is 180 degrees. In this case, the current line segment can be processed without subsequent processing, and a new current line segment can be determined from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed.
[0079] Combination Figure 2 and Figure 3 The inner and outer angles in this example are explained as follows: Figure 2 In the outer contour of the tabletop 201 to be processed, it is assumed that the current line segment is line segment A, the first reference line segment is line segment B, and the dot product of line segment A and line segment B is greater than 0, then the angle attribute between line segment A and line segment B is a negative angle; Figure 3 In the outer contour of the tabletop 301 to be processed, it is assumed that the current line segment is line segment A, the first reference line segment is line segment B, the dot product of line segment A and line segment B is less than 0, and the angle attribute between line segment A and line segment B is a positive angle.
[0080] By adopting the above solution, the angle between the current line segment and the first reference line segment is determined based on the dot product of the normal vector of the current line segment and the direction vector of the first reference line segment. In this way, the angle between the current line segment and the first reference line segment can be obtained more accurately, thereby improving the accuracy of adjusting the outer contour of the table top.
[0081] In some optional examples, the method for determining the angle between the current line segment and the first reference line segment may also include: calculating the angle between the current line segment and the first reference line segment in the external direction of the outer contour of the current table top to be processed; when the angle between the current line segment and the first reference line segment in the external direction of the outer contour of the current table top to be processed is less than an angle threshold, determining that the angle between the current line segment and the first reference line segment is a concave angle; and when the angle between the current line segment and the first reference line segment in the external direction of the outer contour of the current table top to be processed is greater than the angle threshold, determining that the angle between the current line segment and the first reference line segment is a yang angle.
[0082] The angle threshold can be configured according to actual conditions. Preferably, the angle threshold can be 180 degrees.
[0083] When the first reference line segment is a curve, calculating the angle between the current line segment and the first reference line segment in the outer direction of the outer contour of the current table top to be processed includes: calculating the angle between the current line segment and a line connecting the starting point and the end point of the first reference line segment in the outer direction of the current table top to be processed.
[0084] Combination Figure 2 and Figure 3 The inner and outer angles in this example are explained as follows: Figure 2 In the outer contour of the tabletop 201 to be processed, it is assumed that the current line segment is line segment A, the first reference line segment is line segment B, and the angle β between line segment A and line segment B in the outer direction of the outer contour of the current tabletop to be processed is less than 180 degrees, then the angle attribute between line segment A and line segment B is a negative angle; Figure 3 In the outer contour of the table top 301 to be processed, it is assumed that the current line segment is line segment A and the first reference line segment is line segment B. The angle β between line segment A and line segment B in the outer direction of the outer contour of the current table top to be processed is greater than 180 degrees, and the angle attribute between line segment A and line segment B is a positive angle.
[0085] In some optional examples, when the current line segment is a straight line, the first reference line segment is a curve, and the angle between the current line segment and the first reference line segment in the external direction of the outer contour of the current table top to be processed is equal to an angle threshold, the current line segment may not be subsequently processed, and the execution may be returned to continue sorting based on the multiple line segments to be processed, and a new current line segment may be determined from the multiple line segments to be processed.
[0086] In some embodiments, the first target line segment and the second target line segment are processed to obtain an adjusted outer contour of the current table top to be processed, including: based on the first target line segment, determining a first line segment to be adjusted from the multiple line segments to be processed, wherein the first line segment to be adjusted is adjacent to the first target line segment and is located before the first target line segment; based on the second target line segment, determining a second line segment to be adjusted from the multiple line segments to be processed, wherein the second line segment to be adjusted is adjacent to the second target line segment and is located after the second target line segment; deleting the first target line segment and the second target line segment, extending and connecting the first line segment to be adjusted and the second line segment to be adjusted to obtain an adjusted outer contour of the current table top.
[0087] Determining the first line segment to be adjusted from the multiple line segments to be processed based on the first target line segment may include: determining a line segment to be processed that is adjacent to the first target line segment and ranked before the first target line segment from the multiple line segments to be processed as the first line segment to be adjusted.
[0088] The method of determining from the multiple line segments to be processed a line segment to be processed that is adjacent to the first target line segment and ranked before the first target line segment as the first line segment to be adjusted may include: determining from the multiple line segments to be processed two line segments to be processed that are adjacent to the first target line segment; when the first target line segment is ranked first among the multiple line segments to be processed, selecting the line segment to be processed that is ranked last among the multiple line segments to be processed from the two line segments to be processed that are adjacent to the first target line segment as the first line segment to be adjusted; when the first target line segment is not ranked first among the multiple line segments to be processed, selecting the line segment to be processed that is ranked before the first target line segment from the two line segments to be processed that are adjacent to the first target line segment as the first line segment to be adjusted. Figure 2 For example, if there are multiple line segments to be processed, i.e., line segments A to F, of the outer contour of the tabletop 201 to be processed, the order of the line segments A to F is line segment A in order 1, line segment B in order 2, line segment C in order 3, line segment D in order 4, line segment E in order 5, and line segment F in order 6, when the first target line segment is line segment A, the line segment F ranked last is selected from the line segment F and line segment B adjacent to the position of line segment A as the first line segment to be adjusted. For another example: when the first target line segment is line segment E, the line segment D ranked before line segment E is selected from the line segment D and line segment F adjacent to the position of line segment E as the first line segment to be adjusted.
[0089] Determining the second line segment to be adjusted from the multiple line segments to be processed based on the second target line segment may include: determining a line segment to be processed that is adjacent to the second target line segment and ranked after the second target line segment from the multiple line segments to be processed as the second line segment to be adjusted.
[0090] The step of determining the line segment to be processed that is adjacent to the second target line segment and ranked after the second target line segment from the multiple line segments to be processed as the second line segment to be adjusted may include: determining two line segments to be processed that are adjacent to the second target line segment from the multiple line segments to be processed; when the second target line segment is ranked last among the multiple line segments to be processed, selecting the line segment to be processed that is ranked first among the multiple line segments to be processed from the two line segments to be processed that are adjacent to the second target line segment as the second line segment to be adjusted; when the second target line segment is not ranked last among the multiple line segments to be processed, selecting the line segment to be processed that is ranked after the second target line segment from the two line segments to be processed that are adjacent to the second target line segment as the second line segment to be adjusted. Still combined Figure 2For example, when the second target line segment is line segment F, the second line segment to be adjusted is line segment A that is adjacent to the line segment F and ranked first among the multiple line segments to be processed (line segments A to F). For another example: when the second target line segment is line segment E, from line segment D and line segment F that are adjacent to line segment E, line segment F ranked after line segment E is selected as the second line segment to be adjusted.
[0091] The deleting of the first target line segment and the second target line segment, extending and connecting the first line segment to be adjusted and the second line segment to be adjusted, and obtaining the outer contour of the current table top after adjustment may be: deleting the first target line segment and the second target line segment; extending the first line segment to be adjusted in a first direction, and extending and connecting the second line segment to be adjusted in a second direction, wherein the first direction is the direction in which the second line segment to be adjusted is located, and the second direction is the direction in which the first line segment to be adjusted is located; and obtaining the outer contour of the current table top to be processed after adjustment.
[0092] Combination Figures 2 to 5 For example, Figure 2 As shown in the figure: line segment A is the first target line segment, line segment B is the second target line segment, line segment F is the first line segment to be adjusted, and line segment C is the second line segment to be adjusted. Line segment F is extended in the direction of line segment C, and line segment C is extended in the direction of line segment F and connected. Line segment A and line segment B are deleted, and the following is obtained: Figure 4 The outer contour 401 of the current table after adjustment is shown. Figure 3 As shown in the figure: line segment B is the first target line segment, line segment C is the second target line segment, line segment A is the first line segment to be adjusted, and line segment D is the second line segment to be adjusted. Line segment A is extended in the direction where line segment D is located, and line segment D is extended in the direction where line segment A is located and connected, and line segment B and line segment C are deleted, and the following is obtained: Figure 5 The adjusted outer contour 501 of the current table top is shown.
[0093] Furthermore, after obtaining the outer contour of the adjusted current table, the method further includes: determining a plurality of to-be-processed line segments constituting the outer contour of the adjusted current table; determining the current line segment from the plurality of to-be-processed line segments based on the sorting of the plurality of to-be-processed line segments constituting the outer contour of the adjusted current table, and so on. Here, how to specifically determine the plurality of to-be-processed line segments constituting the outer contour of the adjusted current table, how to specifically sort them, how to determine the current line segment, and related processing after determining the current line segment are the same as those in the above embodiment, and therefore will not be described repeatedly.
[0094] By adopting the above scheme, based on the first target line segment, a first line segment to be adjusted is determined from the multiple line segments to be processed, based on the second target line segment, a second line segment to be adjusted is determined from the multiple line segments to be processed, the first target line segment and the second target line segment are deleted, the first line segment to be adjusted and the second line segment to be adjusted are extended and connected, and the outer contour of the current table to be processed after adjustment is obtained. In this way, it is possible to avoid adjusting the outer contour of the table by manual processing, thereby improving the efficiency and accuracy of adjusting the outer contour of the table.
[0095] In addition, the method may also include: when the current line segment and the second reference line segment are not parallel, or when the current line segment and the second reference line segment are parallel and the relative distance is not less than a distance threshold, based on the sorting of multiple line segments to be processed, determining a new current line segment from the multiple line segments to be processed.
[0096] Among them, the method of determining a new current line segment from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed is the same as the method of determining the current line segment from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed that constitute the outer contour of the current table top to be processed, and will not be repeated here.
[0097] In this embodiment, after determining a new current line segment from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed, the process continues to determine whether the current line segment is the last one in the sorting of the multiple line segments to be processed, and the subsequent processing is the same as that in the aforementioned embodiment and will not be elaborated on.
[0098] By adopting the above scheme, when the current line segment and the second reference line segment are not parallel, or the current line segment and the second reference line segment are parallel and the relative distance is not less than the distance threshold, it means that the current line segment does not have the first target line segment and the second target line segment to be processed. In this case, based on the sorting of the multiple line segments to be processed, a new current line segment is determined from the multiple line segments to be processed. In this way, the processing of the current line segment can be skipped, thereby improving the efficiency of adjusting the outer contour of the table top.
[0099] Combination Figure 6 This embodiment is exemplarily described, including:
[0100] S601 : Based on the order of a plurality of line segments to be processed that constitute the outer contour of the current tabletop to be processed, determine a current line segment from the plurality of line segments to be processed.
[0101] The ordering method of the multiple to-be-processed line segments constituting the outer contour of the current tabletop may include: taking any one of the multiple to-be-processed line segments constituting the adjusted outer contour of the current tabletop as the starting line segment, and ordering the remaining to-be-processed line segments in sequence from the starting line segment based on a specified direction.
[0102] S602: Determine whether the current line segment is the last one in the order of the multiple line segments to be processed.
[0103] If the current line segment is not the last one in the order of the multiple line segments to be processed, executing step S603;
[0104] When the current line segment is ranked last among the multiple line segments to be processed, the outer contour of the current table surface to be processed formed by the multiple line segments to be processed is used as the outer contour of the target table surface, and the process ends.
[0105] S603: Determine whether the current line segment is a straight line or a curve.
[0106] When the current line segment is a straight line, execute step 604;
[0107] In the case where the current line segment is a curve, based on the sorting of the plurality of line segments to be processed, a new current line segment is determined from the plurality of line segments to be processed, and the process returns to step 602. In this example, based on the sorting of the plurality of line segments to be processed, the new current line segment is determined from the plurality of line segments to be processed, which may be: one or more untraversed line segments to be processed among the plurality of line segments to be processed are continuously traversed, based on the sorting of the plurality of line segments to be processed, the next line segment to be processed that is located after the sorting of the current line segment is searched from the one or more untraversed line segments to be processed, and the next line segment to be processed is used as the new current line segment. The following description will not be repeated.
[0108] S604: Determine a first reference line segment and a second reference line segment of the current line segment.
[0109] S605: Determine whether the current line segment is parallel to the second reference line segment.
[0110] When the current line segment is parallel to the second reference line segment, executing step 606;
[0111] In the case that the current line segment and the second reference line segment are not parallel, a new current line segment is determined from the multiple line segments to be processed based on the order of the multiple line segments to be processed, and the process returns to step 602 .
[0112] S606: Determine whether the relative distance between the current line segment and the second reference line segment is less than a distance threshold.
[0113] When the relative distance between the current line segment and the second reference line segment is less than the distance threshold, executing step S607;
[0114] When the relative distance between the current line segment and the second reference line segment is not less than the distance threshold, a new current line segment is determined from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed, and the process returns to step 602 .
[0115] S607: Determine a first target line segment and a second target line segment among the current line segment, the first reference line segment, and the second reference line segment.
[0116] Specifically, when the angle between the current line segment and the first reference line segment is a yang angle, the first reference line segment is determined to be the first target line segment and the second reference line segment is determined to be the second target line segment; when the angle between the current line segment and the first reference line segment is a yin angle, the current line segment is determined to be the first target line segment and the first reference line segment is determined to be the second target line segment.
[0117] S608, processing the first target line segment and the second target line segment to obtain the outer contour of the current table after adjustment, taking the outer contour of the current table as the outer contour of the current table to be processed, and continuing to execute S601 until the outer contour of the target table is obtained.
[0118] Combination Figures 7 to 9 , another exemplary description of the above embodiment is given, such as Figure 7 As shown:
[0119] S701, the user initiates a tabletop request for generating a combined model, that is, a request for generating an initial tabletop sent by the user is received.
[0120] S702, extracting the outer contour of each three-dimensional model in the combined model.
[0121] A combined model is generated according to the models of multiple target objects selected by the user in the design tool, and the outer contour of the model of each target object is obtained (i.e., multiple outer contours of the models corresponding to the multiple target objects are obtained) by extracting the boundary line or surface of each model in the models of the multiple target objects (i.e., extracting the models corresponding to the multiple target objects from the request for generating the initial table surface).
[0122] S703, generating an initial outer contour of the tabletop of the combined model.
[0123] The outer contours of multiple models are combined together, and the line segments of the model contact surfaces are deleted (i.e., the line segments corresponding to the overlapping parts of the multiple outer contours are deleted), leaving only the contour line segments of the final non-contact surfaces (i.e., obtaining multiple outer contour line segments of the non-overlapping parts of the multiple outer contours), and the line segments of the model non-contact surfaces are connected (i.e., the multiple outer contour line segments are connected at the intersection), and the line segments of the non-contact surfaces are used to represent the outer contour of the final table top (i.e., the initial outer contour of the table top).
[0124] S704, determining whether the initial outer contour of the table top is a closed contour.
[0125] When the initial outer contour of the table top is a closed contour, execute step S705;
[0126] When the initial outer contour of the table top is not a closed contour, the initial outer contour adjustment of the table top fails and the process ends.
[0127] S705, based on the order of the multiple to-be-processed line segments constituting the outer contour of the current to-be-processed table, determine the current line segment from the multiple to-be-processed line segments. In the case of the first execution of step S705, the current to-be-processed table outer contour is the initial table outer contour.
[0128] The determination and sorting method of the multiple line segments to be processed that constitute the outer contour of the current tabletop to be processed is the same as that in the above embodiment, and will not be described in detail here.
[0129] S706: Determine whether the current line segment is the last one in the order of multiple line segments to be processed.
[0130] When the current line segment is the last one in the sequence of the multiple line segments to be processed, the process is terminated, and the outer contour of the current table top is used as the outer contour of the target table top;
[0131] If the current line segment is not the last one in the order of the multiple line segments to be processed, step S707 is executed.
[0132] S707, determining whether the current line segment is a straight line or a curve.
[0133] When the current line segment is a straight line, execute step S708;
[0134] When the current line segment is a curve, based on the order of the multiple line segments to be processed, a new current line segment is determined from the multiple line segments to be processed, and the process returns to continue executing step S706.
[0135] S708: Determine a first reference line segment and a second reference line segment of the current line segment.
[0136] S709: Determine whether the current line segment is parallel to the second reference line segment.
[0137] When the current line segment is parallel to the second reference line segment, executing step S710;
[0138] When the current line segment is not parallel to the second reference line segment, a new current line segment is determined from the plurality of line segments to be processed based on the order of the plurality of line segments to be processed, and the process returns to continue executing step S706.
[0139] S710: Determine whether the current line segment and the second reference line segment are within a tolerance range, that is, determine whether the relative distance between the current line segment and the second reference line segment is less than a distance threshold.
[0140] When the relative distance between the current line segment and the second reference line segment is less than a distance threshold, executing step S711;
[0141] When the relative distance between the current line segment and the second reference line segment is greater than or equal to the distance threshold, a new current line segment is determined from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed, and the process returns to continue executing step S706.
[0142] S711: Calculate the dot product of the current line segment and the first reference line segment based on the normal vector of the current line segment and the direction vector of the first reference line segment.
[0143] S712: Determine whether a dot product of the normal vector of the current line segment and the direction vector of the first reference line segment is greater than or less than a dot product threshold.
[0144] When the dot product of the current line segment and the first reference line segment is greater than a dot product threshold of 0, executing step S713;
[0145] When the dot product of the current line segment and the first reference line segment is less than the dot product threshold of 0, step S714 is executed.
[0146] S713, determine that the angle attribute between the current line segment and the first reference line segment is a concave angle, use the current line segment as the first target line segment, and use the first reference line segment as the second target line segment; based on the first target line segment, determine a first line segment to be adjusted from the multiple line segments to be processed, and based on the second target line segment, determine a second line segment to be adjusted from the multiple line segments to be processed.
[0147] S714, determine that the angle attribute between the current line segment and the first reference line segment is a positive angle, use the first reference line segment as the first target line segment, and use the second reference line segment as the second target line segment; based on the first target line segment, determine the first line segment to be adjusted from the multiple line segments to be processed, and based on the second target line segment, determine the second line segment to be adjusted from the multiple line segments to be processed.
[0148] S715, obtaining the outer contour of the current table after adjustment, that is, ending the current merging, taking the outer contour of the current table after adjustment as the outer contour of the current table to be processed, and returning to continue to execute step S705 until the target table is obtained.
[0149] In this embodiment, first determine whether the initial outer contour of the table is a closed contour, and only process the closed contour. Then, traverse the entire contour starting from the first line segment of the closed contour, determine whether the current line segment (the first line segment) and the second reference line segment (the third line segment) are parallel, and calculate whether their distance is within a preset tolerance. The line segments that meet the above two points meet the merging requirements. Then calculate the dot product of the normal vector of the first line segment and the unit vector (i.e., the direction vector) of the second line segment to determine whether the angle is a positive angle or a negative angle, and determine whether the line segment to be moved is the first or the third line segment. If it is a negative angle, move the first line segment, find the intersection of the line segment before it and the third line segment and connect them (i.e., extend and connect the first line segment to be adjusted and the second line segment to be adjusted), and delete the first and second line segments at the same time. If it is a positive angle, move the third line segment, find the intersection of the first and fourth line segments and connect them (i.e., extend and connect the first line segment to be adjusted and the second line segment to be adjusted), and delete the second line segment (i.e., the first reference line segment) and the third line segment at the same time. Repeat the above steps until the last line segment in the contour is traversed.
[0150] By adopting the above scheme, we first calculate whether the distance between parallel line segments meets the tolerance to determine whether to merge the line segments, and then accurately determine the line segments that need to be moved by calculating the dot product of the normal vector of the line segment and the unit vector, ensuring that the generated closed contour meets the actual manufacturing needs. Since the Yin-Yang angle between the line segments is calculated based on the geometric shape and relative position, this method is applicable to contours of various shapes. It can adapt to the differences between models of different sizes, shapes and layouts, and provides a universal solution to the line merging problem in different scenarios. By using the calculation and comparison of the Yin-Yang angle, the line merging process can be automated. Without human intervention, the system can automatically identify and move qualified line segments according to the preset tolerance range. This automated processing flow improves efficiency and reduces the possibility of human error.
[0151] Figure 8 FIG. 1 is a schematic block diagram of a device for adjusting the outer contour of a table provided by an embodiment of the present disclosure. Figure 8 As shown, including:
[0152] A current line segment determination module 801 is used to determine a current line segment from a plurality of line segments to be processed based on the order of the plurality of line segments to be processed that constitute the outer contour of the current table surface to be processed;
[0153] A reference line segment determination module 802 is used to determine a first reference line segment and a second reference line segment of the current line segment when the current line segment is a straight line and is not the last one in the plurality of line segments to be processed, wherein the first reference line segment is adjacent to the current line segment and is located after the current line segment, and the second reference line segment is adjacent to the first reference line segment and is located after the first reference line segment;
[0154] A target line segment determination module 803 is used to determine a first target line segment and a second target line segment from among the current line segment, the first reference line segment and the second reference line segment when the current line segment and the second reference line segment are parallel and the relative distance is less than a distance threshold;
[0155] The outer contour adjustment module 804 is used to process the first target line segment and the second target line segment to obtain an adjusted outer contour of the current table top.
[0156] The target line segment determination module is used to perform one of the following:
[0157] When the angle between the current line segment and the first reference line segment is a positive angle, determining the first reference line segment as the first target line segment and the second reference line segment as the second target line segment;
[0158] When the included angle between the current line segment and the first reference line segment is a negative angle, the current line segment is determined to be the first target line segment and the first reference line segment is determined to be the second target line segment.
[0159] like Fig. 9 As shown, the device also includes:
[0160] The angle determination module 901 is used to calculate the dot product of the current line segment and the first reference line segment based on the normal vector of the current line segment and the direction vector of the first reference line segment; and determine the angle between the current line segment and the first reference line segment based on the dot product of the current line segment and the first reference line segment.
[0161] The outer contour adjustment module is used to determine a first line segment to be adjusted from the multiple line segments to be processed based on the first target line segment, wherein the first line segment to be adjusted is adjacent to the first target line segment and is located before the first target line segment; determine a second line segment to be adjusted from the multiple line segments to be processed based on the second target line segment, wherein the second line segment to be adjusted is adjacent to the second target line segment and is located after the second target line segment; delete the first target line segment and the second target line segment, extend and connect the first line segment to be adjusted and the second line segment to be adjusted to obtain the adjusted outer contour of the current table top to be processed.
[0162] The current line segment determination module is used to determine a new current line segment from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed when the current line segment and the second reference line segment are not parallel, or when the current line segment and the second reference line segment are parallel and the relative distance is not less than the distance threshold.
[0163] The current line segment determination module is used to determine a new current line segment from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed when the current line segment is a curve and is not the last one in the multiple line segments to be processed.
[0164] like Fig.10 As shown, the device also includes:
[0165] The target surface generation module 1001 is configured to use the outer contour of the current surface to be processed as the outer contour of the target surface when the current line segment is the last one in the plurality of line segments to be processed.
[0166] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0167] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0168] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0169] Fig.11 A schematic block diagram of an example electronic device 1100 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0170] like Fig.11As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0171] A number of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0172] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above. For example, in some embodiments, the above method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by the computing unit 1101, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).
[0173] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0174] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0175] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0176] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0177] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0178] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0179] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0180] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for adjusting the outer contour of a table, comprising: Based on the order of a plurality of line segments to be processed that constitute the outer contour of the current tabletop to be processed, determine a current line segment from the plurality of line segments to be processed; When the current line segment is a straight line and is not the last one in the order of the multiple line segments to be processed, determine a first reference line segment and a second reference line segment of the current line segment, wherein the first reference line segment is adjacent to the current line segment and is located after the current line segment, and the second reference line segment is adjacent to the first reference line segment and is located after the first reference line segment; In a case where the current line segment and the second reference line segment are parallel and the relative distance is less than a distance threshold, determining a first target line segment and a second target line segment among the current line segment, the first reference line segment and the second reference line segment; Processing the first target line segment and the second target line segment to obtain an adjusted outer contour of the current table top; Wherein, determining the first target line segment and the second target line segment among the current line segment, the first reference line segment and the second reference line segment comprises one of the following: when the angle between the current line segment and the first reference line segment is a positive angle, determining the first reference line segment as the first target line segment and the second reference line segment as the second target line segment; when the angle between the current line segment and the first reference line segment is a negative angle, determining the current line segment as the first target line segment and the first reference line segment as the second target line segment; The processing of the first target line segment and the second target line segment to obtain the outer contour of the adjusted current table top includes: determining a first line segment to be adjusted from the multiple line segments to be processed based on the first target line segment, wherein the first line segment to be adjusted is adjacent to the first target line segment and is located before the first target line segment; determining a second line segment to be adjusted from the multiple line segments to be processed based on the second target line segment, wherein the second line segment to be adjusted is adjacent to the second target line segment and is located after the second target line segment; deleting the first target line segment and the second target line segment, extending and connecting the first line segment to be adjusted and the second line segment to be adjusted to obtain the outer contour of the adjusted current table top to be processed.
2. The method according to claim 1, wherein: The method further comprises: Calculate the dot product of the current line segment and the first reference line segment based on the normal vector of the current line segment and the direction vector of the first reference line segment; Based on a dot product of the current line segment and the first reference line segment, an angle between the current line segment and the first reference line segment is determined.
3. The method according to claim 1, wherein: The method further comprises: When the current line segment and the second reference line segment are not parallel, or when the current line segment and the second reference line segment are parallel and the relative distance between them is not less than the distance threshold, a new current line segment is determined from the multiple line segments to be processed based on the sorting of the multiple line segments to be processed.
4. The method according to claim 1, wherein: The method further comprises: When the current line segment is a curve and is not the last one in the order of the multiple line segments to be processed, a new current line segment is determined from the multiple line segments to be processed based on the order of the multiple line segments to be processed.
5. The method according to claim 1, wherein: The method further comprises: When the current line segment is ranked last among the multiple line segments to be processed, the outer contour of the current tabletop to be processed is used as the outer contour of the target tabletop.
6. A device for adjusting the outer contour of a table, comprising: A current line segment determination module, configured to determine a current line segment from a plurality of line segments to be processed based on the order of the plurality of line segments to be processed that constitute the outer contour of the current tabletop to be processed; A reference line segment determination module, configured to determine, when the current line segment is a straight line and is not the last one in the order of the multiple line segments to be processed, a first reference line segment and a second reference line segment of the current line segment, wherein the first reference line segment is adjacent to the current line segment and is located after the current line segment, and the second reference line segment is adjacent to the first reference line segment and is located after the first reference line segment; a target line segment determination module, configured to determine a first target line segment and a second target line segment from among the current line segment, the first reference line segment and the second reference line segment, when the current line segment and the second reference line segment are parallel and a relative distance is less than a distance threshold; An outer contour adjustment module, used for processing the first target line segment and the second target line segment to obtain an adjusted outer contour of the current table top; The reference line segment determination module is used to perform one of the following: when the angle between the current line segment and the first reference line segment is a positive angle, determine the first reference line segment as the first target line segment and the second reference line segment as the second target line segment; when the angle between the current line segment and the first reference line segment is a negative angle, determine the current line segment as the first target line segment and the first reference line segment as the second target line segment; The outer contour adjustment module is used to determine a first line segment to be adjusted from the multiple line segments to be processed based on the first target line segment, wherein the first line segment to be adjusted is adjacent to the first target line segment and is located before the first target line segment; determine a second line segment to be adjusted from the multiple line segments to be processed based on the second target line segment, wherein the second line segment to be adjusted is adjacent to the second target line segment and is located after the second target line segment; delete the first target line segment and the second target line segment, extend and connect the first line segment to be adjusted and the second line segment to be adjusted to obtain the adjusted outer contour of the current table top to be processed.
7. The device according to claim 6, wherein: The device also includes: The target table top generating module is used to use the outer contour of the current table top to be processed as the outer contour of the target table top when the current line segment is ranked last among the multiple line segments to be processed.
8. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
9. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
Citation Information
Patent Citations
Drawing method and device for adjusting depicted contour and medium
CN114693838A
Method and device for determining lane contour line and electronic equipment
CN116092028A
