Method for changing any sharp corner into round corner

By calculating the starting position and intersection of the triangle rounded corners, the rounded triangle is generated, which solves the problem of the lack of unified standards for any sharp corners to turn corners in the prior art, and realizes the expected and unified standards for rounded corner effects in image development.

CN119067835APending Publication Date: 2024-12-03HONGCHENG TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411175569.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the prior art, there is a lack of unified standards for the implementation method of turning a sharp corner into a rounded corner, which makes it difficult to predict the effect of rounded corners in image development, and the specific effect of methods such as Bezier curve drag and drop depends on human eye observation.

Method used

By specifying the distance between the starting position of the triangle round corner from the vertices on both sides, calculate the formula for straight lines on both sides, and obtain the intersection point of the vertical line between the end point and the corner. Use the intersection point as the center, and the center to the end point as the radius to make a circle, generate a round triangle to form the expected Rounded corner graphics for the effect.

Benefits of technology

The expected effect when sharp corners are deformed into rounded corners is achieved, the problem of parameter adjustment of rounded corner shapes in image development is solved, and an expected unified standard is provided to facilitate graphics software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067835A_ABST
    Figure CN119067835A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image drawing, in particular to an implementation method for changing any sharp corner into a round corner, by setting and determining parameters, when the sharp corner is changed into the round corner, the generation effect can be expected, so that development and use of software with related shapes such as graphics can be facilitated, and the development efficiency is improved. Firstly, the distance between the initial position of the triangular fillet and the vertexes on the two sides is specified, then a formula of two adjacent straight lines is obtained through the coordinates of two points of the straight lines, and the coordinates of the initial positions of the fillet on the two sides are obtained through the specified distance between the endpoints and the vertexes. Obtaining a linear equation with the end points perpendicular to the two sides of the angle through a perpendicular formula, obtaining an intersection point of the two straight lines through the equation, making a circle with the intersection point as the circle center and one of the circle center and the two end points as the radius, and reserving an arc between the two points to generate a rounded triangle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image drawing, and in particular to a method for realizing changing any sharp corner into a rounded corner. Background Art

[0002] In contemporary graphic design, rounded corners are increasingly replacing right angles. The previous rectangular icons are now basically replaced by rounded rectangular icons. Even other polygons, such as triangles, are now becoming more and more rounded. Graphic design drawing can be achieved by simply erasing corners or making Bezier lines, but for image development, these rounded corner effects must be achieved through specific parameters to obtain the desired shape in an expected manner. At the same time, there are many ways to draw rounded corners. In addition to the relatively regular standard graphics that can be directly adjusted through parameters, the method of achieving rounded corners of any angle is generally to use Bezier curves to drag and drop. The specific implementation effect is subject to human eye viewing, and there is no unified standard. Summary of the invention

[0003] In view of the above problems, the present invention provides a method for converting any sharp corner into a rounded corner.

[0004] The technical solution adopted is a method for converting any sharp corner into a rounded corner, comprising the following steps: S1. Specify the distance between the starting position of the triangle rounded corners and the vertices of both sides; S2. Get the formula of the two adjacent sides of the line through the coordinates of the two points of the line; S3. Obtain the coordinates of the starting positions of the rounded corners on both sides by the specified distance between the endpoint and the vertex; S4. Obtain the equation of the line perpendicular to the endpoints and the two sides of the angle by using the perpendicular formula and use this equation to obtain the intersection of the two lines; S5. Draw a circle with the intersection point as the center and the radius from the center to one of the two endpoints. Keep the arc between the two points to generate a rounded triangle.

[0005] Optionally, in S1, the distance between the starting position and the vertices on both sides is specified as L.

[0006] Optionally, in S2, select two points on the coordinate axis with coordinates (X1, Y1) and (X2, Y2), and (X1, Y1) and (X2, Y2) satisfying: ; At the same time, the coordinates of the three endpoints of the triangle are A (XA, YA), B (XB, YB) and C (XC, YC), and A, B, and C satisfy: ; .

[0007] Optionally, in S3, the distance formula between two points can be used to obtain ,in is the distance between point A and point B, and the coordinates of D (XD, YD) are obtained by the following formula: ; .

[0008] Optionally, in S3, the distance formula between two points can be used to obtain ,in is the distance between point C and point B, and the coordinates of E (XE, YE) are obtained by the following formula: ; .

[0009] Optionally, in S4, the coordinates of two points on the coordinate axis (X1, Y1) and (X2, Y2) satisfy: ; And mutually perpendicular lines satisfy: ; Through the slope k, the coordinates of point D (XD, YD) and the coordinates of point E (XE, YE), we can get the coordinates P (XP, YP) ​​of the intersection of the two straight lines.

[0010] Optionally, in S5, the arc area is obtained by using the coordinates P (XP, YP) ​​of the intersection of the two straight lines and the standard equation of the circle: ; And combine the circle and ADEC area obtained by the above formula to get the final rounded corner shape.

[0011] The beneficial effects of the present invention include at least one of the following: 1. By setting certain parameters, when the sharp corners are deformed into rounded corners, the generated effect can be expected, which can facilitate the development and use of software related to graphics and other shapes.

[0012] 2. It solves the problem that the existing image development phase must use specific parameters to obtain the expected shape. There are many ways to draw rounded corners. In addition to the relatively positive standard graphics that can be directly adjusted through parameters, the method of rounding any corner is generally achieved by dragging the Bezier curve. The specific implementation effect is based on the human eye, and there is no unified standard. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a schematic diagram of changing any sharp corner into a rounded corner. DETAILED DESCRIPTION

