Modeling of Focal-Directorial Surfaces for Application in Architecture

The theme of this paper is the modeling of focal-directorial surfaces, starting with their definition, as a locus of points, whose sum of the distances to the focus and/or directrix is constant and predefined. We presented a heuristic algorithm for modeling surfaces and their isocurves, achieved through the use of the Grasshopper visual programming editor in the RhinoCeros environment. Surfaces and their isocurves were generated in a spherical grid, because a Cartesian grid proved unsuitable for the task and the chosen approach. This paper additionally proposes a modeling algorithm of a discrete variation of focal-directorial surfaces. The proposed modeling method is a 3D convex hull implemented on a set of surface points, with the selected points close to that surface. The discrete model is realized both in a Cartesian and spherical grid. There are significant differences between the obtained results.


INTRODUCTION
Due to the development of new technologies, primarily construction technologies and new structural systems, but also because of the rapid progress in the development of computer technology, architectural objects of the 21st century are getting increasingly complex geometric shapes.Traditional orthogonal system is no longer dominant, but on the contrary, free, curved forms or parametrically designed shapes are going through an expansion in architectural and urban design.
We can observe a faster development of geometry as a science related to current trends in architectural and urban design.Constructive processing of geometric surfaces is facilitated through the use of modern software, although, the opposite also applies, we have an increased application of constructive procedures for the formation of new 2D and 3D elements (curves and surfaces) in most graphic software, [2,7,8,10,12].
The theme of this paper is the modeling of focaldirectorial surfaces, starting with their definition, [1] and [5], as a locus of points whose sum of the distances S to the focus and/or directrix is constant and predefined.We will not delve into the problem of the generation and usage of implicit equations that describe them mathematically.We presented a heuristic algorithm for modeling surfaces and their isocurves, achieved through the use of the Grasshopper visual programming editor in the RhinoCeros environment, [4].To speed things up, all tests were first carried out in the programming language Processing, [9] and [11].
Surfaces and their isocurves were generated in a spherical grid, because a Cartesian grid proved unsuitable for the task and the chosen approach.We selected grid points whose sum of distances to the focus and the directrix is within the limits of the predefined absolute error as surface points.As the spherical grid points are distributed in a radial fashion, it turned out that each spoke contains several points for the adopted small step value, so we made an additional improvement -selecting the point with the fewest error between all those points.Isocurves are curves that pass through appropriate points, whereas the surface is a loft passing through one of two sets of isocurves.Surface discretization is a step in the right direction when it comes to applied architecture, [7] and [10].This paper additionally proposes a modeling algorithm of a discrete variation of focal-directorial surfaces.The proposed modeling method is a 3D convex hull implemented on a set of surface points, with the selected points close to that surface.The discrete model is realized both in a Cartesian and spherical grid.There are significant differences between the obtained results.The result of algorithm application in the spherical grid is basically a triangular mesh, and in the case of the Cartesian grid, through step variation in the grid and the allowed deviation from the surface, we get varied polyhedral structures as discrete models of the same focal-directorial surface.
The objective of this paper is not to select surfaces suitable for use in architecture, instead, we chose examples that clearly illustrate the content of the paper.Graphic, visual preview of the modeled surface is given in top view, front view and right view, because perspective view alone would not be sufficient to properly view the model.

MODELING ALGORITHM OF A FOCAL-DIREC-TORIAL SURFACES
The basic idea of this heuristic algorithm is to define a discrete spherical coordinate system -spherical grid.

