WO2022247085A1 - Slice compression method based on marking of pixel coordinates of molding region - Google Patents

Slice compression method based on marking of pixel coordinates of molding region Download PDF

Info

Publication number
WO2022247085A1
WO2022247085A1 PCT/CN2021/121485 CN2021121485W WO2022247085A1 WO 2022247085 A1 WO2022247085 A1 WO 2022247085A1 CN 2021121485 W CN2021121485 W CN 2021121485W WO 2022247085 A1 WO2022247085 A1 WO 2022247085A1
Authority
WO
WIPO (PCT)
Prior art keywords
slice
model
pixels
file
compression method
Prior art date
Application number
PCT/CN2021/121485
Other languages
French (fr)
Chinese (zh)
Inventor
王宜怀
施连敏
陈琳
叶柯阳
何双辰
朱轩
Original Assignee
苏州大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州大学 filed Critical 苏州大学
Publication of WO2022247085A1 publication Critical patent/WO2022247085A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • G06F16/1794Details of file format conversion

Definitions

  • the invention relates to the technical field of intelligent rapid prototyping, in particular to a slice compression method based on pixel coordinate marking of a forming area.
  • the rapid prototyping technology based on light curing is to project ultraviolet light into the liquid photosensitive resin, so that the resin is continuously cured layer by layer.
  • Digital light processing (DLP) molding technology has problems such as limited molding size, high equipment price and lens distortion that restrict the development of this technology. Therefore, liquid crystal display (LCD) is used as an area selective light transmission device, which can be used to manufacture large and High precision parts.
  • LCD liquid crystal display
  • the difficult coordination between molding efficiency and molding quality is the main factor limiting the development of LCD molding technology, so it is necessary to find a reconciliation strategy for the two.
  • the slice data is stored in the bitmap file format, which takes up more storage space than the vector file storage format.
  • the molding is controlled offline, so the slices need to be processed before being transferred to the Raspberry In the Pi, 3D model slices often have thousands of layers, and the standard bitmap format is used to store the slice data up to dozens of GB, which not only requires a large storage space on the Raspberry Pi but also consumes transmission time.
  • the present invention provides a slice compression method based on the pixel coordinate marking of the forming area, including:
  • the parsing of the STL model includes: obtaining relevant parameters, including the vertex information of the triangular patch in the model, the maximum value and the minimum value of the boundary of the model;
  • a slice file set is obtained by OpenGL slicing, the slice file set is composed of a plurality of slice files, and each slice file is a multi-row array composed of black pixels and white pixels;
  • the boundary coordinates appear in pairs, and each row of pixels has several pairs of boundary coordinates.
  • the parsing of the STL model includes: obtaining relevant parameters, including vertex information of triangle patches in the model, maximum and minimum values of the boundary of the model.
  • the vertex information includes coordinates and normal vectors of three vertices of the triangle patch.
  • the binary format of the sliced file is stored in bytes, and the ASCII format is stored in plaintext lines.
  • the size of the STL model does not exceed the size of the molding table.
  • a window is first created before slicing, and zoomed according to the size of the LCD display screen;
  • the STL model is placed in the coordinate system, the observation point is adjusted to adjust the viewing angle, and the slice direction of the STL model is determined.
  • Adjust the distance between the near plane and the origin of observation along the Z axis to obtain the section of the 3D model obtain the section pixels, then write the section pixels into the slice file, and repeatedly move the near plane to obtain the slice set.
  • the advantage of the present invention is that: compared with the prior art, the memory occupied by the DPS slicing file obtained after slicing the hand-figure model of the present invention is very small, and the time spent on transferring the file is also very small. It can be seen that the slice compression method designed by the present invention has high practical value in actual work.
  • 3D model slice compression uses the characteristics of bitmaps to store the complete information expressed by slices in another file format, which requires this file format to occupy a smaller memory space.
  • the compressed file In order to ensure the integrity of part molding, the compressed file must be able to restore the original state of the bitmap after parsing, so a lossless compression method should be used. Therefore, the present invention combines the slicing characteristics of the three-dimensional model and the needs of the molding process, and designs a bitmap compression method with a very high compression rate suitable for the light-curing molding system.
  • the STL model slicing design of the present invention is based on an open source graphics library (Open Graphics Library, OpenGL), this framework contains a series of functions that can manipulate graphics and images, which is convenient for secondary development in 3D processing.
  • OpenGL Open Graphics Library
  • the development environment is Qt Creator 4.14.0.
  • Analyzing the STL model is mainly to obtain relevant parameters, mainly including the vertex information of the triangle patch in the model, the maximum and minimum values of the boundary of the model.
  • the vertex information includes the coordinates and normal vectors of the three vertices of the triangle patch.
  • the binary format of the STL file is stored in bytes, and the ASCII format is stored in plaintext by line.
  • the vertex information of the triangle patch is read and handed over to OpenGL for processing. The reading process is shown in Figure 1.
  • the size of the model cannot exceed the size of the forming table.
  • the STL file data After reading the STL file data, it is processed and displayed by OpenGL. Create a window before slicing. Because the actual size of the model may be different from what is displayed on the screen, it needs to be scaled according to the size of the LCD display.
  • adjust the viewing angle use the viewing angle to observe the model view to simulate the intersection of the model and the cross-section, and save the cross-section pixels. Then move the angle of view according to the slice thickness, and save the model slice pixels in this way.
  • the 3D model is placed in the coordinate system, and the observation point can be adjusted to adjust the viewing angle and determine which direction to slice from the 3D model.
  • the section of the 3D model can be obtained, and the section pixels can be obtained, and then the section pixels are written into the slice file, and the near plane is moved repeatedly to obtain the slice set.
  • the sliced pictures of the 3D model often only have black and white pixels.
  • UV ultraviolet light is used to cure the resin through the LCD, and the white pixel area is used to pass through the UV ultraviolet light, which is the molding area.
  • the black area cannot pass through UV ultraviolet light.
  • the slice file compression method is to convert the current slice file into a smaller storage form according to the characteristics of the slice file. It is more convenient to store slice pixels in BMP file format after using OpenGL slices, but the BMP file format takes up a lot of memory. If it is converted into a vector file format, the conversion and analysis calculations are complex and time-consuming. Taking the Newton reflective shell as an example, as shown in Figure 4, analyze the slice compression file format designed by the present invention.
  • BMP files are used for slice display, and only need three parts of the file format, namely BMP file header, bitmap information header and bitmap pixels.
  • the main information of the BMP file header includes a 2-byte bitmap file type flag, a 4-byte bitmap file size, a 4-byte reserved bit, and a 4-byte file header to bitmap pixel. Offset bits, 14 bytes in total.
  • the effective slice data used by the bitmap header includes 4-byte pixel width, 4-byte pixel height, and 2-byte pixel occupancy.
  • the bitmap pixel records the detailed information of the sliced pixels, each pixel occupies 4 bytes of storage, and there are only two forms: 000000ff and fffffffff.
  • the slice pixels are obtained, so the slice compression method is designed according to its characteristics.
  • the design requirements of the compressed file can be directly derived. Under the premise of reducing the storage space as much as possible, the information carried in the compressed file and the slice source file must be consistent.
  • the pixel data of the BMP slice file only contains two types of pixels, that is, black and white pixels. As shown in Figure 4, the forming area is white, and the non-forming area is black.
  • the pixels are usually densely distributed, that is, white pixels and black pixels are basically continuously distributed, and there are rarely a large number of isolated pixels.
  • the pixel data of the slice file is stored by row, and the data of a whole row of pixels is stored at a time, and then the data of the next row is stored.
  • the slice file compression format is designed. As shown in Figure 5, the pixel arrangement of the slice file, with the row as a basic observation unit, there are only “black and black”, “white and white”, “black and white” and “white and black” between adjacent pixels, and the "black and black” area indicates the non- Forming area, the "white and white” area indicates the forming area, “white and black” and “black and white” indicate the boundary area between the forming area and the non-forming area, this area can mark the range of the forming area, so only the boundary area needs to be saved to effectively obtain pixels The actual information of the distribution.
  • the slice file compression format is named DPS (Dynamic Print System), that is, dynamic molding system.
  • the process of DPS slice file compression method is as follows: First, the slice pixels are obtained through OpenGL slices, the slice row pixels are read, and whether there are white pixels in the row pixels, that is, the forming area, as shown in Figure 5. Coordinates (0,2) and (0,4 ). If there is a forming area, save the boundary coordinates of the area, the boundary coordinates appear in pairs, and there are several pairs of boundary coordinates in each row.
  • the slice compression method flow shown in Method 5-2 describes the implementation process of this method in detail.
  • the input data is a collection of slices, slice pixel width and pixel height.
  • the output data is a collection of DPS sliced compressed files.
  • the compression method of the present invention first traverses the slice file set Cn, and then traverses the pixels of each slice. When the row pixels are "white and black” and “black and white”, write the coordinates of the white pixels into the DPS file.
  • DPS slice file restoration is the opposite of compression.
  • a pair of white pixel coordinates are obtained, only the interval needs to be filled.
  • the exposure time of each slice is about tens of seconds, which is enough to parse and display the DPS slice file.
  • the first essence of the slice compression storage format is to save storage space, which is manifested in that the boundary coordinates occupy less bytes.
  • the resolution of the LCD display screen used in the present invention is 2560x1600. Coordinates occupy 4 bytes of storage space.
  • the slice compression storage format not only stores the boundary coordinates of the slice forming area, but also stores other related forming parameters.
  • the forming parameters change dynamically to match the dynamic forming design.
  • the DPS slice compression format is a custom file format, which cannot be directly recognized by the system, so it is necessary to restore and fill the slice.
  • Slice restore filling only needs to obtain a set of boundary coordinates each time, and fill the middle of the set of coordinates with white pixels.
  • the experimental hardware environment is Windows 10 operating system, and the memory is 64GB.
  • Two STL three-dimensional models were selected as examples to verify the DPS slice compression method of the present invention.
  • the experiments all used a uniform layer thickness of 0.05mm, and the layers of the two three-dimensional models were 715 and 4796 layers respectively.
  • the lion model uses BMP file format slices to occupy a total of 11171.9MB, binary file format slices occupy 349MB, ChiTu slice system slice files occupy 11.5MB, and the DPS slice file format designed by the present invention occupies 1.61MB.
  • the DPS slicing file obtained after slicing the hand-made model occupies the smallest memory, and the time spent on transferring the file is also the smallest. It can be seen that the slice compression method designed by the present invention has high practical value in actual work.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Control Of El Displays (AREA)

Abstract

A slice compression method based on the marking of pixel coordinates of a molding region. The method comprises: parsing a preset STL model, acquiring a model height, and performing slicing according to the STL model, wherein the process of parsing the STL model comprises: acquiring related parameters, including vertex information of triangular patches in the model, and the maximum value and the minimum value of the boundary of the model; obtaining a slice file set by means of OpenGL slices, wherein the slice file set is composed of a plurality of slice files, and each slice file is a multi-row array composed of black pixels and white pixels; traversing each row of pixels in each slice file, determining whether there is a white pixel, adjacent pixels of which comprise a black pixel, in in each row of pixels, and if so, saving coordinates of the white pixel to serve as boundary coordinates of a molding region; and writing the boundary coordinates into a compressed file, so as to obtain a slice compression file set. According to the method, a DPS slice file that is obtained after slicing occupies a small amount of memory space, and the amount of time that is consumed for transmitting the file is quite short.

Description

一种基于成型区域像素坐标标记的切片压缩方法A Slice Compression Method Based on Pixel Coordinate Marking of Shaped Area 技术领域technical field
本发明涉及智能快速成型技术领域,具体涉及一种基于成型区域像素坐标标记的切片压缩方法。The invention relates to the technical field of intelligent rapid prototyping, in particular to a slice compression method based on pixel coordinate marking of a forming area.
背景技术Background technique
基于光固化的快速成型技术是将紫外光投射到液态光敏树脂中,从而使树脂逐层连续固化。数字光处理(DLP)成型技术的成型尺寸有限、设备价格高和镜头畸变等问题制约该技术的发展,因此采用液晶显示屏(LCD)作为区域选择型透光设备,可用于制造尺寸较大且精度较高的零件。但成型效率与成型质量难以协调是限制LCD成型技术发展的主要因素,因此需要寻找二者的调和策略。The rapid prototyping technology based on light curing is to project ultraviolet light into the liquid photosensitive resin, so that the resin is continuously cured layer by layer. Digital light processing (DLP) molding technology has problems such as limited molding size, high equipment price and lens distortion that restrict the development of this technology. Therefore, liquid crystal display (LCD) is used as an area selective light transmission device, which can be used to manufacture large and High precision parts. However, the difficult coordination between molding efficiency and molding quality is the main factor limiting the development of LCD molding technology, so it is necessary to find a reconciliation strategy for the two.
三维模型预处理切片后切片数据采用位图文件格式存储,相比矢量文件存储格式要占用较多的存储空间。为了提高系统的稳定性,采用脱机控制成型,因此需要先处理切片后再传输到Raspberry Pi中,而三维模型切片往往达到数千层,采用标准的位图格式存储切片数据会高达几十GB,不仅需要Raspberry Pi有较大存储空间而且耗费传输时间。After the 3D model is preprocessed and sliced, the slice data is stored in the bitmap file format, which takes up more storage space than the vector file storage format. In order to improve the stability of the system, the molding is controlled offline, so the slices need to be processed before being transferred to the Raspberry In the Pi, 3D model slices often have thousands of layers, and the standard bitmap format is used to store the slice data up to dozens of GB, which not only requires a large storage space on the Raspberry Pi but also consumes transmission time.
技术解决方案technical solution
本发明的目的是通过以下技术方案实现的。The purpose of the present invention is achieved through the following technical solutions.
本发明提供了一种基于成型区域像素坐标标记的切片压缩方法,包括:The present invention provides a slice compression method based on the pixel coordinate marking of the forming area, including:
解析预设的STL模型,获取模型高度,根据所述STL模型进行切片;所述解析STL模型包括:获取相关参数,包括模型中三角面片的顶点信息、模型的边界最大值与最小值;Analyzing the preset STL model, obtaining the height of the model, and slicing according to the STL model; the parsing of the STL model includes: obtaining relevant parameters, including the vertex information of the triangular patch in the model, the maximum value and the minimum value of the boundary of the model;
通过OpenGL切片得到切片文件集合,所述切片文件集合由多个切片文件组成,每个切片文件为一个由黑色像素和白色像素组成的多行阵列;A slice file set is obtained by OpenGL slicing, the slice file set is composed of a plurality of slice files, and each slice file is a multi-row array composed of black pixels and white pixels;
遍历每个切片文件的每行像素,判断行像素是否存在相邻像素中包括黑色像素的白色像素,如果存在,则保存所述白色像素的坐标作为成型区域的边界坐标;Traversing each row of pixels of each slice file, judging whether there are white pixels including black pixels among adjacent pixels in the row of pixels, and if so, saving the coordinates of the white pixels as the boundary coordinates of the forming area;
将所述边界坐标写入压缩文件,得到切片压缩文件集合。Write the boundary coordinates into the compressed file to obtain a collection of sliced compressed files.
优选地,所述边界坐标是成对出现的,每行像素存在若干对边界坐标。Preferably, the boundary coordinates appear in pairs, and each row of pixels has several pairs of boundary coordinates.
优选地,所述解析STL模型包括:获取相关参数,包括模型中三角面片的顶点信息、模型的边界最大值与最小值。Preferably, the parsing of the STL model includes: obtaining relevant parameters, including vertex information of triangle patches in the model, maximum and minimum values of the boundary of the model.
优选地,所述顶点信息包括三角面片的三个顶点坐标和法向量。Preferably, the vertex information includes coordinates and normal vectors of three vertices of the triangle patch.
优选地,所述切片文件的二进制格式按字节存储,ASCII格式采用按行明文存储。Preferably, the binary format of the sliced file is stored in bytes, and the ASCII format is stored in plaintext lines.
优选地,所述STL模型的大小不超过成型台面的尺寸。Preferably, the size of the STL model does not exceed the size of the molding table.
优选地,进一步包括:Preferably, further comprising:
读取切片文件数据,经过OpenGL处理并显示。Read the sliced file data, process it with OpenGL and display it.
优选地,开始切片前首先创建窗口,根据LCD显示屏的尺寸进行缩放;Preferably, a window is first created before slicing, and zoomed according to the size of the LCD display screen;
读取模型后,调整视角,采用视角观测模型视图的方式模拟模型与横截面相交,并把截面像素保存下来;After reading the model, adjust the viewing angle, use the viewing angle to observe the model view to simulate the intersection of the model and the cross-section, and save the cross-section pixels;
按照切片厚度移动视角,如此循环保存得到模型切片像素。Move the angle of view according to the slice thickness, and save the model slice pixels in this way.
优选地,进一步包括:Preferably, further comprising:
将所述STL模型置于坐标系中,调整观测点以调整观察视角,确定所述STL模型的切片方向。The STL model is placed in the coordinate system, the observation point is adjusted to adjust the viewing angle, and the slice direction of the STL model is determined.
优选地,进一步包括:Preferably, further comprising:
将近平面沿着Z轴调整与观察原点的距离获取三维模型截面,获取截面像素,随后将截面像素写入切片文件中,重复移动近平面获取切片集合。Adjust the distance between the near plane and the origin of observation along the Z axis to obtain the section of the 3D model, obtain the section pixels, then write the section pixels into the slice file, and repeatedly move the near plane to obtain the slice set.
有益效果Beneficial effect
本发明的优点在于:相对于现有技术,本发明手办模型切片后得到的DPS切片文件所占用的内存很小,则该文件传输耗费的时间也很小。由此可以看出本发明设计的切片压缩方法在实际工作中具有较高的实用价值。The advantage of the present invention is that: compared with the prior art, the memory occupied by the DPS slicing file obtained after slicing the hand-figure model of the present invention is very small, and the time spent on transferring the file is also very small. It can be seen that the slice compression method designed by the present invention has high practical value in actual work.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:
附图1示出了本发明STL文件读取流程图。Accompanying drawing 1 has shown the flowchart of reading STL file of the present invention.
附图2示出了本发明三维模型透射示意图。Accompanying drawing 2 shows the transmission diagram of the three-dimensional model of the present invention.
附图3示出了本发明三维模型放置角度示意图。Accompanying drawing 3 shows the schematic diagram of placement angle of the three-dimensional model of the present invention.
附图4示出了本发明牛顿反光壳子模型及其切片示意图。Accompanying drawing 4 shows the sub-model of the Newtonian reflective shell of the present invention and a schematic diagram of slices thereof.
附图5示出了本发明切片文件像素排列示意图。Accompanying drawing 5 shows the schematic diagram of the pixel arrangement of the slice file according to the present invention.
本发明的实施方式Embodiments of the present invention
下面将参照附图更详细地描述本公开的示例性实施方式。虽然附图中显示了本公开的示例性实施方式,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
三维模型切片压缩总的来说是利用位图的特征,将切片所表达的完全信息以另一种文件格式存储,要求这种文件格式占用较小的内存空间。为了保证零件成型的完整性,压缩后的文件要能够确保解析后能恢复到位图的原始状态,因此应该采用无损压缩方式。因此本发明结合三维模型切片特征与成型工艺的需要,设计一种压缩率极高的适用于光固化成型系统的位图压缩方式。Generally speaking, 3D model slice compression uses the characteristics of bitmaps to store the complete information expressed by slices in another file format, which requires this file format to occupy a smaller memory space. In order to ensure the integrity of part molding, the compressed file must be able to restore the original state of the bitmap after parsing, so a lossless compression method should be used. Therefore, the present invention combines the slicing characteristics of the three-dimensional model and the needs of the molding process, and designs a bitmap compression method with a very high compression rate suitable for the light-curing molding system.
1 STL模型切片实现过程1 Implementation process of STL model slicing
本发明STL模型切片设计是基于开源图形库(Open Graphics Library,OpenGL),该框架包含了一系列可以操作图形、图像的函数,方便在三维处理方面的二次开发。开发环境是Qt Creator 4.14.0。The STL model slicing design of the present invention is based on an open source graphics library (Open Graphics Library, OpenGL), this framework contains a series of functions that can manipulate graphics and images, which is convenient for secondary development in 3D processing. The development environment is Qt Creator 4.14.0.
1.1 STL格式模型解析1.1 STL format model analysis
解析STL模型主要是获取相关参数,主要包括模型中三角面片的顶点信息、模型的边界最大值与最小值。其中顶点信息包括三角面片的三个顶点坐标和法向量。STL文件二进制格式按字节存储,ASCII格式采用按行明文存储,三角面片顶点信息读取后交给OpenGL处理。读取流程如图1所示。Analyzing the STL model is mainly to obtain relevant parameters, mainly including the vertex information of the triangle patch in the model, the maximum and minimum values of the boundary of the model. The vertex information includes the coordinates and normal vectors of the three vertices of the triangle patch. The binary format of the STL file is stored in bytes, and the ASCII format is stored in plaintext by line. The vertex information of the triangle patch is read and handed over to OpenGL for processing. The reading process is shown in Figure 1.
1.2 STL模型切片1.2 STL model slicing
执行模型切片首先要获取模型路径、成型台面的长和宽、切片图片像素宽和高、切片厚度等,需要注意的是模型的大小不能超过成型台面的尺寸。读取STL文件数据后,经过OpenGL处理并显示。开始切片前首先创建窗口,由于模型的实际尺寸与显示在屏幕上可能不同,因此需要根据LCD显示屏的尺寸进行缩放。读取模型后,调整视角,采用视角观测模型视图的方式模拟模型与横截面相交,并把截面像素保存下来。随后按照切片厚度移动视角,如此循环保存得到模型切片像素。如图2所示,将三维模型置于坐标系中,调整观测点可以调整观察视角,确定从三维模型哪个方向切片。将近平面沿着Z轴调整与观察原点的距离可以获取三维模型截面,可以获取截面像素,随后将截面像素写入切片文件中,重复移动近平面获取切片集合。To perform model slicing, you must first obtain the model path, the length and width of the forming table, the pixel width and height of the slice image, and the slice thickness. It should be noted that the size of the model cannot exceed the size of the forming table. After reading the STL file data, it is processed and displayed by OpenGL. Create a window before slicing. Because the actual size of the model may be different from what is displayed on the screen, it needs to be scaled according to the size of the LCD display. After reading the model, adjust the viewing angle, use the viewing angle to observe the model view to simulate the intersection of the model and the cross-section, and save the cross-section pixels. Then move the angle of view according to the slice thickness, and save the model slice pixels in this way. As shown in Figure 2, the 3D model is placed in the coordinate system, and the observation point can be adjusted to adjust the viewing angle and determine which direction to slice from the 3D model. By adjusting the distance between the near plane and the origin of observation along the Z axis, the section of the 3D model can be obtained, and the section pixels can be obtained, and then the section pixels are written into the slice file, and the near plane is moved repeatedly to obtain the slice set.
需要注意的一点是读取STL模型于成型台面的示意图,用户能够直观地观察到模型的摆放形态,可以调整模型在成型台面的位置,不同的摆放形态,能够直接影响到打印效果,如图所示3所示。切片自下而上,该模型的尖部与成型台面接触极小,难以粘接在成型台面上,因此需要更换合适的角度来切片。为了在脱膜过程中尽量使模型所受的脱膜力均匀,尽可能使模型的重心位于坐标轴原点处。如果模型所受到的脱膜力不均匀且成型面较小,就会导致脱膜失败。One point to be noted is that by reading the schematic diagram of the STL model on the forming table, the user can intuitively observe the placement of the model and adjust the position of the model on the forming table. Different placements can directly affect the printing effect, such as As shown in Figure 3. Slicing is from bottom to top, the tip of the model has very little contact with the molding table, and it is difficult to stick to the molding table, so it is necessary to change the appropriate angle to slice. In order to make the release force on the model as uniform as possible during the release process, the center of gravity of the model should be located at the origin of the coordinate axis as much as possible. If the release force on the model is uneven and the molding surface is small, it will lead to release failure.
2 切片压缩方法与参数标记2 Slice compression methods and parameter markers
在基于LCD光固化成型系统中,三维模型切片图片往往仅有黑白两种像素,根据成型原理可知,UV紫外光通过LCD来固化树脂,白色像素区域用于通过UV紫外光,即为成型区域,黑色区域则无法透过UV紫外光。In the LCD-based light-curing molding system, the sliced pictures of the 3D model often only have black and white pixels. According to the molding principle, UV ultraviolet light is used to cure the resin through the LCD, and the white pixel area is used to pass through the UV ultraviolet light, which is the molding area. The black area cannot pass through UV ultraviolet light.
2.1 基于成像区域坐标标记的切片压缩像素2.1 Slice Compression Pixels Based on Coordinate Marking of Imaging Area
切片文件压缩方法总的来说是根据切片文件的特征,将当前切片文件转换成一种较小的存储形式。使用OpenGL切片后获取切片像素,以BMP文件格式存储较为方便,但是BMP文件格式占用内存较大,如果转换成矢量文件格式,转换与解析计算复杂且耗时。以为牛顿反光壳子为例,如图4所示,分析本发明设计的切片压缩文件格式。Generally speaking, the slice file compression method is to convert the current slice file into a smaller storage form according to the characteristics of the slice file. It is more convenient to store slice pixels in BMP file format after using OpenGL slices, but the BMP file format takes up a lot of memory. If it is converted into a vector file format, the conversion and analysis calculations are complex and time-consuming. Taking the Newton reflective shell as an example, as shown in Figure 4, analyze the slice compression file format designed by the present invention.
1.BMP切片文件详情1. BMP slice file details
BMP文件用于切片显示,只需文件格式的三部分,即BMP文件头、位图信息头和位图像素。如表5-5所示,BMP文件头主要信息包含2字节的位图文件类型标志、4字节的位图文件大小、4字节的保留位和4字节的文件头到位图像素的偏移位,共14个字节。位图信息头使用的切片有效数据包括4字节像素宽、4字节的像素高和2字节的像素占位数等。位图像素记录了切片的像素的详情信息,每个像素占4字节存储,仅有000000ff与ffffffff两种形式。BMP files are used for slice display, and only need three parts of the file format, namely BMP file header, bitmap information header and bitmap pixels. As shown in Table 5-5, the main information of the BMP file header includes a 2-byte bitmap file type flag, a 4-byte bitmap file size, a 4-byte reserved bit, and a 4-byte file header to bitmap pixel. Offset bits, 14 bytes in total. The effective slice data used by the bitmap header includes 4-byte pixel width, 4-byte pixel height, and 2-byte pixel occupancy. The bitmap pixel records the detailed information of the sliced pixels, each pixel occupies 4 bytes of storage, and there are only two forms: 000000ff and ffffffff.
 
Figure dest_path_image002
Figure dest_path_image002
2.BMP切片文件特征2. Features of BMP slice files
将三维模型切片处理后,得到的是切片像素,因此针对其特点来设计切片压缩方法。抽取切片文件特点,就能够直接引出压缩文件的设计需求,在尽可能降低存储空间的前提下,设计的压缩文件与切片源文件携带信息必须保持一致。After slicing the 3D model, the slice pixels are obtained, so the slice compression method is designed according to its characteristics. By extracting the characteristics of the slice file, the design requirements of the compressed file can be directly derived. Under the premise of reducing the storage space as much as possible, the information carried in the compressed file and the slice source file must be consistent.
(1)BMP切片文件像素数据仅包含两种像素,即黑白两种像素,如图4所示,成型区域为白色,非成型区域为黑色。(1) The pixel data of the BMP slice file only contains two types of pixels, that is, black and white pixels. As shown in Figure 4, the forming area is white, and the non-forming area is black.
(2)由于在光固化成型系统中要求图像的分辨率较高,因此像素通常分布较为密集,即白色像素与黑色像素基本会连续分布,极少存在大量孤立像素的情况。(2) Due to the high resolution of the image required in the photo-curing molding system, the pixels are usually densely distributed, that is, white pixels and black pixels are basically continuously distributed, and there are rarely a large number of isolated pixels.
(3)切片文件中的像素数据完全由三维模型切片所得,既不会随意添加也不能任意损之。因此对切片文件压缩只能采用无损压缩模式。(3) The pixel data in the slicing file is completely obtained by slicing the 3D model, and it will neither be added nor damaged arbitrarily. Therefore, only lossless compression mode can be used for slice file compression.
(4)切片文件像素数据按行存储,每次存储像素一整行的数据,接着存储下一行的数据。(4) The pixel data of the slice file is stored by row, and the data of a whole row of pixels is stored at a time, and then the data of the next row is stored.
3.切片文件压缩3. Slice file compression
根据切片文件的特征,设计切片文件压缩格式。如图5所示切片文件像素排列状况,以行作为一个基本观察单位,相邻像素之间只有“黑黑”、“白白”、“黑白”和“白黑”,“黑黑”区域表示非成型区域,“白白”区域表示成型区域,“白黑”与“黑白”表示成型区域与非成型区域分界区域,该区域能够标记出成型区域范围,因此仅需要保存分界区域就可以有效地获取像素分布的实际信息。该切片文件压缩格式命名为DPS(Dynamic Print System),即动态成型系统。According to the characteristics of the slice file, the slice file compression format is designed. As shown in Figure 5, the pixel arrangement of the slice file, with the row as a basic observation unit, there are only "black and black", "white and white", "black and white" and "white and black" between adjacent pixels, and the "black and black" area indicates the non- Forming area, the "white and white" area indicates the forming area, "white and black" and "black and white" indicate the boundary area between the forming area and the non-forming area, this area can mark the range of the forming area, so only the boundary area needs to be saved to effectively obtain pixels The actual information of the distribution. The slice file compression format is named DPS (Dynamic Print System), that is, dynamic molding system.
DPS切片文件压缩方法流程如下:首先通过OpenGL切片得到切片像素,读取切片行像素,判断该行像素是否存在白色像素,即成型区域,如图5中坐标(0,2)与(0,4)。如果存在成型区域,则保存该区域边界坐标,边界坐标是成对出现,每行存在若干对边界坐标。如方法5-2所示切片压缩方法流程,详细描述了该方法实现过程。输入数据为切片集合、切片像素宽和像素高。输出数据为DPS切片压缩文件集合。本发明的压缩方法首先对切片文件集合Cn进行遍历,接着对每一张切片的像素进行遍历,当行像素“白黑”与“黑白”时,写入该白色像素坐标到DPS文件中即可。The process of DPS slice file compression method is as follows: First, the slice pixels are obtained through OpenGL slices, the slice row pixels are read, and whether there are white pixels in the row pixels, that is, the forming area, as shown in Figure 5. Coordinates (0,2) and (0,4 ). If there is a forming area, save the boundary coordinates of the area, the boundary coordinates appear in pairs, and there are several pairs of boundary coordinates in each row. The slice compression method flow shown in Method 5-2 describes the implementation process of this method in detail. The input data is a collection of slices, slice pixel width and pixel height. The output data is a collection of DPS sliced compressed files. The compression method of the present invention first traverses the slice file set Cn, and then traverses the pixels of each slice. When the row pixels are "white and black" and "black and white", write the coordinates of the white pixels into the DPS file.
Figure dest_path_image004
Figure dest_path_image004
DPS切片文件还原与压缩相反,当获取到一对白素像素坐标时,仅需要对该区间进行填充即可。虽然填充过程有些耗时,但每层切片曝光时间约为数十秒,足够对DPS切片文件进行解析并显示。DPS slice file restoration is the opposite of compression. When a pair of white pixel coordinates are obtained, only the interval needs to be filled. Although the filling process is time-consuming, the exposure time of each slice is about tens of seconds, which is enough to parse and display the DPS slice file.
2.2 切片压缩存储格式2.2 Slice compression storage format
切片压缩存储格式的第一要义就是节省存储空间,表现在边界坐标占用较少字节,本发明采用LCD显示屏的分辨率为2560x1600,为了平衡坐标占用存储空间大小与读存速度,采用每个坐标占用4字节存储空间。The first essence of the slice compression storage format is to save storage space, which is manifested in that the boundary coordinates occupy less bytes. The resolution of the LCD display screen used in the present invention is 2560x1600. Coordinates occupy 4 bytes of storage space.
Figure dest_path_image006
Figure dest_path_image006
如表5-6所示切片压缩存储格式,不仅存储切片成型区域边界坐标,而且存储其他相关的成型参数,成型参数动态变化来匹配动态成型设计。As shown in Table 5-6, the slice compression storage format not only stores the boundary coordinates of the slice forming area, but also stores other related forming parameters. The forming parameters change dynamically to match the dynamic forming design.
DPS切片压缩格式为自定义文件格式,系统不能直接识别,因此就要对切片还原填充。切片还原填充只需要每次获取一组边界坐标,将该组坐标中间填充白色像素即可。The DPS slice compression format is a custom file format, which cannot be directly recognized by the system, so it is necessary to restore and fill the slice. Slice restore filling only needs to obtain a set of boundary coordinates each time, and fill the middle of the set of coordinates with white pixels.
2.3 压缩效果分析2.3 Compression effect analysis
对比几种常用的切片文件格式,包括BMP文件、二值化文件、DPS文件和压缩效果较好的ChiTu切片系统。实验硬件环境为Windows 10操作系统,内存为64GB。选择两个STL三维模型为例验证本发明DPS切片压缩方法,实验均采用统一使用层厚0.05mm,该两个三维模型层数分别为715层和4796层。Compare several commonly used slicing file formats, including BMP files, binary files, DPS files, and the ChiTu slicing system with better compression effects. The experimental hardware environment is Windows 10 operating system, and the memory is 64GB. Two STL three-dimensional models were selected as examples to verify the DPS slice compression method of the present invention. The experiments all used a uniform layer thickness of 0.05mm, and the layers of the two three-dimensional models were 715 and 4796 layers respectively.
Figure dest_path_image008
Figure dest_path_image008
如表5-7所示,狮子模型采用BMP文件格式切片共占用11171.9MB、二值化文件格式切片占用349MB、ChiTu切片系统切片文件占用11.5MB,本发明设计的DPS切片文件格式占用1.61MB。同样手办模型切片后得到的DPS切片文件所占用的内存也最小,则该文件传输耗费的时间也最小。由此可以看出本发明设计的切片压缩方法在实际工作中具有较高的实用价值。As shown in Table 5-7, the lion model uses BMP file format slices to occupy a total of 11171.9MB, binary file format slices occupy 349MB, ChiTu slice system slice files occupy 11.5MB, and the DPS slice file format designed by the present invention occupies 1.61MB. Similarly, the DPS slicing file obtained after slicing the hand-made model occupies the smallest memory, and the time spent on transferring the file is also the smallest. It can be seen that the slice compression method designed by the present invention has high practical value in actual work.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (9)

  1. 一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,包括:A slice compression method based on pixel coordinate marking of a molding area, characterized in that it comprises:
    解析预设的STL模型,获取模型高度,根据所述STL模型进行切片;所述解析STL模型包括:获取相关参数,包括模型中三角面片的顶点信息、模型的边界最大值与最小值;Analyzing the preset STL model, obtaining the height of the model, and slicing according to the STL model; the parsing of the STL model includes: obtaining relevant parameters, including the vertex information of the triangular patch in the model, the maximum value and the minimum value of the boundary of the model;
    通过OpenGL切片得到切片文件集合,所述切片文件集合由多个切片文件组成,每个切片文件为一个由黑色像素和白色像素组成的多行阵列;A slice file set is obtained by OpenGL slicing, the slice file set is composed of a plurality of slice files, and each slice file is a multi-row array composed of black pixels and white pixels;
    遍历每个切片文件的每行像素,判断行像素是否存在相邻像素中包括黑色像素的白色像素,如果存在,则保存所述白色像素的坐标作为成型区域的边界坐标;Traversing each row of pixels of each slice file, judging whether there are white pixels including black pixels among adjacent pixels in the row of pixels, and if so, saving the coordinates of the white pixels as the boundary coordinates of the forming area;
    将所述边界坐标写入压缩文件,得到切片压缩文件集合。Write the boundary coordinates into the compressed file to obtain a collection of sliced compressed files.
  2. 根据权利要求1所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,A kind of slice compression method based on the pixel coordinate mark of forming area according to claim 1, it is characterized in that,
    所述边界坐标是成对出现的,每行像素存在若干对边界坐标。The boundary coordinates appear in pairs, and there are several pairs of boundary coordinates in each row of pixels.
  3. 根据权利要求1所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,A kind of slice compression method based on the pixel coordinate mark of forming area according to claim 1, it is characterized in that,
    所述顶点信息包括三角面片的三个顶点坐标和法向量。The vertex information includes the coordinates and normal vectors of the three vertices of the triangle patch.
  4. 根据权利要求1所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,A kind of slice compression method based on the pixel coordinate mark of forming area according to claim 1, it is characterized in that,
    所述切片文件的二进制格式按字节存储,ASCII格式采用按行明文存储。The binary format of the slice file is stored by byte, and the ASCII format is stored by line in plaintext.
  5. 根据权利要求1所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,A kind of slice compression method based on the pixel coordinate mark of forming area according to claim 1, it is characterized in that,
    所述STL模型的大小不超过成型台面的尺寸。The size of the STL model does not exceed the size of the molding table.
  6. 根据权利要求1所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,进一步包括:A kind of slice compression method based on the pixel coordinate mark of forming area according to claim 1, it is characterized in that, further comprises:
    读取切片文件数据,经过OpenGL处理并显示。Read the sliced file data, process it with OpenGL and display it.
  7. 根据权利要求6所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,A kind of slice compression method based on the pixel coordinate mark of forming area according to claim 6, it is characterized in that,
    开始切片前首先创建窗口,根据LCD显示屏的尺寸进行缩放;Create a window first before starting to slice, and scale it according to the size of the LCD display;
    读取模型后,调整视角,采用视角观测模型视图的方式模拟模型与横截面相交,并把截面像素保存下来;After reading the model, adjust the viewing angle, use the viewing angle to observe the model view to simulate the intersection of the model and the cross-section, and save the cross-section pixels;
    按照切片厚度移动视角,如此循环保存得到模型切片像素。Move the viewing angle according to the slice thickness, and save the model slice pixels in this way.
  8. 根据权利要求7所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,进一步包括:A kind of slice compression method based on the pixel coordinate mark of forming area according to claim 7, it is characterized in that, further comprises:
    将所述STL模型置于坐标系中,调整观测点以调整观察视角,确定所述STL模型的切片方向。The STL model is placed in the coordinate system, the observation point is adjusted to adjust the viewing angle, and the slice direction of the STL model is determined.
  9. 根据权利要求8所述的一种基于成型区域像素坐标标记的切片压缩方法,其特征在于,进一步包括:A method for compressing slices based on pixel coordinate marking of a molding area according to claim 8, further comprising:
    将近平面沿着Z轴调整与观察原点的距离获取三维模型截面,获取截面像素,随后将截面像素写入切片文件中,重复移动近平面获取切片集合。Adjust the distance between the near plane and the origin of observation along the Z axis to obtain the section of the 3D model, obtain the section pixels, then write the section pixels into the slice file, and repeatedly move the near plane to obtain the slice set.
