Image drawing method, electronic device, storage medium and program product

By displaying the reference geometric object in the drawing page and automatically identifying the distance between the cursor and the endpoint, the endpoint designation of the target geometric object is achieved, solving the problem of low accuracy and efficiency of image copying in the prior art, and improving the consistency of the copying effect.

CN119759230APending Publication Date: 2025-04-04KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411943171.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The accuracy and efficiency of existing image copying methods are low, especially the challenges caused by direct conversion and differences in representation between different image formats.

Method used

The endpoint specification of the target geometric object is achieved by displaying the reference geometric object in the drawing page and identifying the automatic adsorption of the point by automatically identifying the distance between the cursor and the endpoint. This method takes the layer of the target geometry object and the layer of the reference geometry object as different layers, and displays the target geometry object after obtaining all endpoints.

Benefits of technology

It improves the accuracy and efficiency of image copying, ensures consistency between the copied image and the copied image, and reduces the dependence on human eye comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759230A_ABST
    Figure CN119759230A_ABST
Patent Text Reader

Abstract

The present disclosure provides an image drawing method, an electronic device, a readable storage medium and a computer program product. The drawing method displays a reference geometric object in a drawing page, specifies multiple target endpoints of a target geometric object by executing an endpoint specifying step, and after obtaining the latest specified endpoint of the target geometric object, displays a target line segment with the latest specified endpoint as an endpoint. After obtaining all the specified endpoints of the target geometric object, the target geometric object including the target line segment is displayed in the drawing page, wherein the endpoint specifying step is to first respond to a cursor moving to a position where the distance from one of the reference endpoints of the reference geometric object is less than a specified distance, automatically display a marker point at the reference endpoint where the distance from the cursor is less than the specified distance, and then respond to receiving a first input, specify the position where the marker point is located as the target endpoint of the target geometric object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of drawing technology, and in particular to an image drawing method, an electronic device, a readable storage medium, and a computer program product. Background Art

[0002] The storage formats of different images may be different, and some image formats are difficult to convert directly, and the expressions and styles of images in different formats may be different. In this case, you can use image copying to draw the desired image on the desired drawing platform to obtain the image in the desired storage format and expression.

[0003] The current image copying method is usually to compare the cursor and the target point by human eyes, and after confirming that the cursor and the target point coincide, the geometric object copying begins. The size and shape of the image copied by this method are less accurate, and the copying efficiency is also low. Summary of the invention

[0004] The present disclosure provides an image drawing method, an electronic device, a readable storage medium, and a computer program product.

[0005] In a first aspect, the present disclosure proposes an image drawing method, comprising: displaying a reference geometric object in a drawing page; specifying multiple target endpoints of a target geometric object by executing an endpoint specifying step, wherein a layer for drawing the target geometric object and a layer for displaying the reference geometric object are different layers; and after obtaining the latest specified endpoint of the target geometric object, displaying a target line segment with the latest specified endpoint as an endpoint, after obtaining all the specified endpoints of the target geometric object, displaying the target geometric object including the target line segment in the drawing page, wherein the style of the target line segment is different from the style of the line segment of the reference geometric object; wherein the endpoint specifying step comprises: in response to a cursor moving to a position where the distance from one of the reference endpoints of the reference geometric object is less than a specified distance, an identification point is automatically displayed at a reference endpoint where the distance from the cursor is less than the specified distance; and in response to receiving a first input, specifying the position where the identification point is located as the target endpoint of the target geometric object.

[0006] According to some embodiments of the present disclosure, before displaying the reference geometric object in the drawing page, the method further includes: acquiring an image file storing the reference image, and parsing the image file to obtain data of the reference geometric object contained in the reference image.

[0007] According to some embodiments of the present disclosure, the storage format of the image file does not belong to a file format that can be directly opened in the drawing page.

[0008] According to some embodiments of the present disclosure, before displaying the reference geometric object in the drawing page, the image zoom ratio is first determined according to the scale used by the reference image and the scale used by the drawing page; displaying the reference geometric object in the drawing page includes: displaying the reference geometric object in the drawing page according to the image zoom ratio.

[0009] According to some embodiments of the present disclosure, before displaying the reference geometric object in the drawing page, the method further includes: logging into a drawing platform through a browser, the drawing platform being used to display the drawing page.

[0010] According to some embodiments of the present disclosure, before displaying the reference geometric object in the drawing page, the method further includes: storing the data of the reference geometric object in the cache of the browser, and the cached data of the reference geometric object is used to load into the drawing page for display when the drawing page is refreshed.

[0011] According to some embodiments of the present disclosure, storing data of a reference geometric object in the cache of the browser includes: storing the parsed data of the reference geometric object in a first database supported by the browser; and if storing the data of the reference geometric object in the first database fails, storing the parsed data of the reference geometric object in a second database supported by the browser and having an allowed storage space smaller than that of the first database.

[0012] According to some embodiments of the present disclosure, the endpoint designation step also includes: determining points belonging to the reference geometric object contained in a designated area centered on the cursor; and in response to the presence of reference endpoints of the reference geometric object in the designated area, determining that the cursor moves to a position where the distance between the cursor and one of the reference endpoints of the reference geometric object is less than a specified distance.

[0013] According to some embodiments of the present disclosure, before specifying the target endpoint of the target geometric object by executing the endpoint specifying step, the method further includes: dividing the drawing space into multiple sub-areas, and the points included in the edge line of the reference geometric object are distributed in the multiple sub-areas.

[0014] According to some embodiments of the present disclosure, determining the points belonging to the reference geometric object contained in the designated area centered on the cursor includes: determining a target sub-area where the cursor is located from the multiple sub-areas; and determining the points of the reference geometric object contained in the designated area centered on the cursor from the points contained in the target sub-area.

[0015] According to some embodiments of the present disclosure, the target sub-region is a single sub-region or a plurality of connected sub-regions.

[0016] According to some embodiments of the present disclosure, displaying a target line segment with the latest specified endpoint as an endpoint includes: displaying a variable line segment that overlaps with the reference line segment along the reference line segment as the cursor moves, until the variable line segment forms the target line segment when the current endpoint to be specified is completed, wherein the reference line segment is the edge of the reference geometric object with the latest specified endpoint as an endpoint, and one end of the variable line segment is the latest specified endpoint.

[0017] According to some embodiments of the present disclosure, if there are multiple reference line segments, displaying a variable line segment that overlaps with the reference line segment along the reference line segment includes: determining a target reference line segment closest to the position of the cursor from multiple reference line segments; and displaying a variable line segment that overlaps with the target reference line segment along the target reference line segment.

[0018] According to some embodiments of the present disclosure, the other end of the variable line segment is a projection point of the cursor on the reference line segment that overlaps with the variable line segment.

[0019] According to some embodiments of the present disclosure, the target geometric object is a rectangle, and the total number of specified endpoints is two specified endpoints.

[0020] According to some embodiments of the present disclosure, after displaying a variable line segment that overlaps with the reference line segment along a reference line segment, the image drawing method further includes: determining a nearest reference line segment that is closest to the cursor in the normal direction of the variable line segment from reference line segments parallel to the variable line segment; displaying sides of a variable rectangle, the sides of the variable rectangle including: the variable line segment, and a parallel line segment that overlaps with the nearest reference line segment and has the same length as the variable line segment; and when all the specified endpoints of the target geometric object are obtained, displaying the variable rectangle as the target geometric object.

[0021] According to some embodiments of the present disclosure, the sides of the variable rectangle also include one or more of a first side line and a second side line, wherein the first side line is perpendicular to the variable line segment and its two ends are respectively one end of the variable line segment and one end of the parallel line segment, and the second side line is perpendicular to the variable line segment and its two ends are respectively the other end of the variable line segment and the other end of the parallel line segment.

[0022] According to some embodiments of the present disclosure, the target geometric object is a line segment or a polygon.

[0023] According to some embodiments of the present disclosure, a process for executing image rendering of the drawing page is different from a thread for executing operations required to form the target geometric object.

[0024] A second aspect of the present disclosure proposes an electronic device, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the method described in any one of the above embodiments.

[0025] A third aspect of the present disclosure provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method described in any of the above embodiments.

[0026] A fourth aspect of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it is used to implement the method described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0028] Figure 1 A schematic diagram of the overall process of an image drawing method M100 according to some embodiments of the present disclosure is shown.

[0029] Figure 2 A schematic diagram of a process of image drawing for a reference geometric object containing only line segments according to some embodiments of the present disclosure is shown.

[0030] Figure 3 A schematic diagram showing the overall flow of an image drawing method M100 according to some other embodiments of the present disclosure is shown.

[0031] Figure 4 A schematic diagram of specifying endpoints of a reference geometric object containing multiple edges according to some embodiments of the present disclosure is shown.

[0032] Figure 5 A schematic diagram showing the overall flow of an image drawing method M100 according to some other embodiments of the present disclosure is shown.

[0033] Figure 6 A schematic diagram of a process of image drawing of a reference geometric object containing multiple edges according to some embodiments of the present disclosure is shown.

[0034] Figure 7 It is a schematic block diagram of the structure of an image drawing device according to one embodiment of the present disclosure.

[0035] Figure 8 FIG. 1 is a schematic block diagram of the structure of an electronic device 1000 equipped with an image drawing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0036] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0037] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0038] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged in addition without departing from the technical concept of the present disclosure.

[0039] The terms used herein are for the purpose of describing specific embodiments, rather than being restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values ​​and / or provided values ​​that will be recognized by those of ordinary skill in the art.

[0040] The copying and drawing of 2D images can be applied to many different fields. For example, in the real estate field, it is necessary to generate floor plans for public display, so that the public can understand the floor plan structure and other information of the house by opening the house details page or other online and offline channels.

[0041] When a house plan is designed, it is usually designed and drawn using CAD (Computer Aided Design) software, such as AutoCAD (Autodesk Computer Aided Design) software.

[0042] Developers can obtain CAD drawings when developing floor plans. However, since CAD drawings only contain the size and shape information of the house, the floor plans for display also need to contain some other information, such as different colors for identification and the need to add furniture patterns, etc. These required information and patterns are difficult to add in CAD software, so the content in the drawings needs to be converted to the business party's own image design platform for drawing.

[0043] The business party's platform may not be compatible with and directly open CAD drawing files, such as dxf files drawn by AutoCAD. In this case, image copying is required, such as converting the floor plan in the dxf file to png or other image formats, and opening the image in the business party's platform for manual electronic copying.

[0044] In the process of copying and drawing, it is necessary to draw line segments. When drawing line segments, it is necessary to rely on the human eye to align the cursor with the end points of the line segments for electronic copying. However, the calibration accuracy of the human eye is difficult to meet the requirements and the calibration speed is slow. Therefore, there may be a certain size error between the drawn floor plan and the real floor plan, and the drawing efficiency is also difficult to meet the requirements.

[0045] To this end, the present disclosure proposes an image drawing method.