VOL. 45, No 2, 2017 ▪ 295
Each point on the grid is defined with spherical coordinates ( ) where R should be a large enough value so the surface would be within the grid, and the grid itself is set as a local coordinate system with the coordinate origin within the surface.Angles j θ are the points of division in the division of angle π to m parts, so to n parts, where n k ≤ , r 0 = 0, R r n = and number n should be large enough to ensure a sufficiently small step for the predefined accuracy.1 For fixed i ϕ and j θ , points ( ) belong to the ray that penetrates the surface.In this point of penetration, the sum of distances to the focus and directrix equals the defined value S which defines the surface together with the focuses and directrices.The basic idea is to select a point on the spherical grid closest to the point of penetration, in other words, a grid point whose sum of distances to the focus and directrix is closest to the defined value S.However, one should be careful and make sure that this difference falls within the limits of the predefined absolute or relative error.
Therefore, the procedure should be carried out in two steps.In the first step, for every selected fixed value i ϕ and j θ , we should select points ( ) ϕ from the corresponding ray, whose sum of distances to the focus and directrix is within the limits of the permitted error.For each properly selected step, i.e. for each sufficiently large n, we get a number of such points.From the standpoint of permitted error, each of these points would be a good solution, in other words, each of them could be accepted as a surface point.
However, the following step further improves accuracy.Among all these points, we selected the "best", a point ( ) , with the smallest error.
This selection is realized in Processing with the use of an algorithm for finding the smallest member, and in Grasshopper, using the available sorting of the error array while simultaneously sorting points.
The described procedure of selecting points ( ) is repeated for all discrete values i ϕ and j θ , where we get a double set of points of the modeled surface.Through interpolation, generation of the curve that passes through points ( ) , and for fixed j By creating a lofted surface through the set of ϕ isocurves or through the set of θ isocurves, we will get a model of the focal-directorial surface.

Model of a Focal-Directorial Surface
Focal-directorial surface as a locus of points whose sum of distances to predefined focuses and directrices is constant, defined within an initial global coordinate system.Focuses and directrices are initially defined with the use of Cartesian coordinates, but given the connection between spherical and Cartesian coordinates, it can be said that the surface is defined by its focuses and directrices in the appropriate global spherical coordinate system.We should somehow perform a rough estimation of the position and size of the surface so that the auxiliary spherical grid could be positioned with the origin inside the surface and dimensioned so that it covers the surface.However, the model is parametric and through a variation of the coordinate origin's parametric values and the upper limit of the third coordinate r k grid points, we will soon experimentally obtain some favorable values.The model is entirely realized through a parametric model in Grasshopper, all variables described in the algorithm are parametrically defined.As input data, the focuses and directrices are defined as follows: focuses are defined with their coordinates, whereas directrices are defined by selecting drawn lines or defining a point and a line vector.
The selection of a local spherical coordinate system, its coordinate origin and position in space does not impact the position or the shape of the surface, but it does affect the shape and position of isocurves that are expected to mirror the character and behavior of the surface to some extent.Mathematically speaking, a change in the spherical coordinate system represents the change of its parametric equations for the surface in the global Cartesian coordinate system, i.e. reparametrization, hence its significant impact on the isocurves is quite clear.
If we exclude rotation as a method of switching from the global to the local coordinate system, the translation itself only results in the change of the coordinate origin's position.It was observed that such changes produce interesting results that refer to the isocurves of focal-directorial surfaces.
As an illustration of isocurve behavior, this paper chose an example of a simple surface with three focuses P 1 (-12,0,0), P 2 (0,12,0), P 3 (5,5,5) and a constant sum of distances to the focus 35 = S . Figure 1 shows the said surface with six isocurve variations.
By varying the position of the coordinate origin of the local spherical coordinate system (Figure 1), we get different sets of isocurves whose discretization results in various spatial structures based on the same focaldirectorial surface.Many of these isocurves don't visually match the behavior of the surface, and some can even generate visual illusions about the appearance of the surface itself.This fact should not be necessarily viewed in a negative context from the standpoint of architectural application, although control is necessary, as well as the ability to generate isocurves that mirror the behavior of the surface to a sufficient degree. .The resulting isocurves do not display the existing symmetry.In order for it to be visible, we should perform an additional rotation of the coordinate system or drop the triangle whose vertices are the focuses into the horizontal plane, then perform the modeling.Given that this is not a general problem, it only applies to a trifocal surface, the authors have not tried to model such isocurves.The next surface, shown in Figure 2, manifests a strong antisymmetry.It is the focal-directorial surface P.2. with two bypassing directrices and one focus.Directrices are the diagonals of two sides of a regular triangular prism, whereas the focus is outside the prism, point ( ) 0 , 5 , 5 P (Figure 3).In its part toward the directrices, it behaves as a directorial surface, and in the part toward the focus, as a focal surface.This behavior of the surface is mirrored by the shape of isocurves.
The third presented surface P.3. is a focal surface with focuses in the vertices of an isosceles triangle, so the plane symmetry of that surface in relation to the symmetric plane of the triangle base is expected.In addition, all focuses ( ) 0 , 5 , 5

