Display and control interface device for laser processing
By using modern OpenGL rendering methods and GLSL shaders in the laser processing display and control interface, the vertex algorithm and adaptive vertex density are optimized, and the lag and crash problems caused by CPU rendering in the existing technology are solved, achieving efficient display and interaction efficiency.
Patent Information
- Application Number
- CN202510065488.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The GDI/GDI+ and QPainter in the prior art cause excessive CPU burden when processing complex graphs, resulting in lag and crash, affecting human-computer interaction and user experience.
Using modern OpenGL rendering methods, we optimize vertex algorithm and adaptive vertex density, combine GLSL language to generate vertex shaders and fragment shaders to perform GPU rendering, reducing CPU burden.
It significantly improves display and interaction efficiency, reduces resource occupancy and maintenance costs, and provides better user experience and code portability.
Smart Images

Figure CN119473204A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of laser processing display and control technology, and in particular to a laser processing display and control interface device. Background Art
[0002] The display and control interface is the medium for interaction and information exchange between the system and the user. It realizes the conversion between the internal form of information and the form acceptable to humans. The laser processing display and control interface is an important part of the laser control system. It integrates hand-drawing, loading external vector graphics and bitmaps, and supports object selection, dragging, stretching, rotation, and sorting. The view supports selection observation, workspace observation, zoom in and out observation. Convenient functions such as additional grid points and auxiliary lines are also added. With the increasing application of lasers, the processing content is becoming more and more complex and diverse, and the processing requirements for the laser processing display and control interface are also getting higher and higher.
[0003] In the prior art, GDI / GDI+ is a graphics programming interface unique to the Windows system. It does not support cross-platform and uses CPU rendering, which increases the CPU burden and causes lag or even crashes when processing complex images. QPainter supports cross-platform and mainly relies on the CPU for graphics processing. It causes lag or even crashes when processing complex images, resulting in problems such as unresponsive human-computer interaction and missed beats, giving people a bad user experience.
[0004] In view of the above technical defects, a solution is now proposed. Summary of the invention
[0005] The purpose of the present invention is to solve the above-mentioned problems and to provide a laser processing display and control interface device.
[0006] The purpose of the present invention can be achieved through the following technical solutions: A laser processing display and control interface device, the specific interface device operation method is as follows: Step 1: Draw and add curves or read external curve data and image files, and set the curve data and image data to be stored in the memory at the same time; Draw and add curves: switch the corresponding drawing type through the drawing navigation, and draw the corresponding curve with the mouse and keyboard. The keyboard is used to assist in inputting coordinates. Straight lines and Bezier curves can be closed at the end. Straight lines can add nodes by clicking the mouse, and a window pops up with the right mouse button to insert the user-entered coordinates. The display control interface displays the line connected by the added points in real time. Read external curve data and image data. Step 2: Calculate vertex data: Convert the curve data to corresponding vertex data according to the pen number and color, create image texture, convert it to corresponding vertex data, set the processing sampling accuracy and corresponding color RGB value, and create image texture; Step 3: Transmit vertex data: calculate the space size and perform data transmission interaction; Step 4: Create shaders: Generate source code for vertex shaders and fragment shaders using GLSL language, and create corresponding executable logic units in the GPU; Step 5. Rendering preparation: pass the corresponding parameters to the shader before rendering, and pass the parsed VBO data to the vertex shader; Step 6, Rendering: Call drawing instructions for rendering, use modern OpenGL rendering methods to execute the created vertex shader and fragment shader respectively, and output the rendering results to the window to display curves and pictures; Step 7. Observation: Call the setting command for dynamic adjustment to perform selection observation, workspace observation, and zoom in and out observation.
[0007] As a preferred implementation of the present invention, the process of calculating vertex data in step 2 is as follows: Decompose the curve data into basic geometric types, match the sampling accuracy according to different basic geometric types, collect vertex data, generate cross-line vertex data with the point type as the center and a length of 2, attach the corresponding color RGB value, write it into the vertex array, and record the array length; tune a set of arc lengths and acquisition errors as a reference for the arc type, adjust the acquisition error value according to the current arc length and the reference arc length; external curve data is based on the pen number parameters of the external file, and the default pen number for drawing and adding curves is 0; the display control interface switches the pen number and previews the existing curves.
[0008] As a preferred implementation of the present invention, the process of transmitting vertex data in step 3 is as follows: Calculate the space size, create VBO and bind VAO. VBO opens an area in the video memory to store various attributes of the vertex, provide it to the vertex shader, and write the vertex data in the memory into the opened area; Calculate the space size VertexSpace based on the vertex array length ArrayLength in the vertex data calculated in the previous step. The formula is VertexSpace=ArrayLength*SizeOfVertex. SizeOfVertex indicates the size of the space occupied by a single vertex.
[0009] As a preferred implementation of the present invention, the process of creating a shader in step 4 is as follows: Create shader programs, set up the source code for vertex shaders and fragment shaders; GLSL is for developers to write short custom programs.
[0010] As a preferred implementation of the present invention, the rendering preparation process in step 5 is as follows: The vertex attribute data is read from the buffer VBO and bound to the specified attributes of the shader program; when the drawing command is executed, the attribute data is read from the buffer and passed to the vertex shader for processing.
[0011] Compared with the prior art, the present invention has the following beneficial effects: In the present invention, by optimizing the vertex algorithm and adapting the vertex density, the display quality is guaranteed while reducing the resource occupation; the modern OpenGL rendering method is adopted, which significantly improves the display efficiency, improves the interaction efficiency, reduces the maintenance cost, and has high sustainability; the modern OpenGL has good code portability, and each platform only needs to maintain one set of devices; It uses modern OpenGL rendering, which greatly utilizes the hardware performance and improves the display speed compared with the existing GDI / GDI+ and QPainter. It is even compared with the known traditional OpenGL, which uses the immediate rendering mode and has a lower rendering efficiency; Automatically adjust sampling points according to the size and trajectory characteristics of the object to reduce resource usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0013] Figure 1 A schematic diagram of a method for drawing calculation transmission in the present invention; Figure 2 A schematic diagram of a method for creating a rendering in the present invention; Figure 3 It is a schematic diagram of the method for transmitting vertex data in the present invention. DETAILED DESCRIPTION
[0014] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0015] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0016] See also Figure 1-2 As shown, a laser processing display and control interface device, the specific operation method of the interface device is as follows: Step 1: Draw and add curves (points, straight lines, Bezier curves, rectangles, polygons, circles, ellipses, texts) or read external curve data and image files, and mark them as curve data and image data respectively: store the curve data and image data in memory; Draw and add curves: Switch the corresponding drawing type through the drawing navigation, and draw the corresponding curve with the mouse and keyboard. The keyboard is used to assist in inputting coordinates; straight lines and Bezier curves can be closed at the end; For a straight line, click the mouse to add a node, and right-click to pop up a window to insert the coordinates entered by the user; The display and control interface displays the lines connected by the added points in real time; The Bezier curve is a third-order Bezier curve. The starting point, end point and control point are determined by clicking and dragging the mouse. The display control interface displays the control auxiliary line in real time according to the mouse drag position.
[0017] Read external curve data and image files: switch to vector or bitmap through drawing navigation, pop up the file selector, support formats such as dxf, ai, plt, bmp, and parse the data after the user selects and write it into memory; Step 2: Calculate vertex data: Convert the curve data into corresponding vertex data according to the pen number and color, and create image texture; Convert to corresponding vertex data: Decompose the curve data into basic geometric types, such as point, line, arc, and Bezier. Match the sampling accuracy according to different basic geometric types and collect vertex data. For the convenience of observation, generate cross-line vertex data with the point coordinate as the center and a length of 2, attach the corresponding color RGB value, write it into the vertex array, and record the array length.
[0018] Processing sampling accuracy: Tune a set of arc lengths and acquisition errors as a reference for the arc type, and adjust the acquisition error value based on the current arc length and the reference arc length.
[0019] Corresponding color RGB value: External curve data is based on the pen number parameter of the external file. The default pen number for drawing and adding curves is 0. The display control interface can switch the pen number and preview the existing curves.
[0020] Create image texture: Create a texture through QOpenGLTexture() and pass the image data QImage in memory to the texture object.
[0021] Step 3: Transmit vertex data: calculate the space size and perform data transmission interaction; like Figure 3 As shown: First, calculate the size of the space, then use QOpenGLBuffer::create() to create VBO, QOpenGLVertexArrayObject::Binder() to create and bind VAO, QOpenGLBuffer::bind() to bind VBO, VBO opens up an area in the video memory to store various attributes of the vertex for use by the vertex shader, and finally QOpenGLBuffer::allocate() writes the vertex data in the memory to the opened area; Calculate the space size: Calculate the space size (VertexSpace) according to the vertex array length (ArrayLength) in the previous step "Calculate vertex data". The formula is VertexSpace=ArrayLength*SizeOfVertex, where SizeOfVertex represents the size of the space occupied by a single vertex. When there are too many objects or they are densely populated, VBO will allocate a large continuous storage space, which may cause allocation failure. To solve this problem, data splitting is used to split a large block of data into multiple small-capacity data to ensure that all vertex data is successfully written into VBO. VAO: Object used to record vertex attribute parsing results in OpenGL; Therefore, once the VAO is set up, you can call the rendering command directly by binding the VAO in the subsequent rendering loop without setting the vertex attribute parsing rules again; when rendering each frame, you only need to bind the VAO to access the buffer data; this greatly improves rendering efficiency and simplifies the code.
[0022] Data splitting: The current vertex data space size (VertexSpace) is compared with the preset split space size (DefineSpace). When the preset split space size is exceeded, VertexSpace / DefineSpace is used to round up the number of splits. Step 4: Create shaders: Generate source code for vertex shaders and fragment shaders using GLSL language, and create corresponding executable logic units in the GPU; Use QOpenGLShaderProgram() to create a shader program, and the addShaderFromSourceCode() function sets the source code of the vertex shader and fragment shader; GLSL: short custom programs written by developers; these programs are executed on the GPU (Graphic Processor Unit) of the graphics card, replacing part of the fixed rendering pipeline and making different levels in the rendering pipeline programmable; Step 5. Rendering preparation: pass the corresponding parameters to the shader before rendering, and pass the parsed VBO data to the vertex shader; setAttributeBuffer() reads vertex attribute data (such as position, color, texture coordinates, etc.) from the buffer VBO and binds it to the specified attribute of the shader program; In this way, when OpenGL executes a drawing command, it can read these attribute data from the buffer and pass it to the vertex shader for processing; Step 6, Rendering: Call the drawing instruction glDrawArrays() for rendering, use the modern OpenGL rendering method to execute the created vertex shader and fragment shader respectively, and output the rendering results to the window to display curves and pictures; QOpenGLVertexArrayObject::Binder() binds the VAO and then renders the vertex data through glDrawArrays(); Step 7. Observation: Call the setting command setUniformValue() to dynamically adjust to achieve selection observation, workspace observation, zoom in and out observation; Real-time selection and observation: You can select all current objects through the object list or mouse selection area, traverse the maximum and minimum XY coordinates of the selected state objects, calculate the minimum bounding box of the currently selected content, and then calculate the scaling ratio (minimum bounding box size / current display area size) and offset distance (minimum bounding box lower left corner XY coordinate - current lower left corner XY coordinate) that need to be set to display the minimum bounding box area; after setting it through setUniformValue(), update() refreshes the rendering.
[0023] Workspace observation: The workspace is the XY coordinates of the lower left corner and the XY area size, which are configurable. The workspace observation will be set by default every time the system is restarted. The display and control interface is equipped with a workspace observation button. No matter what state it is in, it will immediately switch to the workspace observation after pressing it. The zoom ratio (workspace size / current display area size) and offset distance (XY coordinates of the lower left corner of the workspace - current XY coordinates of the lower left corner) required to display the workspace area are calculated. After setting it through setUniformValue(), update() is used to refresh the rendering.
[0024] Zoom in and out: The display interface is equipped with zoom in and zoom out buttons. Use the buttons or the middle mouse button to adjust the current ratio (*0.8 or / 0.8). After setting it through setUniformValue(), update() refreshes the rendering. The above formulas are obtained by collecting a large amount of data and performing software simulation, and a formula close to the actual value is selected. The coefficients in the formula are set by technicians in this field according to actual conditions; When the present invention is used, it draws and adds curves or reads external curve data and picture files, and sets the curve data and picture data to be stored in the memory at the same time; draws and adds curves: switches the corresponding drawing type through the drawing navigation, and draws the corresponding curves with the mouse in combination with the keyboard, and the keyboard is used to assist in inputting coordinates; the straight line and the Bezier curve can be selected to be closed at the end; the straight line adds nodes by clicking the mouse, and the right mouse button pops up a window to insert the coordinates input by the user; the display control interface displays the line connected by the added points in real time; reads the external curve data and picture data; Calculate vertex data: convert curve data into corresponding vertex data according to pen number and color, create image texture, convert it into corresponding vertex data, set processing sampling accuracy and corresponding color RGB value, and create image texture; Transmit vertex data: calculate the space size and perform data transmission interaction; create shaders: use GLSL language to generate vertex shader and fragment shader source code, and create corresponding executable logic units in GPU; render preparation: pass corresponding parameters to shader before rendering, and pass parsed VBO data to vertex shader; Rendering: Call drawing instructions for rendering, use modern OpenGL rendering methods to execute the created vertex shader and fragment shader respectively, and output the rendering results to the window to display curves and pictures; Observation: Call setting instructions for dynamic adjustment, select observation, workspace observation, and zoom in and out observation.
[0025] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A laser processing display and control interface device, characterized in that: The specific interface device operation method is as follows: Step 1: Draw and add curves or read external curve data and image files, and set the curve data and image data to be stored in the memory at the same time; Draw and add curves: switch the corresponding drawing type through the drawing navigation, and draw the corresponding curve with the mouse and keyboard. The keyboard is used to assist in inputting coordinates. Straight lines and Bezier curves can be closed at the end. Straight lines can add nodes by clicking the mouse, and a window pops up with the right mouse button to insert the user-entered coordinates. The display control interface displays the line connected by the added points in real time. Read external curve data and image data. Step 2: Calculate vertex data: Convert the curve data to corresponding vertex data according to the pen number and color, create image texture, convert it to corresponding vertex data, set the processing sampling accuracy and corresponding color RGB value, and create image texture; Step 3: Transmit vertex data: calculate the space size and perform data transmission interaction; Step 4: Create shaders: Generate source code for vertex shaders and fragment shaders using GLSL language, and create corresponding executable logic units in the GPU; Step 5. Rendering preparation: pass the corresponding parameters to the shader before rendering, and pass the parsed VBO data to the vertex shader; Step 6, Rendering: Call drawing instructions for rendering, use modern OpenGL rendering methods to execute the created vertex shader and fragment shader respectively, and output the rendering results to the window to display curves and pictures; Step 7. Observation: Call the setting command for dynamic adjustment to perform selection observation, workspace observation, and zoom in and out observation.
2. A laser processing display and control interface device according to claim 1, characterized in that: Step 2: The process of calculating vertex data is as follows: Decompose the curve data into basic geometric types, match the sampling accuracy according to different basic geometric types, collect vertex data, generate cross-line vertex data with the point type as the center and a length of 2, attach the corresponding color RGB value, write it into the vertex array, and record the array length; tune a set of arc lengths and acquisition errors as a reference for the arc type, adjust the acquisition error value according to the current arc length and the reference arc length; external curve data is based on the pen number parameters of the external file, and the default pen number for drawing and adding curves is 0; the display control interface switches the pen number and previews the existing curves.
3. The laser processing display and control interface device according to claim 1, characterized in that: Step 3: The process of transmitting vertex data is as follows: Calculate the space size, create VBO and bind VAO. VBO opens an area in the video memory to store various attributes of the vertex, provide it to the vertex shader, and write the vertex data in the memory into the opened area; Calculate the space size VertexSpace based on the vertex array length ArrayLength in the vertex data calculated in the previous step. The formula is VertexSpace=ArrayLength*SizeOfVertex. SizeOfVertex indicates the size of the space occupied by a single vertex.
4. The laser processing display and control interface device according to claim 1, characterized in that: Step 4 The process of creating a shader is as follows: Create shader programs, set up the source code for vertex shaders and fragment shaders; GLSL is for developers to write short custom programs.
5. The laser processing display and control interface device according to claim 1, characterized in that: Step 5: Rendering preparation process is as follows: The vertex attribute data is read from the buffer VBO and bound to the specified attributes of the shader program; when the drawing command is executed, the attribute data is read from the buffer and passed to the vertex shader for processing.
Citation Information
Patent Citations
Three-dimensional digital earth construction method for avionics display and control
CN113593028A
Boot animation implementation method based on VBIOS rendering
CN115601476A
Controlling Rendering Operations by Shader Buffer Identification
US20200380757A1