.. _minimal_schwarz_p: Minimal (Maximal) Surfaces from Weierstrass Data -- The Schwarz P surface ------------------------------------------------------------------------- .. image:: min_koebe.png :width: 49% .. image:: schwarz_p_min.png :width: 49% In this example, we will construct the discrete S-isothermic minimal Schwarz-P surface from discrete Weierstrass data. We can use the same code to construct the spacelike S-isothermic maximal Schwarz-P surface in Lorentz-Minkowski space :math:`\mathbb{R}^{2,1}`. .. image:: max_koebe.png :width: 49% .. image:: schwarz_p_max.png :width: 49% We use essentially the same script as in :ref:`this example `, where we have constructed another discrete minimal surface, the catenoid, from discrete Weierstrass data. However, in this example the discrete Weierstrass data is a piece of the :math:`\mathbb{Z}^{2}` square lattice, it has corners which need a specific treatment. Moreover, the given discrete Weierstrass data originates from the minimization of a functional and thus is not as explicit as the Weierstrass data of the catenoid. We also need to take this into account. To get started we refer to the easier example of :ref:`the catenoid `. You can download the full script :download:`minimal_schwarz_p.py <../../../../examples/blender/docs/examples/minimal_schwarz_p.py>` and obj files storing the central extension (see below) of the discrete Schwarz P surface in Euclidean :download:`schwarz_p_euc.obj <../../../../examples/blender/docs/examples/schwarz_p_euc.obj>` or Lorentz-Minkowski space :download:`schwarz_p_lor.obj <../../../../examples/blender/docs/examples/schwarz_p_lor.obj>`. You can also download the discrete Weierstrass data that we use for the construction of the surface :download:`weierstrass_schwarz_p.obj <../../../../examples/blender/docs/examples/weierstrass_schwarz_p.obj>`. It is an orthogonal circle pattern given in the same way as in the :ref:`catenoid example `: half of its vertices correspond to circle centers of an orthogonal circle pattern, the other half to their touching points. .. contents:: :local: :backlinks: none Setup ===== We begin by importing the required modules, clearing the Blender scene, and defining the unit sphere and the dot product. .. literalinclude:: ../../../../examples/blender/docs/examples/minimal_schwarz_p.py :language: python :start-after: [setup] :end-before: [setup] This example can easily be modified to create a maximal surface in Lorentz-Minkowski space. We simply need to choose the geometry to be ``"lor"``. We load the Weierstrass data (for :math:`\mathbb{R}^{2,1}` it must lie inside the Poincaré disc) from an ``.obj`` file. Its vertices divide into white and black vertices, corresponding to cirlce centers and touching points respectively. .. literalinclude:: ../../../../examples/blender/docs/examples/minimal_schwarz_p.py :language: python :start-after: [setup2] :end-before: [setup2] Preparation =========== We prepare our data. We color the vertices and black and white (``b`` and ``w``), and the white ones again in ``ws`` and ``wc`` vertices. The bi-coloring of the white vertices distinguishes which white vertices will become spheres (``ws``) and which will become circles (``wc``) of the S-isothermic surface. The black vertices will be the touching points. .. image:: central_extension.png :width: 400px :align: center .. literalinclude:: ../../../../examples/blender/docs/examples/minimal_schwarz_p.py :language: python :start-after: [prepare] :end-before: [prepare] Project to a Koebe net ====================== We want to construct an S-isothermic Koebe net, tangential to the unit sphere, with white sphere centers ``ws`` and white circle centers ``wc``. For the Koebe net, black points will be the points of tangency, so we project all of the black points to the unit sphere. We can compute all of the white points to be the the points polar to the planes that contain all adjacent black points. For the sphere centers ``ws`` these are the correct points. For the circle centers ``wc`` there is an easy formula to obtain the correct points from the polar points we have constructed before. In contrast to the :ref:`catenoid example `, we take least square subspaces to compensate numerical inaccuracy and we introduce a specific treatment for vertices in the corners. .. literalinclude:: ../../../../examples/blender/docs/examples/minimal_schwarz_p.py :language: python :start-after: [to_koebe] :end-before: [to_koebe] Dualize ======= Now we want to compute the Christoffel dual of the Koebe net. It is known that the central extension of an S-isothermic surface is a discrete isothermic (factorizing face cross-ratio) surface. The discrete one-form for the Christoffel dual of an isothermic surface is :math:`\partial c^* (v, v') = \pm \frac{\partial c (v, v') }{|\partial c (v, v') |^2}` for all edges :math:`(v, v')`. We initialize the Christoffel dual by associating new edges to the old ones, which we determine by the formula above. We also need to bi-color the edges, as half the edges change direction in the Christoffel dual. We can verify that the one-form closes, and then integrate it by specifying a starting vertex, its position, and the name of the new vertex attribute to store the coordinates of the dual surface. Note that we also multiply by a global scaling. .. literalinclude:: ../../../../examples/blender/docs/examples/minimal_schwarz_p.py :language: python :start-after: [dualize] :end-before: [dualize] The resulting maximal surface is the central extension of an S-isothermic surface. One family of white vertices forms the S-isothermic surface. The other white vertices are again the circle centers. Note that the resulting surfaces is only a *fundamental piece* of the discrete Schwarz P surface. Other pieces of the surface can be obtained by reflecting the fundamental piece. We have applied the corresponding reflection in a separate script, which is not included in our examples yet. However, the provided ``.obj`` files contain the data of the surfaces shown in the figures above. Visualization ============= In the visualization step, we can render various objects. For a more detailed visualization of the weierstrass data , see the :ref:`s-exp example `. .. literalinclude:: ../../../../examples/blender/docs/examples/minimal_schwarz_p.py :language: python :start-after: [vis] :end-before: [vis] We can also visualize the touching face circles of the surface in a way that works for the Euclidean as well as for the Lorentzian case. .. literalinclude:: ../../../../examples/blender/docs/examples/minimal_schwarz_p.py :language: python :start-after: [vis2] :end-before: [vis2] OBJ Export and Rendering Setup ============================== The remaining part of the file contains code for exporting an OBJ file and setting up rendering options.