CN110211202A - Broken line method for drafting, device, electronic equipment and storage medium - Google Patents

Broken line method for drafting, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110211202A
CN110211202A CN201910471964.7A CN201910471964A CN110211202A CN 110211202 A CN110211202 A CN 110211202A CN 201910471964 A CN201910471964 A CN 201910471964A CN 110211202 A CN110211202 A CN 110211202A
Authority
CN
China
Prior art keywords
point
offset
line
line segment
broken line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910471964.7A
Other languages
Chinese (zh)
Other versions
CN110211202B (en
Inventor
舒经纬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201910471964.7A priority Critical patent/CN110211202B/en
Publication of CN110211202A publication Critical patent/CN110211202A/en
Application granted granted Critical
Publication of CN110211202B publication Critical patent/CN110211202B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

This application discloses a kind of broken line method for drafting, device, electronic equipment and storage mediums, belong to technical field of image processing.The described method includes: according to the offset point D and offset point G of point A, the point A, and point B and point C, determine the offset point E and offset point H of the point B, the point A is the last one point on the broken line drawn, the point B is currently to need increased point, and the point C needs an increased point after being the point B;If the broken line type currently drawn determines two triangles according to the offset point D, the offset point G, the offset point E and the offset point H for wedge angle broken line;Described two triangles are rendered, obtain the broken line between the point A and the point B to draw.Method provided by the present application can reduce the consumption of memory headroom, and need the quantity of the triangle rendered to improve rendering speed so as to shorten render time, and then improve the drafting speed of broken line.

Description

Broken line method for drafting, device, electronic equipment and storage medium
Technical field
This application involves technical field of image processing, in particular to a kind of broken line method for drafting, device, electronic equipment and deposit Storage media.
Background technique
Broken line usually has certain line width, and broken line may include straight angle broken line, wedge angle broken line and fillet broken line.Than Such as, shown in FIG. 1 is a kind of straight angle broken line, and shown in Fig. 2 is a kind of wedge angle broken line, and shown in Fig. 3 is a kind of fillet broken line.
Currently, being substantially through Open GL (Open Graphics Library, open image program interface) skill Art draws broken line.As shown in figure 4, can be with by the operation of Open GL technology to drawing broken line are as follows: for the broken line drawn On point A, needed on the basis of point A if current, the broken line between graphical pointv A and point B, then can at point A edge One half-distance of vertical direction downward shift line width of line segment AB, obtains point A1 and point A2, and similarly, determination obtains point C1 at point C With point C2.Vertical Square at point B along line segment AB and line segment BC offsets up one half-distance of line width and obtains point B1 and point B2, end Point is point A1 and is parallel to the ray of line segment AB and endpoint is point C1 and is parallel to the ray intersection of line segment BC in point D1.By triangle Shape A2D1B1, A2A1D1 is determined as broken line body region triangle.If drawing wedge angle broken line, connecting line segment A2B1, C2B2 Reverse extending line intersect at point F1, triangle B1D1F1, B2D1F1 are determined as broken line corner area triangle.Later, will All broken line body region triangles and broken line corner area triangle, which render, to be come, and can be drawn on the basis of point A Obtain the broken line between point A and point B.It similarly, can according to the method described above, on the basis of point B between graphical pointv B and point C Broken line.
However, the above method, for wedge angle broken line, needs to store the data of four points at the every increase of broken line one, And four triangles of rendering, and render time is usually with the quantity of triangle come what is calculated, therefore, the above method not only disappears A large amount of memory headroom has been consumed, also will affect rendering speed.For example, increase point B on the basis of being currently at point A, then, it needs The data of this four points of B1, B2, F1, D1 are stored, and need to render this four triangles of A2D1B1, A2A1D1, B1D1F1, B2D1F1 Shape.
Summary of the invention
This application provides a kind of broken line method for drafting, device, electronic equipment and storage mediums, can solve the relevant technologies Memory headroom consume problem larger, that rendering speed is slower.The technical solution is as follows:
On the one hand, a kind of broken line method for drafting is provided, which comprises
According to the offset point D and offset point G of point A, the point A, and point B and point C, determine the offset point E of the point B with Offset point H, the point A are the last one point on the broken line drawn, and the point B is currently to need increased point, described Point C needs an increased point after being the point B;
If the broken line type currently drawn be wedge angle broken line, according to the offset point D, the offset point G, it is described partially The point E and offset point H is moved, determines two triangles;
Described two triangles are rendered, obtain the broken line between the point A and the point B to draw.
Optionally, the offset point D and offset point G according to point A, the point A, and point B and point C, determine the point B Offset point E and offset point H, comprising:
The distance between determining and first line segment is the half of the line width of broken line to be drawn and is parallel to described first Two rays of line segment, line segment of first line segment between the point A and the point B, the endpoint point of two rays It Wei not the offset point D and offset point G;
It is determining the distance between with second line segment for the half of the line width and be parallel to two of the second line segment it is straight Line, line segment of the second line segment between the point B and the point C;
Intersection point between first straight line in the first ray and two straight lines in two rays is determined as The offset point H, the intersection point between the second straight line in the second ray and two straight lines in two rays is true It is set to the offset point E, first ray refers to that endpoint is the ray of the offset point G, and second ray refers to endpoint For the ray of the offset point D, the first straight line refers to the straight line with the first intersection of the first ray, the second straight line Refer to the straight line in two rays in addition to the first straight line.
Optionally, the offset point D and offset point G according to point A, the point A, and point B and point C, determine the point B Offset point E and offset point H after, further includes:
If the broken line type currently drawn is straight angle broken line, it is determined that point J and point K, between the point J and the point B Line it is vertical with the first line segment, the line between the point K and the point B is vertical with second line segment, and first line segment is Line segment between the point A and the point B, line segment of the second line segment between the point B and the point C;
According to the offset point D, the offset point G, the offset point H, the point J and the point K, three triangles are determined Shape;
Three triangles are rendered, obtain the broken line between the point A and the point B to draw.
Optionally, the offset point D and offset point G according to point A, the point A, and point B and point C, determine the point B Offset point E and offset point H after, further includes:
If the broken line type currently drawn is fillet broken line, increase position point D ' identical with the offset point D, with And increase position point G ' identical with the offset point G;
The apex coordinate and wire length of the point D ', the point G ', the offset point E and the offset point H are set;
According to the apex coordinate and wire length of the point D ', the point G ', the offset point E and the offset point H, screen out Meet the point of screening conditions in quadrilateral area D ' EHG ';
Point remaining after screening is rendered, obtains the broken line between the point A and the point B to draw.
Optionally, the apex coordinate of the setting point D ', the point G ', the offset point E and the offset point H and Wire length, comprising:
Determine that first angle and second angle, the first angle refer to using the point A as the half of the angle at turning, institute Second angle is stated to refer to using the point B as the half of the angle at turning;
According to the wire length of the first angle, the second angle and the first line segment, determine the point D ', the point G ', The apex coordinate of the offset point E and the offset point H, line segment of first line segment between the point A and the point B;
First line segment is set by the wire length of the point D ', the point G ', the offset point E and the offset point H Wire length.
Optionally, the apex coordinate according to the point D ', the point G ', the offset point E and the offset point H and Wire length is screened out and is unsatisfactory for before the point of screening conditions in quadrilateral area D ' EHG ', further includes:
A point P is selected from third line segment, the third line segment is between the offset point E and the offset point H Line segment, and the third line segment passes through the point B;
Determine the distance between the point P and first line segment and point the distance between the P and second line segment, it is described Line segment of first line segment between the point A and the point B, line of the second line segment between the point B and the point C Section;
According to the distance between the wire length of the first line segment, the point P and described first line segment and the point P with it is described The distance between second line segment determines the screening conditions.
On the other hand, a kind of broken line drawing apparatus is provided, described device includes:
First determining module is determined for the offset point D and offset point G according to point A, the point A, and point B and point C The offset point E and offset point H, the point A of the point B are the last one point on the broken line drawn, and the point B is current Increased point is needed, the point C is that the point B needs an increased point later;
Second determining module, if broken line type for currently drawing is wedge angle broken line, according to the offset point D, The offset point G, the offset point E and the offset point H, determine two triangles;
First rendering module is obtained between the point A and the point B for rendering described two triangles with drawing Broken line.
Optionally, first determining module includes:
First determines submodule, one for the line width that the distance between determining and first line segment is broken line to be drawn Half and two rays of first line segment are parallel to, line segment of first line segment between the point A and the point B, institute The endpoint for stating two rays is respectively the offset point D and the offset point G;
Second determines submodule, for the half of the line width and is parallel to institute for the distance between determining and second line segment State two straight lines of second line segment, line segment of the second line segment between the point B and the point C;
Third determines submodule, for first in the first ray and two straight lines in two rays is straight Intersection point between line is determined as the offset point H, by the in the second ray and two articles of straight lines in two articles of rays Intersection point between two straight lines is determined as the offset point E, and first ray refers to that endpoint is the ray of the offset point G, institute It states the second ray and refers to that endpoint is the ray of the offset point D, the first straight line refers to and the first intersection of the first ray Straight line, the second straight line refers to the straight line in two rays in addition to the first straight line.
On the other hand, a kind of electronic equipment is provided, the electronic equipment includes processor and memory, the memory In be stored at least one instruction, described instruction is loaded by the processor and executes broken line method for drafting described above.
On the other hand, a kind of computer readable storage medium is provided, is stored in the computer readable storage medium Instruction, when run on a computer, so that computer executes broken line method for drafting described above.
Technical solution provided by the present application can at least bring it is following the utility model has the advantages that in this application, for wedge angle broken line, Only it needs to be determined that the offset point E and offset point H of point B, so that it is determined that two triangles, by the rendering to the two triangles, The broken line between point A and point B is obtained to draw.It that is to say, the application only needs to increase by two points, and then only needs to store this The data of two points reduce the consumption of memory headroom.And only need to render two triangles, reduce need to render three Angular quantity so as to shorten render time, and then improves rendering speed, also just improves the drafting speed of broken line.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of schematic diagram for straight angle broken line that the relevant technologies provide;
Fig. 2 is a kind of schematic diagram for wedge angle broken line that the relevant technologies provide;
Fig. 3 is a kind of schematic diagram for fillet broken line that the relevant technologies provide;
Fig. 4 is a kind of schematic diagram of the drawing process for broken line that the relevant technologies provide;
Fig. 5 is a kind of flow chart of broken line method for drafting provided by the embodiments of the present application;
Fig. 6 is a kind of drawing process schematic diagram of wedge angle broken line provided by the embodiments of the present application;
Fig. 7 is a kind of drawing process schematic diagram of straight angle broken line provided by the embodiments of the present application;
Fig. 8 is provided by the embodiments of the present application a kind of for illustrating the schematic diagram of first angle and second angle;
Fig. 9 is a kind of schematic diagram for drawing obtained fillet broken line provided by the embodiments of the present application;
Figure 10 is a kind of structural schematic diagram of broken line drawing apparatus provided by the embodiments of the present application;
Figure 11 is the structural schematic diagram of another broken line drawing apparatus provided by the embodiments of the present application;
Figure 12 is the structural schematic diagram of another broken line drawing apparatus provided by the embodiments of the present application;
Figure 13 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party Formula is described in further detail.
In order to navigate by electronic map, or the distance between two positions and row checked by electronic map Sail route, it usually needs drawn path on the electronic map.It will appear broken line section in the route of drafting, and usually in order to guarantee The display diversity in broken line section can be plotted as tip-angled shape, straight angle shape or radiussed at the inflection point in broken line section.The application A kind of broken line method for drafting is proposed, above-mentioned broken line section can be drawn by the broken line method for drafting.It that is to say, lead to Broken line method for drafting provided by the present application is crossed, wedge angle broken line, straight angle broken line or fillet broken line can be drawn out.
Broken line method for drafting provided by the present application can be applied in broken line drawing apparatus, which can be Terminal.As an example, terminal, which can be any one, to pass through keyboard, touch tablet, touch screen, remote controler, language with user One or more modes such as sound interaction or handwriting equipment carry out the electronic product of human-computer interaction, such as PC (Personal Computer, personal computer), it is mobile phone, PDA (Personal Digital Assistant, personal digital assistant), wearable Equipment, tablet computer, vehicle-mounted computer etc..It should be understood that above-mentioned terminal is only for example, other are existing or may go out from now on Existing terminal is such as applicable to the application, should also be included within the application protection scope, and is contained in by reference herein This.
Broken line is usually to pass through multiple broken lines to combine to obtain, and be that is to say, in order to draw a broken line, is needed from first Point starts, and draws the broken line between first point and second point, then, on the basis of second point, draws second Broken line between point and third point, and so on, a broken line may finally be obtained.Therefore, the embodiment of the present application doubling The method for drafting of a broken line in line is illustrated, and the method for drafting of other broken lines on this broken line can be with reference to this Apply for the method that embodiment provides, no longer the method for drafting of other broken lines is repeated herein.
Fig. 5 is a kind of flow chart of broken line method for drafting shown according to an exemplary embodiment.This method can be applied In above-mentioned terminal, referring to Fig. 5, this method comprises the following steps.
Step 501: according to the offset point D and offset point G of point A, point A, and point B and point C, determine the offset point E of point B with Offset point H, point A are the last one point on the broken line drawn, and point B is currently to need increased point, after point C is point B Need an increased point.
Since point A is the last one point on the broken line drawn, point B is currently to need increased point, be that is to say, when The preceding broken line needed between graphical pointv A and point B.Since the broken line of drafting has certain line width, therefore, it is necessary to first determine The offset point E and offset point H of point B, and then the broken line with certain line width is drawn by offset point E and offset point H.
In some embodiments, it can determine that the distance between first line segment is the one of the line width of broken line to be drawn Half and two rays of the first line segment are parallel to, the endpoint of line segment of first line segment for point A and point B between, two rays is distinguished For offset point D and offset point G.It is determining for the half of line width and to be parallel to two of second line segment the distance between with second line segment Straight line, line segment of the second line segment between point B and point C.First in the first ray and two straight lines in two rays is straight Intersection point between line is determined as offset point H, will be between the second straight line in the second ray and two straight lines in two rays Intersection point is determined as offset point E, and the first ray refers to that endpoint is the ray of offset point G, and the second ray refers to that endpoint is offset point D's Ray, first straight line refer to the straight line with the first intersection of the first ray, second straight line refer in two rays except first straight line it Outer straight line.
Illustratively, it is assumed that the line width of the broken line between point A and point B is 2 pixels, referring to Fig. 6, can be determined and line Section the distance between AB is 1 pixel and is parallel to two rays of line segment AB, respectively from a ray of D point and from The ray that G point sets out, i.e. the first ray and the second ray.Determining the distance between with line segment BC is 1 pixel and parallel In two straight lines of line segment BC, i.e. first straight line and second straight line.The intersection point of first ray and first straight line is determined as deviating Intersection point between second ray and second straight line is determined as offset point E by point H.
It should be noted that the data of each inflection point on broken line can be stored in advance, for example, point A, point B and point C Data can be stored in advance.Moreover, the data of each point may include this point coordinate, can also include this point other Attribute, for example, transparency.
In addition, it is generally the case that the line width of each broken line on a broken line can be identical, certainly, different broken lines Line width can also be different.When the line width difference of each broken line, a mark can be set for each broken line, then will The storage corresponding with the line width of each broken line of the mark of each broken line.Illustratively, it can be set for each inflection point on broken line A number is set, it, can will be between the number of this inflection point and each inflection point and its previous inflection point for non-first inflection point The corresponding storage of line width.In this way, when broken line between graphical pointv A and point B point B and point can be obtained according to the number of point B Line width between A, that is to say, the line width of broken line to be drawn described in above-mentioned steps.
Step 502: if the broken line type currently drawn is wedge angle broken line, according to offset point D, offset point G, offset point E and offset point H determines two triangles.
In some embodiments, triangle DGE can be determined according to offset point D, offset point G, offset point E and offset point H With triangle GHE.It certainly, in further embodiments, can be according to offset point D, offset point G, offset point E and offset point H, really Determine triangle DGH and triangle DHE.
It, can be directly according to offset point D, offset point G, offset point E and offset after determining offset point E and offset point H Point H determines two triangles.Since offset point D and offset point G are increased two points when increasing point A, currently only need to increase Add the two points of offset point E and offset point H, and then only need to store the data of the two points of offset point E and offset point H, compares In the relevant technologies, reduce the consumption of memory headroom, improves the reusability to offset point D and offset point G.It that is to say, rolling over One point of every increase on line, in other words, one broken line of every increase, it is only necessary to the data of two points are stored, to will reduce The consumption of memory headroom.
Similarly, when broken line between graphical pointv B and point C, it is only necessary to which then two offset points for increasing point C utilize Offset point E and offset point H improves the reusability of offset point E and offset point H to reduce the consumption of memory headroom.
Step 503: rendering two determining triangles, obtain the broken line between point A and point B to draw.
After determining two triangles, the two triangles can be rendered, so as to draw to obtain point A with Broken line between point B, and the broken line has certain line width.
In some embodiments, the wash with watercolours of above-mentioned two triangle can be carried out by way of the triangle rendering of OpenGL Dye.
For wedge angle broken line, method provided by the present application, it is only necessary to render two triangles and subtract compared to the relevant technologies The number of triangles for needing to render is lacked, so as to shorten render time, and then has improved rendering speed, also just improve broken line Drafting speed.
Wedge angle broken line is a seed type of broken line, for other kinds of broken line, for example, straight angle broken line and fillet folding Line can also be drawn after the offset point E and offset point H that through the above steps 501 determine point B by following manner.
About straight angle broken line
If the broken line type currently drawn is straight angle broken line, it is determined that point J and point K, line between point J and point B and First line segment is vertical, and the line between point K and point B is vertical with second line segment, line segment of first line segment between point A and point B, the Line segment of two line segments between point B and point C.According to offset point D, offset point G, offset point H, point J and point K, three triangles are determined Shape.These three triangles are rendered, obtain the broken line between point A and point B to draw.
Illustratively, referring to Fig. 7, it can determine that and endpoint vertical with line segment AB is the third ray of point B, and and line segment BC is vertical and endpoint is the 4th ray of point B, the intersection point of third ray and line segment DE is determined as point J, by the 4th ray and line The intersection point of section BC is determined as point K.Then, according to offset point D, offset point G, offset point H, point J and point K, three triangles are determined. These three triangles are rendered, obtain the broken line between point A and point B to draw.
In some embodiments, triangle can be determined according to offset point D, offset point G, offset point H, point J and point K DGJ, triangle GJH and triangle JHK.It certainly, in further embodiments, can be according to offset point D, offset point G, offset point H, point J and point K determines triangle DGH, triangle DHJ and triangle JHK.Alternatively, in some other embodiment, Ke Yigen According to offset point D, offset point G, offset point H, point J and point K, triangle DGH, triangle DHK and triangle DKJ are determined.Or Triangle DGJ, triangle JGK and triangle GHK can be determined according to offset point D, offset point G, offset point H, point J and point K.
Two triangles drawn when it should be noted that rendering the mode and drafting wedge angle broken line of these three triangles Mode can be identical, and details are not described herein.
After determining offset point E and offset point H, can directly according to offset point D, offset point G, offset point H, point J and Point K determines three triangles.Since offset point D and offset point G are increased two points when increasing point A, currently only need to increase Add offset point H, point J and point K these three points, and then only need to store the data of these three points of offset point H, point J and point K, compares In the relevant technologies, reduce the consumption of memory headroom, improves the reusability to offset point D and offset point G.It that is to say, rolling over One point of every increase on line, in other words, one broken line of every increase, it is only necessary to the data of three points are stored, to will reduce The consumption of memory headroom.And for straight angle broken line, method provided by the present application, it is only necessary to three triangles are rendered, compared to The relevant technologies reduce the number of triangles for needing to render, so as to shorten render time, and then improve rendering speed, Just improve the drafting speed of broken line.
About fillet broken line
If the broken line type currently drawn is fillet broken line, increase position point D ', Yi Jizeng identical with offset point D Add position point G ' identical with offset point G.The apex coordinate and wire length of set-point D ', point G ', offset point E and offset point H.According to The apex coordinate and wire length of point D ', point G ', offset point E and offset point H screen out and meet screening item in quadrilateral area D ' EHG ' The point of part.Point remaining after screening is rendered, obtains the broken line between point A and point B to draw.
In some embodiments, it can determine that first angle and second angle, first angle refer to using point A as the angle at turning The half of degree, second angle refer to using point B as the half of the angle at turning.According to first angle, second angle and the first line segment Wire length, determine point D ', point G ', offset point E and offset point H apex coordinate, line segment of first line segment between point A and point B. Set the wire length of point D ', point G ', offset point E and offset point H to the wire length of the first line segment.
Due to intersection point of the offset point H between the first ray and first straight line, offset point E is the second ray and second straight line Between intersection point, and the first ray and the second ray are the half of line width, first straight line with the distance between the first line segment respectively It is respectively also the half of line width with the distance between second line segment with second straight line, therefore, line segment EH is the angle bisection of ∠ ABC Line.In this way, being ∠ ABH or ∠ HBC by the half of the angle at turning of point B.Similarly, using point A as the one of the angle at turning Half is ∠ G ' AB.In other words, first angle is ∠ ABH or ∠ HBC, and second angle is ∠ G ' AB.
Illustratively, referring to Fig. 8, it is assumed for convenience of description that two offset points of point C are respectively point I and point F.Due to Line segment D ' E is parallel with line segment AB, and line segment G ' H is parallel with line segment AB, and the distance between line segment D ' E and line segment AB and line segment G ' H is equal with the distance between line segment AB and is the half of line width.Line segment HI is parallel with line segment BC, and line segment EF and line segment BC are flat Row, and the distance between line segment HI and line segment BC and line segment EF it is equal with the distance between line segment BC and for line width half, Therefore, line segment EH is the angular bisector of ∠ ABC.In this way, first angle is ∠ ABH or ∠ HBC, second angle is ∠ G ' AB.
As an example, the apex coordinate that point D ' can be set is (- d/2-s/tan θ1, s), the apex coordinate of point G ' For (- d/2+s/tan θ1,-s), the apex coordinate of offset point E be (d/2+s/tan θ2, s), the apex coordinate of offset point H is (d/ 2-s/tanθ2,-s).Wherein, d is the length of line segment AB, and s is the half of line width, θ1For first angle, θ2For second angle.
More simply, the half of line width can be normalized, is that is to say, the half of line width is 1, at this point, set-point The apex coordinate of D ' is (- d/2-1/tan θ1, 1), the apex coordinate of point G ' be (- d/2+1/tan θ1, -1), the vertex of offset point E Coordinate is (d/2+1/tan θ2, 1), the apex coordinate of offset point H is (d/2-1/tan θ2, -1).
It that is to say, the midpoint of line segment AB is coordinate origin, and point A to the direction of point B is the direction of horizontal axis, perpendicular to line segment AB And towards the direction of line segment DE be the longitudinal axis direction.
Certainly, aforesaid way is a kind of implementation, and the embodiment of the present application can also be arranged in other way The apex coordinate and wire length of point D ', point G ', offset point E and offset point H.
In some embodiments, it according to the apex coordinate and wire length of point D ', point G ', offset point E and offset point H, screens out It is unsatisfactory for before the point of screening conditions in quadrilateral area D ' EHG ', screening conditions can also be set.That is, being selected from third line segment Select a point P, line segment of the third line segment between offset point E and offset point H, and third line segment passing point B.Determine point P and the The distance between one line segment, and point the distance between P and second line segment, line segment of first line segment between point A and point B, the Line segment of two line segments between point B and point C.According to the distance between the wire length of the first line segment, point P and first line segment, and point P The distance between second line segment, determines screening conditions.
Based on foregoing description, line segment EH is therefore the angular bisector of ∠ ABC arbitrarily selects a point P on line segment EH, The distance between point P and line segment D ' E, and point P are equal with the distance between line segment EF, in this way, can using point P as the center of circle, It regard the distance between point P line segment D ' E or the distance between point P and line segment EF as radius, border circular areas is drawn, by circle Point except domain screens out, and remaining point after screening in quadrilateral area D ' EHG ' is rendered, so as to obtain fillet Smoother fillet broken line.
As an example, screening conditions can be indicated by such as lower inequality:
| x | > d/2, (| x |-x1)^2+(|y|-y1)^2>1
Wherein, d is line width, (x1, y1) be point P coordinate.
It more simply, can be using the position where point B as the center of circle, in this way, screening conditions can pass through such as lower inequality To indicate:
| x | > d/2, (| x |-d/2) ^2+y^2 > 1
It in some embodiments, can be with after the apex coordinate and wire length of point D ', point G ', offset point E and offset point H Two triangles are determined according to point D ', point G ', offset point E and offset point H, then according to screening conditions, render the two triangles Shape, so as to draw to obtain the broken line between point A and point B.It as an example, can be by determine two triangles Apex coordinate and wire length input vertex tinter, that is to say, by the apex coordinate of point D ', point G ', offset point E and offset point H It is input in vertex shader with wire length, the coordinate of each point in quadrilateral area DGHE is determined by vertex shader.So The coordinate of each pixel in quadrilateral area DGHE is input in piece member tinter afterwards, by being screened to piece member tinter Fall to be unsatisfactory for the pixel of screening conditions in quadrilateral area D ' EHG '.Pixel remaining after screening is rendered, to draw Broken line between point A and point B.
It should be noted that vertex shader and piece member tinter are a plug-in unit in terminal, for carrying out image Rendering.In addition, the transparency that these pixels can be set is 0, for being unsatisfactory for screening item for the pixel for meeting screening conditions The pixel of part is rendered, and can both draw out smoother fillet broken line in this way.
Illustratively, it is assumed that screening conditions are constructed using the position where point B as the center of circle, at this point, rendering through the above way The fill part as shown in Figure 9 of broken line afterwards.
After determining offset point E and offset point H, position point D ' identical with offset point D can be increased, and increase position Set point G ' identical with offset point G.Then according to the apex coordinate and wire length of point D ', point G ', offset point E and offset point H, screening Fall to meet in quadrilateral area D ' EHG ' point of screening conditions.Since point D ', point G ', offset point E and offset point H can be determined Two triangles.It that is to say, the current data for only needing to store point D ', point G ', offset point E and offset point H this four points are compared In the relevant technologies, reduce the consumption of memory headroom, improves the reusability to offset point D and offset point G.It that is to say, rolling over One point of every increase on line, in other words, one broken line of every increase, it is only necessary to the data of four points are stored, to will reduce The consumption of memory headroom.And for fillet broken line, method provided by the present application, it is only necessary to two triangles are rendered, compared to The relevant technologies reduce the number of triangles for needing to render, so as to shorten render time, and then improve rendering speed, Just improve the drafting speed of broken line.
In the embodiment of the present application, for wedge angle broken line, it is only necessary to increase by two points, and then only need to store the two points Data, reduce the consumption of memory headroom.And only need to render two triangles, reduce the triangle number for needing to render Amount, so as to shorten render time, and then improves rendering speed, also just improves the drafting speed of broken line.The straight angle is rolled over Line, it is only necessary to increase by three points, and then only need to store the data of these three points, reduce the consumption of memory headroom.And only It needs to render three triangles, reduces the number of triangles for needing to render, so as to shorten render time, and then improve wash with watercolours Speed is contaminated, the drafting speed of broken line is also just improved.For fillet broken line, it is only necessary to increase by four points, and then only need to store The data of this four points reduce the consumption of memory headroom.And only need to render two triangles, reduce what needs rendered Number of triangles so as to shorten render time, and then improves rendering speed, also just improves the drafting speed of broken line, and And the smoothness of the fillet broken line rendered is preferable, and the problem of being distorted generation will not be caused because of amplification.
Figure 10 is a kind of structural schematic diagram of broken line drawing apparatus provided by the embodiments of the present application, which can With being implemented in combination with as some or all of of terminal by software, hardware or both.Referring to Figure 10, which includes: One determining module 1001, the second determining module 1002 and the first rendering module 1003.
First determining module 1001 is determined for the offset point D and offset point G according to point A, point A, and point B and point C The offset point E and offset point H of point B, point A are the last one point on the broken line drawn, and point B is increased currently to need Point, point C need an increased point after being point B;
Second determining module 1002, if broken line type for currently drawing is wedge angle broken line, according to offset point D, Offset point G, offset point E and offset point H determine two triangles;
First rendering module 1003 obtains the broken line between point A and point B for rendering two triangles to draw.
Optionally, the first determining module 1001 includes:
First determines submodule, one for the line width that the distance between determining and first line segment is broken line to be drawn Half and two rays of the first line segment are parallel to, the endpoint of line segment of first line segment for point A and point B between, two rays is distinguished For offset point D and offset point G;
Second determines submodule, for the half of line width and is parallel to the second line for the distance between determining and second line segment Two straight lines of section, line segment of the second line segment between point B and point C;
Third determines submodule, for will be between the first straight line in the first ray and two straight lines in two rays Intersection point is determined as offset point H, and the intersection point between the second straight line in the second ray and two straight lines in two rays is determined For offset point E, the first ray refers to that endpoint is the ray of offset point G, and the second ray refers to that endpoint is the ray of offset point D, the One straight line refers to the straight line with the first intersection of the first ray, and second straight line refers to one in addition to first straight line in two rays Straight line.
Optionally, referring to Figure 11, the device further include:
Third determining module 1004, if the broken line type for currently drawing is straight angle broken line, it is determined that point J and point K, Line between point J and point B is vertical with the first line segment, and the line between point K and point B is vertical with second line segment, and the first line segment is Line segment between point A and point B, line segment of the second line segment between point B and point C;
4th determining module 1005, for determining three three according to offset point D, offset point G, offset point H, point J and point K It is angular;
Second rendering module 1006 obtains the broken line between point A and point B for rendering three triangles to draw.
Optionally, referring to Figure 12, the device further include:
Increase module 1007, if the broken line type for currently drawing is fillet broken line, increases position and offset point D Identical point D ', and increase position point G ' identical with offset point G;
Setup module 1008, apex coordinate and wire length for set-point D ', point G ', offset point E and offset point H;
Screening module 1009, for the apex coordinate and wire length according to point D ', point G ', offset point E and offset point H, screening Fall to meet in quadrilateral area D ' EHG ' point of screening conditions;
Third rendering module 1010 is rendered for remaining point after screening, and is obtained between point A and point B with drawing Broken line.
Optionally, setup module 1008 includes:
4th determines submodule, for determining that first angle and second angle, first angle refer to using point A as the angle at turning The half of degree, second angle refer to using point B as the half of the angle at turning;
5th determines submodule, for the wire length according to first angle, second angle and the first line segment, determines point D ', point The apex coordinate of G ', offset point E and offset point H, line segment of first line segment between point A and point B;
Submodule is set, for setting the wire length of point D ', point G ', offset point E and offset point H on the line of the first line segment It is long.
Optionally, the device further include:
Selecting module, for selecting a point P from third line segment, third line segment is between offset point E and offset point H Line segment, and third line segment passing point B;
5th determining module, for determining the distance between point P and the first line segment, and between point P and second line segment Distance, line segment of first line segment between point A and point B, line segment of the second line segment between point B and point C;
6th determining module, for the distance between the wire length, point P and the first line segment according to the first line segment, and point P with The distance between second line segment determines screening conditions.
In the embodiment of the present application, for wedge angle broken line, it is only necessary to increase by two points, and then only need to store the two points Data, reduce the consumption of memory headroom.And only need to render two triangles, reduce the triangle number for needing to render Amount, so as to shorten render time, and then improves rendering speed, also just improves the drafting speed of broken line.The straight angle is rolled over Line, it is only necessary to increase by three points, and then only need to store the data of these three points, reduce the consumption of memory headroom.And only It needs to render three triangles, reduces the number of triangles for needing to render, so as to shorten render time, and then improve wash with watercolours Speed is contaminated, the drafting speed of broken line is also just improved.For fillet broken line, it is only necessary to increase by four points, and then only need to store The data of this four points reduce the consumption of memory headroom.And only need to render two triangles, reduce what needs rendered Number of triangles so as to shorten render time, and then improves rendering speed, also just improves the drafting speed of broken line, and And the smoothness of the fillet broken line rendered is preferable, and the problem of being distorted generation will not be caused because of amplification.
It should be understood that broken line drawing apparatus provided by the above embodiment is when carrying out broken line drafting, only with above-mentioned each The division progress of functional module can according to need and for example, in practical application by above-mentioned function distribution by different function Energy module is completed, i.e., the internal structure of device is divided into different functional modules, to complete whole described above or portion Divide function.In addition, broken line drawing apparatus provided by the above embodiment and broken line method for drafting embodiment belong to same design, have Body realizes that process is detailed in embodiment of the method, and which is not described herein again.
Figure 13 shows the structural block diagram of the terminal 1300 of one exemplary embodiment of the application offer.The terminal 1300 can To be portable mobile termianl, such as: smart phone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) player, laptop Or desktop computer.Terminal 1300 be also possible to referred to as user equipment, portable terminal, laptop terminal, terminal console etc. other Title.
In general, terminal 1300 includes: processor 1301 and memory 1302.
Processor 1301 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place Reason device 1301 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field- Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed Logic array) at least one of example, in hardware realize.Processor 1301 also may include primary processor and coprocessor, master Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.? In some embodiments, processor 1301 can be integrated with GPU (Graphics Processing Unit, image processor), GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 1301 can also be wrapped AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processor is for handling related machine learning Calculating operation.
Memory 1302 may include one or more computer readable storage mediums, which can To be non-transient.Memory 1302 may also include high-speed random access memory and nonvolatile memory, such as one Or multiple disk storage equipments, flash memory device.In some embodiments, the non-transient computer in memory 1302 can Storage medium is read for storing at least one instruction, at least one instruction performed by processor 1301 for realizing this Shen Please in embodiment of the method provide broken line method for drafting.
In some embodiments, terminal 1300 is also optional includes: peripheral device interface 1303 and at least one periphery are set It is standby.It can be connected by bus or signal wire between processor 1301, memory 1302 and peripheral device interface 1303.It is each outer Peripheral equipment can be connected by bus, signal wire or circuit board with peripheral device interface 1303.Specifically, peripheral equipment includes: In radio circuit 1304, touch display screen 1305, camera 1306, voicefrequency circuit 1307, positioning component 1308 and power supply 1309 At least one.
Peripheral device interface 1303 can be used for I/O (Input/Output, input/output) is relevant outside at least one Peripheral equipment is connected to processor 1301 and memory 1302.In some embodiments, processor 1301, memory 1302 and periphery Equipment interface 1303 is integrated on same chip or circuit board;In some other embodiments, processor 1301, memory 1302 and peripheral device interface 1303 in any one or two can be realized on individual chip or circuit board, this implementation Example is not limited this.
Radio circuit 1304 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal. Radio circuit 1304 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 1304 is by telecommunications Number being converted to electromagnetic signal is sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit 1304 include: antenna system, RF transceiver, one or more amplifiers, tuner, oscillator, digital signal processor, volume solution Code chipset, user identity module card etc..Radio circuit 1304 can by least one wireless communication protocol come with it is other Terminal is communicated.The wireless communication protocol includes but is not limited to: WWW, Metropolitan Area Network (MAN), Intranet, each third generation mobile communication network (2G, 3G, 4G and 5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some implementations In example, radio circuit 1304 can also include that NFC (Near Field Communication, wireless near field communication) is related Circuit, the application are not limited this.
Display screen 1305 is for showing UI (User Interface, user interface).The UI may include figure, text, Icon, video and its their any combination.When display screen 1305 is touch display screen, display screen 1305 also there is acquisition to exist The ability of the touch signal on the surface or surface of display screen 1305.The touch signal can be used as control signal and be input to place Reason device 1301 is handled.At this point, display screen 1305 can be also used for providing virtual push button and/or dummy keyboard, it is also referred to as soft to press Button and/or soft keyboard.In some embodiments, display screen 1305 can be one, and the front panel of terminal 1300 is arranged;Another In a little embodiments, display screen 1305 can be at least two, be separately positioned on the different surfaces of terminal 1300 or in foldover design; In still other embodiments, display screen 1305 can be flexible display screen, is arranged on the curved surface of terminal 1300 or folds On face.Even, display screen 1305 can also be arranged to non-rectangle irregular figure, namely abnormity screen.Display screen 1305 can be with Using LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) etc. materials preparation.
CCD camera assembly 1306 is for acquiring image or video.Optionally, CCD camera assembly 1306 includes front camera And rear camera.In general, the front panel of terminal is arranged in front camera, the back side of terminal is arranged in rear camera.? In some embodiments, rear camera at least two is that main camera, depth of field camera, wide-angle camera, focal length are taken the photograph respectively As any one in head, to realize that main camera and the fusion of depth of field camera realize background blurring function, main camera and wide Pan-shot and VR (Virtual Reality, virtual reality) shooting function or other fusions are realized in camera fusion in angle Shooting function.In some embodiments, CCD camera assembly 1306 can also include flash lamp.Flash lamp can be monochromatic temperature flash of light Lamp is also possible to double-colored temperature flash lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, can be used for Light compensation under different-colour.
Voicefrequency circuit 1307 may include microphone and loudspeaker.Microphone is used to acquire the sound wave of user and environment, and It converts sound waves into electric signal and is input to processor 1301 and handled, or be input to radio circuit 1304 to realize that voice is logical Letter.For stereo acquisition or the purpose of noise reduction, microphone can be separately positioned on the different parts of terminal 1300 to be multiple. Microphone can also be array microphone or omnidirectional's acquisition type microphone.Loudspeaker is then used to that processor 1301 or radio frequency will to be come from The electric signal of circuit 1304 is converted to sound wave.Loudspeaker can be traditional wafer speaker, be also possible to piezoelectric ceramics loudspeaking Device.When loudspeaker is piezoelectric ceramic loudspeaker, the audible sound wave of the mankind can be not only converted electrical signals to, can also be incited somebody to action Electric signal is converted to the sound wave that the mankind do not hear to carry out the purposes such as ranging.In some embodiments, voicefrequency circuit 1307 may be used also To include earphone jack.
Positioning component 1308 is used for the current geographic position of positioning terminal 1300, to realize navigation or LBS (Location Based Service, location based service).Positioning component 1308 can be the GPS (Global based on the U.S. Positioning System, global positioning system), China dipper system or Russia Galileo system positioning group Part.
Power supply 1309 is used to be powered for the various components in terminal 1300.Power supply 1309 can be alternating current, direct current Electricity, disposable battery or rechargeable battery.When power supply 1309 includes rechargeable battery, which can be line charge Battery or wireless charging battery.Wired charging battery is the battery to be charged by Wireline, and wireless charging battery is to pass through The battery of wireless coil charging.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, terminal 1300 further includes having one or more sensors 1310.One or more sensing Device 1310 includes but is not limited to: acceleration transducer 1311, gyro sensor 1312, pressure sensor 1313, fingerprint sensing Device 1314, optical sensor 1315 and proximity sensor 1316.
Acceleration transducer 1311 can detecte the acceleration in three reference axis of the coordinate system established with terminal 1300 Size.For example, acceleration transducer 1311 can be used for detecting component of the acceleration of gravity in three reference axis.Processor The 1301 acceleration of gravity signals that can be acquired according to acceleration transducer 1311, control touch display screen 1305 with transverse views Or longitudinal view carries out the display of user interface.Acceleration transducer 1311 can be also used for game or the exercise data of user Acquisition.
Gyro sensor 1312 can detecte body direction and the rotational angle of terminal 1300, gyro sensor 1312 Acquisition user can be cooperateed with to act the 3D of terminal 1300 with acceleration transducer 1311.Processor 1301 is according to gyro sensors The data that device 1312 acquires, following function may be implemented: action induction (for example changing UI according to the tilt operation of user) is clapped Image stabilization, game control and inertial navigation when taking the photograph.
The lower layer of side frame and/or touch display screen 1305 in terminal 1300 can be set in pressure sensor 1313.When When the side frame of terminal 1300 is arranged in pressure sensor 1313, user can detecte to the gripping signal of terminal 1300, by Reason device 1301 carries out right-hand man's identification or prompt operation according to the gripping signal that pressure sensor 1313 acquires.Work as pressure sensor 1313 when being arranged in the lower layer of touch display screen 1305, is grasped by processor 1301 according to pressure of the user to touch display screen 1305 Make, realization controls the operability control on the interface UI.Operability control include button control, scroll bar control, At least one of icon control, menu control.
Fingerprint sensor 1314 is used to acquire the fingerprint of user, is collected by processor 1301 according to fingerprint sensor 1314 Fingerprint recognition user identity, alternatively, by fingerprint sensor 1314 according to the identity of collected fingerprint recognition user.Knowing Not Chu the identity of user when being trusted identity, authorize the user to execute relevant sensitive operation by processor 1301, which grasps Make to include solving lock screen, checking encryption information, downloading software, payment and change setting etc..Fingerprint sensor 1314 can be set Set the front, the back side or side of terminal 1300.When being provided with physical button or manufacturer Logo in terminal 1300, fingerprint sensor 1314 can integrate with physical button or manufacturer Logo.
Optical sensor 1315 is for acquiring ambient light intensity.In one embodiment, processor 1301 can be according to light The ambient light intensity that sensor 1315 acquires is learned, the display brightness of touch display screen 1305 is controlled.Specifically, work as ambient light intensity When higher, the display brightness of touch display screen 1305 is turned up;When ambient light intensity is lower, the aobvious of touch display screen 1305 is turned down Show brightness.In another embodiment, the ambient light intensity that processor 1301 can also be acquired according to optical sensor 1315, is moved The acquisition parameters of state adjustment CCD camera assembly 1306.
Proximity sensor 1316, also referred to as range sensor are generally arranged at the front panel of terminal 1300.Proximity sensor 1316 for acquiring the distance between the front of user Yu terminal 1300.In one embodiment, when proximity sensor 1316 is examined When measuring the distance between the front of user and terminal 1300 and gradually becoming smaller, by processor 1301 control touch display screen 1305 from Bright screen state is switched to breath screen state;When proximity sensor 1316 detect the distance between front of user and terminal 1300 by When gradual change is big, touch display screen 1305 is controlled by processor 1301 and is switched to bright screen state from breath screen state.
It, can be with it will be understood by those skilled in the art that the restriction of the not structure paired terminal 1300 of structure shown in Figure 13 Including than illustrating more or fewer components, perhaps combining certain components or being arranged using different components.
In the exemplary embodiment, a kind of computer readable storage medium is additionally provided, the memory for example including instruction, Above-metioned instruction can be executed by the processor in terminal to complete the broken line method for drafting in above-described embodiment.For example, the calculating Machine readable storage medium storing program for executing can be ROM (read-only memory, read-only memory), RAM (random access Memory, random access memory), it is CD-ROM (Compact Disc Read-Only Memory, CD-ROM), tape, soft Disk and optical data storage devices etc..
It is worth noting that, the computer readable storage medium that the application mentions can be non-volatile memory medium, change Sentence is talked about, and is non-transient storage medium.
It should be understood that realize above-described embodiment all or part of the steps can by software, hardware, firmware or Its any combination is realized.When implemented in software, it can entirely or partly realize in the form of a computer program product. The computer program product includes one or more computer instructions.The computer instruction can store in above-mentioned computer In readable storage medium storing program for executing.
The above is embodiment provided by the present application, all in spirit herein and original not to limit the application Within then, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.

