Arch window interaction method and device, and electronic device
By identifying and attaching curved windows to curved walls in architectural design software, and updating their position and shape in response to user input, the matching problem between curved windows and curved walls was solved, achieving efficient and accurate curved structure design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING CHENGSHI WANGLIN INFORMATION TECH CO LTD
- Filing Date
- 2024-11-29
- Publication Date
- 2026-06-16
AI Technical Summary
Existing architectural design and interior decoration software lacks flexibility when dealing with curved structures, making it difficult to achieve precise matching and intuitive adjustment of curved windows and curved walls. Furthermore, it lacks intelligent processing mechanisms for complex curved structures, affecting design efficiency and effectiveness.
By identifying curved walls that meet the adsorption conditions between the curved window and the curved wall, the curved window is adsorbed onto the curved wall, and its position and shape are updated in response to user input, including dragging, moving, and endpoint adjustment, to achieve a reasonable match between the curved window and the curved wall.
It improves the efficiency and accuracy of arc structure design, and provides a flexible and easy-to-use interaction method, making the design of complex arc structures simple and easy to use.
Smart Images

Figure CN119691857B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of interior design technology, and in particular to an interactive method, device and electronic device for curved windows. Background Technology
[0002] Existing architectural design and interior design software typically offers drawing and editing functions for straight walls and rectangular windows. However, these software programs often have the following shortcomings when dealing with curved structures:
[0003] 1. Lack of flexible creation and editing support for curved windows and curved walls; 2. Difficulty in establishing the connection between curved windows and curved walls; 3. Movement and shape adjustment of curved windows are usually not intuitive and precise enough; 4. Difficulty in ensuring the connection between curved windows and curved walls during the editing process; 5. Lack of intelligent handling mechanism for special cases (such as large curved walls).
[0004] The aforementioned shortcomings severely impact the creativity and efficiency of architects when dealing with complex curved structures, and also affect the final design outcome. Therefore, the interactive design of curved windows has become a problem to be solved in housing design. Summary of the Invention
[0005] In view of the above problems, embodiments of this application provide a curved window interaction method, apparatus, and electronic device that overcomes or at least partially solves the above problems.
[0006] In a first aspect, embodiments of this application provide a curved window interaction method, including:
[0007] In response to the drag input of the target curved window, a target curved wall that meets the adsorption conditions 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] Upon receiving a motion interaction input for the target curved window, in response to the motion interaction input, the target curved window is controlled to move on the target curved wall to update the position of the target curved window;
[0009] Upon receiving an update input for the first endpoint of the target curved window, 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.
[0010] Secondly, embodiments of this application provide an arc-shaped window interaction device, comprising:
[0011] The identification and adsorption module is used to identify a target curved wall that meets the adsorption conditions between the target curved window and the target curved window in response to the drag input of the target curved window, and adsorb the target curved window to the target curved wall.
[0012] The control module is configured to, upon receiving a motion interaction input to the target curved window, control the target curved window to move on the target curved wall in response to the motion interaction input, so as to update the position of the target curved window;
[0013] An adjustment module is configured to, upon receiving an update input for the first endpoint of the target curved window, adjust the position of the first endpoint on the target curved wall in response to the update input, so as to update the shape of the target curved window.
[0014] Thirdly, embodiments of this application provide an electronic device, including 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-shaped window interaction method as described in the first aspect above.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the arc-shaped window interaction method described in the first aspect above.
[0016] The technical solution of this application embodiment, 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. This allows the shape of the window to adapt to the wall, achieving a reasonable match between the target curved window and the target curved wall, and greatly improving design efficiency. Based on the interactive input of moving the target curved window, the target curved window is controlled to move on the target curved wall, and the shape of the target curved window is updated based on the update input of the first endpoint of the target curved window. This ensures that the target curved window always fits on the target curved wall during movement and deformation, improving design accuracy. Moreover, the intuitive interaction method makes the design of complex curved structures simple and easy to use.
[0017] Furthermore, the highly flexible, precise, and easy-to-use arc-shaped structure design provided by the embodiments of this application offers new possibilities for architectural and interior design scenarios. Attached Figure Description
[0018] Figure 1 A schematic diagram illustrating the arc-shaped window interaction method provided in an embodiment of this application;
[0019] Figure 2 This is a schematic diagram showing the parameters of the arc-shaped window provided in the embodiments of this application;
[0020] Figure 3A This diagram illustrates the relative positional relationship between the target curved window and the curved wall provided in the embodiments of this application. Figure 1 ;
[0021] Figure 3B This diagram illustrates the relative positional relationship between the target curved window and the curved wall provided in the embodiments of this application. Figure 2 ;
[0022] Figure 4A A schematic diagram illustrating the calculation of the endpoint coordinates of the small arc window provided in this application embodiment. Figure 1 ;
[0023] Figure 4B A schematic diagram illustrating the calculation of the endpoint coordinates of the small arc window provided in this application embodiment. Figure 2 ;
[0024] Figure 5A A schematic diagram illustrating the calculation of the endpoint coordinates of a large arc window provided in this application embodiment. Figure 1 ;
[0025] Figure 5B A schematic diagram illustrating the calculation of the endpoint coordinates of a large arc window provided in this application embodiment. Figure 2 ;
[0026] Figure 6 This is a schematic diagram illustrating the calculation of contour points based on unit vectors provided in an embodiment of this application.
[0027] Figure 7 A schematic diagram illustrating the adjustment of the target arc-shaped window position provided in an embodiment of this application;
[0028] Figure 8 This diagram illustrates how the curved window covers the gap in the curved wall and adjusts the type of the curved window according to an embodiment of this application.
[0029] Figure 9 This is a schematic diagram illustrating whether an endpoint is on an arc based on vector identification provided in an embodiment of this application.
[0030] Figure 10 A schematic diagram illustrating the updated target curved window shape provided in an embodiment of this application;
[0031] Figure 11 This is a schematic diagram of the arc-shaped window interaction device provided in the embodiments of this application;
[0032] Figure 12 This is a schematic diagram of the electronic device structure provided in the embodiments of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0034] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Multiple embodiments in this application may include two or more.
[0035] In the various embodiments of this application, it should be understood that the sequence number of each process described below does not imply 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 this application.
[0036] This application provides an embodiment of an interactive method for an arc-shaped window, such as... Figure 1 As shown, it includes:
[0037] Step 101: In response to the drag input of the target curved window, identify the target curved wall that meets the adsorption conditions between the target curved window and the target curved window, and adsorb the target curved window to the target curved wall.
[0038] The arc-shaped window provided in this application embodiment includes the following parameters: arc center point (representing the specific location of the arc-shaped window, specifically the center point of the middle arc), start point (start, representing the initial position of the arc-shaped window), end point (end, representing the final position of the arc-shaped window), chord length (chord, representing the straight-line distance from start to end), radius (radius, representing the radius of the circle containing the arc-shaped window, which is also the radius of the arc-shaped window), arc-shaped window category (whether it is a large arc or a small arc), and clockwise / counterclockwise direction of the arc-shaped window (determined based on the arc direction from the start point to the end point). Specifically, the arc-shaped window is determined to be a large or small arc by comparing the distance from the arc center point to the chord length and the arc-shaped window radius. If the distance from the arc center point to the chord length is greater than the arc-shaped window radius, it indicates a large arc; if the distance from the arc center point to the chord length is less than or equal to the arc-shaped window radius, it indicates a small arc. Typically, isSmall can be used to distinguish between large and small arcs; isSmall = true indicates a small arc, and isSmall = false indicates a large arc. Counterclockwise is used to indicate the clockwise or counterclockwise direction of a curved window. Specifically: Counterclockwise = true indicates counterclockwise, and Counterclockwise = false indicates clockwise. Figure 2 In the arc-shaped window shown, the distance from the center point of the arc to the chord length is less than the radius of the arc-shaped window. The arc-shaped window is a small arc, and the direction of the arc from the starting point to the ending point is clockwise, indicating that the arc-shaped window is in a clockwise direction.
[0039] After clicking the "Create Curved Window" button, a target curved window is drawn on the canvas. The mouse position represents the center point of the arc, which also indicates the position of the target curved window. The target curved window updates its position information as the mouse moves across the canvas. If a target curved wall close to the target curved window is detected, it is snapped to the wall. That is, when a target curved wall is detected on the canvas whose distance from the target curved window meets the snapping condition, the target curved window is snapped to the target curved wall. Snapping the target curved window to the target curved wall allows the window's shape to adapt to the wall, achieving a reasonable match between the curved window and the curved wall, significantly improving design efficiency.
[0040] Step 102: Upon receiving a motion interaction input for the target curved window, in response to the motion 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 curved window is snapped to the target curved wall, it can receive interactive input for movement. For example, after selecting the target curved window, it can be dragged to move it, with the drag point being the center point of the arc. To ensure the target curved window remains on the target curved wall, a large-distance snapping threshold can be applied to the drag point. This means that even if the mouse is not on the target curved window (e.g., at a certain distance), the target curved window will still remain snapped to the target curved wall, allowing dragging of the target curved window based on mouse movements.
[0042] Responding to mobile interactive input, the target curved window is controlled to move on the target curved wall. While maintaining the shape of the target curved window, its position on the target curved wall is adjusted, and the position of the target curved window is updated. This ensures that the target curved window always fits on the target curved wall during the movement, thus improving design accuracy.
[0043] Step 103: Upon receiving an update input for the first endpoint of the target curved window, adjust 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.
[0044] After snapping the target curved window to the target curved wall, it can receive update input for the first endpoint of the target curved window, which is either the start or end point of the target curved window. This update input for the first endpoint can be understood as dragging the first endpoint. During the dragging of the first endpoint, the target curved window remains on the target curved wall. Therefore, we also need to snap the mouse position to the wall at a large distance during dragging. This way, even if the mouse position is not on the target curved window, the target curved window will remain snapped to the target curved wall, allowing dragging of the target curved window's endpoint based on mouse movements.
[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 while the second endpoint remains unchanged on the target curved wall, the target curved window deforms. This deformation is based on the update input of the endpoints. 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 vice versa. During the deformation process, the target curved window remains attached to the target curved wall. By adjusting the position of the first endpoint of the target curved window on the target curved wall and updating the shape of the target curved window attached to the target curved wall, the shape of the target curved window is updated, ensuring that the target curved window remains attached to the target curved wall during deformation, thus improving design accuracy.
[0046] The above-described implementation scheme of this 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 wall, and adsorbs the target curved window to the target curved wall. This allows the shape of the window to adapt to the wall, achieving a reasonable match between the target curved window and the target curved wall, and greatly improving design efficiency. Based on the interactive input of moving the target curved window, the movement of the target curved window on the target curved wall is controlled, and the shape of the target curved window is updated based on the update input of the first endpoint of the target curved window. This ensures that the target curved window always fits against the target curved wall during movement and deformation, improving design accuracy. Moreover, the intuitive interaction method makes the design of complex curved structures simple and easy to use.
[0047] Furthermore, the highly flexible, precise, and easy-to-use arc-shaped structure design provided by the embodiments of this application offers new possibilities for architectural and interior design scenarios.
[0048] The process of adsorbing a target curved window onto a target curved wall is described below. In response to drag input to the target curved window, identifying the target curved wall that meets the adsorption conditions between the target curved window and the target curved wall, and adsorbing the target curved window onto the target curved wall, the process includes:
[0049] In response to drag input, update the position information of the target curved window;
[0050] During the process of dragging the target arc-shaped window to update its position information, identify whether there is an arc-shaped wall whose distance from the target arc-shaped window meets the adsorption conditions;
[0051] If a target arc wall is identified where the absolute value of the difference between the distance between the center of the circle and the arc center point of the target arc window and the wall radius is less than the adsorption threshold, the position of the arc center point of the target arc window on the corresponding arc center point on the target arc wall is determined, and the circle information of the target arc window is updated.
[0052] Based on the position of the arc center point, 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, calculate the starting and ending positions of the target arc window on the target arc wall.
[0053] Draw the target curved window on the target curved wall based on the starting and ending positions.
[0054] Based on the drag input of the target curved window on the canvas, the position information of the target curved window on the canvas is updated, and the shape of the target curved window remains unchanged during this process. While updating the position information of the target curved window on the canvas, it is identified whether there are curved walls whose distance from the target curved window meets the adsorption condition. Curved walls whose absolute value of the difference between the distance between the center of the identified circle and the center point of the arc of the target curved window and the radius of the wall is less than the adsorption threshold are identified as target curved walls.
[0055] like Figure 3A As shown, the difference between the distance d between the center of the curved wall and the center point of the target curved window, and the wall radius R, is positive. When the difference is less than the adsorption threshold, the curved wall is determined to be the target curved wall that has an adsorption relationship with the target curved window. Figure 3B As shown, the difference between the distance d between the center of the curved wall and the center point of the target curved window and the wall radius R is negative. If the absolute value of the difference is less than the adsorption threshold, the curved wall is determined to be the target curved wall that has an adsorption relationship with the target curved window.
[0056] After determining the target curved wall, the position of the arc center point corresponding to the arc center point of the target curved window is determined on the target curved wall, and the circle information of the target curved window is updated, replacing the circle information (radius and center) of the target curved window with the circle information of the target curved wall. Specifically, the updated radius of the target curved window is the radius of the attached target curved wall, and the updated center of the target curved window is the center of the attached target curved wall.
[0057] Given the known position of the center point of the arc of the target curved window on the corresponding arc center point on the target curved wall, the circle information corresponding to the target curved window, and the arc category to which the target curved window belongs (whether the target curved window belongs to a large arc or a small arc), calculate the starting position and ending position of the target curved window on the target curved wall based on the position of the arc center point, the chord length corresponding to the target curved window, the circle information corresponding to the target curved window, and the arc category to which the target curved window belongs. Then, draw the target curved window on the target curved wall based on the starting position and ending position.
[0058] The chord length corresponding to the target arc window remains unchanged. When calculating the starting and ending positions 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 calculation methods are used for different arc categories. Therefore, it is necessary to consider the arc category to which the target arc window belongs.
[0059] In the above implementation scheme, during the process of dragging the target curved window on the canvas, a target curved wall whose distance from the target curved window meets the snapping 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 type of the target curved window, the corresponding start position and end position on the target curved wall are calculated. The target curved window is drawn on the target curved wall according to the start position and end position. The target curved window can be snapped onto the target curved wall, so that the shape of the window is adapted to the wall, realizing the reasonable matching of the curved window and the curved wall, and greatly improving the design efficiency.
[0060] Specifically, determining the position of the arc center point of the target arc window on the corresponding arc center point on the target arc wall includes: determining the position of the arc center point of the target arc window on the corresponding arc center point on the target arc wall based on the intersection of the line connecting the arc center point of the target arc window and the center of the target arc wall or the extension of the line connecting the line and the target arc wall.
[0061] When determining the position of the center point of the arc corresponding to the center point of the target arc window on the target arc wall, such as Figure 3A As shown, based on the intersection of the line connecting the center point of the target curved window's arc and the center of the target curved wall with the target curved wall, the position of the center point of the corresponding arc on the target curved wall is determined. Figure 3A The intersection point 1 is the location of the arc center point.
[0062] When determining the position of the center point of the arc corresponding to the center point of the target arc window on the target arc wall, such as Figure 3B As shown, after connecting the center point of the arc of the target curved window to the center of the circle of the target curved wall, the position of the center point of the arc of the target curved window on the target curved wall is determined based on the intersection of the extension of the connecting line and the target curved wall. Figure 3B In the diagram, the intersection point 2 determined by the extended line (dashed line) is the location of the arc center point on the target arc wall.
[0063] In the above implementation process, based on the positional relationship between the target curved window and the target curved wall, the position of the center point of the arc corresponding to the target curved window on the target curved wall is determined by an appropriate method. The positional information of the target curved window on the target curved wall is calculated based on the accurate projection point, which provides a positional basis for redrawing the target curved window on the target curved wall and ensures that the curved window fits on the curved wall.
[0064] Optionally, when calculating the start and end positions of the target curved window on the target curved wall based on the position of the arc center point, the chord length corresponding to the target curved window, the circle information corresponding to the target curved window, and the arc category to which the target curved window belongs, the calculation includes:
[0065] In response to the fact that the target arc window belongs to the first type of arc window, coordinate calculations are performed based on the first angle, the second angle and the center coordinates of the target arc window to determine the first coordinate position and the second coordinate position. The first angle is the angle between the line connecting the arc center point and the center coordinates of the target arc window and the positive half axis of the X-axis. The second angle is 1 / 2 of the central angle of the target arc window.
[0066] Since the target curved window belongs to the second type of curved window, coordinate calculations are performed based on the third angle, fourth angle and center coordinates of the target curved 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 position of the arc center point are symmetrical about the center of the target curved window. The fourth angle is 360 minus 1 / 2 of the difference between the center angle of the target curved window and the center angle of the target curved window.
[0067] Determine the starting and ending positions based on the first and second coordinate positions;
[0068] Among them, arc windows 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 belong to the first type of arc window, and arc windows whose distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window belong 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 center point of the arc 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 center point of the arc 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 center coordinates of the target curved window and the positive half-axis of the X-axis. The second angle is determined based on half of the central angle of the target curved window. Then, coordinate calculations are performed based on the first angle, the second 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.
[0071] Wherein, the first angle (angle b) = Math.atan2(y-center.y, x-center.x), the second angle (angle a) = Math.asin(chord length / (2radius)) = central angle / 2, the angle range of the second angle is: greater than 0 degrees and less than or equal to 90 degrees, the coordinates of the arc center point are (x, y), and the coordinates of the center are (center.x, center.y).
[0072] The following example illustrates the process of determining the start and end points when the target curved window belongs to the first type of curved window. For example... Figure 4AAs shown, the target curved window is located in the fourth quadrant of the current coordinate system (the right side of the X-axis is the positive half-axis, and the bottom of the Y-axis is the positive half-axis). Angle 'a' is half the central angle and is taken as a positive angle. Angle 'b' is in the fourth quadrant and is taken as a negative angle. Angle 'c' is in the fourth quadrant and is taken as a negative angle, with angle 'c' = angle 'b' + angle 'a'. Angle 'd' is in the fourth quadrant and is taken as a negative angle, with angle 'd' = angle 'b' - angle 'a'. All four angles are considered in terms of sign. Specifically, 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 curved window is clockwise, the x-coordinate of the starting point A is Ax = center.x + R * cos(angle b - angle a), and its y-coordinate is Ay = center.y + R * sin(angle b - angle a), where R represents the updated radius of the target curved window. The x-coordinate of endpoint B is Bx = center.x + R*cos(angle b + angle a), and its y-coordinate is By = center.y + R*sin(angle b + angle a). If the target curved window is counterclockwise, the x-coordinate of starting point B is Bx = center.x + R*cos(angle b + angle a), and its y-coordinate is By = center.y + R*sin(angle b + angle a). The x-coordinate of endpoint A is Ax = center.x + R*cos(angle b - angle a), and its y-coordinate is Ay = center.y + R*sin(angle b - angle a).
[0073] In another example, such as Figure 4BAs shown, the target arc-shaped 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 half the central angle and is taken as a positive angle; angle b is taken as a negative angle; angle c1 = angle b + angle a and is taken as a negative angle; angle d1 = angle b - angle a and is taken as 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 negative, cos(angle c2) is positive, and they are opposites of each other; sin(angle c1) is negative, sin(angle c2) is negative, and they are equal. cos(angle d1) is negative, cos(angle d2) is positive, and they are opposites of each other; sin(angle d1) is negative, sin(angle d2) is negative, and they are equal. For the target curved window that is clockwise, the x-coordinate of the starting point B is Bx = center.XR*cos(angle d2) = center.X + R*cos(angle d1) = center.X + R*cos(angle b - angle a), and its y-coordinate is By = 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 x-coordinate of endpoint A is Ax = center.XR*cos(angle c2) = center.X + R*cos(angle c1) = center.X + R*cos(angle b + angle a), and its y-coordinate is 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 curved window is counter-clockwise, the x-coordinate of starting point A is Ax = center.X + R*cos(angle b + angle a), and its y-coordinate is Ay = center.y + R*sin(angle b + angle a); the x-coordinate of endpoint B is Bx = center.X + R*cos(angle b - angle a), and its y-coordinate is By = center.y + R*sin(angle b - angle a).
[0074] Based on the above calculations, the first and second coordinate positions of the target arc-shaped window belonging to the first type of arc window can be determined, which also determines the starting and ending positions.
[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 and the positive half-axis of the X-axis. The target position and the position of the arc center point are symmetrical about the center of the target curved window. The fourth angle is determined based on 360 minus 1 / 2 of the difference between the angle of the center of the target curved window and the angle of the center of the target curved window. Then, coordinate calculations are 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 / (2radius)) = (360-central angle) / 2, the coordinates of the arc center point are (x, y), the coordinates of the target point P are (Px, Py), and the coordinates of the center are (center.x, center.y).
[0077] For example, such as Figure 5A As shown, the target arc-shaped window is a large arc. The target position (point P), which is symmetrical to the center point of the arc about the center, is located in the second quadrant of the current coordinate system (the right side of the X-axis is the positive half-axis, and the bottom of the Y-axis is the positive half-axis). Both angles e and f are positive angles. For the case where the target arc-shaped window is clockwise, the x-coordinate of the starting point A is Ax = center.XR*cos(π-(angle e+angle f)) = center.X+R*cos(angle e+angle f), and its y-coordinate is Ay = center.y+R*sin(π-(angle e+angle f)) = center.y+R*sin(angle e+angle f); the x-coordinate of the ending point B is Bx = center.X+R*cos(angle e-angle f), and its y-coordinate is By = center.y+R*sin(angle e-angle f). For the target curved window that is counterclockwise, the x-coordinate of the starting point B is Bx = center.X + R*cos(angle e - angle f), and its y-coordinate is By = center.y + R*sin(angle e - angle f); the x-coordinate of the ending point A is Ax = center.X + R*cos(angle e + angle f), and its y-coordinate is Ay = center.y + R*sin(angle e + angle f).
[0078] Or, such as Figure 5BAs shown, the target arc-shaped window is a large arc. The target position (point P), which is symmetrical to the center point of the arc about the center, is located in the first quadrant of the current coordinate system (the right side of the X-axis is the positive half-axis, and the bottom of the Y-axis is the positive half-axis). Both angles e and f are positive angles. For the case where the target arc-shaped window is clockwise, the x-coordinate of the starting point A is Ax = center.X + R*cos(angle e + angle f), and its y-coordinate is Ay = center.y + R*sin(angle e + angle f); the x-coordinate of the ending point B is Bx = center.X + R*cos(angle e - angle f), and its y-coordinate is By = center.y + R*sin(angle e - angle f). For the target curved window that is counterclockwise, the x-coordinate of the starting point B is Bx = center.X + R*cos(angle e - angle f), and its y-coordinate is By = center.y + R*sin(angle e - angle f); the x-coordinate of the ending point A is Ax = center.X + R*cos(angle e + angle f), and its y-coordinate is Ay = center.y + R*sin(angle e + angle f).
[0079] Based on the above calculations, the first and second coordinate positions of the target arc window belonging to the second type of arc window can be determined, which also determines the starting and ending positions.
[0080] In the above implementation scheme, the coordinates of the endpoint position of the target curved window on the curved wall are calculated by using an appropriate scheme based on the type of curved window. The curved window can be ensured to fit on the curved wall based on an accurate parameter update algorithm.
[0081] Optionally, after determining the starting and ending positions, when drawing the target curved window on the target curved wall based on the starting and ending positions, the process includes:
[0082] The first outer contour point and the first inner contour point are determined based on the starting position, and the second outer contour point and the second inner contour point are determined based on the ending position.
[0083] The first starting point angle and the first ending point angle are determined based on the first outer contour point and the second outer contour point, and multiple discrete points of the outer contour arranged clockwise are determined based on the first starting point angle and the first ending point angle.
[0084] The second starting point angle and the second ending point angle are determined based on the first inner contour point and the second inner contour point, and multiple discrete points of the inner contour arranged clockwise are determined based on the second starting point angle and the second ending point angle.
[0085] Place the starting point, multiple outer contour discrete points, the ending point, and multiple inner contour discrete points as key points in the target array, and draw the target arc window on the target arc wall based on the key points in the target array.
[0086] Given the starting point position, calculate the tangent vector at that position, and then calculate two unit vectors perpendicular to the tangent vector. Based on the coordinates of the starting point and the two unit vectors, calculate and determine the outer and inner contour points of the starting point. Here, 'top' represents the outer contour of the curved wall, and 'bottom' represents the inner contour of the curved wall.
[0087] like Figure 6 As shown, the tangent vector unv at the starting position is determined, and then the first unit vector unv1 and the second unit vector unv2 are calculated. The directions of the first and second unit vectors are opposite. After defining the positive direction, the sign of the unit vectors needs to be considered when calculating based on them. The x-coordinate top.x of the first outer contour point = unv1.x * half the wall thickness + start.x, and the y-coordinate top.y of the first outer contour point = unv1.y * half the wall thickness + start.y. For the inner contour point, the x-coordinate bottom.x of the first inner contour point = unv2.x * half the wall thickness + start.x, and the y-coordinate bottom.y of the first inner contour point = unv2.y * half the wall thickness + start.y. The calculation method for the outer and inner contour points on the endpoint side is similar and will not be described here.
[0088] After determining the first outer contour point and the first inner contour point based on the starting position, and the second outer contour point and the second inner contour point based on the ending position, for the two outer contour points, the first starting angle startTopAngle and the first ending angle endTopAngle are calculated using the Math.atan2 function based on the information of the circle's center. 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) represent the coordinates corresponding to the first outer contour point at the starting position. After obtaining the first starting angle and the first ending angle, multiple discrete points of the outer contour arranged clockwise on the outer contour are calculated based on the first starting angle and the first ending angle.
[0089] At this stage, it is first necessary to determine whether the outer contour is clockwise or counterclockwise. If it is clockwise, the calculation is performed directly. If it is counterclockwise, the start and end points of the outer contour need to be replaced. After the replacement, startTopAngle and endTopAngle are determined. If endTopAngle is less than startTopAngle, 2π is added to endTopAngle.
[0090] When determining discrete points on the outer contour through calculation, the angle range of the corresponding arc of the outer contour is determined as endTopAngle minus startTopAngle. This angle range is divided into n equal parts, and the angle t corresponding to each part is t = startTopAngle + i(endTopAngle - startTopAngle) / n, where i takes a value 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 discrete points on the outer contour arranged clockwise can be determined.
[0091] Similarly, for the two inner contour points, the second starting angle (startBottomAngle) and the second ending angle (endBottomAngle) are calculated. After obtaining the second starting angle and the second ending angle, multiple discrete points of the inner contour arranged clockwise are calculated based on the second starting angle and the second ending angle. For a detailed explanation of the outer contour, please refer to the description of the outer contour, which will not be repeated here.
[0092] After determining multiple discrete points on the outer contour and multiple discrete points on the inner contour, identify whether the target curved window is clockwise or counterclockwise (the direction from the starting point to the ending point is clockwise or counterclockwise). If it is clockwise, first add the starting point to the target array, then add the multiple outer contour discrete points in ascending order, then add the ending point to the target array, and finally add the multiple inner contour discrete points in descending order. Draw the points in the target array sequentially, ensuring they are connected end-to-end, to draw the target curved window. If it is counterclockwise, first add the ending point to the target array, then add the multiple outer contour discrete points in ascending order, then add the starting point to the target array, and finally add the multiple inner contour discrete points in descending order. Draw the points in the target array sequentially, ensuring they are connected end-to-end, to draw the target curved window. The drawn target curved window can be understood in terms of shape as part of a target curved wall.
[0093] In the above implementation scheme, multiple outer contour discrete points and multiple inner contour discrete points are determined based on the starting point and ending point positions. The outer contour discrete points and inner contour discrete points are used as key points to draw the target arc-shaped window. The target arc-shaped window can be redrawn on the target arc-shaped wall, so that the target arc-shaped window is adapted to the wall, and the reasonable matching between the arc-shaped window and the arc-shaped wall is achieved.
[0094] The following describes a scheme for moving a target curved window on a target curved wall. Optionally, when controlling the movement of the target curved window on the target curved wall in response to a movement interaction input to update the position of the target curved window, the following steps are included:
[0095] In response to interactive input of dragging the center point of the target curved window on the target curved wall, update the start and end positions of the target curved window; based on the updated start and end positions, redraw the target curved window 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.
[0096] After selecting the target curved window, dragging it allows you to move it on the target curved wall. The dragging point is the center point of the curved window's arc; this dragging operation is the interactive input for moving the target curved window. Based on this interactive input, the start and end positions of the target curved window on the target curved wall are updated. During this process, the shape of the target curved window remains unchanged; only its position on the target curved wall changes.
[0097] After determining the updated start and end positions based on mobile interactive input, the target curved window is redrawn on the target curved wall based on the updated start and end positions, and the position of the target curved window on the target curved wall is updated to respond to mobile interactive input to control the movement of the target curved window on the target curved wall. For example... Figure 7 As shown, in the initial state, the target curved window is attached to the first position of the target curved wall. Based on the movement interaction input of dragging the target curved window, the position of the target curved window on the target curved wall is adjusted so as to update the position of the target curved window while maintaining its shape.
[0098] It should be noted that during the dragging of the target curved window, the starting and ending positions of the target curved window on the target curved wall are updated in real time. Based on these updated starting and ending positions, the target curved window is redrawn on the target curved wall to maintain its display during movement. The process of redrawing the target curved window based on the starting and ending positions will not be further elaborated here.
[0099] Optionally, if the perimeter of the target curved wall is greater than half the perimeter of the circle it is in, the method further includes: in response to the target curved window stopping moving on the target curved wall, identifying whether the two endpoints of the target curved wall are in the target curved window; and 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] Specifically, if the target curved window is a second type of curved window where the distance from the center point of the arc to the chord is greater than the radius of the target curved window, the target curved window is adjusted to a first type of curved window where the distance from the center point of the arc to the chord is less than the radius of the target curved window; if the target curved window is a first type of curved window, the target curved window is adjusted to a second type of curved 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 the circumference of the corresponding circle), since the target curved window moves and continuously adjusts its position on the target curved wall, there is a possibility that the target curved window will cover 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 determined whether the target curved window covers the gap in the curved wall. If it covers the gap in the curved wall, the target curved window is reclassified. 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. This can be simply understood as follows: For large arched windows that cover the gaps in the curved wall, adjust them to small arched windows; for small arched windows that cover the gaps in the curved wall, adjust them to large arched windows. For example, such as... Figure 8 As shown, the large curved window moves on the curved wall. When it stops moving, the large curved window covers the gap in the curved wall. At this point, the large curved window is adjusted to become a small curved window that attaches to the curved wall. Consider a special case: if the distance from the center point of the arc to the chord length is equal to the radius corresponding to the target curved window, then the target curved window also belongs to the first type of curved window. When adjusting, the starting and ending positions are interchanged to adjust the curved window, or the arc direction from the starting point to the ending point is adjusted to adjust the curved window.
[0102] When adjusting a small arc window to a large arc window, or vice versa, since the starting and ending positions are known, the arc window can be redrawn in the manner described above. Alternatively, if the starting and ending positions are known, the new arc window can be determined by directly changing the clockwise or counterclockwise direction from the starting point to the ending point.
[0103] In determining whether a target curved window covers a gap in a curved wall, it can be identified whether the two endpoints of the target curved wall are within the target curved window. If both endpoints are within the target curved window, then it is determined that the target curved window covers the gap in the curved wall. For a specific endpoint of the target curved wall, the following method can be used to identify whether that endpoint is within the target curved window:
[0104] The first and second vectors are determined based on the arc center point of the target arc window and the two endpoints of the target arc window; the third vector is determined based on the arc center point of the target arc window and the center of the circle; and the fourth vector is determined based on the arc center point of the target arc window and the endpoint of the target arc wall.
[0105] The first value is determined by multiplying the value of the cross product of the first vector and the fourth vector by the cross product of the first vector and the third vector.
[0106] The second value is determined by multiplying the value of the cross product of the second vector and the fourth vector, and the value of the cross product of the second vector and the third vector.
[0107] In response to a negative first or second value, determine that the endpoint of the target curved wall is within the target curved window.
[0108] When determining whether a point is on the left or right side of a line, the cross product operation can be used. If two points (such as point A and point B) are on opposite 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 cross product of vector 1 and vector 2 and the cross product of vector 1 and vector 3 will definitely be less than 0.
[0109] like Figure 9 As shown, the first vector is determined by the arc center point P and the starting point start of the target curved window; the second vector is determined by the arc center point P and the ending point end of the target curved window; and the third vector is determined by the arc center point P and the center O of the circle. If there exists a point E (the endpoint of the target curved wall) on the arc corresponding to P and start, then points E and O must be on opposite sides of the line containing vector Pstart (the first vector). That is, the cross product of vector Pstart and vector PE (the fourth vector) multiplied by the cross product of vector Pstart and vector PO (the third vector) will always be negative. Similarly, if there exists a point E (the endpoint of the target curved wall) on the arc corresponding to P and end, then points E and O must be on opposite sides of the line containing vector Pend (the second vector). That is, the cross product of vector Pend and vector PE (the fourth vector) multiplied by the cross product of vector Pend and vector PO (the third vector) will always be negative.
[0110] Based on the above, it can be determined that for a certain endpoint of the target curved wall, if either the first value (the product of the first vector's cross product with the fourth vector and the first vector's cross product with the third vector) or the second value (the product of the second vector's cross product with the fourth vector and the second vector's cross product with the third vector) is negative, then that endpoint of the target curved wall is determined to be within the target curved window. The same judgment strategy is used to identify whether the other endpoint of the target curved wall is within the target curved window.
[0111] In the above implementation scheme, when the target curved window updates its position on the target curved wall, it is identified whether the target curved window covers the gap in the curved wall when the target curved window stops moving. If the target curved window covers the gap in the curved wall, the target curved window is reclassified and a new curved window is determined. This intelligently handles the special case of large curved walls through a dynamic large and small arc switching mechanism, solving the problem of large curved wall gaps being covered and enhancing applicability.
[0112] The following describes a scheme for updating the shape of a curved window. Optionally, when 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, the following steps are included:
[0113] In response to the update input of dragging the first endpoint of the target curved window to change its position on the target curved wall, update the chord length of the target curved window and the position information of the first endpoint; update the arc center point of the target curved window according to the position information of the first endpoint and the initial position information of the second endpoint; determine the category of the target curved window according to the distance between the arc center point and the chord length; 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.
[0114] After selecting the first endpoint (start or end point) of the target curved window, drag the first endpoint to update its position on the target curved wall. Since the first endpoint's position is updated while the second endpoint remains stationary, the chord length corresponding to the target curved window changes. Based on the dragging first endpoint and the other endpoint (second endpoint), determine the target curved window's position point (arc center point) to update the arc center point of the target curved 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 chord length, calculate the distance from the arc center point to the chord length. Based on the calculated distance and the current radius of the target curved window, identify the category of the target curved window. Then, based on the category of the target curved window, the position information of the first endpoint, and the initial position information of the second endpoint, redraw the target curved window on the target curved wall.
[0115] Specifically, when updating the arc center point of the target arc window based on 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 based on the position information of the first endpoint and the initial position information of the second endpoint. Then, based on the coordinates of the center O and the coordinates of the chord center F, the unit vector unv3 in the OF direction is calculated. The coordinates of the arc center point are determined based on the coordinates of the center O, the unit vector unv3, and the radius R. For example, the abscissa of the arc center point P is Px = center.x + unv3.x * R, and the ordinate of the arc center point P is Py = center.y + unv3.y * R.
[0116] After determining the arc center point and chord length, the distance from the arc center point to the chord length is calculated. This distance is compared with the radius of the target arc window. If the distance 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. With the arc window type determined, the target arc window is redrawn on the target arc wall based on the position information of the first endpoint and the initial position information of the second endpoint. The redrawing process is not described here. Because the first endpoint updates its position in real time while being dragged, 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 shape changes.
[0117] After dragging the first endpoint stops, the shape update of the target curved window ends. At this point, the target curved window attached to the target curved wall is the curved window after the shape change. For example, Figure 10 As shown, by dragging one end point and changing the shape of the target curved window, the small curved window attached to the curved wall can be adjusted into a large curved window.
[0118] In the above implementation scheme, the target curved window is updated by updating the position of the endpoint of the target curved window on the curved wall. The window shape can be adjusted in real time based on the movement of the drag point, and the curved window shape can be edited and updated intuitively.
[0119] This application also provides an arc-shaped window interaction device, such as... Figure 11 As shown, it includes:
[0120] The identification and adsorption module 1101 is used to identify a target arc-shaped wall that meets the adsorption conditions between the target arc-shaped window and the target arc-shaped window in response to the drag input of the target arc-shaped window, and adsorb the target arc-shaped window to the target arc-shaped wall.
[0121] The control module 1102 is configured to, upon receiving a motion interaction input to the target curved window, control the target curved window to move on the target curved wall in response to the motion interaction input, so as to update the position of the target curved window;
[0122] The adjustment module 1103 is used to adjust the position of the first endpoint on the target curved wall in response to the update input when receiving an update input for the first endpoint of the target curved window, so as to update the shape of the target curved window.
[0123] Optionally, the identification and adsorption module includes:
[0124] The first update submodule is used to update the position information of the target arc-shaped window in response to the drag input;
[0125] The identification submodule is used to identify whether there is an arc-shaped wall whose distance from the target arc-shaped window meets the adsorption condition during the process of dragging the target arc-shaped window to update its position information.
[0126] The determination update submodule is used to determine the position of the arc center point of the target arc window on the target arc wall when the absolute value of the difference between the distance between the center of the circle and the arc center point of the target arc window and the wall radius is less than the adsorption threshold, and update the circle information of the target arc window.
[0127] The calculation submodule is used to calculate the starting position and ending position of the target arc window on the target arc wall based on the position of the arc center point, 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] A drawing submodule is used to draw the target arc-shaped window on the target arc-shaped wall according to the starting position and the ending position.
[0129] Optionally, the determination update submodule is further used for:
[0130] Based on the intersection of the line connecting the center point of the arc of the target arc window and the center of the target arc wall, or the extension of the line connecting the center point of the arc of the target arc wall, with the target arc wall, the position of the center point of the arc of the target arc window on the target arc wall is determined.
[0131] Optionally, the computing submodule includes:
[0132] The first processing unit is configured to, in response to the fact that the target arc-shaped window belongs to the first type of arc window, perform coordinate calculations based on the first angle, the second angle, and the center coordinates of the target arc-shaped window to determine the first coordinate position and the second coordinate position. The first angle is the angle between the line connecting the arc center point and the center coordinates of the target arc-shaped window and the positive half-axis of the X-axis. The second angle is 1 / 2 of the central angle of the target arc-shaped window.
[0133] The second processing unit is used to respond to the fact that the target arc window belongs to the second type of arc window, and to perform coordinate calculations based on the third angle, fourth angle and center coordinates of 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 target arc window. The fourth angle is 360 minus 1 / 2 of the difference between the center angle of the target arc window and the center angle of the target arc window.
[0134] The first determining unit is configured to determine the starting point position and the ending point position based on the first coordinate position and the second coordinate position;
[0135] Among them, arc windows 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 belong to the first type of arc window, and arc windows whose distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window belong to the second type of arc window.
[0136] Optionally, the drawing submodule includes:
[0137] The second determining unit is used to determine the first outer contour point and the first inner contour point according to the starting position, and to determine the second outer contour point and the second inner contour point according to the ending position.
[0138] The third determining unit is used to determine the first starting point angle and the first ending point angle based on the first outer contour point and the second outer contour point, and to determine a plurality of discrete points on the outer contour arranged clockwise based on the first starting point angle and the first ending point angle.
[0139] The fourth determining unit is used to determine the second starting point angle and the second ending point angle based on the first inner contour point and the second inner contour point, and to determine a plurality of discrete inner contour points arranged clockwise on the inner contour based on the second starting point angle and the second ending point angle.
[0140] The drawing processing unit is used to place the starting point, the plurality of outer contour discrete points, the ending point, and the plurality of inner contour discrete points as key points in the target array, and draw the target arc window on the target arc wall according to the key points in the target array.
[0141] Optionally, the control module includes:
[0142] The second update submodule is used to update the start position and end position of the target arc window in response to the 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 start position and end position, so as 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, if the perimeter of the target curved wall is greater than half the circumference of the circle in which it is located, the device further includes:
[0145] The identification module is used to identify whether the two endpoints of the target curved wall are in the target curved window in response to the target curved window stopping moving on the target curved wall;
[0146] The processing module is configured to adjust the category of the target curved window in response to the two endpoints of the target curved wall being in the target curved window;
[0147] If the target arc window is a second type of arc window where 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 of arc window where 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 of arc window, the target arc window is adjusted to a second type of arc window.
[0148] Optionally, the adjustment module includes:
[0149] The third update submodule is used to update the chord length corresponding to the target arc window and the position information of the first endpoint in response to the update input of dragging the first endpoint of the target arc window to change its position on the target arc wall;
[0150] The fourth update submodule is used to update the arc center point of the target arc window based on the position information of the first endpoint and the initial position information of the second endpoint.
[0151] A determination submodule is used to determine the category of the target arc-shaped window based on the distance between the arc center point and the chord length;
[0152] The second redrawing submodule is used to redraw the target arc-shaped window on the target arc-shaped wall according to the category of the target arc-shaped 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-shaped wall and update the shape of the target arc-shaped window.
[0153] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0154] This 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, it implements the various processes of the above-described arc-shaped window interaction method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0155] For example, Figure 12 A schematic diagram of the physical structure of an electronic device is shown. (For example...) Figure 12As shown, the electronic device may include a processor 1210, a communications interface 1220, a memory 1230, and a communication bus 1240. The processor 1210, communications interface 1220, and memory 1230 communicate with each other via the communication bus 1240. The processor 1210 can call logical instructions from the memory 1230. The processor 1210 is used to execute various processes of the arc-shaped window interaction method according to the embodiments of this application, which will not be described in detail here.
[0156] Furthermore, the logical instructions in the aforementioned memory 1230 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0157] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described arc-shaped window interaction method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be 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 document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0159] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0160] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A curved window interaction method, characterized in that, include: In response to the drag input of the target curved window, a target curved wall that meets the adsorption conditions between the target curved window and the target curved window is identified, and the target curved window is adsorbed to the target curved wall; Upon receiving a motion interaction input for the target curved window, in response to the motion interaction input, the target curved window is controlled to move on the target curved wall to update the position of the target curved window; Upon receiving an update input for the first endpoint of the target curved window, 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; The step of attaching the target curved window to the target curved wall includes: Determine the position of the arc center point of the target arc window corresponding to the arc center point on the target arc wall, and update the circle information of the target arc window; Based on the position of the arc center point, 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, calculate the starting point and ending point positions of the target arc window on the target arc wall. The target arc-shaped window is drawn on the target arc-shaped wall according to the starting position and the ending position.
2. The method according to claim 1, characterized in that, The step of identifying a target curved wall that meets the adsorption conditions with respect to the target curved window in response to a drag input to the target curved window includes: In response to the drag input, update the position information of the target curved window; During the process of dragging the target arc-shaped window to update its position information, it is identified whether there is an arc-shaped wall whose distance from the target arc-shaped window meets the adsorption conditions. If an arc wall is identified where the absolute value of the difference between the distance between the center of the arc and the center point of the target arc window and the wall radius is less than the adsorption threshold, the identified arc wall is determined to be the target arc wall.
3. The method according to claim 2, characterized in that, Determining the position of the arc center point of the target arc-shaped window corresponding to the arc center point on the target arc-shaped wall includes: Based on the intersection of the line connecting the center point of the arc of the target arc window and the center of the target arc wall, or the extension of the line connecting the center point of the arc of the target arc wall, with the target arc wall, the position of the center point of the arc of 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 start and end positions of the target arc window on the target arc wall based on 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 fact that the target arc-shaped window belongs to the first type of arc window, coordinate calculation is performed based on the first angle, the second angle and the center coordinates of the target arc-shaped window to determine the first coordinate position and the second coordinate position. The first angle is the angle between the line connecting the arc center point and the center coordinates of the target arc-shaped window and the positive half axis of the X-axis. The second angle is 1 / 2 of the central angle of the target arc-shaped window. In response to the fact that the target arc-shaped window belongs to the second type of arc window, coordinate calculations are performed based on the third angle, fourth angle and center coordinates of the target arc-shaped 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 target arc window. The fourth angle is 360 minus 1 / 2 of the difference between the center angle of the target arc window and the center angle of the target arc window. The starting point and the ending point are determined based on the first coordinate position and the second coordinate position; Among them, arc windows 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 belong to the first type of arc window, and arc windows whose distance from the arc center point to the chord length is greater than the radius corresponding to the target arc window belong to the second type of arc window.
5. The method according to claim 2, characterized in that, The step of drawing the target arc-shaped window on the target arc-shaped wall according to the starting position and the ending position includes: The first outer contour point and the first inner contour point are determined based on the starting position, and the second outer contour point and the second inner contour point are determined based on the ending position. The first starting point angle and the first ending point angle are determined based on the first outer contour point and the second outer contour point, and multiple discrete points of the outer contour arranged clockwise are determined based on the first starting point angle and the first ending point angle. The second starting point angle and the second ending point angle are determined based on the first inner contour point and the second inner contour point, and multiple discrete points of the inner contour arranged clockwise are determined based on the second starting point angle and the second ending point angle. The starting point, the plurality of outer contour discrete points, the ending point, and the plurality of inner contour discrete points are placed as key points in the target array, and the target arc window is drawn on the target arc wall according to the key points in the target array.
6. The method according to claim 1, characterized in that, The step of controlling the target curved window to move on the target curved wall in response to the mobile interaction input, so as to update the position of the target curved window, includes: In response to interactive input of dragging the center point of the target curved window on the target curved wall, update the start position and end position of the target curved window; Based on the updated start and end positions, the target curved window is redrawn on the target curved wall to control the movement of the target curved window and update its position on the target curved wall.
7. The method according to claim 6, characterized in that, When the perimeter of the target curved wall is greater than half the circumference of the circle it lies in, the method further includes: In response to the target curved window stopping moving on the target curved wall, it is identified whether the two endpoints of the target curved wall are within the target curved window; In response to the two endpoints of the target curved wall being in the target curved window, the target curved window is categorized and adjusted; If the target arc window is a second type of arc window where 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 of arc window where 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 of arc window, the target arc window is adjusted to a second type of arc window.
8. The method according to claim 1, characterized in that, The step of 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 includes: In response to an update input that drags the first endpoint of the target curved window to change its position on the target curved wall, the chord length corresponding to the target curved window and the position information of the first endpoint are updated. The arc center point of the target arc window is updated based on the position information of the first endpoint and the initial position information of the second endpoint; The category of the target arc-shaped window is determined based on the distance between the center point of the arc and the chord length; Based on 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. An interactive device with an arc-shaped window, characterized in that, include: The identification and adsorption module is used to identify a target curved wall that meets the adsorption conditions between the target curved window and the target curved window in response to the drag input of the target curved window, and adsorb the target curved window to the target curved wall. The control module is configured to, upon receiving a motion interaction input to the target curved window, control the target curved window to move on the target curved wall in response to the motion interaction input, so as to update the position of the target curved window; An adjustment module is configured to, upon receiving an update input for the first endpoint of the target curved window, adjust the position of the first endpoint on the target curved wall in response to the update input, so as to update the shape of the target curved window; The identification and adsorption module includes: The determination update submodule is used to determine the position of the arc center point of the target arc window corresponding to the arc center point on the target arc wall, and update the circle information of the target arc window; The calculation submodule is used to calculate the starting position and ending position of the target arc window on the target arc wall based on the position of the arc center point, 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; A drawing submodule is used to draw the target arc-shaped window on the target arc-shaped wall according to the starting position and the ending position.
10. An electronic device, characterized in that, It includes 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-shaped window interaction method as described in any one of claims 1 to 8.