Discrete Model of a Focal-Directorial Surface
This paper proposes the generation of a discrete model of a focal-directorial surface as a convex hull of the selected set of points.Convex hull is the smallest convex set that contains the defined set of points.For points in a plane, the convex hull is a polygon, and for points in space that do not belong to the same plane, it is a polyhedron.Some of the defined points are vertices of the polyhedron, whereas all other points are outside of it.To generate a convex hull in Processing, we used an algorithm from the ComputationalGeometry library.We performed model testing in Processing and realized it in the Grasshopper afterwards.Grasshopper definition includes the convex hull algorithm in the script, and for everything else (discrete grid, point selection and result finalization) we used Grasshopper components.The result of the script algorithm for the convex hull is a polyhedron as a triangular mesh.Through additional examination of whether the triangles belong to the same plane or not, we get a convex hull with visible polygonal sides.
Unlike the continuous model of the focal-directorial surface, the discrete model is realized in a spherical and Cartesian grid.We already explained the spherical grid in detail, a small step for r ensures sufficient precision, and through step variations for ϕ and θ we get different variations of the solution.In the Cartesian grid, we choose the step arbitrarily, based on variables x and y arbitrarily, and the step based on variable z should be small enough in order to ensure sufficient precision in surface points selection.The step based on variables x and y impacts the final outcomes, because through variations of these values, we get different variations of polyhedral as discrete models of focal-directorial surfaces.
Convex hull is formed as a sheath for the selected grid points.The points were selected in two ways.
In the first version, we selected grid points ( ) ϕ on a spherical grid, or (x i , y i , z jk ) on a Cartesian grid, whose sum of distances to the focuses and directrices ijk s satisfies

S s S ijk ≤ ≤ − ε
, where S is a predefined number that defines the surface together with focuses and directrices and ε is an arbitrarily selected, but sufficiently small number that provides the selection of a reasonable number of points from inside the body confined by the closed focal-directorial surface.Geometry of the convex hull depends on external points, so the obtained solution for the adopted grid is unique, regardless of the selected value for ε .Through step variation in the grid, we get different polyhedra as discrete models of the focal-directorial surface.
In the second version, we selected grid points located in the predefined close proximity of the surface, points whose sum of distances to the focus and directrix ijk s equals S within limit of a predefined error δ (

δ ≤ − S s ijk
).In this version, the solution depends on δ .
Even very small changes in the value of δ lead to changes in external points, resulting in various polyhedra as discrete models of the focal-directorial surface.In addition, variations of the grid step result in new variations of polyhedra, which represent new discrete models of the focal-directorial surface provided they are within the limits of the permitted deviation.We performed the modeling of several surfaces, both in a spherical and Cartesian grid, parallelly for both versions of point selection.In the case of the spherical grid, we can say that the outcome of applying the convex hull algorithm is a triangulated surface.Almost all sides of the obtained polyhedron are triangles, except a very small number of quadrilaterals that do not have much significance in the preview.Therefore, the authors of this paper accepted the triangular mesh generated by the script itself as the result in the case of the spherical grid, without any additional research on whether some triangles belong to the same plane and make multilateral polyhedra.
We can practically say that through the application of the convex hull, we performed surface triangulation.Figure 4 shows the obtained triangular mesh of the focaldirectorial surface P.  Convex hull algorithm is implemented on a set of points whose sum of distances to the directrices and the focus differs from the defined sum S by less than δ = 0.2625 .The change of the spherical grid, i.e. step ϕ and θ , would affect the size of the triangles, theoretically, it would be a new polyhedron, but in any case, it is a triangulated surface.
A Cartesian grid yields far more interesting results.A discrete model obtained as a convex hull in the Cartesian grid is shown in Figure 5   We selected points in the immediate vicinity of the surface ( δ ≤ − S s ijk ) with the permitted deviation of = δ 0.05 for the surface in the first row and = δ 0.01 for the surface in the second row.Discrete models shown in the picture above are just an illustration of possible variations, which are virtually unlimited in number.We selected an asymmetric focal-directorial surface for the preview so as to present the most general and comprehensive case possible.
The symmetry is mirrored in the symmetry of the discrete mode.

CONCLUSION
The family of focally generated 3D elements include: sphere, Cassini surface and m-ellipsoid, [3], [6].This paper discussed well-known focally generated 3D elements and a new type, focally-directorially generated 3D elements.By changing the small number of parameters (position of the focus and/or directrix), we can significantly influence the change of shape of the generated element, hence these forms can be adapted, adjusted and transformed according to the requirements of the architectural task.Because of their geometrically definable forms, flexibility of shape, and morphological compatibility with the feasible structures, favored by current trends in design, focallydirectorially generated elements provide a basis for exploring their suitability in the design of architectural and urban spaces.
This paper first presented an algorithm of continuous focal-directorial models in a spherical grid.The model represents a good approximation of a focaldirectorial surface in terms of the ability to achieve sufficient preview accuracy.Through the variation of the spherical grid, we come to the variation of isocurves, which represent a good basis for the variation of discrete spatial structures that display the same surface.By connecting the appropriate points of the isocurves, we can achieve triangulation in a simple manner, which is a standard procedure omitted from this paper because of its scope.
The Displayed triangulation is obtained with a Convex hull with the origin of the spherical grid in the center of gravitz, which enables an even distribution of the triangles.Of course, triangles are not congruent, nor equal in size, their shape and size depend on the local behavior of the surface.However, if we significantly displaced the coordinate origin from the centroid, it would cause significant differences in the shape and size of the triangles.They would be grouped by size, small ones on one side, significantly larger ones on the other, which may be the subject of further research in the field of applied architecture.
In the case of the Cartesian grid, the position of the coordinate system is irrelevant.A significant role in this case belongs to the grid step.Two coordinates globally determine polygon sizes, and the step for the third is responsible for the accuracy of the surface preview.Obtained polyhedral structures are the result of the stepthird coordinate ratio and the required accuracy in point selection.Through variations of that ratio, we get different polyhedral surfaces.
When it comes to preview accuracy, greater deviations may be allowed.In that case, we could talk about discrete spatial structures inspired by focaldirectorial surfaces, instead about the modeling of such surfaces.In contrast, if we demanded small deviations and if we coordinated grid step with the required preview accuracy of surface points in the grid, the expected result would be a triangulated surface as a very good approximation of the focaldirectorial surface.This model has not been realized in this paper.
same step, angles i ϕ are the points of division in the division of angle π of coordinates k r are the points of divi- sion of the interval [ ] R , 0

Figure 1 .PP
Figure 1.Isocurve variations on a trifocal surface For that purpose, authors of this paper suggest another step in the modeling algorithm of focaldirectorial surfaces.In the second iteration, with the coordinate origin of the spherical grid in the centroid of the obtained model.Results obtained on the example of three surfaces P.1, P.2 and P.3, are shown in Figure 2. The obtained isocurves mirror the behavior of the surface, express their character and clearly indicate the existing symmetries and antisymmetries within the surface.Figure 2 first shows a surface P.1.with the isocurve variation shown in Figure 1.It is a focal surface whose focuses are three points in space: the first on the − x axis ( ) 0 , 0 , 12 1 − P , the second on the − y axis ( ) 0 , 12 , 0 2 P and the third point outside the coordinate axes, ( ) 5 , 5 , 5 3 P .The sum of distances between the surface points and the focuses is 35.It is a general case of a scalene triangle, so the surface is not expected to have other planes of symmetry, except the plane of the triangle itself 3 2 1 P P P .The resulting isocurves do not

3 PFigure 2 .Figure 3 .
Figure 2. Isocurves of modeled surfaces -spherical grid with the coordinate origin in the centroid 2. with two directrices and one focus, a continuous model of which was already presented in the previous section of the paper.a) top view b) right view c) right view

Figure 4 .
Figure 4. Discrete model of the focal-directorial surface P.2.-triangulation-convex hull in a spherical grid (Example I).Convex hull algorithm is applied on a set of points of the Cartesian grid, whose sum of distances to the focus and directrices ijk s satisfies 05.Discrete model is shown in the first row with a step for x and y 0.25, and the model in the second row with a step 0.5.The step for z has not changed and equals 0.2.The change of step for x and y significantly affects the resulting polyhedron, which is naturally best seen in top view.

Figure 5 .Figure 5 .
Figure 5. Discrete model of the focal-directorial surface P.2.(examples I and II, convex hull with two different versions of point selection)

Figure 6 .
shows a model of a focal surface with focuses in the vertices of an isosceles triangle, which is the example described in detail in the previous section of the paper.Two planes of symmetry can be clearly read on the discrete model.a) top view a) front view c) right view

Figure 6 .
Figure 6.Discrete model -An example of a focal surface with two planes of symmetry