PCT/CN2021/121485 2021-05-28 2021-09-28 Slice compression method based on marking of pixel coordinates of molding region WO2022247085A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110590031.7 2021-05-28
CN202110590031.7A CN113204527A (en) 2021-05-28 2021-05-28 Slice compression method based on forming area pixel coordinate mark

Publications (1)

Publication Number Publication Date
WO2022247085A1 true WO2022247085A1 (en) 2022-12-01

Family

ID=77023457

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/121485 WO2022247085A1 (en) 2021-05-28 2021-09-28 Slice compression method based on marking of pixel coordinates of molding region

Country Status (2)

Country Link
CN (1) CN113204527A (en)
WO (1) WO2022247085A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204527A (en) * 2021-05-28 2021-08-03 苏州大学 Slice compression method based on forming area pixel coordinate mark

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718214A (en) * 2015-10-21 2016-06-29 深圳芯启航科技有限公司 Access method and device for fingerprint mask image
CN105992010A (en) * 2015-02-13 2016-10-05 北京中星微电子有限公司 Binary foreground compression coding method
CN111319264A (en) * 2018-12-17 2020-06-23 苏州苏大维格科技集团股份有限公司 Data processing method applied to 3D printing equipment and 3D printing equipment
WO2020211021A1 (en) * 2019-04-17 2020-10-22 京东方科技集团股份有限公司 Image processing method and device, data transmission method and device, and storage medium
CN113204527A (en) * 2021-05-28 2021-08-03 苏州大学 Slice compression method based on forming area pixel coordinate mark

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105992010A (en) * 2015-02-13 2016-10-05 北京中星微电子有限公司 Binary foreground compression coding method
CN105718214A (en) * 2015-10-21 2016-06-29 深圳芯启航科技有限公司 Access method and device for fingerprint mask image
CN111319264A (en) * 2018-12-17 2020-06-23 苏州苏大维格科技集团股份有限公司 Data processing method applied to 3D printing equipment and 3D printing equipment
WO2020211021A1 (en) * 2019-04-17 2020-10-22 京东方科技集团股份有限公司 Image processing method and device, data transmission method and device, and storage medium
CN113204527A (en) * 2021-05-28 2021-08-03 苏州大学 Slice compression method based on forming area pixel coordinate mark

Also Published As

Publication number Publication date
CN113204527A (en) 2021-08-03

Similar Documents

Publication Publication Date Title
TWI451358B (en) Banana codec
TWI330782B (en) Subdividing geometry images in graphics hardware
TWI314004B (en) Color gamut mapping
WO2020098721A1 (en) Image presentation method and apparatus for virtual reality device, device and computer storage medium
CN107330964B (en) Display method and system of complex three-dimensional object
CN111192552B (en) Multi-channel LED spherical screen geometric correction method
CN106815807A (en) A kind of unmanned plane image Fast Mosaic method based on GPU CPU collaborations
WO2021169396A1 (en) Media content placement method and related device
WO2022247085A1 (en) Slice compression method based on marking of pixel coordinates of molding region
CN101155248A (en) Image processing apparatus, image processing method, and computer product
CN103413339B (en) 1000000000 pixel high dynamic range images are rebuild and the method for display
AU2018233015B2 (en) System and method for image processing
CN111696185A (en) Method and device for generating dynamic expression image sequence by using static face image
US20190371047A1 (en) Method for Generating Three-Dimensional Model, and Terminal Device
US8139893B2 (en) Online image processing systems and methods utilizing image processing parameters
CN111654621A (en) Dual-focus camera continuous digital zooming method based on convolutional neural network model
CN101729739A (en) Method for rectifying deviation of image
WO2009076876A1 (en) Cartoon image generation, implantation method and system
WO2022247086A1 (en) Three-dimensional model self-adaptive slicing method based on pixel curvature
WO2023280266A1 (en) Fisheye image compression method, fisheye video stream compression method and panoramic video generation method
JP2005203865A (en) Image processing system
TW200830264A (en) A motion image data sequence, a method for generating the sequence, and a display apparatus using the sequence
US20140354627A1 (en) Rendering a 3d shape
CN117078803B (en) SVG-based primary graph quick drawing method
Geng et al. Application Processing of Film Industrial Grade Color Grading Simulation Style Based on LUT Color Matching Algorithm

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21942650

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21942650

Country of ref document: EP

Kind code of ref document: A1