[0046] The image drawing method proposed in the present disclosure can be implemented solely on a terminal device. In the present disclosure, the "terminal device" may be different types of electronic devices, for example, the terminal device may be a tablet computer, a laptop computer, a desktop computer or the like.

[0047] Figure 1 FIG. 2 is a schematic diagram showing the overall flow of an image drawing method M100 in some embodiments of the present disclosure. Figure 1 The method shown includes step S110, step S120 and step S130. The method can be executed by a device such as a tablet computer, a laptop computer or a desktop computer.

[0048] S110, displaying the reference geometry object on the drawing page.

[0049] The user can enter the drawing page by opening an application or opening a browser and logging into the drawing platform. After entering the drawing page, the user can open the corresponding image file to display the reference geometry object on the drawing page.

[0050] An image file may contain data of one or more reference geometric objects, and the corresponding reference geometric objects displayed on the drawing page will have one or more. A reference geometric object has multiple reference endpoints. A reference geometric object is a two-dimensional geometric object, such as a line segment. Users cannot directly operate and modify the image in the image file through the drawing platform, so they need to electronically copy the reference geometric object to obtain the corresponding image that can be directly operated. The obtained image is displayed as the target geometric object. In other words, when electronically copying (image drawing), the reference geometric object is used as the base map to draw the target geometric object that is similar to or the same as the base map. The base map refers to the layer placed at the bottom of multiple layers during the mapping process. The drawn content will be located above the base map content, thereby visually covering the base map.

[0051] Figure 2 A schematic diagram of a process of image drawing for a reference geometric object containing only line segments according to some embodiments of the present disclosure is shown. Figure 2 Part (1) of FIG. 1 shows the situation when the image to be copied is displayed on the drawing page. The image P1 contains 4 reference geometric objects, all of which are line segments. Line segment L1 is one of the reference geometric objects, that is, a reference geometric line segment. The two end points of line segment L1 are p1 and p2. C is a cursor. Figure 2 When copying, the target geometric objects obtained can also be line segments, that is, target geometric line segments.

[0052] When the electronic copying of the floor plan is performed by the image drawing method M100, Figure 2 The line segments in (such as line segment L1) can represent walls from a top-down perspective, and the line segments can also represent the edges of doors, windows, furniture or other physical structures in the house from a top-down perspective.

[0053] S120, specify multiple target endpoints of the target geometric object by executing an endpoint specifying step. The layer for drawing the target geometric object is different from the layer for displaying the reference geometric object. The endpoint specifying step includes: in response to the cursor moving to a position where the distance from one of the reference endpoints of the reference geometric object is less than a specified distance, the identification point is automatically displayed at the reference endpoint where the distance from the cursor is less than the specified distance; and in response to receiving a first input, specifying the position where the identification point is located as the target endpoint of the target geometric object.

[0054] After the reference geometric object is displayed, the user can start drawing the image. The identification point refers to the point on the reference geometric object that is currently allowed to be specified. There is only one identification point at the same time. When the identification point is specified, the target endpoint of the target geometric object is formed at the location of the identification point.

[0055] Continue reading Figure 2 , Figure 2 Part (2) in shows the situation when the cursor moves close to the endpoint p1 of the line segment. When drawing the line segment L1, the user moves the cursor C from the dotted cursor position as shown by the dotted arrow to the vicinity of the reference endpoint p1 of the line segment L1, and when the straight-line distance d1 between the cursor C and the endpoint p1 is less than the specified distance, an identification point h is displayed at the endpoint p1. The identification point h can be displayed as a hollow circle or other graphics. At this time, as long as the straight-line distance between the cursor C and the endpoint p1 remains less than the specified distance, the identification of the identification point h is always displayed at the endpoint p1 unchanged until the target geometric object is fully displayed. When the straight-line distance between the cursor C and the endpoint p1 is greater than the specified distance, the identification point h disappears from the endpoint p1. For example, when the cursor is at the dotted cursor position, the distance between the dotted cursor and the line segment L1 is far, so the identification point will not be displayed on L1.

[0056] It is understandable that when the cursor is far away from any line segment, the mark point h can always be displayed at the head of the cursor, and the position of the head is the click position of the cursor when clicking. When the cursor is close to the end of the line segment, the mark point h automatically disappears from the head of the cursor and appears at the end of the line segment.

[0057] When the marker point h is automatically adsorbed to the endpoint p1, the user can specify the endpoint of the target geometric object (i.e., the target geometric line segment) through the first input. The first input can be triggered by a click event or by the keyboard. For example, the user Figure 2 If you click the mouse in the case of part (2) in the figure, the position of endpoint p1 will be used as the first endpoint of the target geometric segment. At this time, the reference geometric segment (L1) and one of the endpoints of the target geometric segment coincide with each other, thus achieving accurate positioning of the endpoint during drawing. When the endpoint of the target geometric segment is specified, a hollow circular mark or other type of mark can be kept at the endpoint to indicate that the point has been specified as the target endpoint of the target geometric object.

[0058] The layer that displays reference geometric objects is usually called a basemap, and the layer that draws and displays target geometric objects is usually a new layer located above the basemap.

[0059] S130, after obtaining the latest specified endpoint of the target geometric object, displaying the target line segment with the latest specified endpoint as the endpoint. After obtaining all the specified endpoints of the target geometric object, the target geometric object including the target line segment is displayed on the drawing page.

[0060] The style of the target line segment and the style of the line segment of the reference geometric object may be different, and the style can visually distinguish the target line segment from the line segment of the reference geometric object.

