CN113204527A - Slice compression method based on forming area pixel coordinate mark - Google Patents
Slice compression method based on forming area pixel coordinate mark Download PDFInfo
- Publication number
- CN113204527A CN113204527A CN202110590031.7A CN202110590031A CN113204527A CN 113204527 A CN113204527 A CN 113204527A CN 202110590031 A CN202110590031 A CN 202110590031A CN 113204527 A CN113204527 A CN 113204527A
- Authority
- CN
- China
- Prior art keywords
- slice
- pixels
- file
- model
- pixel coordinate
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/178—Techniques for file synchronisation in file systems
- G06F16/1794—Details of file format conversion
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 a forming area pixel coordinate mark comprises the following steps: firstly, obtaining a slice file set through an OpenGL slice, 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 of each slice file, judging whether the row of pixels have white pixels of which adjacent pixels comprise black pixels, and if so, saving the coordinates of the white pixels as the boundary coordinates of a molding area; and writing the boundary coordinates into a compressed file to obtain a slice compressed file set. The DPS slice file obtained after slicing by the method occupies a small memory, and the time consumed by file transmission is small.
Description
Technical Field
The invention relates to the technical field of intelligent rapid molding, in particular to a slice compression method based on a molding area pixel coordinate mark.
Background
A rapid prototyping technology based on photocuring projects ultraviolet light into a liquid photosensitive resin, thereby continuously curing the resin layer by layer. The problems of limited molding size, high equipment price, lens distortion and the like of a Digital Light Processing (DLP) molding technology restrict the development of the technology, so that a Liquid Crystal Display (LCD) is adopted as an area selection type light transmission equipment, and the DLP molding technology can be used for manufacturing parts with larger size and higher precision. However, the difficulty in coordinating the molding efficiency and the molding quality is a major factor limiting the development of LCD molding technology, and therefore, a blending strategy for the two is needed to be found.
After the three-dimensional model is preprocessed and sliced, the sliced data are stored in a bitmap file format, and the storage space is more occupied compared with a vector file storage format. In order to improve the stability of the system, offline control molding is adopted, so that the slices need to be processed and then transmitted to the Raspberry Pi, the slices of the three-dimensional model often reach thousands of layers, the data of the slices stored in a standard bitmap format can reach dozens of GB, and the Raspberry Pi is required to have a large storage space and consume transmission time.
Disclosure of Invention
The purpose of the invention is realized by the following technical scheme.
The invention provides a slice compression method based on a forming area pixel coordinate mark, which comprises the following steps:
firstly, obtaining a slice file set through an OpenGL slice, 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 of each slice file, judging whether the row of pixels have white pixels of which adjacent pixels comprise black pixels, and if so, saving the coordinates of the white pixels as the boundary coordinates of a molding area;
and writing the boundary coordinates into a compressed file to obtain a slice compressed file set.
Preferably, the boundary coordinates are present in pairs, there being several pairs of boundary coordinates per row of pixels.
Preferably, the parsing STL model comprises: and acquiring related parameters including vertex information of a triangular patch in the model and the maximum value and the minimum value of the boundary of the model.
Preferably, the vertex information includes three vertex coordinates and a normal vector of a triangular patch.
Preferably, the binary format of the sliced file is stored in bytes, and the ASCII format is stored in plain text in lines.
Preferably, the size of the STL mold does not exceed the size of the molding table.
Preferably, further comprising:
and reading the slice file data, and processing and displaying the slice file data through OpenGL.
Preferably, a window is first created before slicing is started, and scaling is performed according to the size of an LCD display screen;
after the model is read, adjusting the view angle, simulating the intersection of the model and the cross section in a mode of observing the model view by the view angle, and storing the pixels of the cross section;
and moving the visual angle according to the slice thickness, and circularly storing in such a way to obtain the model slice pixels.
Preferably, further comprising:
and placing the STL model in a coordinate system, adjusting the observation point to adjust the observation visual angle, and determining the slice direction of the STL model.
Preferably, further comprising:
and adjusting the distance between the near plane and the observation origin along the Z axis to obtain a three-dimensional model section, obtaining section pixels, then writing the section pixels into a slice file, and repeatedly moving the near plane to obtain a slice set.
The invention has the advantages that: compared with the prior art, the DPS slice file obtained after model slicing is handled by the method has small occupied memory, and the time consumed by file transmission is also small. Therefore, the slice compression method designed by the invention has higher practical value in practical work.
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 embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flow chart of STL file reading in accordance with the present invention.
FIG. 2 is a schematic diagram of a three-dimensional model transmission according to the present invention.
FIG. 3 is a schematic view of the placement angle of the three-dimensional model according to the present invention.
FIG. 4 is a diagram of a Newton's reflector model and its slice.
FIG. 5 is a schematic diagram of a pixel arrangement of a slice file according to the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While 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 to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The three-dimensional model slice compression generally utilizes the characteristics of bitmaps to store complete information expressed by slices in another file format, and the file format is required to occupy smaller memory space. In order to ensure the integrity of the part molding, the compressed file can be restored to the original state of the bitmap after being analyzed, and therefore a lossless compression mode should be adopted. Therefore, the invention designs a bitmap compression mode which has extremely high compression rate and is suitable for a photocuring molding system by combining the slicing characteristics of the three-dimensional model and the requirements of a molding process.
1STL model slicing implementation Process
The STL model slice design is based on an Open Graphics Library (OpenGL), and the framework comprises a series of functions capable of operating Graphics and images, so that secondary development in the aspect of three-dimensional processing is facilitated. The development environment is Qt Creator 4.14.0.
1.1 STL Format model parsing
The STL model is analyzed to mainly obtain related parameters, which mainly comprise vertex information of a triangular patch in the model, and the maximum value and the minimum value of the boundary of the model. Wherein the vertex information includes three vertex coordinates and normal vectors of the triangular patch. The STL file is stored according to bytes in a binary format, the ASCII file is stored according to lines in plain text, and the vertex information of the triangular patch is read and then is processed by OpenGL. The read flow is shown in fig. 1.
1.2 STL model section
Performing model slicing first acquires the model path, the length and width of the molding mesa, the slice picture pixel width and height, the slice thickness, etc., noting that the size of the model cannot exceed the size of the molding mesa. And after reading the STL file data, processing and displaying through OpenGL. The window is created first before the slicing starts and needs to be scaled according to the size of the LCD screen, since the actual size of the model may differ from that displayed on the screen. After the model is read, the visual angle is adjusted, the intersection of the model and the cross section is simulated by adopting a mode of observing the model view by the visual angle, and the pixels of the cross section are stored. And then moving the view angle according to the slice thickness, and circularly storing to obtain the model slice pixel. As shown in fig. 2, the three-dimensional model is placed in a coordinate system, and adjusting the observation point can adjust the observation angle to determine which direction to slice from the three-dimensional model. Adjusting the distance between the near plane and the observation origin along the Z axis can acquire a three-dimensional model section, can acquire section pixels, then writes the section pixels into a slice file, and repeatedly moves the near plane to acquire a slice set.
It should be noted that reading the schematic diagram of the STL model on the molding table allows the user to visually observe the model placement, adjust the position of the model on the molding table, and directly influence the printing effect due to different placement, as shown in fig. 3. The tip of the model is extremely small in contact with the molding table top from bottom to top, and is difficult to adhere to the molding table top, so that the model needs to be cut at a proper angle. In order to make the demoulding force borne by the model as uniform as possible in the demoulding process, the gravity center of the model is positioned at the origin of the coordinate axis as much as possible. If the mold is subjected to uneven release force and the molding surface is small, release failure may result.
2 slice compression method and parameter labeling
In a light curing molding system based on an LCD (liquid crystal display), a three-dimensional model slice picture usually has only black and white pixels, and according to a molding principle, UV ultraviolet light is used for curing resin through the LCD, a white pixel area is used for passing the UV ultraviolet light, namely, a molding area, and a black area cannot pass the UV ultraviolet light.
2.1 slice compression pixels based on imaging region coordinate markers
The method of compressing a slice file is generally to convert the current slice file into a smaller storage form according to the characteristics of the slice file. Slice pixels are obtained after OpenGL slices are used, storage in a BMP file format is convenient, the BMP file format occupies a large memory, and if the BMP file format is converted into a vector file format, conversion and analysis are complex and time-consuming. Taking a newton's reflective shell as an example, as shown in fig. 4, the format of the slice compression file designed by the present invention was analyzed.
BMP section File details
The BMP file is used for slice display, and only three parts of the file format are needed, namely a BMP file header, a bitmap information header and bitmap pixels. As shown in tables 5-5, the BMP file header main information includes a bitmap file type flag of 2 bytes, a bitmap file size of 4 bytes, a reserved bit of 4 bytes, and an offset bit of a file header of 4 bytes to bitmap pixels, which are 14 bytes in total. The slice effective data used by the bitmap information header includes a 4-byte pixel width, a 4-byte pixel height, a 2-byte pixel bit count, and the like. The bit image pixels record the detail information of the pixels of the slice, each pixel takes 4 bytes to store, and only has two forms of 000000ff and ffffff.
TABLE 5-5 storage Format for slice BMP files
BMP slice File features
After the three-dimensional model is sliced, slice pixels are obtained, and therefore a slice compression method is designed according to the characteristics of the slice pixels. By extracting the characteristics of the slice files, the design requirements of the compressed files can be directly led out, and the designed compressed files and the slice source files must keep consistent with each other in information carrying under the premise of reducing the storage space as much as possible.
(1) The BMP slice file pixel data only includes two kinds of pixels, i.e., black and white pixels, as shown in fig. 4, the molding area is white, and the non-molding area is black.
(2) Because of the high resolution required for the image in the light-curing molding system, the pixels are generally distributed densely, i.e., the white pixels and the black pixels are distributed substantially continuously, and there are rarely a large number of isolated pixels.
(3) The pixel data in the slice file is completely obtained by slicing the three-dimensional model, and cannot be added or damaged randomly. Therefore, only lossless compression mode can be used for slice file compression.
(4) The tile file pixel data is stored in rows, with data for an entire row of pixels being stored at a time, followed by the next row.
3. Slice file compression
And designing a slice file compression format according to the characteristics of the slice file. As shown in fig. 5, in the pixel arrangement of the slide document, with a line as a basic observation unit, only "black" and "white" regions, which represent non-molding regions, and "white" and "black" regions, which represent molding regions, are present between adjacent pixels, and "black" regions, which represent molding regions and non-molding regions, are present between adjacent pixels. The compressed format of the slice file is designated as DPS (dynamic Print System), i.e., dynamic modeling system.
The DPS slice file compression method has the following flows: firstly, obtaining slice pixels through an OpenGL slice, reading slice line pixels, and judgingWhether there are white pixels, i.e., molding regions, for the row of pixels, as shown by coordinates (0,2) and (0,4) in fig. 5. If the forming area exists, the boundary coordinates of the area are saved, the boundary coordinates appear in pairs, and a plurality of pairs of boundary coordinates exist in each row. The flow of the slice compression method shown in the method 5-2 describes the implementation process of the method in detail. The input data is a slice set, slice pixel width and pixel height. The output data is a set of DPS slice compressed files. The compression method of the invention firstly sets the slice files CnAnd traversing, namely traversing the pixels of each slice, and writing the white pixel coordinates into the DPS file when the line pixels are white and black and white.
DPS slice file reduction is opposite to compression, and when a pair of white pixel coordinates is acquired, only the interval needs to be filled. Although the padding process is somewhat time consuming, the exposure time for each slice is on the order of tens of seconds, which is sufficient to parse and display the DPS slice file.
2.2 slice compressed storage Format
The first important meaning of the slice compression storage format is that the storage space is saved, which means that the boundary coordinates occupy less bytes, the resolution of the LCD display screen adopted by the invention is 2560x1600, and in order to balance the size of the storage space occupied by the coordinates and the reading and storing speed, each coordinate occupies 4 bytes of storage space.
Tables 5-6 slice compression storage Format (Unit: bit)
The slice compression storage format shown in tables 5-6 stores not only the slice molding region boundary coordinates, but also other relevant molding parameters that are dynamically changed to match the dynamic molding design.
The DPS slice compression format is a custom file format which cannot be directly identified by the system, so that the slice needs to be restored and filled. The slice reduction filling only needs to acquire a group of boundary coordinates each time, and fill white pixels in the middle of the group of coordinates.
2.3 compression Effect analysis
Compared with several common slicing file formats, the method comprises the steps of BMP files, binarization files, DPS files and a ChiTu slicing system with a better compression effect. The experimental hardware environment is a Windows 10 operating system, and the memory is 64 GB. Two STL three-dimensional models are selected as an example to verify that the DPS slice compression method adopts the uniform using layer thickness of 0.05mm in experiments, and the number of the two three-dimensional models is 715 layers and 4796 layers respectively.
Table 5-7 slice file size comparison
As shown in tables 5-7, the lion model adopts a BMP file format slice to occupy 11171.9MB, a binarization file format slice to occupy 349MB, a ChiTu slice system slice file to occupy 11.5MB, and the DPS slice file format designed by the invention occupies 1.61 MB. Similarly, the memory occupied by the DPS slice file obtained after model slicing is handled is also minimum, and the time consumed by the file transmission is also minimum. Therefore, the slice compression method designed by the invention has higher practical value in practical work.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (10)
1. A slice compression method based on a forming area pixel coordinate mark is characterized by comprising the following steps:
firstly, obtaining a slice file set through an OpenGL slice, 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 of each slice file, judging whether the row of pixels have white pixels of which adjacent pixels comprise black pixels, and if so, saving the coordinates of the white pixels as the boundary coordinates of a molding area;
and writing the boundary coordinates into a compressed file to obtain a slice compressed file set.
2. The slice compression method based on the shaped region pixel coordinate mark according to claim 1,
the boundary coordinates occur in pairs, with pairs of boundary coordinates present for each row of pixels.
3. The slice compression method based on the shaped region pixel coordinate mark according to claim 1,
the parsing STL model includes: and acquiring related parameters including vertex information of a triangular patch in the model and the maximum value and the minimum value of the boundary of the model.
4. The slice compression method based on the shaped region pixel coordinate mark according to claim 3,
the vertex information includes three vertex coordinates and normal vectors of the triangular patch.
5. The slice compression method based on the shaped region pixel coordinate mark according to claim 1,
the binary format of the sliced file is stored according to bytes, and the ASCII format adopts plain text storage according to lines.
6. The slice compression method based on the shaped region pixel coordinate mark according to claim 1,
the size of the STL model does not exceed the size of the molding table.
7. The method for compressing the slice based on the pixel coordinate marks of the molding area according to claim 1, further comprising:
and reading the slice file data, and processing and displaying the slice file data through OpenGL.
8. The method of claim 7, wherein the slice is compressed based on the pixel coordinate mark of the molding area,
before slicing is started, a window is firstly created, and scaling is carried out according to the size of an LCD display screen;
after the model is read, adjusting the view angle, simulating the intersection of the model and the cross section in a mode of observing the model view by the view angle, and storing the pixels of the cross section;
and moving the visual angle according to the slice thickness, and circularly storing in such a way to obtain the model slice pixels.
9. The method of claim 8, further comprising:
and placing the STL model in a coordinate system, adjusting the observation point to adjust the observation visual angle, and determining the slice direction of the STL model.
10. The method of claim 9, further comprising:
and adjusting the distance between the near plane and the observation origin along the Z axis to obtain a three-dimensional model section, obtaining section pixels, then writing the section pixels into a slice file, and repeatedly moving the near plane to obtain a slice set.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110590031.7A CN113204527A (en) | 2021-05-28 | 2021-05-28 | Slice compression method based on forming area pixel coordinate mark |
PCT/CN2021/121485 WO2022247085A1 (en) | 2021-05-28 | 2021-09-28 | Slice compression method based on marking of pixel coordinates of molding region |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
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 |
---|---|
CN113204527A true CN113204527A (en) | 2021-08-03 |
Family
ID=77023457
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110590031.7A Pending CN113204527A (en) | 2021-05-28 | 2021-05-28 | Slice compression method based on forming area pixel coordinate mark |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113204527A (en) |
WO (1) | WO2022247085A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022247085A1 (en) * | 2021-05-28 | 2022-12-01 | 苏州大学 | Slice compression method based on marking of pixel coordinates of molding region |
Citations (4)
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 |
Family Cites Families (1)
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 |
-
2021
- 2021-05-28 CN CN202110590031.7A patent/CN113204527A/en active Pending
- 2021-09-28 WO PCT/CN2021/121485 patent/WO2022247085A1/en active Application Filing
Patent Citations (4)
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 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022247085A1 (en) * | 2021-05-28 | 2022-12-01 | 苏州大学 | Slice compression method based on marking of pixel coordinates of molding region |
Also Published As
Publication number | Publication date |
---|---|
WO2022247085A1 (en) | 2022-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Apollonio et al. | A photogrammetry-based workflow for the accurate 3D construction and visualization of museums assets | |
Park et al. | Digital imaging in pathology | |
CN104346615B (en) | The extraction element and extracting method of composite diagram in format document | |
ES2967621T3 (en) | Digital multidimensional imaging photon platform system and methods of use | |
CN106502613B (en) | A kind of method and device to Load Image | |
US6542646B1 (en) | Computerized image-processing method | |
US11908107B2 (en) | Method and apparatus for presenting image for virtual reality device, device and non-transitory computer-readable storage medium | |
JP2010187376A (en) | Resizing digital document image | |
JP2006004425A (en) | Method for digital image segmentation | |
CN103761397A (en) | Three-dimensional model slice for surface exposure additive forming and projection plane generating method | |
US20070110301A1 (en) | Gamut selection in multi-engine systems | |
WO2008040188A1 (en) | Grating-type treatment method and device for transparent page | |
CN109636893A (en) | The parsing and rendering method of three-dimensional OBJ model and MTL material in iPhone | |
AU2018233015B2 (en) | System and method for image processing | |
Peng et al. | Fabricating QR codes on 3D objects using self-shadows | |
CN113204527A (en) | Slice compression method based on forming area pixel coordinate mark | |
CN106182330A (en) | A kind of hypostazation method of the concrete pore structural model printed based on 3D | |
Ogli et al. | Raster and vector formats of electronic document of technical documentation | |
US11663693B2 (en) | Generating downscaled images representing an object to be generated in additive manufacturing | |
JP2008090750A (en) | Method and device for generating three-dimensional image | |
CN113223160A (en) | Three-dimensional model self-adaptive slicing method based on pixel curvature | |
CN112200158B (en) | Training data generation method and system | |
CN110660119B (en) | Character dynamic effect generation method and device based on bitmap scanning | |
CN111369577B (en) | Method for converting bitmap into vector image | |
CN116311003B (en) | Video detection method and system based on dual-channel loading mechanism |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |