WebGL-based PDF drawing electronic measurement method

Through the analysis and rendering of PDF drawings based on WebGL, combined with the electronic measurement module, the measurement operations of the length, area, angle and other aspects of the PDF drawings are realized, which solves the problem that online measurement cannot be conveniently carried out in the existing technology and improves the efficiency of drawing review.

CN119693967APending Publication Date: 2025-03-25TAIZHOU ANTI-SEISMIC OFFICE (TAIZHOU CONSTR ENG CONSTR DRAWING DESIGN REVIEW CENT) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411747196.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the prior art, when reviewing PDF format drawings, it is impossible to easily perform measurement operations such as length, area, angle, etc. online.

Method used

采用基于WebGL的PDF图纸电子测量方法,通过解析PDF规范,利用WebGL技术渲染图形矢量数据,加载电子测量模块,实时追踪用户鼠标操作,识别鼠标关键操作并给出样式反馈,计算测量结果。

Benefits of technology

It enables more convenient measurement operations such as length, area, angle, etc. when reviewing PDF drawings online, improving the efficiency of drawing review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693967A_ABST
    Figure CN119693967A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of document processing, in particular to a WebGL-based PDF drawing electronic measurement method, which comprises the following steps of: firstly, analyzing a PDF drawing based on a PDF specification, and rendering acquired graphic vector data to a webpage by utilizing a WebGL technology; loading an electronic measurement module, and tracking a mouse operation track of a user in real time; key operation of the mouse is recognized, and style feedback is given by a page; calculating a measurement result based on the graphic vector data and the user operation information; according to the method, the WebGL technology is used for carrying out graph vector data analysis on the PDF-format building construction design drawing, the functions of unit calibration, precision adjustment, length measurement, area measurement, angle measurement, line segment recognition and end point and center point capture are achieved, measurement operation can be carried out more conveniently when the PDF drawing is examined online, and the method has a promoting effect on improvement of drawing examination efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of document processing, and in particular to a PDF drawing electronic measurement method based on WebGL. Background Art

[0002] In recent years, with the continuous development of technology, the review of construction drawings has gradually moved away from the offline paper-based review method. Instead, it uses online review of electronic documents of construction drawings to improve review efficiency. PDF is a common document format for construction drawings.

[0003] However, when reviewing PDF format drawings with existing technology, there is a problem that it is not convenient to perform measurement operations such as length, area, angle, etc. when viewing PDF drawings online. Summary of the invention

[0004] The purpose of the present invention is to provide a PDF drawing electronic measurement method based on WebGL, aiming to solve the technical problem in the prior art that when reviewing PDF format drawings, there is an inconvenient problem of not being able to conveniently perform measurement operations such as length, area, angle, etc. when viewing PDF drawings online.

[0005] To achieve the above object, the present invention adopts a PDF drawing electronic measurement method based on WebGL, comprising the following steps:

[0006] Step 1: Parse the PDF drawing based on the PDF specification, and use WebGL technology to render the obtained graphic vector data to the web page;

[0007] Step 2: Load the electronic measurement module to track the user's mouse operation trajectory in real time;

[0008] Step 3: Identify key mouse operations and the page will give style feedback;

[0009] Step 4: Calculate the measurement result based on the graphic vector data and user operation information.

[0010] In step 1, the acquired graphic vector data includes attribute data of coordinates, shapes, colors, and line types of lines, curves, polygons, and text graphic elements.

[0011] Among them, in step 1, the WebGL technology used is Web Graphics Library, a JavaScript API for rendering interactive 3D and 2D graphics on web pages, based on the OpenGL ES2.0 standard, using hardware accelerated graphics rendering on web pages.

[0012] In step 2, the electronic measurement module used includes unit calibration, precision adjustment, length measurement, area measurement, and angle measurement functions.

[0013] Among them, in step three, the key mouse operations are identified, and the page gives style feedback including line segment recognition, endpoint recognition and capture, center point recognition and capture, and node marking functions.

[0014] Among them, in the recognition of mouse key operations, the page gives style feedback, and the specific method of line segment recognition is:

[0015] All line segments in the drawing are identified based on the graphic vector data parsed in step 1. When the user's mouse is captured and moved to a line segment, the mouse style automatically changes to a small inner triangle to prompt the user that the current position is locked on the line segment. The user can use the mouse to click to set the current position as the measurement start or end node.

[0016] Among them, in identifying key mouse operations and giving style feedback on the page, the specific method of endpoint recognition and capture is:

[0017] According to the graphic vector data parsed in step 1, the two endpoints of all line segments in the drawing are identified. When the user's mouse is captured and moved to an endpoint, the mouse style automatically changes to a small square to remind the user that the current position is locked on the endpoint. The user can use the current position as the measurement start or end node by clicking the mouse.