[0061] Figure 2Part (3) of FIG. 1 shows the situation when the cursor moves to the vicinity of the line segment endpoint p2. After obtaining the first endpoint of the target geometric line segment in step S120, the cursor C is moved from the dashed cursor position to the vicinity of the reference endpoint p2 of the reference geometric line segment L1 as indicated by the dashed arrow. The distance between the cursor C and point p2 is less than the specified distance, so the identification point h appears at point p2. Figure 2 The target geometry object is a line segment, so the target line segment is the target geometry segment.

[0062] Figure 2 The obtained target geometric line segment is shown in part (4) of FIG. 1 . When the identification point h appears at point p2, the endpoint p2 is designated as the other endpoint of the target geometric line segment through the click event trigger. At this time, the point designated at endpoint p2 is the latest designated endpoint, and the point designated at endpoint p2 is the previous designated endpoint. At this time, the latest designated endpoint is not the first designated endpoint.

[0063] The target geometric line segment (i.e., the target line segment) contains two specified endpoints. At this time, all the specified endpoints of the target geometric line segment have been obtained, so the target geometric line segment L2 is displayed. In order to distinguish the target geometric object from the reference geometric object, the style of the target geometric line segment L2 is different from the style of the reference geometric line segment L1. Figure 2 The line width of the line segment L2 in FIG. 1 is greater than the line width of the line segment L1. It is understandable that other styles may be used to indicate the difference between the two, such as by distinguishing by line color.

[0064] It can be understood that since the specified endpoint at point p2 is the last specified endpoint of the target geometric line segment, after the target endpoint at point p2 is specified, when the target geometric line segment L2 is displayed, the hollow circular marks at both ends of the target geometric line segment L2 may disappear.

[0065] It should be noted that if the target geometric object is a polygon such as a rectangle rather than a line segment, the target geometric object is not a target geometric line segment but a target geometric figure, and the target line segment is not the entire target geometric figure but one of the edges of the target geometric figure. For example, for a rectangular reference geometric object, the rectangle can be electronically copied by specifying four target endpoints. After specifying the second target endpoint, the first target line segment (rectangular edge) is formed, and after specifying the third target endpoint, the second target line segment is formed, until after specifying the fourth target endpoint, the third and fourth target line segments are formed, and the target geometric object of the rectangle is obtained.

[0066] According to the image drawing method proposed in the embodiment of the present disclosure, the marking point is automatically adsorbed to the endpoint position by automatically identifying the distance between the cursor and the endpoint, thereby avoiding wasting time on size measurement and position calibration, and eliminating the need for careful position comparison by human eyes. This not only improves the efficiency of electronic copying, but also improves the accuracy of the copied image, and can ensure the consistency between the copied image and the copied image.

[0067] Figure 3 FIG. 1 is a schematic diagram showing the overall flow of an image drawing method M100 in some other embodiments of the present disclosure. Figure 3 Before executing step S110 (displaying the reference geometric object in the drawing page), the following step S102 may be executed first.

[0068] S102, obtaining an image file storing a reference image, parsing the image file to obtain data of reference geometric objects contained in the reference image, wherein the storage format of the image file may not be a file format that can be directly opened in a drawing page.

[0069] The image file can be a dxf file drawn by AutoCAD or a file in other formats that can store image data. The drawing platform cannot directly open the dxf file, so after obtaining the image file of the reference image, the reference image is processed and converted by a pre-developed and packaged tool to obtain the image data of the reference geometric object. During the image processing and conversion process, unnecessary annotations and labels in the image can be removed. The image data obtained after the conversion can exist in the form of an SVG image. The image file can be pre-stored in a server or a local disk. When the image file is obtained in step S101, the local image file can be uploaded to the drawing platform for parsing and image display, and the displayed reference image can be used as a base map.

[0070] By parsing the reference drawings that cannot be opened directly, it is possible to display the reference drawings in the form of base maps on the drawing platform, thereby achieving electronic copying of reference geometric objects in the reference drawings.

[0071] It should be noted that since the image content that the operator performing electronic copying needs to draw is usually not completely consistent with the content of the base map (reference map), some corrections may be required for the shapes and sizes of some structures and entities. Therefore, the reference geometric objects obtained by analysis cannot be directly used as target geometric objects. Instead, manual copying is required, and in the copying process, target geometric objects that are similar or overlapping with the reference geometric objects but not exactly the same are directly drawn.

[0072] Continue reading Figure 3Before executing step S110 (displaying the reference geometric object in the drawing page), the following step S103 may be executed first.

[0073] S103, determining the image zoom ratio according to the scale used by the reference image and the scale used by the drawing page. Step S103 can be started after the execution of step S102 is completed.

[0074] Correspondingly, step S110 may include S111.

[0075] S111, displaying the reference geometry object on the drawing page according to the zoom ratio.

[0076] Since the scale of the CAD drawing space when drawing the reference drawing may be different from the default scale of the drawing space of the drawing platform, in order for the size of the reference geometry objects obtained after the reference drawing is converted to remain consistent with that in the CAD drawing space when displayed on the drawing platform, it is necessary to determine the scaling ratio between the CAD drawing space and the platform drawing space, so that the reference geometry objects are displayed according to the scaling ratio and the scale of the platform drawing space.

[0077] Continue reading Figure 3 Before executing step S110, the following step S101 may also be executed first.

[0078] S101, log in to the drawing platform through a browser. The drawing platform is used to display the drawing page. Step S101 can be performed before starting to perform step S102.

[0079] When a user wants to make an electronic copy, he first opens a browser and logs into the drawing platform, then starts uploading and importing image files, and performs image analysis and scale conversion to display the reference geometric objects.