[0014] The following describes the implementation of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific implementations, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0015] It should be noted that the illustrations provided in the following embodiments are only used to schematically illustrate the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0016] A method for converting any sharp corner into a rounded corner comprises the following steps: S1. Specify the distance between the starting position of the triangle rounded corners and the vertices of both sides; S2. Get the formula of the two adjacent sides of the line through the coordinates of the two points of the line; S3. Obtain the coordinates of the starting positions of the rounded corners on both sides by the specified distance between the endpoint and the vertex; S4. Obtain the equation of the line perpendicular to the endpoints and the two sides of the angle by using the perpendicular formula and use this equation to obtain the intersection of the two lines; S5. Draw a circle with the intersection point as the center and the radius from the center to one of the two endpoints. Keep the arc between the two points to generate a rounded triangle.

[0017] The purpose of this design is to set certain parameters so that when sharp corners are deformed into rounded corners, the generated effect can be predicted, thereby facilitating the development and use of software for graphics and other related shapes, and solving the problem that the existing image development phase must use specific parameters to obtain the desired shape in an expected manner. At the same time, there are many ways to draw rounded corners. In addition to the relatively straight standard graphics that can be directly adjusted through parameters, the method of rounding arbitrary corners is generally achieved by dragging Bezier curves. The specific implementation effect is based on the human eye, and there is no unified standard problem.

[0018] In the specific implementation, Figure 1As shown, a triangle is formed by three points A, B, and C in space. At the same time, a coordinate point D is selected on the straight line AB, and a coordinate point E is selected on the straight line CB, and the lengths of DB and EB are both L, where ABC is an arbitrary angle. PD and PE are perpendicular to the sides AB and BC respectively, and a circle is made with point P as the center and PD as the radius. Finally, the arc in the middle of the circle ED is taken to form the final rounded image with ACED. In the specific calculation, the coordinates of two points on the coordinate axis (X1, Y1) and (X2, Y2) are first selected, and (X1, Y1) and (X2, Y2) satisfy: ; At the same time, the coordinates of the three endpoints of the triangle are A (XA, YA), B (XB, YB) and C (XC, YC), and A, B, and C satisfy: ; .

[0019] At the same time, the distance formula between two points can be obtained ,in is the distance between point A and point B, and the coordinates of D (XD, YD) are obtained by the following formula: ; .

[0020] The distance formula between two points can be obtained ,in is the distance between point C and point B, and the coordinates of E (XE, YE) are obtained by the following formula: ; .

[0021] Next, the coordinates of the two points on the coordinate axis (X1, Y1) and (X2, Y2) satisfy: ; And mutually perpendicular lines satisfy: ; Through the slope k, the coordinates of point D (XD, YD) and the coordinates of point E (XE, YE), we can get the coordinates P (XP, YP) ​​of the intersection of the two straight lines.

[0022] It should be pointed out that when performing calculations, if the slope of k1 does not exist, it means that its vertical line is a fixed constant.

[0023] Finally, the arc area is obtained by the coordinates of the intersection point P (XP, YP) ​​of the two straight lines and the standard equation of the circle: ; And combine the circle and ADEC area obtained by the above formula to get the final rounded corner shape.

[0024] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for converting any sharp corner into a rounded corner, characterized in that: The following steps are involved: S1. Specify the distance between the starting position of the triangle rounded corners and the vertices of both sides; S2. Get the formula of the two adjacent sides of the line through the coordinates of the two points of the line; S3. Obtain the coordinates of the starting positions of the rounded corners on both sides by the specified distance between the endpoint and the vertex; S4. Obtain the equation of the line perpendicular to the endpoints and the two sides of the angle by using the perpendicular formula and use this equation to obtain the intersection of the two lines; S5. Draw a circle with the intersection point as the center and the radius from the center to one of the two endpoints. Keep the arc between the two points to generate a rounded triangle.

2. The method for converting any sharp corner into a rounded corner according to claim 1, characterized in that: In S1, the distance between the starting position and the vertices on both sides is specified as L.

3. The method for converting any sharp corner into a rounded corner according to claim 1, characterized in that: In S2, select two points on the coordinate axis with coordinates (X1, Y1) and (X2, Y2), and (X1, Y1) and (X2, Y2) satisfying: ; At the same time, the coordinates of the three endpoints of the triangle are A (XA, YA), B (XB, YB) and C (XC, YC), and A, B, and C satisfy: ; 。 4. The method for converting any sharp corner into a rounded corner according to claim 3, characterized in that: In S3, the distance formula between two points can be obtained ,in is the distance between point A and point B, and the coordinates of D (XD, YD) are obtained by the following formula: ; 。 5. The method for converting any sharp corner into a rounded corner according to claim 4, characterized in that: In S3, the distance formula between two points can be obtained ,in is the distance between point C and point B, and the coordinates of E (XE, YE) are obtained by the following formula: ; 。 6. A method for converting any sharp corner into a rounded corner according to claim 5, characterized in that: In S4, the coordinates of two points on the coordinate axis (X1, Y1) and (X2, Y2) satisfy: ; And mutually perpendicular lines satisfy: ; Through the slope k, the coordinates of point D (XD, YD) and the coordinates of point E (XE, YE), we can get the coordinates P (XP, YP) ​​of the intersection of the two straight lines.

7. The method for converting any sharp corner into a rounded corner according to claim 6, characterized in that: In S5, the arc area is obtained by the coordinates of the intersection of the two straight lines P (XP, YP) ​​and the standard equation of the circle: ; And combine the circle and ADEC area obtained by the above formula to get the final rounded corner shape.