Page 75 - MSAM-1-3
P. 75

Materials Science in Additive Manufacturing                      2D/3D visualization software for bioprinting


            extracts the information from the lines that contain Cartesian   A         B
            coordinates (X, Y, and Z) and stores this information in a file.
            In simple terms, if X, Y, and/or Z letters exist in a G-code line,
            the program extracts those lines alongside the G commands
            that specify the type of movement mentioned (e.g., linear
            or circular) and then determines whether positioning
            is  absolute  or  relative.  The  positioning  type  determines   C        D
            how the Cartesian coordinates of the 3D construct are
            calculated. In case of absolute positioning, the XYZ values
            are specific coordinates and stored as they are. However,
            in relative positioning, the XYZ values of a line are added
            to corresponding XYZ of the previous line. Sometimes a
            G-code line might not have coordinate information for all   E             F
            XYZ; in this case, the values of the missing coordinates in
            a line are copied from the previous stored line information.

            2.3. From G-code to visualization
            The calculated XYZ coordinates and movement types were
            retrieved from either a.txt or.xlsx file to begin the translation
            process from written text lines into a 3D visualized model.   Figure  2. (A-F) Overview of graphical user interface for the two-
            The stored information represents the 3D trajectory points   dimensional and three-dimensional visualization sections.
            that form the path of the cross-section of the sliced surfaces.
            The sweep lines along the axes and generates the object’s   remark on a model’s rigidity, while infills take note of its
            outer boundaries. The file is read sequentially, line by line,   stability, both factors of which are of high importance in
            and an instantaneous conversion from a line to a visualized   3D printing modules.
            layer results in the high precision of the plotted shapes. The   Another feature the software provides is an
            visualization was made using Scientific Graphics and GUI   interactive interface with a dynamic graphics view.
                                      [22]
            Library for Python (PyQtGraph)  , and inspired by codes   This interface allows the user to zoom in and out of the
            from these sources [23-25] .                       model, as well as to rotate around to observe different
            2.4. Software development                          perspectives. The software also allows the isolation of
                                                               specific layers to evaluate the initiating and finalizing
            All the scripts and coding files used for the development   paths (Figure 3A, 3C, and 3E) in addition to a scalable
            of the 2D or 3D G-code preview software were written   increase of layers for a path-centered view of the 3D
            in Python Programming Language. This is also the same   object (Figure  3B, 3D and 3F). This comes with the
            language used to build the TwinPrint System.       ability to customize size, type, and color of the path

            3. Results and discussion                          lines. For ease of view, the user can also modify the
                                                               background colors by selecting one of the two offered
            The GUI of our program, as shown in Figure 2, has two   options. Axis labels can also be set for better navigation.
            main partitioned sections. The first section is used for   Furthermore, the software is capable of visualizing 3D
            previewing the 2D representation of the model and is   models with various structural complexities, ranging
            shown singularly layer by layer through a white background   from very simple constructs (composed of straight lines
            and black lines, enabling a clear view; this can be seen in   and circles, e.g.,  Figure  2C) to irregular and curved
            Figure 2A, 2C and 2E. The second section, likewise, shows   structures (e. g., Figure 2D).
            a 3D preview by transferring the code line into path shapes   Another aspect accessible by plotting any given G-code’s
            as stated earlier, and shown in Figure 2B, 2D and 2F. The   data is its capability of interactivity. In other words, such
            black lines, shown in Figure 2A and B, preview the shapes
            of the shell exteriors at those layers; they can be thought   viewing measures allow the user to rotate and zoom the
            of as “the lines to be colored into” in the 3D viewing tab.   model and get closer looks at specific layers within it; such
            Further detail of the 3D shape of the model (e.g., infills)   accessibility is shown in Figure 4.
            can be seen as the “colored in” areas within the previewed   Coupling the accessibility of viewing in the third
            3D section (e.g., in Figure 2F). This illustration of detail   dimension with the ability for line customization (e.g.,
            represents the utility of a viewing program since shells   size, type, and color) facilitates the preview of not only


            Volume 1 Issue 3 (2022)                         4                      https://doi.org/10.18063/msam.v1i3.19
   70   71   72   73   74   75   76   77   78   79   80