[0080] Continue reading Figure 3 Before executing step S110, the following step S104 may also be executed first.

[0081] S104, storing the data of the reference geometric object in the cache of the browser. The cached data of the reference geometric object is used to load into the drawing page for display when the drawing page is refreshed. It is understandable that step S104 may be executed before the above step S111, or after the step S111, or at the same time as the step S111 (e.g., Figure 3 as shown).

[0082] By caching the acquired reference image data first, the image data is prevented from being lost when the browser is refreshed. If the reference geometry object is displayed on the drawing page and the page is refreshed due to an error operation or the like, the reference geometry object data can be read and loaded from the browser cache and then displayed, thereby preventing the image on the drawing page from being lost, without having to perform uploading, parsing, converting, and the like operations again. The zoom ratio obtained in step S103 can also be stored in the browser cache, so that after the drawing page is refreshed, the loaded reference geometry data can be displayed according to the zoom ratio.

[0083] It is understandable that, when the user is drawing the target geometric object, the image drawn by the user can be cached periodically, and the reference geometric object and the target geometric object drawn by the user can be refreshed simultaneously when the page is refreshed.

[0084] Based on the display of the drawing page through the browser described in step S101, in step S104, the method of storing the data of the reference geometric object in the cache of the browser may include the following steps: storing the parsed data of the reference geometric object in a first database supported by the browser; and if storing the data of the reference geometric object in the first database fails, storing the parsed data of the reference geometric object in a second database supported by the browser and having an allowed storage space smaller than that of the first database.

[0085] Since the cache allocated by the browser for the drawing page may be small, for example, the cache space may be configured to be no more than 10Mb, in order to avoid cache failure, two different cache methods can be set when caching the data of the reference geometric object. First, the first cache method is used for storage, that is, it is stored through the first database with a larger allowed storage space. The first database can use the IndexedDB database system. IndexedDB is an object-oriented transactional database system based on JavaScript, which can store data in the form of key-value pairs. If IndexedDB fails to store data, the second cache method is used for storage, that is, it is stored through the second database with a smaller allowed storage space. The second database can use the localstorage database. The allowed storage space of the localstorage database is small, which may be only 5Mb. Compared with IndexDB, localstorage has better compatibility and a higher cache success rate.

[0086] It is understandable that step S104 and step S111 may also be executed in parallel, that is, after obtaining the data of the reference geometric object and the zoom ratio, the image display process of step S111 may be started at the same time as the caching process of step S104 is started.

[0087] Exemplarily, the endpoint designation step may also include the following steps: determining points belonging to the reference geometric object contained in a specified area centered on the cursor; and in response to the presence of reference endpoints of the reference geometric object in the specified area, determining that the cursor moves to a position where the distance between it and one of the reference endpoints of the reference geometric object is less than a specified distance.

[0088] The specified area can be a circular area, a rectangular area, or an area of ​​other shapes. Figure 4 A schematic diagram of specifying endpoints of a reference geometric object containing multiple edges according to some embodiments of the present disclosure is shown. Figure 4 , T1 is the reference geometric object, the outer contour of T1 contains 10 edges, L3 is one of them. With the head position of the cursor C as the center and the specified distance (for example, 100 mm) as the radius, there is a circular area r (represented by a dotted arc), which is the specified area. When the cursor C moves, the range covered by the area r will change accordingly, and the points contained in the area r that belong to the reference geometric object T1 will also change. For example Figure 4 At the position of the cursor C, the points in region r belonging to edge L3 are the points within the length d2 of L3, and the points within the length d2 include an endpoint. Figure 4 When it is a floor plan, T1 can represent a wall or furniture.

[0089] All reference endpoints of all reference geometric objects displayed on the drawing page are configured with invisible special marks. When there are reference endpoints in the specified area, the reference endpoints can be identified from non-endpoints by special marks. When the region r contains the reference endpoint of T1, it is determined that the cursor C has moved to a position where the distance between it and a reference endpoint of T1 is less than the radius of the region r. At this time, in response to the determined position, the mark point h is automatically displayed at the reference endpoint. Figure 4 , where the identification point h is already displayed at the reference endpoint, is shown in FIG. It is understandable that the region r will not be displayed on the drawing page and thus will not be observed by the operator.

[0090] By identifying and adsorbing the endpoints within the circular range of the cursor, the required amount of calculation is small and the operation is convenient for the operator, which can ensure the timeliness of the appearance of the identification point. It is understandable that if the specified area does not contain an endpoint but contains a non-endpoint, the identification point can be displayed at the non-endpoint closest to the cursor.

[0091] Continue reading Figure 3Before executing step S120 (specifying the endpoints of the target geometric object by executing the endpoint specifying step), step S112 may be executed first. It is understandable that step S112 may be executed after, before, or at the same time as step S111. Step S112 may also be executed before step S103, and the area division result obtained in step S112 may be cached in step S104.

[0092] S112, dividing the drawing space into a plurality of sub-areas, wherein the points included in the edge line of the reference geometric object are distributed in the plurality of sub-areas.

[0093] Continue reading Figure 4 , through step S112, the two-dimensional drawing space is divided into four sub-regions R1, R2, R3, and R4, each of which contains points of reference geometric objects. The drawing space is usually rectangular, so the sub-region can be set as a rectangle. The area size of each sub-region can be the same, that is, the drawing space is evenly divided into i×j sub-regions according to the matrix. Figure 4 In the example, each sub-region contains points of reference geometric objects.