[0018] Among them, in the recognition of key mouse operations, the page gives style feedback, and the specific method of center point recognition and capture is as follows:

[0019] According to the graphic vector data parsed in step 1, the center points of all line segments in the drawing are identified. When the user's mouse is moved to the center point, the mouse style automatically changes to a small equilateral triangle to prompt the user that the current position is locked on the center point. The user can use the current position as the measurement start or end node by clicking the mouse.

[0020] Among them, when identifying key mouse operations and giving style feedback on the page, the specific way of node marking is as follows:

[0021] When the user clicks the mouse, the current mouse position is marked as the measurement start node or middle node. When the user double-clicks the mouse or the current position coincides with the previous node, the current mouse position is marked as the end node.

[0022] The specific method of calculating the measurement result based on the graphic vector data and the user operation information is as follows:

[0023] Based on the graphic vector data obtained by analysis in step one and the node positions marked in step three, the corresponding length, area, and angle values ​​are calculated.

[0024] The invention discloses a PDF drawing electronic measurement method based on WebGL. The method comprises the following steps: firstly, the PDF drawing is parsed based on the PDF specification, and the obtained graphic vector data is rendered to a web page by using the WebGL technology; an electronic measurement module is loaded to track the user's mouse operation trajectory in real time; key mouse operations are identified, and the page gives style feedback; and a measurement result is calculated based on the graphic vector data and user operation information.

[0025] The present invention utilizes WebGL (Web Graphics Library, a JavaScript API for rendering interactive 3D and 2D graphics on web pages) technology to perform graphic vector data analysis of architectural construction design drawings in PDF format, and realizes unit calibration, precision adjustment, length measurement, area measurement, angle measurement, line segment recognition, and endpoint and center point capture functions, so that measurement operations are more convenient when reviewing PDF drawings online, which has a promoting effect on improving the review efficiency.

[0026] The invention solves the technical problem that when reviewing PDF format drawings in the prior art, there is a problem that it is not convenient to perform measurement operations such as length, area, angle, etc. when viewing PDF drawings online. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 It is a flowchart of the steps of the electronic measurement method of PDF drawings based on WebGL of the present invention. DETAILED DESCRIPTION

[0029] Embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, but should not be construed as limiting the present invention.

[0030] See also Figure 1 , Figure 1 It is a flowchart of the steps of the electronic measurement method of PDF drawings based on WebGL of the present invention.

[0031] The present invention provides a PDF drawing electronic measurement method based on WebGL, comprising the following steps:

[0032] S101, parsing the PDF drawing based on the PDF specification, and rendering the obtained graphic vector data to the web page using the WebGL technology;

[0033] For this specific implementation, the acquired graphic vector data includes attribute data of coordinates, shapes, colors, and line types of lines, curves, polygons, and text graphic elements;

[0034] The WebGL technology used is the Web Graphics Library, a JavaScript API for rendering interactive 3D and 2D graphics on web pages. It is based on the OpenGL ES2.0 standard and uses hardware-accelerated graphics rendering on web pages.

[0035] S102, loading the electronic measurement module to track the user's mouse operation trajectory in real time;

[0036] For this specific implementation, the electronic measurement module used includes unit calibration, accuracy adjustment, length measurement, area measurement, and angle measurement functions.

[0037] S103, identifying key mouse operations, and providing style feedback on the page;

[0038] For this specific implementation, the key mouse operations are recognized, and the page provides style feedback including line segment recognition, endpoint recognition and capture, center point recognition and capture, and node marking functions;

[0039] Among them, the specific method of line segment recognition is:

[0040] All line segments in the drawing are identified based on the graphic vector data parsed in step 1. When the user's mouse is captured and moved to a line segment, the mouse style automatically changes to a small inner triangle to prompt the user that the current position is locked on the line segment. The user can use the mouse to click to set the current position as the measurement start or end node.

[0041] The specific method of endpoint identification and capture is as follows:

[0042] According to the graphic vector data parsed in step 1, the two endpoints of all line segments in the drawing are identified. When the user's mouse is captured and moved to an endpoint, the mouse style automatically changes to a small square to remind the user that the current position is locked on the endpoint. The user can use the current position as the measurement start or end node by clicking the mouse.

[0043] Among them, the specific method of center point recognition and capture is:

[0044] According to the graphic vector data parsed in step 1, the center points of all line segments in the drawing are identified. When the user's mouse is moved to the center point, the mouse style automatically changes to a small equilateral triangle to prompt the user that the current position is locked on the center point. The user can use the current position as the measurement start or end node by clicking the mouse.

[0045] The specific method of node marking is as follows:

[0046] When the user clicks the mouse, the current mouse position is marked as the measurement start node or middle node. When the user double-clicks the mouse or the current position coincides with the previous node, the current mouse position is marked as the end node.

[0047] S104: Calculate a measurement result based on the graphic vector data and the user operation information.

[0048] According to this specific implementation, based on the graphic vector data obtained by parsing in step one and the node positions marked in step three, the corresponding length, area and angle values ​​are calculated.

[0049] A WebGL-based PDF drawing electronic measurement method using the present embodiment, when in use, first parses the PDF drawing based on the PDF specification, and uses the WebGL technology to render the acquired graphic vector data to the web page; loads the electronic measurement module, and tracks the user's mouse operation trajectory in real time; identifies key mouse operations, and the page gives style feedback; and calculates the measurement result based on the graphic vector data and user operation information.

[0050] The present invention utilizes WebGL (Web Graphics Library, a JavaScript API for rendering interactive 3D and 2D graphics on web pages) technology to perform graphic vector data analysis of architectural construction design drawings in PDF format, and realizes unit calibration, precision adjustment, length measurement, area measurement, angle measurement, line segment recognition, and endpoint and center point capture functions, so that measurement operations are more convenient when reviewing PDF drawings online, which has a promoting effect on improving the review efficiency.

[0051] The invention solves the technical problem that when reviewing PDF format drawings in the prior art, there is a problem that it is not convenient to perform measurement operations such as length, area, angle, etc. when viewing PDF drawings online.

[0052] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.

Claims

1. A PDF drawing electronic measurement method based on WebGL, It is characterized in that The following steps are involved: Step 1: Parse the PDF drawing based on the PDF specification, and use WebGL technology to render the obtained graphic vector data to the web page; Step 2: Load the electronic measurement module to track the user's mouse operation trajectory in real time; Step 3: Identify key mouse operations and the page will give style feedback; Step 4: Calculate the measurement result based on the graphic vector data and user operation information.

2. The WebGL-based PDF drawing electronic measurement method according to claim 1, characterized in that: In step 1, the acquired graphic vector data includes attribute data of coordinates, shapes, colors, and line types of lines, curves, polygons, and text graphic elements.

3. The WebGL-based PDF drawing electronic measurement method according to claim 2, characterized in that: In step 1, the WebGL technology used is Web Graphics Library, a JavaScript API for rendering interactive 3D and 2D graphics on web pages, based on the OpenGL ES2.0 standard, using hardware accelerated graphics rendering on web pages.

4. The WebGL-based PDF drawing electronic measurement method according to claim 3, characterized in that: In step 2, the electronic measurement module used includes unit calibration, precision adjustment, length measurement, area measurement, and angle measurement functions.

5. The WebGL-based PDF drawing electronic measurement method according to claim 4, characterized in that: In step three, the key mouse operations are identified, and the page gives style feedback including line segment recognition, endpoint recognition and capture, center point recognition and capture, and node marking functions.

6. The WebGL-based PDF drawing electronic measurement method according to claim 5, characterized in that: When recognizing key mouse operations and providing style feedback on the page, the specific method of line segment recognition is as follows: All line segments in the drawing are identified based on the graphic vector data parsed in step 1. When the user's mouse is captured and moved to a line segment, the mouse style automatically changes to a small inner triangle to prompt the user that the current position is locked on the line segment. The user can use the mouse to click to set the current position as the measurement start or end node.

7. The WebGL-based PDF drawing electronic measurement method according to claim 6, characterized in that: When identifying key mouse operations and providing style feedback on the page, the specific method of endpoint recognition and capture is as follows: According to the graphic vector data parsed in step 1, the two endpoints of all line segments in the drawing are identified. When the user's mouse is captured and moved to an endpoint, the mouse style automatically changes to a small square to remind the user that the current position is locked on the endpoint. The user can use the current position as the measurement start or end node by clicking the mouse.

8. The WebGL-based PDF drawing electronic measurement method according to claim 7, characterized in that: When identifying key mouse operations and giving style feedback on the page, the specific method of center point recognition and capture is as follows: According to the graphic vector data parsed in step 1, the center points of all line segments in the drawing are identified. When the user's mouse is captured and moved to the center point, the mouse style automatically changes to a small equilateral triangle to prompt the user that the current position is locked on the center point. The user can use the current position as the measurement start or end node by clicking the mouse.

9. The WebGL-based PDF drawing electronic measurement method according to claim 8, characterized in that: When identifying key mouse operations and providing style feedback on the page, the specific way of node marking is as follows: When the user clicks the mouse, the current mouse position is marked as the measurement start node or middle node. When the user double-clicks the mouse or the current position coincides with the previous node, the current mouse position is marked as the end node.

10. The WebGL-based PDF drawing electronic measurement method according to claim 9, characterized in that: The specific method of calculating the measurement results based on the graphic vector data and user operation information is as follows: Based on the graphic vector data obtained by analysis in step one and the node positions marked in step three, the corresponding length, area, and angle values ​​are calculated.