Arc-shaped window interaction method and device and electronic equipment
By providing interactive methods of curved windows in architectural design and interior decoration software, the flexibility and accuracy problems in arc structure design are solved, and the effective matching between arc windows and arc walls is achieved and the design efficiency is improved.
Patent Information
- Application Number
- CN202411747639.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing architectural design and interior decoration software lacks flexible creation and editing support when dealing with curved structures, the relationship between curved windows and curved walls is difficult to establish, the movement and shape adjustment are not intuitive and precise enough, and there is a lack of intelligent processing mechanism for special situations.
A curved window interaction method is provided. By identifying a target curved wall that meets the adsorption conditions with the target curved window, adsorbs the curved window to the wall, controls the movement of the curved window on the wall in response to the mobile interaction input, and adjusts the shape of the curved window in response to the end point update input.
It achieves reasonable matching between curved windows and curved walls, improves design efficiency and accuracy, provides an intuitive interaction method, and makes complex curved structure design simple and easy to use.
Smart Images

Figure CN119691857A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of decoration design technology, and in particular to a curved window interaction method, device and electronic equipment. Background Art
[0002] Existing architectural design and interior decoration software usually provide the drawing and editing functions of straight walls and rectangular windows. However, these software often have the following defects when dealing with curved structures:
[0003] 1. Lack of flexible creation and editing support for curved windows and curved walls; 2. It is not easy to establish the association between curved windows and curved walls; 3. The movement and shape adjustment of curved windows are usually not intuitive and accurate enough; 4. It is difficult to ensure the association between curved windows and curved walls during the editing process of curved windows; 5. Lack of intelligent processing mechanism for special cases (such as large curved walls).
[0004] The above defects seriously affect the creativity and work efficiency of architects when dealing with complex curved structures, and will affect the design effect of houses. Therefore, the interactive design of curved windows has become a problem to be solved in house design scenarios. Summary of the invention
[0005] In view of the above problems, embodiments of the present application provide a curved window interaction method, device, and electronic device that overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, an embodiment of the present application provides an arc window interaction method, comprising:
[0007] In response to a drag input to a target curved window, a target curved wall satisfying an adsorption condition between the target curved window and the target curved window is identified, and the target curved window is adsorbed to the target curved wall;
[0008] When receiving a movement interaction input to the target curved window, in response to the movement interaction input, control the target curved window to move on the target curved wall to update the position of the target curved window;
[0009] When an update input for a first endpoint of the target curved window is received, the position of the first endpoint on the target curved wall is adjusted in response to the update input to update the shape of the target curved window.
[0010] In a second aspect, an embodiment of the present application provides a curved window interaction device, including:
[0011] an identification and adsorption module, for, in response to a drag input to a target curved window, identifying a target curved wall between the target curved window and the target curved window that satisfies an adsorption condition, and adsorbing the target curved window to the target curved wall;
[0012] A control module, configured to, upon receiving a movement interaction input for the target curved window, control the target curved window to move on the target curved wall in response to the movement interaction input, so as to update the position of the target curved window;
[0013] The adjustment module is used for, upon receiving an update input for the first endpoint of the target curved window, adjusting the position of the first endpoint on the target curved wall in response to the update input to update the shape of the target curved window.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the arc window interaction method described in the first aspect above.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the arc window interaction method described in the first aspect above are implemented.
[0016] The technical solution of the embodiment of the present application, in response to the drag input of the target curved window, identifies the target curved wall that meets the adsorption conditions between the target curved window and the target curved window, and adsorbs the target curved window to the target curved wall, so that the shape of the window can be adapted to the wall, thereby achieving a reasonable match between the target curved window and the target curved wall, and greatly improving the design efficiency; based on the mobile interactive input of the target curved window, the target curved window is controlled to move on the target curved wall, and based on the update input of the first endpoint of the target curved window, the shape of the target curved window is updated, thereby ensuring that the target curved window is always attached to the target curved wall during the movement and deformation process, thereby improving the design accuracy, and the intuitive interaction method makes the complex curved structure design simple and easy to use.
[0017] Furthermore, the highly flexible, precise and easy-to-use arc structure design provided by the embodiments of the present application provides new possibilities for architectural and interior design scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic diagram showing an arc window interaction method provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram showing parameters of a curved window provided in an embodiment of the present application;
[0020] Figure 3A Schematic diagram showing the relative position relationship between the target curved window and the curved wall provided in the embodiment of the present application Figure 1 ;
[0021] Figure 3B Schematic diagram showing the relative position relationship between the target curved window and the curved wall provided in the embodiment of the present application Figure 2 ;
[0022] Figure 4A Schematic diagram showing the calculation of the endpoint coordinates of the small arc window provided in the embodiment of the present application Figure 1 ;
[0023] Figure 4B Schematic diagram showing the calculation of the endpoint coordinates of the small arc window provided in the embodiment of the present application Figure 2 ;
[0024] Figure 5A Schematic diagram showing the calculation of the endpoint coordinates of the large arc window provided in the embodiment of the present application Figure 1 ;
[0025] Figure 5B Schematic diagram showing the calculation of the endpoint coordinates of the large arc window provided in the embodiment of the present application Figure 2 ;
[0026] Figure 6 A schematic diagram showing the calculation of contour points based on unit vectors provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram showing the adjustment of the target curved window position provided in an embodiment of the present application;
[0028] Figure 8 A schematic diagram showing the arc window covering the arc wall gap and adjusting the arc window type provided in the embodiment of the present application;
[0029] Fig. 9 A schematic diagram showing whether an endpoint is on an arc based on a vector provided in an embodiment of the present application;
[0030] Fig.10 A schematic diagram showing the updated target curved window form provided in an embodiment of the present application;
[0031] Fig.11 A schematic diagram showing a curved window interaction device provided in an embodiment of the present application;
[0032] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0034] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. The multiple in the embodiments of the present application can include two and more than two.
[0035] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0036] The present application embodiment provides a curved window interaction method, such as Figure 1 As shown, including:
[0037] Step 101 : In response to a drag input to a target curved window, a target curved wall satisfying an adsorption condition between the target curved window and the target curved window is identified, and the target curved window is adsorbed to the target curved wall.
[0038] The arc window provided in the embodiment of the present application includes the following parameters: arc center point (indicating the specific position of the arc window, specifically the center point of the middle arc), starting point (start, indicating the starting position of the arc window), end point (end, indicating the ending position of the arc window), chord length (chord, indicating the straight-line distance from start to end), radius (radius, indicating the radius of the circle where the arc window is located, which is also the radius of the arc window), category of the arc window (large arc or small arc), clockwise and counterclockwise direction of the arc window (determined based on the arc direction from the starting point to the end point). Among them, by comparing the distance from the arc center point to the chord length and the size of the arc window radius, it is determined whether the arc window belongs to a large arc or a small arc. If the distance from the arc center point to the chord length is greater than the arc window radius, it indicates that it belongs to a large arc. If the distance from the arc center point to the chord length is less than or equal to the arc window radius, it indicates that it belongs to a small arc. Usually, isSmall can be used to distinguish whether the arc window is a large arc or a small arc. isSmall is true for a small arc, and isSmall is false for a large arc. Counterclockwise is used to indicate the clockwise or counterclockwise direction of the curved window. Specifically, if Counterclockwise is true, it indicates counterclockwise, and if Counterclockwise is false, it indicates clockwise. Figure 2 In the arc window shown, the distance from the arc center point to the chord length is less than the radius of the arc window. The arc window is a small arc, and the direction of the arc from the starting point to the end point is clockwise, indicating that the arc window is in a clockwise direction.
[0039] After clicking the arc window creation button, a target arc window is drawn on the canvas. The position of the mouse is the position of the arc center point, which also represents the position of the target arc window. The target arc window updates its position information while moving on the canvas based on the dragging of the mouse. If a target arc wall with a similar distance to the target arc window is identified, it is adsorbed. That is, when a target arc wall with a distance from the target arc window that meets the adsorption conditions is identified on the canvas, the target arc window is adsorbed to the target arc wall. After the target arc window is adsorbed to the target arc wall, the shape of the window can be adapted to the wall, achieving a reasonable match between the arc window and the arc wall, greatly improving the design efficiency.
[0040] Step 102: When receiving a movement interaction input for a target curved window, in response to the movement interaction input, control the target curved window to move on the target curved wall to update the position of the target curved window.
[0041] After the target arc window is adsorbed to the target arc wall, the target arc window can be received for interactive input of movement, such as, after selecting the target arc window, dragging the target arc window to move, and the dragging point is the arc center point. In order to ensure that the target arc window is always on the target arc wall, the drag point can be adsorbed at a large distance, that is, the adsorption threshold is enlarged, so that even if the mouse is not on the target arc window (for example, there is a certain distance from the target arc window), the target arc window can remain adsorbed on the target arc wall, and the target arc window can be dragged based on the mouse action.
[0042] In response to mobile interactive input, the target curved window is controlled to move on the target curved wall, so as to adjust the position of the target curved window on the target curved wall while maintaining the shape of the target curved window, update the position of the target curved window, and ensure that the target curved window always fits the target curved wall during the movement, thereby improving the design accuracy.
[0043] Step 103: When an update input for the first endpoint of the target curved window is received, in response to the update input, the position of the first endpoint on the target curved wall is adjusted to update the shape of the target curved window.
[0044] After the target curved window is adsorbed to the target curved wall, an update input of the first endpoint of the target curved window can be received, and the first endpoint is the starting point or the end point of the target curved window. The update input of the first endpoint can be understood as a drag input of dragging the first endpoint. During the dragging process of the first endpoint, the target curved window always remains on the target curved wall. Therefore, we also need to perform a large distance adsorption of the mouse position during dragging on the wall. In this way, even if the mouse position is not on the target curved window, the target curved window can remain adsorbed on the target curved wall, and the dragging of the target curved window endpoint is realized based on the mouse action.
[0045] In response to the update input of the first endpoint of the target curved window, the position of the first endpoint on the target curved wall is adjusted. Since the position of the first endpoint changes and the position of the second endpoint on the target curved wall remains unchanged, the target curved window is deformed at this time, so as to deform the target curved window based on the update input of the endpoint. For example, by changing the position of the first endpoint of the target curved window, the target curved window can be changed from a small arc to a large arc, or the target curved window can be changed from a large arc to a small arc. During the deformation process of the target curved window, it is always adsorbed on the target curved wall. By adjusting the position of the first endpoint of the target curved window on the target curved wall, the morphology of the target curved window adsorbed on the target curved wall is updated, so that the target curved window can always fit the target curved wall during the deformation process, thereby improving the design accuracy.
[0046] The above-mentioned implementation scheme of the present application responds to the drag input of the target curved window, identifies the target curved wall that meets the adsorption conditions between the target curved window, and adsorbs the target curved window to the target curved wall, so that the shape of the window can be adapted to the wall, thereby achieving a reasonable match between the target curved window and the target curved wall, and greatly improving the design efficiency; based on the mobile interactive input of the target curved window, the target curved window is controlled to move on the target curved wall, and based on the update input of the first endpoint of the target curved window, the shape of the target curved window is updated, thereby ensuring that the target curved window is always attached to the target curved wall during the movement and deformation process, thereby improving the design accuracy, and the intuitive interaction method makes the complex curved structure design simple and easy to use.
[0047] Furthermore, the highly flexible, precise and easy-to-use arc structure design provided by the embodiments of the present application provides new possibilities for architectural and interior design scenarios.
[0048] The following describes the process of adsorbing the target curved window onto the target curved wall. In response to the drag input of the target curved window, the target curved wall that satisfies the adsorption condition between the target curved window and the target curved window is identified, and the target curved window is adsorbed onto the target curved wall, including:
[0049] In response to the drag input, updating the position information of the target arc window;
[0050] In the process of dragging the target arc window to update the position information, identifying whether there is an arc wall whose distance from the target arc window satisfies the adsorption condition;
[0051] When a target curved wall is identified in which the absolute value of the difference between the distance between the circle center and the arc center point of the target curved window minus the wall radius is less than the adsorption threshold, the arc center point position corresponding to the arc center point of the target curved window on the target curved wall is determined, and the circle information of the target curved window is updated;
[0052] Calculate the starting position and the end position of the target arc window on the target arc wall according to the arc center point position, the chord length corresponding to the target arc window, the circle information corresponding to the target arc window, and the arc category to which the target arc window belongs;
[0053] A target arc window is drawn on the target arc wall according to the starting point position and the end point position.
[0054] Based on the drag input of the target arc window on the canvas, the position information of the target arc window on the canvas is updated, and the shape of the target arc window remains unchanged in the process. In the process of dragging the target arc window on the canvas to update the position information, it is identified whether there is an arc wall whose distance from the target arc window meets the adsorption condition, and the arc wall whose absolute value of the difference between the distance between the identified center of the circle and the arc center point of the target arc window minus the wall radius is less than the adsorption threshold is determined as the target arc wall.
[0055] like Figure 3A As shown, the difference between the distance d between the center of the arc wall and the arc center point of the target arc window minus the wall radius R is positive. When the difference is less than the adsorption threshold, the arc wall is determined to be the target arc wall that has an adsorption relationship with the target arc window. Figure 3B As shown, the difference between the distance d between the center of the arc wall and the arc center point of the target arc window minus the wall radius R is negative. If the absolute value of the difference between the two is less than the adsorption threshold, the arc wall is determined to be the target arc wall that has an adsorption relationship with the target arc window.
[0056] After determining the target curved wall, determine the arc center point position corresponding to the arc center point of the target curved window on the target curved wall, and update the circle information of the target curved window, and update the circle information (radius, center) corresponding to the target curved window to the circle information of the target curved wall. The radius corresponding to the updated target curved window is the radius of the target curved wall to which it is attached, and the center of the circle corresponding to the updated target curved window is the center of the target curved wall to which it is attached.
[0057] When the arc center point position corresponding to the target arc window on the target arc wall, the circle information corresponding to the target arc window, and the arc category to which the target arc window belongs (is the target arc window a large arc or a small arc) are known, the starting point position and the end point position of the target arc window on the target arc wall are calculated according to the arc center point position, the chord length corresponding to the target arc window, the circle information corresponding to the target arc window, and the arc category to which the target arc window belongs, and then the target arc window is drawn on the target arc wall according to the starting point position and the end point position.
[0058] The chord length corresponding to the target arc window remains unchanged. When the start position and the end position are calculated based on the arc center point position, the chord length corresponding to the target arc window, and the circle information corresponding to the target arc window, different arc categories use different calculation methods. Therefore, it is necessary to consider the arc category to which the target arc window belongs.
[0059] In the above implementation scheme, in the process of dragging the target curved window on the canvas, the target curved wall whose distance to the target curved window satisfies the adsorption condition is identified, and the position information of the target curved window on the target curved wall is determined. Based on the determined position information and the chord length, circle information and arc category of the target curved window, the corresponding starting position and end position on the target curved wall are calculated, and the target curved window is drawn on the target curved wall according to the starting position and the end position. The target curved window can be adsorbed to the target curved wall so that the shape of the window is adapted to the wall, thereby achieving a reasonable match between the curved window and the curved wall, and greatly improving the design efficiency.
[0060] Among them, when determining the arc center point position corresponding to the target arc center point of the target arc window on the target arc wall, it includes: based on the connection line between the arc center point of the target arc window and the wall center of the target arc wall or the extension of the connection line, and the intersection with the target arc wall, determining the arc center point position corresponding to the target arc window on the target arc wall.
[0061] When determining the arc center point position corresponding to the arc center point of the target arc window on the target arc wall, such as Figure 3A As shown, based on the intersection of the arc center point of the target arc window and the center point of the target arc wall, the arc center point position corresponding to the target arc window on the target arc wall is determined. Figure 3A The intersection point 1 in is the center point of the arc.
[0062] When determining the arc center point position corresponding to the arc center point of the target arc window on the target arc wall, such as Figure 3B As shown, after connecting the arc center point of the target arc window with the wall center of the target arc wall, based on the intersection of the extended line of the connection and the target arc wall, the arc center point position corresponding to the target arc window on the target arc wall is determined. Figure 3B In the figure, the intersection point 2 determined based on the extension line (dashed line) is the arc center point position on the target arc wall.
[0063] During the above implementation process, based on the positional relationship between the target curved window and the target curved wall, a suitable method is used to determine the arc center point position corresponding to the target curved window on the target curved wall, so as to calculate the position information of the target curved window on the target curved wall based on the accurate projection point, thereby providing a positional basis for redrawing the target curved window on the target curved wall and ensuring that the curved window fits well on the curved wall.
[0064] Optionally, when calculating the starting position and the end position corresponding to the target arc window on the target arc wall according to the arc center point position, the chord length corresponding to the target arc window, the circle information corresponding to the target arc window, and the arc category to which the target arc window belongs, the method includes:
[0065] In response to the target arc window belonging to the first type of arc window, coordinate calculation is performed based on the first angle, the second angle and the center coordinates corresponding to the target arc window to determine the first coordinate position and the second coordinate position, the first angle being the angle between the line connecting the arc center point position and the center coordinates corresponding to the target arc window and the positive semi-axis of the X-axis, and the second angle being 1 / 2 of the center angle corresponding to the target arc window;
[0066] In response to the target arc window belonging to the second type of arc window, coordinate calculation is performed based on the third angle, the fourth angle and the center coordinates corresponding to the target arc window to determine the first coordinate position and the second coordinate position, the third angle is the angle between the line connecting the target position and the center coordinates and the positive semi-axis of the X-axis, the target position and the arc center point position are symmetrical about the center of the circle corresponding to the target arc window, and the fourth angle is 360 minus 1 / 2 of the difference of the center angle corresponding to the target arc window;
[0067] Determine the starting point and the end point according to the first coordinate position and the second coordinate position;
[0068] Among them, the arc window whose distance from the arc center point to the chord length is less than or equal to the radius corresponding to the target arc window belongs to the first type of arc window, and the arc window whose distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window belongs to the second type of arc window.
[0069] When calculating the starting and ending positions of the target curved window on the target curved wall, it is necessary to distinguish whether the target curved window belongs to the first type of curved window (the distance from the arc center point to the chord length is less than or equal to the radius corresponding to the target curved window) or the second type of curved window (the distance from the arc center point to the chord length is greater than the radius corresponding to the target curved window).
[0070] If the target curved window belongs to the first type of curved window, the first angle is determined based on the angle between the line connecting the determined arc center point position and the circle center coordinate corresponding to the target curved window and the positive half axis of the X axis, and the second angle is determined based on 1 / 2 of the circle center angle corresponding to the target curved window. Then, coordinate calculation is performed based on the first angle, the second angle and the circle center coordinate to determine the first coordinate position and the second coordinate position of the target curved window on the target curved wall.
[0071] Among them, the first angle (angle b) = Math.atan2(y-center.y, x-center.x), the second angle (angle a) = Math.asin(chord length / (2radius)) = center angle / 2, the angle range of the second angle is: greater than 0 degrees and less than or equal to 90 degrees, the coordinates corresponding to the center point of the arc are (x, y), and the coordinates corresponding to the center of the circle are (center.x, center.y).
[0072] The following is an example of how to determine the starting and ending positions when the target arc window belongs to the first type of arc window. Figure 4AAs shown, the target arc window is located in the fourth quadrant of the current coordinate system (the right side of the X-axis is the positive semi-axis, and the bottom of the Y-axis is the positive semi-axis). Angle a is 1 / 2 of the center angle and is a positive angle. Angle b is in the fourth quadrant and is a negative angle. Angle c is a negative angle in the fourth quadrant and angle c = angle b + angle a. Angle d is a negative angle in the fourth quadrant and angle d = angle b - angle a. The above four angles all take into account positive and negative values. Among them, cos (angle c) is greater than 0, sin (angle c) is less than 0, cos (angle d) is greater than 0, and sin (angle d) is less than 0. For the case where the target arc window is clockwise, the horizontal coordinate Ax corresponding to the starting point A is center.x + R*cos (angle b - angle a), and the corresponding vertical coordinate Ay is center.y + R*sin (angle b - angle a), and R represents the radius of the target arc window after update. The abscissa Bx corresponding to the end point B is center.x+R*cos(angle b+angle a), and its corresponding ordinate By is center.y+R*sin(angle b+angle a). If the target arc window is counterclockwise, the abscissa Bx corresponding to the starting point B is center.x+R*cos(angle b+angle a), and its corresponding ordinate By is center.y+R*sin(angle b+angle a), and the abscissa Ax corresponding to the end point A is center.x+R*cos(angle b-angle a), and its corresponding ordinate Ay is center.y+R*sin(angle b-angle a).
[0073] In another example, if Figure 4BAs shown, the target arc window is located in the third quadrant of the current coordinate system (the right side of the X-axis is the positive semi-axis, and the bottom of the Y-axis is the positive semi-axis). Angle a is 1 / 2 of the central angle, and is a positive angle. Angle b is a negative angle. Angle c1 = angle b + angle a, and is a negative angle. Angle d1 = angle b - angle a, and is a negative angle. Angle c2 is a negative angle and its sum with angle c1 is -π. Angle d2 is a negative angle and its sum with angle d1 is -π. cos(angle c1) is a negative number, cos(angle c2) is a positive number, and the two are opposite numbers to each other; sin(angle c1) is a negative number, sin(angle c2) is a negative number, and the two are equal. cos(angle d1) is a negative number, cos(angle d2) is a positive number, and the two are opposite numbers to each other; sin(angle d1) is a negative number, sin(angle d2) is a negative number, and the two are equal. When the target arc window is clockwise, the horizontal coordinate Bx corresponding to the starting point B is center.XR*cos(angle d2)=center.X+R*cos(angle d1)=center.X+R*cos(angle b-angle a), and its corresponding vertical coordinate By is center.y+R*sin(angle d2)=center.y+R*sin(-π-angle d1)=center.y+R*sin(angle d1)=center.y+R*sin(angle b-angle a). The abscissa Ax corresponding to the end point A is center.XR*cos(angle c2)=center.X+R*cos(angle c1)=center.X+R*cos(angle b+angle a), and its corresponding ordinate Ay=center.y+R*sin(angle c2)=center.y+R*sin(-π-angle c1)=center.y+R*sin(angle c1)=center.y+R*sin(angle b+angle a). For the case where the target arc window is counterclockwise, the abscissa Ax corresponding to the starting point A is center.X+R*cos(angle b+angle a), and its corresponding ordinate Ay=center.y+R*sin(angle b+angle a); the abscissa Bx corresponding to the end point B is center.X+R*cos(angle b-angle a), and its corresponding ordinate By=center.y+R*sin(angle b-angle a).
[0074] Based on the above calculation, the first coordinate position and the second coordinate position corresponding to the target arc window belonging to the first type of arc window can be determined, and the starting position and the end position are also determined.
[0075] If the target curved window belongs to the second type of curved window, the third angle is determined based on the angle between the line connecting the target position and the center coordinates of the circle and the positive half axis of the X-axis. The target position and the center point position of the arc are symmetrical about the center of the circle corresponding to the target curved window. The fourth angle is determined based on 360 minus 1 / 2 of the difference between the center angle of the target curved window and the target window. Then, coordinate calculation is performed based on the third angle, the fourth angle and the center coordinates to determine the first coordinate position and the second coordinate position of the target curved window on the target curved wall.
[0076] The third angle (angle e) = Math.atan2(Py-center.y, Px-center.x), the fourth angle (angle f) = Math.asin(chord length / (2 radius)) = (360-center angle of circle) / 2, the coordinates corresponding to the center point of the arc are (x, y), the coordinates corresponding to the target position point P are (Px, Py), and the coordinates corresponding to the center of the circle are (center.x, center.y).
[0077] As an example, Figure 5A As shown, the target arc window belongs to a large arc, and the target position (point P) symmetrical with the arc center position about the center of the circle is located in the second quadrant of the current coordinate system (the right side of the X axis is the positive semi-axis, and the bottom of the Y axis is the positive semi-axis), and angle e and angle f are both positive angles. For the case where the target arc window is clockwise, the horizontal coordinate Ax corresponding to the starting point A is center.XR*cos(π-(angle e+angle f))=center.X+R*cos(angle e+angle f), and its corresponding vertical coordinate Ay=center.y+R*sin(π-(angle e+angle f))=center.y+R*sin(angle e+angle f); the horizontal coordinate Bx corresponding to the end point B is center.X+R*cos(angle e-angle f), and its corresponding vertical coordinate By=center.y+R*sin(angle e-angle f). When the target arc window is counterclockwise, the horizontal coordinate Bx corresponding to the starting point B is center.X+R*cos(angle e-angle f), and its corresponding vertical coordinate By is center.y+R*sin(angle e-angle f); the horizontal coordinate Ax corresponding to the end point A is center.X+R*cos(angle e+angle f), and its corresponding vertical coordinate Ay is center.y+R*sin(angle e+angle f).
[0078] Or, if Figure 5BAs shown, the target arc window belongs to a large arc, and the target position (point P) symmetrical with the arc center point position about the circle center is located in the first quadrant of the current coordinate system (the right side of the X axis is the positive semi-axis, and the bottom of the Y axis is the positive semi-axis), and angle e and angle f are both positive angles. For the case where the target arc window is clockwise, the horizontal coordinate Ax corresponding to the starting point A is center.X+R*cos(angle e+angle f), and its corresponding vertical coordinate Ay is center.y+R*sin(angle e+angle f); the horizontal coordinate Bx corresponding to the end point B is center.X+R*cos(angle e-angle f), and its corresponding vertical coordinate By is center.y+R*sin(angle e-angle f). When the target arc window is counterclockwise, the horizontal coordinate Bx corresponding to the starting point B is center.X+R*cos(angle e-angle f), and its corresponding vertical coordinate By is center.y+R*sin(angle e-angle f); the horizontal coordinate Ax corresponding to the end point A is center.X+R*cos(angle e+angle f), and its corresponding vertical coordinate Ay is center.y+R*sin(angle e+angle f).
[0079] Based on the above calculation, the first coordinate position and the second coordinate position corresponding to the target arc window belonging to the second type of arc window can be determined, and the starting position and the end position are also determined.
[0080] In the above implementation scheme, based on the type of curved window, a suitable solution is adopted to calculate the endpoint position coordinates of the target curved window on the curved wall, and an accurate parameter updating algorithm can be used to ensure that the curved window fits on the curved wall.
[0081] Optionally, after determining the starting position and the end position, drawing the target curved window on the target curved wall according to the starting position and the end position includes:
[0082] Determine a first outer contour point and a first inner contour point according to the starting point position, and determine a second outer contour point and a second inner contour point according to the end point position;
[0083] Determine a first starting point angle and a first end point angle according to the first outer contour point and the second outer contour point, and determine a plurality of outer contour discrete points arranged clockwise on the outer contour according to the first starting point angle and the first end point angle;
[0084] Determine a second starting point angle and a second end point angle according to the first inner contour point and the second inner contour point, and determine a plurality of inner contour discrete points arranged clockwise on the inner contour according to the second starting point angle and the second end point angle;
[0085] The starting point, multiple outer contour discrete points, the end point, and multiple inner contour discrete points are placed in the target array as key points, and the target arc window is drawn on the target arc wall according to the key points in the target array.
[0086] When the starting point is known, the tangent vector is calculated at the starting point, and then two unit vectors perpendicular to the tangent vector are calculated. The outer contour point and the inner contour point at the starting point are determined based on the coordinates at the starting point and the two unit vectors. Among them, top represents the outer contour of the arc wall, and bottom represents the inner contour of the arc wall.
[0087] like Figure 6 As shown, determine the tangent vector unv at the starting point, and then calculate the first unit vector unv1 and the second unit vector unv2. The directions of the first unit vector and the second unit vector are opposite. After specifying the positive direction, the positive and negative indications of the unit vectors need to be considered when calculating based on the unit vectors. The horizontal coordinate top.x corresponding to the first outer contour point is unv1.x*half the wall thickness + start.x, and the vertical coordinate top.y corresponding to the first outer contour point is unv1.y*half the wall thickness + start.y. For the inner contour point, the horizontal coordinate bottom.x corresponding to the first inner contour point is unv2.x*half the wall thickness + start.x, and the vertical coordinate bottom.y corresponding to the first inner contour point is unv2.y*half the wall thickness + start.y. For the end point side, the method of calculating the outer contour point and the inner contour point is similar, which will not be introduced here.
[0088] After determining the first outer contour point and the first inner contour point according to the starting point position, and determining the second outer contour point and the second inner contour point according to the end point position, for the two outer contour points, according to the information of the center of the circle, the first starting angle startTopAngle and the first end angle endTopAngle are obtained by the Math.atan2 function. Taking the calculation of the first starting angle startTopAngle as an example, startTopAngle = Math.atan2 (A1.y-center.y, A1.x-center.x), where (A1.x, A1.y) represents the coordinates corresponding to the first outer contour point at the starting point position. After obtaining the first starting angle and the first end angle, multiple outer contour discrete points arranged clockwise on the outer contour are calculated based on the first starting angle and the first end angle.
[0089] At this stage, we first need to determine whether the outer contour is clockwise or counterclockwise. If it is clockwise, we can directly calculate it. If it is counterclockwise, we need to permute the start and end points of the outer contour, and then determine the startTopAngle and endTopAngle. If the endTopAngle is smaller than the startTopAngle, we can add 2π to the endTopAngle.
[0090] When determining the discrete points on the outer contour by calculation, the angle range of the arc corresponding to the outer contour is determined to be endTopAngle minus startTopAngle, and the angle range is divided into n equal parts, then the angle t corresponding to each part is t = startTopAngle + i (endTopAngle - startTopAngle) / n, and the value of i is greater than or equal to 0 and less than or equal to n. For angle t, taking the positive half axis of the XY axis as an example, the corresponding coordinates on the arc are (center x + R*cos t, center y + R*sint). Based on the above calculation, multiple outer contour discrete points arranged clockwise on the outer contour can be determined.
[0091] Similarly, the second starting angle startBottomAngle and the second end angle endBottomAngle are obtained for the two inner contour points. After obtaining the second starting angle and the second end angle, multiple inner contour discrete points arranged clockwise on the inner contour are calculated based on the second starting angle and the second end angle. The detailed process can be found in the description of the outer contour, which will not be repeated here.
[0092] After determining multiple outer contour discrete points and multiple inner contour discrete points, identify whether the target arc window is clockwise or counterclockwise (the direction from the starting point to the end point is clockwise or counterclockwise). If it is clockwise, you can first put the starting point into the target array, put multiple outer contour discrete points into the target array in positive order, put the end point into the target array, and put multiple inner contour discrete points into the target array in reverse order. Draw the points in the target array in sequence to ensure that they are connected from beginning to end, and then draw the target arc window. If it is counterclockwise, you can first put the end point into the target array, put multiple outer contour discrete points into the target array in positive order, put the starting point into the target array, and put multiple inner contour discrete points into the target array in reverse order. Draw the points in the target array in sequence to ensure that they are connected from beginning to end, and then draw the target arc window. For the drawn target arc window, it can be understood in shape that it is part of the target arc wall.
[0093] In the above implementation scheme, by determining multiple outer contour discrete points and multiple inner contour discrete points based on the starting point position and the end point position, and using the outer contour discrete points and the inner contour discrete points as key points to draw the target curved window, the target curved window can be redrawn on the target curved wall, so that the target curved window is adapted to the wall, thereby achieving a reasonable match between the curved window and the curved wall.
[0094] The following is an introduction to a solution for moving a target curved window on a target curved wall. Optionally, in response to a mobile interaction input, the target curved window is controlled to move on the target curved wall to update the position of the target curved window, including:
[0095] In response to the interactive input of dragging the arc center point of the target arc window on the target arc wall, the starting point position and the end point position of the target arc window are updated; based on the updated starting point position and the end point position, the target arc window is redrawn on the target arc wall to control the movement of the target arc window and update the position of the target arc window on the target arc wall.
[0096] After selecting the target curved window, you can control the target curved window to move on the target curved wall by dragging it. The dragging point is the arc center point of the target curved window. The dragging operation here is the mobile interactive input of the target curved window. Based on the mobile interactive input, the starting position and the end position of the target curved window on the target curved wall are updated. In this process, the shape of the target curved window remains unchanged, and only the position of the target curved window on the target curved wall is changed.
[0097] After determining the updated starting position and end position based on the mobile interaction input, redraw the target curved window on the target curved wall based on the updated starting position and end position, and update the position of the target curved window on the target curved wall to control the target curved window to move on the target curved wall in response to the mobile interaction input. Figure 7 As shown, in the initial situation, the target curved window is adsorbed on the first position of the target curved wall, and based on the mobile interactive input of dragging the target curved window, the position of the target curved window on the target curved wall is adjusted to update the position of the target curved window while maintaining the shape of the target curved window.
[0098] It should be noted that, during the process of dragging the target arc window, the starting position and the end position of the target arc window on the target arc wall are updated in real time, and the target arc window is redrawn on the target arc wall based on the real-time updated starting position and the end position to keep the display of the target arc window during the moving process. The process of redrawing the target arc window based on the starting position and the end position will not be further described here.
[0099] Optionally, in the case where the circumference of the target curved wall is greater than 1 / 2 of the circumference of the circle in which it is located, the method further comprises: in response to the target curved window stopping moving on the target curved wall, identifying whether two endpoints of the target curved wall are in the target curved window; in response to the two endpoints of the target curved wall being in the target curved window, adjusting the category of the target curved window;
[0100] Among them, if the target arc window is a second-type arc window in which the distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window, the target arc window is adjusted to a first-type arc window in which the distance from the arc center point to the chord length is less than the radius corresponding to the target arc window; if the target arc window is a first-type arc window, the target arc window is adjusted to a second-type arc window.
[0101] For the specific case where the target curved wall is a large arc (i.e., the circumference of the target curved wall is greater than half of the corresponding circumference of the circle in which it is located), since the target curved window moves on the target curved wall and continuously adjusts its position, there is a situation where the target curved window covers the gap in the curved wall after updating its position. Therefore, a judgment process is required. That is, when the target curved window stops moving on the target curved wall, it is judged whether the target curved window covers the gap in the curved wall. If the gap in the curved wall is covered, the category of the target curved window is adjusted. For the case where the target curved window is a second-class curved window (the distance from the arc center point to the chord length is greater than the radius corresponding to the target curved window), the target curved window is adjusted to a first-class curved window (the distance from the arc center point to the chord length is less than the radius corresponding to the target curved window). For the case where the target curved window is a first-class curved window (the distance from the arc center point to the chord length is less than the radius corresponding to the target curved window), the target curved window is adjusted to a second-class curved window. It can be simply understood as: for the large curved window covering the gap in the curved wall, it is adjusted to a small curved window, and for the small curved window covering the gap in the curved wall, it is adjusted to a large curved window. Figure 8 As shown in the figure, the large arc window moves on the arc wall. When it stops moving, the large arc window covers the gap of the arc wall. At this time, the large arc window is adjusted to a small arc window adsorbed on the arc wall. Consider a special case, if the distance from the arc center point to the chord length is equal to the radius corresponding to the target arc window, then the target arc window also belongs to the first type of arc window. When adjusting, the starting point and the end point are interchanged to adjust the arc window or the arc direction from the starting point to the end point is adjusted to adjust the arc window.
[0102] Among them, when adjusting a small arc window to a large arc window, or adjusting a large arc window to a large arc window, since the starting point and the end point are known, the arc window can be redrawn in the above manner, or when the starting point and the end point are known, the new arc window can be determined by directly changing the clockwise or counterclockwise direction of the starting point to the end point.
[0103] When judging whether the target curved window covers the curved wall gap, it is possible to identify whether the two endpoints of the target curved wall are in the target curved window. If the two endpoints of the target curved wall are in the target curved window, it is determined that the target curved window covers the curved wall gap. For a certain endpoint of the target curved wall, when identifying whether the endpoint is in the target curved window, the following method can be used:
[0104] Determine a first vector and a second vector based on the arc center point of the target arc window and two endpoints of the target arc window, determine a third vector based on the arc center point of the target arc window and the center of the circle, and determine a fourth vector based on the arc center point of the target arc window and the endpoint of the target arc wall;
[0105] Determine a first value according to a product of a value obtained by cross-producting the first vector and the fourth vector and a value obtained by cross-producting the first vector and the third vector;
[0106] Determine a second value according to a product of a value of the second vector cross-multiplied by the fourth vector and a value of the second vector cross-multiplied by the third vector;
[0107] In response to the first value or the second value being negative, it is determined that the endpoint of the target arc wall is in the target arc window.
[0108] When judging whether a point is on the left or right side of a straight line, the cross product operation can be used. If two points (such as point A and point B) are on both sides of line segment CD, then vector 1 is determined based on line segment CD, vector 2 is determined based on CA, and vector 3 is determined based on CB. The product of the value of vector 1 cross product of vector 2 and the value of vector 1 cross product of vector 3 must be less than 0.
[0109] like Fig. 9 As shown, the first vector is determined based on the arc center point P of the target arc window and the starting point start of the target arc window, the second vector is determined based on the arc center point P of the target arc window and the end point end of the target arc window, and the third vector is determined based on the arc center point P of the target arc window and the center O. If there is a point E (the end point of the target arc wall) on the arc corresponding to P and start, then point E and point O must be on both sides of the straight line where vector Pstart (the first vector) is located, that is, the value of vector Pstart cross-multiplied by vector PE (the fourth vector) multiplied by the value of vector Pstart cross-multiplied by vector PO (the third vector), the product must be a negative number. Similarly, if there is a point E (the end point of the target arc wall) on the arc corresponding to P and end, then point E and point O must be on both sides of the straight line where vector Pend (the second vector) is located, that is, the value of vector Pend cross-multiplied by vector PE (the fourth vector) multiplied by the value of vector Pend cross-multiplied by vector PO (the third vector), the product must be a negative number.
[0110] Based on the above situation, it can be known that for a certain endpoint of the target curved wall, when the first value (the product of the value of the first vector cross multiplied by the fourth vector and the value of the first vector cross multiplied by the third vector) or the second value (the product of the value of the second vector cross multiplied by the fourth vector and the value of the second vector cross multiplied by the third vector) is negative, it is determined that the endpoint of the target curved wall is in the target curved window. The same judgment strategy is used to identify whether the other endpoint of the target curved wall is in the target curved window.
[0111] In the above implementation scheme, in response to the situation where the target curved window updates its position on the target curved wall, when the target curved window stops moving, it is identified whether the target curved window covers the gap in the curved wall. If the target curved window covers the gap in the curved wall, the category of the target curved window is adjusted and a new curved window is determined. Through a dynamic large and small arc switching mechanism, the special situation of the large curved wall is intelligently handled, which solves the problem of the large curved wall gap being covered and enhances applicability.
[0112] The following is an introduction to a solution for updating the shape of the curved window. Optionally, in response to the update input, adjusting the position of the first endpoint on the target curved wall to update the shape of the target curved window includes:
[0113] In response to an update input of dragging the first endpoint of the target arc window to change its position on the target arc wall, the chord length corresponding to the target arc window and the position information of the first endpoint are updated; the arc center point of the target arc window is updated according to the position information of the first endpoint and the initial position information of the second endpoint; the category of the target arc window is determined according to the distance between the arc center point and the chord length; and the target arc window is redrawn on the target arc wall according to the category of the target arc window, the position information of the first endpoint and the initial position information of the second endpoint, so as to adjust the position of the first endpoint on the target arc wall and update the shape of the target arc window.
[0114] After selecting the first endpoint (starting point or end point) of the target arc window, drag the first endpoint to update the position of the first endpoint on the target arc wall. Since the position of the first endpoint is updated and the second endpoint remains stationary, the chord length corresponding to the target arc window changes. According to the first endpoint being dragged and the other endpoint (the second endpoint), determine the position point (arc center point) of the target arc window to update the arc center point of the target arc window according to the position information of the first endpoint and the initial position information of the second endpoint. After updating the arc center point and the chord length, calculate the distance from the arc center point to the chord length, identify the category of the target arc window according to the calculated distance and the size of the radius currently corresponding to the target arc window, and then redraw the target arc window on the target arc wall according to the category of the target arc window, the position information of the first endpoint and the initial position information of the second endpoint.
[0115] When the arc center point of the target arc window is updated according to the position information of the first endpoint and the initial position information of the second endpoint, the coordinates of the chord center F are determined according to the position information of the first endpoint and the initial position information of the second endpoint, and then the unit vector unv3 in the OF direction is calculated according to the coordinates of the circle center O and the coordinates of the chord center F, and the coordinates of the arc center point are determined based on the coordinates of the circle center O, the unit vector unv3 and the radius R. For example, the horizontal coordinate Px corresponding to the arc center point P is center.x+unv3.x*R, and the vertical coordinate Py corresponding to the arc center point P is center.y+unv3.y*R.
[0116] After the arc center point and chord length are known, the distance from the arc center point to the chord length is calculated, and the distance is compared with the radius currently corresponding to the target arc window. If it is greater than the radius, it is determined to be a large arc window. If it is less than or equal to the radius, it is determined to be a small arc window. When the arc window type has been determined, the target arc window is redrawn on the target arc wall according to the position information of the first endpoint and the initial position information of the second endpoint. The redrawing process is not introduced here. Since the position of the first endpoint is updated in real time during the dragging process, it is necessary to determine the chord length, update the arc center point, and redraw the target arc window in real time to maintain the display of the target arc window during the shape change process.
[0117] After the dragging of the first endpoint stops, the shape update of the target arc window ends, and the target arc window adsorbed on the target arc wall is the arc window after the shape change is completed. Fig.10 As shown, by dragging one end point and changing the shape of the target arc window, the small arc window adsorbed on the arc wall is adjusted to a large arc window.
[0118] In the above implementation scheme, the shape of the target curved window is updated by updating the position of the endpoint of the target curved window on the curved wall. The real-time adjustment of the window shape can be triggered based on the movement of the drag point, and the curved window can be edited and updated intuitively.
[0119] The present application also provides a curved window interaction device, such as Fig.11 As shown, including:
[0120] An identification and adsorption module 1101 is used for, in response to a drag input to a target curved window, identifying a target curved wall between the target curved window and the target curved window that meets an adsorption condition, and adsorbing the target curved window to the target curved wall;
[0121] The control module 1102 is used for, when receiving a movement interaction input for the target curved window, controlling the target curved window to move on the target curved wall in response to the movement interaction input, so as to update the position of the target curved window;
[0122] The adjustment module 1103 is used for, upon receiving an update input for the first endpoint of the target curved window, adjusting the position of the first endpoint on the target curved wall in response to the update input to update the shape of the target curved window.
[0123] Optionally, the identification and adsorption module includes:
[0124] A first updating submodule, configured to update the position information of the target arc-shaped window in response to the dragging input;
[0125] An identification submodule, used for identifying whether there is an arc wall whose distance from the target arc window satisfies an adsorption condition during the process of dragging the target arc window to update the position information;
[0126] A determination and update submodule, configured to determine the arc center point position corresponding to the arc center point of the target arc window on the target arc wall, and update the circle information of the target arc window, when identifying a target arc wall whose absolute value of the difference between the distance between the circle center and the arc center point of the target arc window minus the wall radius is less than an adsorption threshold.
[0127] A calculation submodule, used for calculating the starting position and the end position of the target arc window on the target arc wall according to the arc center point position, the chord length corresponding to the target arc window, the circle information corresponding to the target arc window and the arc category to which the target arc window belongs;
[0128] The drawing submodule is used to draw the target curved window on the target curved wall according to the starting position and the end position.
[0129] Optionally, the determining and updating submodule is further used for:
[0130] Based on the intersection of a line connecting the arc center point of the target arc window and the center of the target arc wall or an extended line of the line connecting the line and the target arc wall, the arc center point position corresponding to the target arc window on the target arc wall is determined.
[0131] Optionally, the calculation submodule includes:
[0132] a first processing unit, configured to, in response to the target arc window belonging to the first type of arc window, perform coordinate calculation based on a first angle, a second angle and a center coordinate corresponding to the target arc window to determine a first coordinate position and a second coordinate position, wherein the first angle is an angle between a line connecting the arc center point position and the center coordinate corresponding to the target arc window and the positive half axis of the X-axis, and the second angle is 1 / 2 of the center angle corresponding to the target arc window;
[0133] a second processing unit, for performing coordinate calculation based on a third angle, a fourth angle and a center coordinate corresponding to the target arc window to determine a first coordinate position and a second coordinate position in response to the target arc window belonging to the second type of arc window, wherein the third angle is an angle between a line connecting the target position and the center coordinate and the positive half axis of the X-axis, the target position and the arc center point position are symmetrical about the center of the circle corresponding to the target arc window, and the fourth angle is 360 minus 1 / 2 of a difference between the center angle corresponding to the target arc window;
[0134] A first determining unit, configured to determine the starting position and the ending position according to the first coordinate position and the second coordinate position;
[0135] Among them, the arc window whose distance from the arc center point to the chord length is less than or equal to the radius corresponding to the target arc window belongs to the first type of arc window, and the arc window whose distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window belongs to the second type of arc window.
[0136] Optionally, the drawing submodule includes:
[0137] A second determining unit, configured to determine a first outer contour point and a first inner contour point according to the starting point position, and to determine a second outer contour point and a second inner contour point according to the end point position;
[0138] a third determining unit, configured to determine a first starting point angle and a first end point angle according to the first outer contour point and the second outer contour point, and to determine a plurality of outer contour discrete points arranged clockwise on the outer contour according to the first starting point angle and the first end point angle;
[0139] a fourth determining unit, configured to determine a second starting point angle and a second end point angle according to the first inner contour point and the second inner contour point, and determine a plurality of inner contour discrete points arranged clockwise on the inner contour according to the second starting point angle and the second end point angle;
[0140] A drawing processing unit is used to place the starting point, the multiple outer contour discrete points, the end point, and the multiple inner contour discrete points as key points in a target array, and draw the target curved window on the target curved wall according to the key points in the target array.
[0141] Optionally, the control module includes:
[0142] A second updating submodule, configured to update a starting point position and an end point position of the target arc window in response to a moving interactive input of dragging the arc center point of the target arc window on the target arc wall;
[0143] The first redrawing submodule is used to redraw the target curved window on the target curved wall based on the updated starting position and end position to control the movement of the target curved window and update the position of the target curved window on the target curved wall.
[0144] Optionally, when the circumference of the target curved wall is greater than 1 / 2 of the circumference of the circle in which it is located, the device further comprises:
[0145] An identification module, configured to identify whether two end points of the target curved wall are within the target curved window in response to the target curved window stopping moving on the target curved wall;
[0146] A processing module, configured to adjust the category of the target curved window in response to two end points of the target curved wall being in the target curved window;
[0147] Among them, if the target arc window is a second-type arc window in which the distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window, the target arc window is adjusted to a first-type arc window in which the distance from the arc center point to the chord length is less than the radius corresponding to the target arc window; if the target arc window is a first-type arc window, the target arc window is adjusted to a second-type arc window.
[0148] Optionally, the adjustment module includes:
[0149] A third updating submodule, configured to update the chord length corresponding to the target curved window and the position information of the first endpoint in response to an update input of dragging the first endpoint of the target curved window to change the position on the target curved wall;
[0150] A fourth updating submodule, configured to update the arc center point of the target arc window according to the position information of the first endpoint and the initial position information of the second endpoint;
[0151] A determination submodule, used to determine the category of the target arc window according to the distance between the arc center point and the chord length;
[0152] The second redrawing submodule is used to redraw the target curved window on the target curved wall according to the category of the target curved window, the position information of the first endpoint and the initial position information of the second endpoint, so as to adjust the position of the first endpoint on the target curved wall and update the shape of the target curved window.
[0153] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0154] An embodiment of the present application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned arc window interaction method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0155] For example, Fig.12 FIG. 1 shows a schematic diagram of the physical structure of an electronic device. Fig.12As shown, the electronic device may include: a processor 1210, a communication interface 1220, a memory 1230 and a communication bus 1240, wherein the processor 1210, the communication interface 1220, and the memory 1230 communicate with each other through the communication bus 1240. The processor 1210 may call the logic instructions in the memory 1230, and the processor 1210 is used to execute each process of the arc window interaction method of the embodiment of the present application, which will not be described one by one here.
[0156] In addition, the logic instructions in the above-mentioned memory 1230 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0157] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned arc window interaction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0158] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0160] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A curved window interaction method, characterized in that: include: In response to a drag input to a target curved window, a target curved wall satisfying an adsorption condition between the target curved window and the target curved window is identified, and the target curved window is adsorbed to the target curved wall; When receiving a movement interaction input to the target curved window, in response to the movement interaction input, control the target curved window to move on the target curved wall to update the position of the target curved window; When an update input for a first endpoint of the target curved window is received, the position of the first endpoint on the target curved wall is adjusted in response to the update input to update the shape of the target curved window.
2. The method according to claim 1, characterized in that In response to the drag input of the target curved window, identifying a target curved wall between the target curved window and the target curved window that meets the adsorption condition, and adsorbing the target curved window to the target curved wall, comprises: In response to the drag input, updating the position information of the target arc window; In the process of dragging the target arc window to update the position information, identifying whether there is an arc wall whose distance from the target arc window satisfies the adsorption condition; In the case of identifying a target curved wall whose absolute value of the difference between the distance between the center of the circle and the arc center point of the target curved window minus the wall radius is less than the adsorption threshold, determining the arc center point position corresponding to the arc center point of the target curved window on the target curved wall, and updating the circle information of the target curved window; Calculate the starting position and the ending position of the target arc window on the target arc wall according to the arc center point position, the chord length corresponding to the target arc window, the circle information corresponding to the target arc window, and the arc category to which the target arc window belongs; The target curved window is drawn on the target curved wall according to the starting point position and the end point position.
3. The method according to claim 2, characterized in that The step of determining the arc center point position of the target arc window corresponding to the arc center point on the target arc wall includes: Based on the intersection of a line connecting the arc center point of the target arc window and the center of the target arc wall or an extended line of the line connecting the line and the target arc wall, the arc center point position corresponding to the target arc window on the target arc wall is determined.
4. The method according to claim 2, characterized in that: The step of calculating the starting point position and the end point position of the target arc window on the target arc wall according to the arc center point position, the chord length corresponding to the target arc window, the circle information corresponding to the target arc window, and the arc category to which the target arc window belongs includes: In response to the target arc window belonging to the first type of arc window, coordinate calculation is performed based on a first angle, a second angle and a center coordinate corresponding to the target arc window to determine a first coordinate position and a second coordinate position, wherein the first angle is an angle between a line connecting the arc center point position and the center coordinate corresponding to the target arc window and the positive half axis of the X-axis, and the second angle is 1 / 2 of the center angle corresponding to the target arc window; In response to the target arc window belonging to the second type of arc window, coordinate calculation is performed based on the third angle, the fourth angle and the center coordinates corresponding to the target arc window to determine the first coordinate position and the second coordinate position, the third angle is the angle between the line connecting the target position and the center coordinates and the positive half axis of the X-axis, the target position and the arc center point position are symmetrical about the center of the circle corresponding to the target arc window, and the fourth angle is 360 minus 1 / 2 of the difference of the center angle corresponding to the target arc window; Determine the starting point position and the end point position according to the first coordinate position and the second coordinate position; Among them, the arc window whose distance from the arc center point to the chord length is less than or equal to the radius corresponding to the target arc window belongs to the first type of arc window, and the arc window whose distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window belongs to the second type of arc window.
5. The method according to claim 2, characterized in that: Drawing the target curved window on the target curved wall according to the starting position and the end position includes: Determine a first outer contour point and a first inner contour point according to the starting point position, and determine a second outer contour point and a second inner contour point according to the end point position; Determine a first starting point angle and a first end point angle according to the first outer contour point and the second outer contour point, and determine a plurality of outer contour discrete points arranged clockwise on the outer contour according to the first starting point angle and the first end point angle; Determine a second starting point angle and a second end point angle according to the first inner contour point and the second inner contour point, and determine a plurality of inner contour discrete points arranged clockwise on the inner contour according to the second starting point angle and the second end point angle; The starting point, the plurality of outer contour discrete points, the end point, and the plurality of inner contour discrete points are placed in a target array as key points, and the target curved window is drawn on the target curved wall according to the key points in the target array.
6. The method according to claim 1, characterized in that In response to the movement interaction input, controlling the target curved window to move on the target curved wall to update the position of the target curved window includes: In response to a moving interactive input of dragging the arc center point of the target arc window on the target arc wall, updating the starting position and the ending position of the target arc window; Based on the updated starting point position and end point position, the target curved window is redrawn on the target curved wall to control the movement of the target curved window and update the position of the target curved window on the target curved wall.
7. The method according to claim 6, characterized in that In the case where the circumference of the target curved wall is greater than 1 / 2 of the circumference of the circle in which it is located, the method further includes: In response to the target curved window stopping moving on the target curved wall, identifying whether two end points of the target curved wall are within the target curved window; In response to two end points of the target curved wall being within the target curved window, adjusting the category of the target curved window; Among them, if the target arc window is a second-type arc window in which the distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window, the target arc window is adjusted to a first-type arc window in which the distance from the arc center point to the chord length is less than the radius corresponding to the target arc window; if the target arc window is a first-type arc window, the target arc window is adjusted to a second-type arc window.
8. The method according to claim 1, characterized in that In response to the update input, adjusting the position of the first endpoint on the target curved wall to update the shape of the target curved window includes: In response to an update input of dragging the first endpoint of the target curved window to change the position on the target curved wall, updating the chord length corresponding to the target curved window and the position information of the first endpoint; Update the arc center point of the target arc window according to the position information of the first endpoint and the initial position information of the second endpoint; Determining the category of the target arc window according to the distance between the arc center point and the chord length; According to the category of the target curved window, the position information of the first endpoint and the initial position information of the second endpoint, the target curved window is redrawn on the target curved wall to adjust the position of the first endpoint on the target curved wall and update the shape of the target curved window.
9. A curved window interactive device, characterized in that: include: an identification and adsorption module, for, in response to a drag input to a target curved window, identifying a target curved wall between the target curved window and the target curved window that satisfies an adsorption condition, and adsorbing the target curved window to the target curved wall; A control module, configured to, upon receiving a movement interaction input for the target curved window, control the target curved window to move on the target curved wall in response to the movement interaction input, so as to update the position of the target curved window; The adjustment module is used for, upon receiving an update input for the first endpoint of the target curved window, adjusting the position of the first endpoint on the target curved wall in response to the update input to update the shape of the target curved window.
10. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the arc window interaction method as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Automatic adsorption method and device for entities in home design system and electronic equipment
CN111550015A
House type structure adjusting method based on single space
CN113901555A
Arc window design method and device and storage medium
CN116127565A
Wall data processing method, component creation method, electronic equipment and storage medium
CN116680793A
Model arrangement information determination method and device, electronic equipment and storage medium
CN117708917A