[0094] It is understandable that the number of divided sub-areas can be preset as needed, and any possible value is within the scope of the present disclosure. In addition, the sub-areas and target sub-areas will not be displayed on the drawing page, so they will not be observed by the operator.

[0095] Since there may be many reference geometric objects displayed in the drawing space and the content is relatively complex, during the image drawing process on the browser, if all the points in the drawing space are identified and determined as points to be determined each time when determining which points are included in the specified area r, the amount of calculation may be large, making it difficult for the system to respond in time and unable to quickly perform reference endpoint adsorption.

[0096] Based on this, in the endpoint designation step, the method of determining the points belonging to the reference geometric object contained in the designated area centered on the cursor may include the following steps: determining the target sub-area where the cursor is located from the above-mentioned multiple sub-areas; and determining the points of the reference geometric object contained in the designated area centered on the cursor from the points contained in the target sub-area.

[0097] The above-mentioned sub-region division and point query can be implemented by using a quadtree algorithm. Whenever the cursor moves, the new position of the cursor after the movement is judged to identify which sub-region the cursor is located in after the movement. The sub-region where the cursor is located is called the target sub-region, and it is possible to determine which points of the reference geometric object are located in the circular specified area only from the target sub-region. As a result, the points to be determined are limited from the points in the overall drawing space to the points in a certain sub-region, which can reduce the amount of calculation required for point comparison, so that when running in a browser, the system can avoid freezes and ensure timely response of the system, quickly identify the reference endpoints, and adsorb the identification points.

[0098] For example, the target sub-region may be a single sub-region or a plurality of connected sub-regions. Figure 4 In the example, the target sub-region only includes region R3. Alternatively, when the number of sub-regions into which the drawing space is divided is large, the region range of the sub-region may be small. In this case, the region range of the target sub-region may be expanded to ensure that the target sub-region can include all points in the specified region.

[0099] Figure 5 FIG. 1 is a schematic diagram showing the overall flow of an image drawing method M100 in some other embodiments of the present disclosure. Figure 5 In step S130, the method of displaying the target line segment with the latest specified endpoint as the endpoint may include the following steps: as the cursor moves, a variable line segment that overlaps with the reference line segment is displayed along the reference line segment until the variable line segment forms the target line segment when the current endpoint to be specified is specified. The reference line segment is the edge of the reference geometric object with the latest specified endpoint as the endpoint. One end of the variable line segment is the latest specified endpoint.

[0100] Figure 6 The following is a schematic diagram showing the process of drawing an image of a reference geometric object containing multiple edges in some embodiments of the present disclosure. The reference image obtained in step S102 may be a floor plan. Figure 6 The reference geometric object shown in may be a wall. Figure 6 Part (1) of FIG. 1 shows the situation when one of the reference endpoints of the reference wall is designated. If a reference endpoint of the reference wall appears in the designated area r of the cursor C, a marker point h appears at the endpoint. Figure 6 Part (2) of the figure shows the process of moving along the edge of the reference wall. After the identification point h appears at the endpoint, the operator clicks the mouse to designate the endpoint as an endpoint of the target wall being drawn. The designated endpoint is the current latest designated endpoint. The current latest designated endpoint is not the first designated endpoint.

[0101] As the cursor C moves to the right from the position shown in part (1), it extends outward from the latest specified endpoint of the edge line L4 of the reference wall to form a variable line segment L7 (thick solid line), which visually covers L4. The variable line segment L7 changes its length as the cursor moves horizontally. The two ends of L7 are the latest specified endpoint and the position point corresponding to the cursor position along the straight line where the reference line segment is located.

[0102] Figure 6 Part (3) in the figure shows the situation where the cursor moves to the vicinity of another reference endpoint of the reference wall. The cursor moves to the vicinity of a reference endpoint of the reference wall edge line L5 that is colinear with L4, and the endpoint is located within the specified area of ​​the cursor, so an identification point h appears at the endpoint. At this time, the length of the variable line segment L7 is the horizontal distance between the latest specified endpoint and the current endpoint of the identification point h. The line segment with two identification points as endpoints in part (3) is the target line segment. Since the target geometric object at this time is a polygon, the target line segment is a sideline of the target geometric object.

[0103] Figure 6 Part (4) of FIG. 5 shows a schematic diagram of an image of a wall Q1 drawn by two specified endpoints. The wall Q1 is a rectangle, and the two specified endpoints form a sideline of the wall Q1, through which the image of the wall Q1 is generated.

[0104] By displaying the connection line between the specified endpoint and the cursor in real time during the process of specifying the endpoint, the operator can be facilitated to perform electronic copying through the visualization of the line segment.

[0105] Exemplarily, if there are multiple reference line segments, then in the endpoint specification step, the method of displaying a variable line segment that overlaps with the reference line segment along the reference line segment may include the following steps: determining a target reference line segment closest to the cursor position from multiple reference line segments; and displaying a variable line segment that overlaps with the target reference line segment along the target reference line segment.

[0106] See also Figure 6 In part (1), the endpoint of the identification point h is connected to the reference wall edge line L4 and L6. Both L4 and L6 are optional target reference line segments. Figure 6 In part (1), the cursor moves to the right, so the distance between the cursor and edge line L4 is closer than the distance between the cursor and edge line L6, so the variable line segment L7 overlaps with the edge line L4, and L4 is the target reference line segment at this time; if the cursor moves upward, the cursor will be closer to L6, and the variable line segment will overlap with the edge line L6, and L6 is the target reference line segment.

[0107] Exemplarily, the other end of the variable line segment is a projection point of the cursor on the reference line segment that coincides with the variable line segment.

[0108] See also Figure 6 In part (2), the identification point h moves on the target reference line segment L4 as the cursor moves. The location of the identification point h can be located at the intersection between the normal line of the target reference line segment L4 passing through the cursor (the dotted line part in the figure, which will not be displayed on the drawing page) and the target reference line segment L4. The intersection is the projection point. One end of the variable line segment is a fixed end, and the other end is a movable end that moves on the straight line where the reference line segment is located as the cursor changes.

[0109] Understandably, Figure 6 To draw a rectangular wall Q1, the operator can specify the four endpoints of the wall Q1 to draw the image of the wall Q1. Whenever a non-first specified endpoint is specified, the edge formed between the latest specified endpoint and the previous specified endpoint remains displayed on the drawing page. When all four endpoints are specified, the complete form of the wall Q1 including the four edges is displayed, and the specified color can be automatically filled in the rectangular frame of the wall Q1 for easy distinction.

[0110] The target geometric object may be a rectangle. All specified endpoints may be two specified endpoints. After displaying the variable line segment that overlaps with the reference line segment along the reference line segment, the following steps may be performed. First, determine the nearest reference line segment that is closest to the cursor in the normal direction of the variable line segment from the reference line segments that are parallel to the variable line segment. Then display the side of the variable rectangle, wherein the side of the variable rectangle includes: the variable line segment, and the parallel line segment that overlaps with the nearest reference line segment and has the same length as the variable line segment. The side of the variable rectangle may also include one or more of a first side line and a second side line, wherein the first side line is perpendicular to the variable line segment and its two ends are one end of the variable line segment and one end of the parallel line segment, respectively, and the second side line is perpendicular to the variable line segment and its two ends are the other end of the variable line segment and the other end of the parallel line segment, respectively. Finally, when all specified endpoints of the target geometric object are obtained, the variable rectangle is displayed as the target geometric object.

[0111] Continue reading Figure 6In part (2), L11 is a reference line segment parallel to the variable line segment L7 and is the closest to L7 in the vertical direction, so L11 is the nearest reference line segment. The four sides of the variable rectangle are L7, L8, L9 and L10. L7 is a variable line segment, L8 coincides with the nearest reference line segment and is parallel to the variable line segment L7, the length of L8 is the same as L7, and as the cursor moves horizontally, L7 and L8 grow and shrink synchronously. L8 is equivalent to the vertical projection of L7 on the nearest reference line segment. L9 and L10 are the other two parallel sides of the variable rectangle. L9 is perpendicular to both L7 and L8 and has the endpoints of L7 and L8 as its endpoints, and L10 is also perpendicular to both L7 and L8 and has the endpoints of L7 and L8 as its endpoints. L9 and L10 can start to be displayed when the first specified endpoint is obtained, and one of L9 and L10 will also change position as the length of the variable line segment changes. L9 and L10 may also be displayed after obtaining the second specified endpoint (that is, obtaining all specified endpoints).

[0112] When the cursor moves to the position shown in part (3), the variable rectangle changes to the state shown in part (3). When the cursor clicks at this position, the second specified endpoint is obtained. At this time, all the specified endpoints have been obtained, and the state of the variable rectangle changes to a solid rectangle filled with color as shown in part (4). The position and size of the solid rectangle are the same as the rectangular frame shown in part (3). The solid rectangle represents the wall Q1. It can be understood that in addition to the solid rectangle, the wall Q1 can also be represented by a hollow rectangle or a rectangle filled with hatching, and the present disclosure does not limit this.

[0113] Through the above steps, only two endpoints need to be specified, and the system can automatically adapt the wall width, thereby copying a rectangular wall. There is no need to manually specify the remaining two endpoints, which improves the efficiency of copying rectangular walls.

[0114] In the process of electronic copying, the process used to execute the image rendering of the drawing page can be different from the thread used to execute the calculation required to form the target geometric object. Specifically, the entire calculation process required for electronic copying can include data calculation processes involving position calculations, coordinate calculations, and line segment calculations such as coordinate conversion and space segmentation. Therefore, the API provided by the browser where the drawing page is located (such as requestIdleCallback and Web Worker) can be used to render the page through the main thread, and use another separate thread to perform data calculations. This can avoid the data calculation process occupying resources, causing the system to freeze, thereby reducing the real-time performance of page rendering.

[0115] requestIdleCallback is an API provided by the browser that allows developers to schedule tasks to be executed during the idle period in the main event loop, thereby improving the performance of web applications.

[0116] Web Worker is a multithreading solution introduced by HTML5 (HyperText Markup Language 5) that allows background scripts to be executed in a browser environment. Web Worker allows JavaScript code to run in a separate thread without blocking the user interface or other tasks that require the main thread (such as event handling, rendering, etc.). By using Web Worker, some computationally intensive tasks or time-consuming operations can be executed in the background, thereby maintaining the responsiveness and smoothness of the web page.

[0117] The data calculation process is calculated through requestIdleCallback and web worker, and the DOM is obtained and queried during the browser's idle time, thereby optimizing the system's resource allocation and optimizing the experience.

[0118] Based on any of the above implementations, the present disclosure also provides an image drawing device.

[0119] Figure 7 FIG. 1 is a schematic block diagram of the structure of an image drawing device according to an embodiment of the present disclosure. Figure 7 As shown, the image drawing device includes: a reference object display module 1002 , an endpoint specifying module 1004 and a target object display module 1006 .

[0120] The reference object display module 1002 is used to display reference geometric objects in the drawing page.

[0121] The endpoint specifying module 1004 is used to specify multiple target endpoints of the target geometric object by executing the endpoint specifying step. The layer for drawing the target geometric object is different from the layer for displaying the reference geometric object. The endpoint specifying step includes: in response to the cursor moving to a position where the distance from one of the reference endpoints of the reference geometric object is less than a specified distance, the identification point is automatically displayed at the reference endpoint where the distance from the cursor is less than the specified distance; and in response to receiving the first input, the position where the identification point is located is specified as the target endpoint of the target geometric object.

[0122] The target object display module 1006 is used to display the target line segment with the latest specified endpoint as the endpoint after obtaining the latest specified endpoint of the target geometric object. After obtaining all the specified endpoints of the target geometric object, the target geometric object including the target line segment is displayed on the drawing page.

[0123] The above modules can be implemented by computer program modules. The implementation process of the functions and effects of each module in the above device is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.

[0124] The execution subject of the image drawing method in the specific implementation manner of the present disclosure may be an electronic device such as a tablet computer, a desktop computer, etc.

[0125] Therefore, based on any of the above embodiments, the present disclosure further provides an electronic device, which can execute the image drawing method of any of the above embodiments of the present disclosure, and the image drawing device of any of the above embodiments can be configured on the electronic device.

[0126] Figure 8 FIG. 1 is a schematic block diagram of an electronic device 1000 equipped with an image drawing device according to an embodiment of the present disclosure. Figure 8 The image drawing device includes: a reference object display module 1002, an endpoint designation module 1004 and a target object display module 1006. Each of the above modules can be implemented by a computer program module. The implementation process of the functions and effects of each module in the above device is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.

[0127] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300 and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.

[0128] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.

[0129] The processor 1200 may be a central processing unit (CPU). The processor 1200 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0130] The memory 1300 can be used as a non-transitory computer-readable storage medium, and can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions of the computer program in the embodiment of the present disclosure. The processor 1200 implements the image drawing method by running the non-transitory software programs, instructions and modules stored in the memory 1300.

[0131] The memory 1300 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created by the processor 1200, such as structural data, model data, sample data, stiffness evaluation results, etc. of the bridge. In addition, the memory 1300 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1300 may optionally include a memory remotely arranged relative to the processor 1200, and these remote memories may be connected to the processor 1200 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0132] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.

[0133] The present disclosure also provides a computer program product, and the method of the present disclosure can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.

[0134] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0135] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0139] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.

[0140] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0141] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.

Claims

1. An image drawing method, characterized in that: include: Display reference geometry objects on the drawing page; Specifying a plurality of target endpoints of the target geometric object by executing the endpoint specifying step, wherein the layer for drawing the target geometric object and the layer for displaying the reference geometric object are different layers; as well as After obtaining the latest specified endpoint of the target geometric object, displaying the target line segment with the latest specified endpoint as the endpoint, and after obtaining all the specified endpoints of the target geometric object, displaying the target geometric object including the target line segment in the drawing page; in The endpoint designation step includes: In response to the cursor moving to a position where the distance from one of the reference endpoints of the reference geometric object is less than a specified distance, the identification point is automatically displayed at the reference endpoint where the distance from the cursor is less than the specified distance; as well as In response to receiving the first input, the position of the identification point is designated as the target endpoint of the target geometric object.

2. The image drawing method according to claim 1, characterized in that: Before displaying the reference geometry object on the drawing page, the method further includes: An image file storing a reference image is obtained, and the image file is parsed to obtain data of reference geometric objects contained in the reference image.

3. The image drawing method according to claim 2, characterized in that: The storage format of the image file does not belong to the file format that can be directly opened in the drawing page.

4. The image drawing method according to claim 1, characterized in that: The endpoint designation step further includes: Determine a point belonging to the reference geometric object contained in a designated area centered on the cursor; and In response to the reference endpoints of the reference geometric object existing in the designated area, it is determined that the cursor moves to a position where the distance between the cursor and one of the reference endpoints of the reference geometric object is less than a designated distance.

5. The image drawing method according to any one of claims 1 or 4, characterized in that: Displays the target line segment with the most recently specified endpoint as the endpoint, including: As the cursor moves, a variable line segment that overlaps with the reference line segment is displayed along the reference line segment until the variable line segment forms a target line segment when the current endpoint to be specified is completed, wherein the reference line segment is the edge of the reference geometric object with the latest specified endpoint as its endpoint, and one end of the variable line segment is the latest specified endpoint.

6. The image drawing method according to claim 5, characterized in that: If there are multiple reference line segments, the variable line segments that overlap with the reference line segments are displayed along the reference line segments and include: Determine a target reference line segment closest to the position of the cursor from among the plurality of reference line segments; and A variable line segment that overlaps with the target reference line segment is displayed along the target reference line segment.

7. The image drawing method according to claim 5, characterized in that: The other end of the variable line segment is a projection point of the cursor on the reference line segment that overlaps with the variable line segment.

8. The image drawing method according to claim 5, characterized in that: After displaying the variable line segment that overlaps with the reference line segment along the reference line segment, the image drawing method further includes: Determine, from the reference line segments parallel to the variable line segment, a nearest reference line segment that is closest to the cursor in the normal direction of the variable line segment; Displaying the side of the variable rectangle, the side of the variable rectangle comprising: the variable line segment, and a parallel line segment that overlaps with the nearest reference line segment and has the same length as the variable line segment; and When all the specified endpoints of the target geometric object are obtained, the variable rectangle is displayed as the target geometric object.

9. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory so that the processor executes the method according to any one of claims 1 to 8.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 8.