ArticlePDF Available

3D Printers: A new challenge for mathematical modeling


Abstract and Figures

This short communication aims at creating a bridge between 3D printing and advanced mathematical methods. We review some features of 3D printing in order to show how 3D printers' software can benefit from mathematical methods. To prove the feasibility of one possible PDE-based approach, we use a classical model for the Shape-from-Shading problem to create a 3D object starting from a single 2D photograph, and we 3D-print it!
Content may be subject to copyright.
Emiliano Cristiani
Istituto per le Applicazioni del Calcolo
Consiglio Nazionale delle Ricerche
Rome, Italy
Abstract. This short communication aims at creating a bridge between 3D printing
and advanced mathematical methods. We review some features of 3D printing in
order to show how 3D printers’ software can benefit from mathematical methods. To
prove the feasibility of one possible PDE-based approach, we use a classical model
for the Shape-from-Shading problem to create a 3D object starting from a single 2D
photograph, and we 3D-print it!
1. New modeling needs. Is a new industrial revolution coming? Many people think
so: 3D printers are able to create almost any solid object one can image and replicate
existing ones. Nowadays, the price of a 3D printer is small enough to allow many people
to have one at home, and create their own plastic objects (works of art, toys, glasses,
covers for cell phones, spare parts of any kind, etc.). Within a decade, some products
may be downloaded from the Internet for printing at home, causing a revolution in the
market of such a small objects. One can also print at home some parts of an object and
buy the others at shops, then assemble the final product by himself. Most important,
the number of printable materials is growing and it is already possible printing an object
mixing different materials. We leave to futurists the comments about the time when 3D
printers will be able to fully replicate themselves.
In the context of 3D printers there exist several new modeling needs. We list some of
them which could be attacked by known mathematical techniques, like PDE-based and
variational methods.
Hardware issues. If the 3D printer employs the additive manufacturing technique
(the solid object is created through an additive processes in which successive layers of
material are laid down under computer control), 3D-printouts are not always satisfactory
due to some flaws and artifacts which come out during the deposition of the material. It
can happen that the machine deposits too much material in some parts of the object, or
the material oozes, especially when the nozzle changes direction or stay on the same point
for a long time. This issue is mainly related to the temperature of the nozzle’s hot end,
to be suitably controlled, and the pressure drop due to the filament, see, e.g., [10].
3D printing without a 3D model. 3D-printed objects usually originate either by
virtual solids created on a computer or by 3D scans of real objects. In some cases, one
wants to replicate a real object which cannot be 3D-scanned, so that other techniques must
2010 Mathematics Subject Classification. 68U10.
Key words and phrases. 3D printers, 3D printing, Shape-from-Shading, Hamilton–Jacobi equations,
PDE-based models, Variational models.
arXiv:1409.1714v1 [math.NA] 5 Sep 2014
be employed. The typical scenario is that of the (photometric, perspective) Shape-from-
Shading problem, see, e.g., [6,15], [3] and [12], where one or more photographs of the same
object are used to build the 3D surface corresponding to the object. The photographs are
usually taken under different points of view or different light conditions. By means of
these techniques one can also 3D-print objects which are physically impossible to create.
Shape or shading? 3D-printed objects replicating real objects are usually made of a
different (and cheaper) material with respect to the original one. As a consequence, it is
expected that the replicated object reflects light in a different manner (different albedo,
different degree of Lambertianity), thus resulting in an unsatisfactory product. In some
cases it can be preferable creating an object with different shape but which appears as
the original one. In other words, one aims at replicating the reflectance properties of an
object, not its original shape. Let us mention, among others, the paper [11] which proposes
a method to generate and print a solid with custom surface reflectance properties. The
underlying idea is that, starting from an original object, one can modify its surface by
means of tiny ripples which modify locally the normal to the surface and, consequently,
the way the surface reflects the light.
Printing with different materials. Let us also mention the possibility to print ob-
jects with different materials simultaneously, alternating them while printing [13]. Mate-
rials can have different reflectance properties and transparency, and, consequently, endless
combinations are possible, as well as related optimization processes. Similarly, one can
coat the surface with paint, thus altering the reflectance properties.
Shape optimization. Printing plain solids is often not convenient because of the large
quantity of material to be used [14]. Shape optimization tools can give the optimal way
to hollow the solid, keeping the desired rigidity and printable features.
A similar problem comes from the fact that some objects are not 3D-printable at all,
because they have hang parts (like a horse leaning on two legs) [14]. In this case one
should find the minimal amount of material needed to lean the object against the base
of the printer and/or find a suitable coordinate system in which the object can lie in
equilibrium without falling down during the printing process. Moreover, one could need
to insert artificial chamfers in the solid to reduce too large slopes.
A new economy. 3D printers are going to make a revolution in some basic laws of
economics. First of all, for 3D printers, it does not matter how many items are produced.
The price of production per item remains constant. Then, production on the small-scale
is efficient as large scale production. Second, complexity is no longer an issue because the
rule “the more complex an object is, the more money must be spent on robots and people
to build it” is no longer true. We expect that new models for mathematical economics
could be developed to describe these new kind of manufacturing features.
The goal of this short communication is creating a bridge between 3D printing and
advanced mathematical tools, in particular PDE-based models. Indeed, although the
literature about 3D printers is already large, dedicate advanced mathematical tools are
still missing. To our knowledge, no PDE-based or variational models were proposed so far.
As a very first attempt, we will focus on the problem of getting a 3D model of a real object
without a 3D scan of it, aiming at creating a solid which appears, without necessarily being,
as the original one. To do that, we use the PDE-based machinery already developed for
the Shape-from-Shading problem [6,15]. Our results can be compared with those in [1,2],
where authors propose discrete optimization methods to get a 3D object starting from a
2D image of it, in such a way that the object appears as the input image when illuminated
under prescribed light conditions.
2. Shape-from-Shading. In this section we briefly recall the Shape-from-Shading (SfS)
problem and a classical PDE-based model used for solving it.
SfS is a well-known ill-posed problem in computer vision [8,9]. It consists in recon-
structing the 3D shape of a scene from the brightness variation (shading) in a grey level
photograph of that scene.
The study of the SfS problem was a hot topic for many years, and a huge number of pa-
pers have appeared on this subject, especially from the computer vision and mathematical
community. We refer the interested reader to the surveys [6,15] and references therein.
To introduce the model, let Ω be a bounded set of R2and z: Ω Rbe the (visible)
surface of the 3D object we want to reconstruct. The PDE related to the SfS model can
be derived by the image irradiance equation
Rn(x, y)) = I(x, y),(x, y ),(1)
where Iis the brightness function measured at all points (x, y) in the image, Ris the
reflectance function giving the value of the light reflection on the surface as a function
of its orientation (i.e. of its normal) and ˆn(x) is the unit normal to the surface at point
(x, y, z(x, y)). If the surface is smooth we have
ˆn(x, y) = (zx(x, y),zy(x, y),1)
p1 + |∇z(x, y)|2.(2)
The brightness function Iis the datum in the model and it is measured on each pixel of
the image in terms of a gray level, for example from 0=black to 1=white.
In order to make the problem manageable, a set of assumptions about the surface and
the camera used to take its photograph are usually considered: (H1) The material is
Labertian (its brighness does not depend on the observation point) and the albedo (the
ratio between the energy reflected and the energy captured) is constant; (H2) The light
source is unique; (H3) Both the light source and the camera are very far from the surface
(ray lights are parallel, no perspective deformations are visible); (H4) Multiple reflections
are negligible; (H5) The surface is completely visible by the camera, i.e. there are not
hidden regions (undercuts).
Under assumptions (H1)–(H5), we have R(ˆn(x, y)) = ω·ˆn(x, y),where ωR3is a unit
vector which indicates the direction of the light source. Then, equation (1) can be written,
using (2), as
I(x, y)p1 + |∇z(x, y)|2+ (ω1, ω2)· ∇z(x, y )ω3= 0 ,(x, y),(3)
thus getting a first order nonlinear PDE of Hamilton–Jacobi type. If the light source is
vertical, i.e. ω= (0,0,1), equation (3) simplifies to the eikonal equation, see, e.g., [6].
3. 3D-printed Lena. We employed the PDE model based on equation (3) to recon-
struct a 3D virtual representation of Lena (the most celebrated example for benchmarks
in computer vision and image processing), starting from a single photograph (Fig.1(a)).
We assume here ω= (0,0,1), i.e. vertical illumination. The domain Ω is discretized by a
structured (rectangular) grid with 401×401 nodes, corresponding to the pixels of the orig-
inal image. To discretize the equation we used a first-order semi-Lagrangian scheme [7],
which is iterated at each grid node until convergence is reached. Boundary conditions are
z0 for (x, y)Ω. The reconstructed surface is (an approximation of) the unique vis-
cosity solution to the equation, which of course does not match the real shape (Fig.1(c,d)).
Nevertheless, the simulated photograph of the surface taken under assumptions (H1)–(H5)
gives Lena back (Fig.1(b)), cf. [5,6].
(a) (b)
(c) (d)
Figure 1. SfS on Lena. (a) Original image, (b) Simulated photograph of
the reconstructed surface, (c) Reconstructed surface (front), (d) Recon-
structed surface (rear).
Before printing the surface, we resampled the square grid in a triangular mesh by di-
viding each cell in two triangles tracing the diagonal, and we created a solid object (see
Appendix for details). The solid was printed using the printer DELTA 20 40, with resolu-
tion 0.012 mm on x,yand 0.2 mm on z. The material is PLA (white). Physical dimensions
are 120×120×109 mm. 3D-printing time was about 4 hours. The result is shown in Fig.
2(a), whereas Fig. 2(b) shows a photograph of the solid under a vertical illumination,
obtained by means of a built-in flash. We note that Lena is perfectly recognizable in any
light condition, provided that the viewpoint is vertical.
Conclusions and perspectives. The result of this short communication shows that 3D
printing can actually benefit from advanced mathematical models and methods. Indeed,
despite the authors of [4] claim that modern methods for SfS “fail to fit the shading details
and thus cannot reproduce detailed normal variations over the surface”, we obtained a solid
which fits well the expected features. It is also useful to note that it is often preferable to
handle surfaces with small height variation, due to manufacturing constraints. This can
be achieved by duly selecting one of the many weak solutions of the SfS PDE, rather than
the unique viscosity solution as we did here.
Acknowledgments. The author wishes to thank Simone Cacace, Maurizio Falcone and
Fabio Bonaccorso for the fruitful discussions he had with them during the preparation of
this short communication. He also wishes to thank 3DiTALY for the hardware support.
(a) (b)
Figure 2. 3D-printout. (a) Real photograph of the solid object under
sunlight, (b) Real photograph of the solid from above, illuminated by a
Appendix A. The STL format. STL (STereo Lithography interface format or Stan-
dard Triangulation Language) is the most common file format used by 3D printers to
store object data which have to be printed. It comes in two flavors, ASCII or binary. The
latter requires less space to be stored and it can be easily created from the former via free
software, e.g., STLView.
3D printers can create solid objects. The object is determined by means of its surface,
which must be closed, so to have a watertight object. This means that, e.g., a plane
cannot be printed and one should consider a thin parallelepiped instead. Analogously, a
sphere should be fattened in a thin spherical shell. It is also mandatory that the “interior”
and the “exterior” of the solid are always defined. The simplest way to print a surface
represented by the graph of a function z=z(x, y) is placing the surface over a support
base, see Fig. 3, in order to close the graph and form a solid.
Figure 3. Example of triangulated pyramid “closed” by a thin parallelepiped.
The surface of the solid to be printed must be tassellated by means of a triangulation.
Each triangle, commonly called facet, is uniquely identified by the (x, y, z) coordinates
of the three vertices (V1, V2, V3) and by its unit exterior normal (ˆnx,ˆny,ˆnz). The total
number of data for each facet is 12. Moreover,
1. Each triangle must share two vertices with every neighboring triangle. In other
words, a vertex of one triangle cannot lie on the side of another triangle.
2. All vertex coordinates must be strictly positive numbers. The STL file format does
not contain any scale information, the coordinates are in arbitrary units. Actual
units (mm, cm, ...) will be chosen in the printing process.
3. Each facet is part of the boundary between the interior and the exterior of the object.
The orientation of the facets is specified redundantly in two ways. First, the direction
of the normal is outward. Second, the vertices are listed in counterclockwise order
when looking at the object from the outside (right-hand rule).
The actual format of the STL file is given in the following.
s ol i d n a me - of - th e - s o l id
facet n orm a l n x n y n z
outer lo o p
vert e x V 1 x V 1 y V 1 z
vert e x V 2 x V 2 y V 2 z
vert e x V 3 x V 3 y V 3 z
facet n orm a l n x n y n z
outer lo o p
vert e x V 1 x V 1 y V 1 z
vert e x V 2 x V 2 y V 2 z
vert e x V 3 x V 3 y V 3 z
e nd s o l id n am e - o f - t he - s o li d
Values are float numbers and indentation is made by two blanks (no tab). Unit normal
direction can be simply computed by
[1] M. Alexa and W. Matusik, Reliefs as images, ACM Trans. Graph.,29 (2010), 60:1–60:7.
[2] A. Bermano, I. Baran, M. Alexa and W. Matusk, Shadowpix: multiple images from self shadowing,
Comp. Graph. Forum,31 (2012), 593–602.
[3] M. Breuß, E. Cristiani, J.-D. Durou, M. Falcone and O. Vogel, Perspective Shape from Shading:
ambiguity analysis and numerical approximations, SIAM J. Imaging Sciences,5(2012), 311–342.
[4] Y. Dong, X. Tong, F. Pellacini and B. Guo, Appgen: interactive material modeling from a single
image, ACM Trans. Graph.,30 (2011), 146:1–146:10.
[5] J.-D. Durou, Shape from shading – eclairages, r´eflexions et perspectives, HDR, 2007, In French.
[6] J.-D. Durou, M. Falcone and M. Sagona, Numerical methods for shape-from-shading: a new survey
with benchmarks, Comput. Vis. Image Underst.,109 (2008), 22–43.
[7] M. Falcone and R. Ferretti, Semi-Lagrangian approximation schemes for linear and Hamilton-Jacobi
equations, SIAM, 2014.
[8] B. K. P. Horn, Shape from Shading: a method for obtaining the shape of a smooth opaque object from
one view, PhD thesis, Department of Electrical Engineering and Computer Science, Massachusetts
Institute of Technology, Cambridge, Massachusetts, USA, 1970.
[9] B. K. P. Horn and M. J. Brooks (eds.), Shape from Shading, MIT Press, Cambridge, MA, USA, 1989.
[10] B. Kubicek, Improved oozing compensation for diy fused deposition 3d printers, URL http:
//, Unfinished preprint.
[11] Y. Lan, Y. Dong, F. Pellacini and X. Tong, Bi-scale appearance fabrication, ACM Trans. Graph.,32
(2013), 145:1–145:12.
[12] R. Mecca and M. Falcone, Uniqueness and approximation of a photometric Shape-from-Shading
model, SIAM J. Imaging Sciences,6(2013), 616–659.
[13] K. Vidimˇce, S.-P. Wang, J. Ragan-Kelley and W. Matusik, Openfab: a programmable pipeline for
multi-material fabrication, ACM Trans. Graph.,32 (2013), 136:1–136:12.
[14] W. Wang, T. Y. Wang, Z. Yang, L. Liu, X. Tong, W. Tong, J. Deng, F. Chen and X. Liu, Cost-effective
printing of 3d objects with skin-frame structures, ACM Trans. Graph.,32 (2013), 177:1–177:10.
[15] R. Zhang, P.-S. Tsai, J. Cryer and M. Shah, Shape-from-shading: a survey, IEEE Transactions on
Pattern Analysis and Machine Intelligence,21 (1999), 690–706.
... The final look and touch of the 3D math printings of the beautiful IMAGINARY objects with singularities using this cutting-edge technology are found appealing [1]. These satisfy our initial expectations to inspire curiosity, incentivate deeper understanding and put learning literally in the hands of scholars and new generations of scientists and mathematicians (alternative approaches can be seen in [3][4]). ...
Full-text available
We have made an attempt to reproduce 17 objects of the IMAGINARY Open Mathematics Exhibition ( using low-cost, desktop 3D printers. The IMAGINARY open math is an international project by the Mathematisches Forschungsinstitut Oberwolfach in Germany and includes galleries of volumetric objects that are unique, have aesthetic appeal and mathematical meaning. We illustrate here the printing of these diverse learning materials using new 3D affordable printing technologies based on Fused Deposition Modelling (FDM) and the use of biodegradable plastic PLA. The final goal is to support museums, schools and higher education institutions in countries with lower scientific infrastructure.
Photometric 3D-reconstruction techniques aim at inferring the geometry of a scene from one or several images, by inverting a physical model describing the image formation. This chapter presents an introductory overview ofShape-from-polarisation the main photometric 3D-reconstruction techniques which are shape-from-shadingShape-from-shading, photometric stereoPhotometric stereo and shape-from-polarisation.
Full-text available
Since the first shape-from-shading (SFS) technique was developed by Horn in the early 1970s, many different approaches have emerged. In this paper, six well-known SFS algorithms are implemented and compared. The performance of the algorithms was analyzed on synthetic images using mean and standard deviation of depth ($Z$) error, mean of surface gradient ($p$, $q$) error, and CPU timing. Each algorithm works well for certain images, but performs poorly for others. In general, minimization approaches are more robust, while the other approaches are faster. The implementation of these algorithms in C and images used in this paper are available by anonymous ftp under the pub/tech_paper/survey directory at ( These are also part of the electronic version of paper.
Full-text available
Many algorithms have been suggested for the shape-from-shading problem, and some years have passed since the publication of the survey paper by Zhang et al. [R. Zhang, P.-S. Tsai, J.E. Cryer, M. Shah, Shape from shading: a survey, IEEE Transactions on Pattern Analysis and Machine Intelligence 21 (8) (1999) 690–706]. In this new survey paper, we try to update their presentation including some recent methods which seem to be particularly representative of three classes of methods: methods based on partial differential equations, methods using optimization and methods approximating the image irradiance equation. One of the goals of this paper is to set the comparison of these methods on a firm basis. To this end, we provide a brief description of each method, highlighting its basic assumptions and mathematical properties. Moreover, we propose some numerical benchmarks in order to compare the methods in terms of their efficiency and accuracy in the reconstruction of surfaces corresponding to synthetic, as well as to real images.
3D printing hardware is rapidly scaling up to output continuous mixtures of multiple materials at increasing resolution over ever larger print volumes. This poses an enormous computational challenge: large high-resolution prints comprise trillions of voxels and petabytes of data and simply modeling and describing the input with spatially varying material mixtures at this scale is challenging. Existing 3D printing software is insufficient; in particular, most software is designed to support only a few million primitives, with discrete material choices per object. We present OpenFab, a programmable pipeline for synthesis of multi-material 3D printed objects that is inspired by RenderMan and modern GPU pipelines. The pipeline supports procedural evaluation of geometric detail and material composition, using shader-like fablets, allowing models to be specified easily and efficiently. We describe a streaming architecture for OpenFab; only a small fraction of the final volume is stored in memory and output is fed to the printer with little startup delay. We demonstrate it on a variety of multi-material objects.
ShadowPixare white surfaces that display several prescribed images formed by the self-shadowing of the surface when lit from certain directions. The effect is surprising and not commonly seen in the real world. We present algorithms for constructing ShadowPixthat allow up to four images to be embedded in a single surface. ShadowPixcan produce a variety of unusual effects depending on the embedded images: moving the light can animate or relight the object in the image, or three colored lights may be used to produce a single colored image. ShadowPixare easy to manufacture using a 3D printer and we present photographs, videos, and renderings demonstrating these effects.
In this paper we study a perspective model for shape from shading and its numerical approximation. We show that an ambiguity still persists, although the model with light attenuation factor has previously been shown to be well-posed under appropriate assumptions. Analytical results revealing the ambiguity are complemented by various numerical tests. Moreover, we present convergence results for two iterative approximation schemes. The first is based on a finite difference discretization, whereas the second is based on a semi-Lagrangian discretization. The convergence results are obtained in the general framework of viscosity solutions of the underlying partial differential equation. In addition to these theoretical and numerical results, we propose an algorithm for reconstructing discontinuous surfaces, making it possible to obtain results of reasonable quality even for complex scenes. To this end, we solve the constituting equation on a previously segmented input image, using state constraint boundary conditions at the segment borders.
3D printers have become popular in recent years and enable fabrication of custom objects for home users. However, the cost of the material used in printing remains high. In this paper, we present an automatic solution to design a skin-frame structure for the purpose of reducing the material cost in printing a given 3D object. The frame structure is designed by an optimization scheme which significantly reduces material volume and is guaranteed to be physically stable, geometrically approximate, and printable. Furthermore, the number of struts is minimized by solving an l0 sparsity optimization. We formulate it as a multi-objective programming problem and an iterative extension of the preemptive algorithm is developed to find a compromise solution. We demonstrate the applicability and practicability of our solution by printing various objects using both powder-type and extrusion-type 3D printers. Our method is shown to be more cost-effective than previous works.
Surfaces in the real world exhibit complex appearance due to spatial variations in both their reflectance and local shading frames (i.e. the local coordinate system defined by the normal and tangent direction). For opaque surfaces, existing fabrication solutions can reproduce well only the spatial variations of isotropic reflectance. In this paper, we present a system for fabricating surfaces with desired spatially-varying reflectance, including anisotropic ones, and local shading frames. We approximate each input reflectance, rotated by its local frame, as a small patch of oriented facets coated with isotropic glossy inks. By assigning different ink combinations to facets with different orientations, this bi-scale material can reproduce a wider variety of reflectance than the printer gamut, including anisotropic materials. By orienting the facets appropriately, we control the local shading frame. We propose an algorithm to automatically determine the optimal facets orientations and ink combinations that best approximate a given input appearance, while obeying manufacturing constraints on both geometry and ink gamut. We fabricate the resulting surface with commercially available hardware, a 3D printer to fabricate the facets and a flatbed UV printer to coat them with inks. We validate our method by fabricating a variety of isotropic and anisotropic materials with rich variations in normals and tangents.
This largely self-contained book provides a unified framework of semi-Lagrangian strategy for the approximation of hyperbolic PDEs, with a special focus on Hamilton–Jacobi equations. The authors provide a rigorous discussion of the theory of viscosity solutions and the concepts underlying the construction and analysis of difference schemes; they then proceed to high-order semi-Lagrangian schemes and their applications to problems in fluid dynamics, front propagation, optimal control, and image processing. The developments covered in the text and the references come from a wide range of literature. Audience Semi-Lagrangian Approximation Schemes for Linear and Hamilton–Jacobi Equations is written for advanced undergraduate and graduate courses on numerical methods for PDEs and for researchers and practitioners whose work focuses on numerical analysis and numerical methods for nonlinear hyperbolic PDEs. approx. x + 325, List Price $99.00 / SIAM Member Price $69.30 / Order Code: OT133
We deal with an inverse problem where we want to determine the surface of an object using the information contained in two or more pictures which correspond to different light conditions. In particular, we will examine the case where the light source direction varies between the pictures, and we will show how this additional information allows us to obtain a uniqueness result solving the well-known convex/concave ambiguity of the shape-from-shading problem. We will prove a uniqueness result for weak (Lipschitz continuous) solutions that improves previous results in [R. Kozera, Appl. Math. Comput. 44, No. 1, 1–103 (1991; Zbl 0732.53005)] and [R. Onn and A. Bruckstein, Int. J. Comput. Vision 5, 105–113 (1990)]. We also propose some approximation schemes for the numerical solution of this problem and analyze the properties of two approximation schemes: an upwind finite difference scheme and a semi-Lagrangian scheme. Finally, we present some numerical tests on smooth and nonsmooth surfaces coming from virtual and real images.
We present AppGen, an interactive system for modeling materials from a single image. Given a texture image of a nearly planar surface lit with directional lighting, our system models the detailed spatially-varying reflectance properties (diffuse, specular and roughness) and surface normal variations with minimal user interaction. We ask users to indicate global shading and reflectance information by roughly marking the image with a few user strokes, while our system assigns reflectance properties and normals to each pixel. We first interactively decompose the input image into the product of a diffuse albedo map and a shading map. A two-scale normal reconstruction algorithm is then introduced to recover the normal variations from the shading map and preserve the geometric features at different scales. We finally assign the specular parameters to each pixel guided by user strokes and the diffuse albedo. Our system generates convincing results within minutes of interaction and works well for a variety of material types that exhibit different reflectance and normal variations, including natural surfaces and man-made ones.