Claims (10)

1. a kind of broken line method for drafting, which is characterized in that the described method includes:
According to the offset point D and offset point G of point A, the point A, and point B and point C, offset point E and the offset of the point B are determined Point H, the point A are the last one point on the broken line drawn, and the point B is currently to need increased point, and the point C is An increased point is needed after the point B;
If the broken line type currently drawn is wedge angle broken line, according to the offset point D, the offset point G, the offset point The E and offset point H, determines two triangles;
Described two triangles are rendered, obtain the broken line between the point A and the point B to draw.
2. the method as described in claim 1, which is characterized in that the offset point D and offset point G according to point A, the point A, And point B and point C, determine the offset point E and offset point H of the point B, comprising:
The distance between determining and first line segment is the half of the line width of broken line to be drawn and is parallel to first line segment Two rays, line segment of first line segment between the point A and the point B, the endpoint of two rays is respectively The offset point D and offset point G;
The distance between determining and second line segment is the half of the line width and two straight lines for being parallel to the second line segment, institute State line segment of the second line segment between the point B and the point C;
Intersection point between first straight line in the first ray and two straight lines in two rays is determined as described Intersection point between second straight line in the second ray and two straight lines in two rays is determined as by offset point H The offset point E, first ray refer to that endpoint is the ray of the offset point G, and second ray refers to endpoint for institute The ray of offset point D is stated, the first straight line refers to the straight line with the first intersection of the first ray, and the second straight line refers to Straight line in two rays in addition to the first straight line.
3. method according to claim 1 or 2, which is characterized in that described according to point A, the offset point D of the point A and offset Point G, and point B and point C, after the offset point E and offset point H that determine the point B, further includes:
If the broken line type currently drawn is straight angle broken line, it is determined that point J and point K, the company between the point J and the point B Line is vertical with the first line segment, and the line between the point K and the point B is vertical with second line segment, and first line segment is described Line segment between point A and the point B, line segment of the second line segment between the point B and the point C;
According to the offset point D, the offset point G, the offset point H, the point J and the point K, three triangles are determined;
Three triangles are rendered, obtain the broken line between the point A and the point B to draw.
4. method according to claim 1 or 2, which is characterized in that described according to point A, the offset point D of the point A and offset Point G, and point B and point C, after the offset point E and offset point H that determine the point B, further includes:
If the broken line type currently drawn is fillet broken line, increase position point D ', Yi Jizeng identical with the offset point D Add position point G ' identical with the offset point G;
The apex coordinate and wire length of the point D ', the point G ', the offset point E and the offset point H are set;
According to the apex coordinate and wire length of the point D ', the point G ', the offset point E and the offset point H, four sides are screened out Meet the point of screening conditions in the D ' EHG ' of shape region;
Point remaining after screening is rendered, obtains the broken line between the point A and the point B to draw.
5. method as claimed in claim 4, which is characterized in that described that the point D ', the point G ', the offset point E is arranged With the apex coordinate and wire length of the offset point H, comprising:
Determine that first angle and second angle, the first angle refer to using the point A as the half of the angle at turning, described Two angles refer to using the point B as the half of the angle at turning;
According to the wire length of the first angle, the second angle and the first line segment, the point D ', the point G ', described is determined The apex coordinate of offset point E and the offset point H, line segment of first line segment between the point A and the point B;
Set the wire length of the point D ', the point G ', the offset point E and the offset point H on the line of first line segment It is long.
6. method as claimed in claim 4, which is characterized in that described according to the point D ', the point G ', the offset point E With the apex coordinate and wire length of the offset point H, screens out and is unsatisfactory for before the point of screening conditions in quadrilateral area D ' EHG ', Further include:
One point P of selection from third line segment, line segment of the third line segment between the offset point E and the offset point H, And the third line segment passes through the point B;
Determine the distance between the point P and first line segment and point the distance between the P and second line segment, described first Line segment of the line segment between the point A and the point B, line segment of the second line segment between the point B and the point C;
According to the distance between the wire length of the first line segment, the point P and described first line segment and the point P and described second The distance between line segment determines the screening conditions.
7. a kind of broken line drawing apparatus, which is characterized in that described device includes:
First determining module, for the offset point D and offset point G according to point A, the point A, and point B and point C, described in determination The offset point E and offset point H, the point A of point B are the last one point on the broken line drawn, and the point B is current needs Increased, the point C needs an increased point after being the point B;
Second determining module, if broken line type for currently drawing is wedge angle broken line, according to the offset point D, described Offset point G, the offset point E and the offset point H, determine two triangles;
First rendering module obtains the broken line between the point A and the point B for rendering described two triangles to draw Section.
8. device as claimed in claim 7, which is characterized in that first determining module includes:
First determines submodule, for it is determining the distance between with first line segment for the half of the line width of broken line to be drawn and It is parallel to two rays of first line segment, line segment of first line segment between the point A and the point B, described two The endpoint of ray is respectively the offset point D and the offset point G;
Second determines submodule, for the half of the line width and is parallel to described the distance between with second line segment for determining Two straight lines of two line segments, line segment of the second line segment between the point B and the point C;
Third determines submodule, for by two rays the first ray and two straight lines in first straight line it Between intersection point be determined as the offset point H, second in the second ray and two straight lines in two rays is straight Intersection point between line is determined as the offset point E, and first ray refers to that endpoint is the ray of the offset point G, and described the Two rays refer to that endpoint is the ray of the offset point D, and the first straight line refers to straight with the first intersection of the first ray Line, the second straight line refer to the straight line in two rays in addition to the first straight line.
9. a kind of electronic equipment, which is characterized in that the electronic equipment includes processor and memory, is stored in the memory There is at least one instruction, described instruction is loaded by the processor and executed to realize as claimed in any one of claims 1 to 6 Broken line method for drafting.
10. a kind of computer readable storage medium, which is characterized in that instruction is stored in the computer readable storage medium, When run on a computer, so that computer executes broken line method for drafting as claimed in any one of claims 1 to 6.
CN201910471964.7A 2019-05-31 2019-05-31 Fold line drawing method and device, electronic equipment and storage medium Active CN110211202B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910471964.7A CN110211202B (en) 2019-05-31 2019-05-31 Fold line drawing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910471964.7A CN110211202B (en) 2019-05-31 2019-05-31 Fold line drawing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110211202A true CN110211202A (en) 2019-09-06
CN110211202B CN110211202B (en) 2020-07-10

Family

ID=67790073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910471964.7A Active CN110211202B (en) 2019-05-31 2019-05-31 Fold line drawing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110211202B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368496A (en) * 2020-03-10 2020-07-03 苏州浪潮智能科技有限公司 Method and device for changing straight line into broken line with any angle in PCB design
CN113470144A (en) * 2021-07-23 2021-10-01 北京光启元数字科技有限公司 Method, device and equipment for drawing fillet of page element and readable medium
CN114357553A (en) * 2021-12-31 2022-04-15 重庆宝图科技发展有限公司 Real estate auxiliary drawing method based on mobile terminal
CN115359146A (en) * 2022-07-22 2022-11-18 北京城市网邻信息技术有限公司 Line drawing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101950427A (en) * 2010-09-08 2011-01-19 东莞电子科技大学电子信息工程研究院 Vector line segment contouring method applicable to mobile terminal
CN104268911A (en) * 2014-09-18 2015-01-07 腾讯科技(深圳)有限公司 Method and device for drawing route in map
US20150054844A1 (en) * 2013-08-23 2015-02-26 Disney Enterprises, Inc. Methods and systems for generating a polygon mesh
CN106384370A (en) * 2015-07-31 2017-02-08 高德软件有限公司 Broken line drawing method and apparatus thereof
CN108021136A (en) * 2017-12-08 2018-05-11 北京奇虎科技有限公司 Control method, device and the robot that Robot route of travel is advanced
CN108230424A (en) * 2018-02-09 2018-06-29 城市生活(北京)资讯有限公司 A kind of lines display methods and lines display system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101950427A (en) * 2010-09-08 2011-01-19 东莞电子科技大学电子信息工程研究院 Vector line segment contouring method applicable to mobile terminal
US20150054844A1 (en) * 2013-08-23 2015-02-26 Disney Enterprises, Inc. Methods and systems for generating a polygon mesh
CN104268911A (en) * 2014-09-18 2015-01-07 腾讯科技(深圳)有限公司 Method and device for drawing route in map
CN106384370A (en) * 2015-07-31 2017-02-08 高德软件有限公司 Broken line drawing method and apparatus thereof
CN108021136A (en) * 2017-12-08 2018-05-11 北京奇虎科技有限公司 Control method, device and the robot that Robot route of travel is advanced
CN108230424A (en) * 2018-02-09 2018-06-29 城市生活(北京)资讯有限公司 A kind of lines display methods and lines display system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368496A (en) * 2020-03-10 2020-07-03 苏州浪潮智能科技有限公司 Method and device for changing straight line into broken line with any angle in PCB design
CN111368496B (en) * 2020-03-10 2022-07-08 苏州浪潮智能科技有限公司 Method and device for changing straight line into broken line with any angle in PCB design
CN113470144A (en) * 2021-07-23 2021-10-01 北京光启元数字科技有限公司 Method, device and equipment for drawing fillet of page element and readable medium
CN114357553A (en) * 2021-12-31 2022-04-15 重庆宝图科技发展有限公司 Real estate auxiliary drawing method based on mobile terminal
CN114357553B (en) * 2021-12-31 2023-12-15 重庆宝图科技发展有限公司 Mobile-terminal-based real estate auxiliary drawing method
CN115359146A (en) * 2022-07-22 2022-11-18 北京城市网邻信息技术有限公司 Line drawing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110211202B (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN108304265B (en) Memory management method, device and storage medium
CN110211202A (en) Broken line method for drafting, device, electronic equipment and storage medium
CN108762881B (en) Interface drawing method and device, terminal and storage medium
CN110368689A (en) Display methods, system, electronic equipment and the storage medium of interface
CN110121094A (en) Video is in step with display methods, device, equipment and the storage medium of template
CN108491748B (en) Graphic code identification and generation method and device and computer readable storage medium
CN109862412A (en) It is in step with the method, apparatus and storage medium of video
CN108563377A (en) The method and apparatus that switching shows the page
WO2021027890A1 (en) License plate image generation method and device, and computer storage medium
CN110673944B (en) Method and device for executing task
CN110288689A (en) The method and apparatus that electronic map is rendered
US20240212114A1 (en) Method, apparatus, and device for processing image, and storage medium
CN112922589A (en) Pinch-out line determining method, device, terminal and storage medium
CN110321126A (en) The method and apparatus for generating page code
CN111105474B (en) Font drawing method, font drawing device, computer device and computer readable storage medium
CN108734662A (en) The method and apparatus for showing icon
CN109614563A (en) Show method, apparatus, equipment and the storage medium of webpage
CN115344537A (en) Storage space allocation method and device, file system and storage medium
CN111596925B (en) Method, device, computer equipment and medium for automatically generating codes
CN114550717A (en) Voice sound zone switching method, device, equipment and storage medium
CN110119233A (en) Content delivery method and device, terminal, storage medium
CN110132294A (en) Draw method, apparatus, computer equipment and the readable storage medium storing program for executing of motion track
CN112329355B (en) Method and device for determining single-well control area, computer equipment and storage medium
CN109345447A (en) The method and apparatus of face replacement processing
CN109343113A (en) Method and device for predicting oil and gas reservoir position

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant