Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

17 Nets and embeddings
 17.1 Anomalies
 17.2 Drawing a net in TikZ
 17.3 Drawing a net in SVG
 17.4 Drawing the face graph

17 Nets and embeddings

One of the central questions about polygonal complexes and simplicial surfaces (for the detailed definitions see Chapter 2) is whether they can be embedded into \(ℝ^3\). This is a very hard question and can currently only be solved for small examples.

Therefore the SimplicialSurface-package does not contain methods to compute general embeddings. This chapter contains some prerequisite methods in the direction of the general embedding-problem.

Section 17.1 deals with properties that make embeddings impossible. Section 17.2 contains a method to draw the net of a polygonal complex.

17.1 Anomalies

If an embedding of a polygonal complex maps edges to straight lines, it is defined by the images of its vertices alone. This restricts the possible incidence structures:

Two edges that are incident to the same vertices would be mapped to the same line, contradicting the injectivity of the embedding. The same argument applies to two faces with the same vertices.

Those cases are called edge-anomalies and face-anomalies. Both are appearing in the example of an open bag:

gap> bag := SimplicialSurfaceByUpwardIncidence( [ [1,2], [1,3,4], [2,3,4] ],
>               [ [1,2], [1,2], [2], [1] ]);;
gap> IsAnomalyFree( bag );
false
gap> EdgeAnomalyClasses( bag );
[ [ 1 ], [ 2 ], [ 3, 4 ] ]
gap> FaceAnomalyClasses( bag );
[ [ 1, 2 ] ]

17.1-1 IsAnomalyFree
‣ IsAnomalyFree( complex )( property )
‣ IsVertexFaithful( complex )( property )

Returns: true or false

Check whether the given polygonal complex contains anomalies, i.e. pairs of edges or pairs of faces that are incident to the same vertices.

As examples, consider a tetrahedron (without any anomalies) and the open bag from the start of section 17.1 (with anomalies):

gap> IsAnomalyFree( Tetrahedron() );
true
gap> IsAnomalyFree( bag );
false

gap> IsVertexFaithful( Tetrahedron() );
true
gap> IsVertexFaithful( bag );
false

17.1-2 EdgeAnomalyClasses
‣ EdgeAnomalyClasses( complex )( attribute )
‣ EdgeAnomalyClassOfEdge( complex, edge )( operation )
‣ EdgeAnomalyClassOfEdgeNC( complex, edge )( operation )

Returns: a set of sets of positive integers

Return the set of all edge-anomaly-classes of the given polygonal complex. Two edges of complex lie in the same edge-anomaly-class if they are incident to the same vertices.

The method EdgeAnomalyClassOfEdge only returns the edge-anomaly-class of the given edge (as set). The NC-version does not check if edge is an edge of complex.

Consider the open bag from the start of section 17.1:

gap> EdgeAnomalyClassOfEdge( bag, 1 );
[ 1 ]
gap> EdgeAnomalyClassOfEdge( bag, 3 );
[ 3, 4 ]
gap> EdgeAnomalyClasses( bag );
[ [ 1 ], [ 2 ], [ 3, 4 ] ]

17.1-3 FaceAnomalyClasses
‣ FaceAnomalyClasses( complex )( attribute )
‣ FaceAnomalyClassOfFace( complex, face )( operation )
‣ FaceAnomalyClassOfFaceNC( complex, face )( operation )

Returns: a set of sets of positive integers

Return the set of all face-anomaly-classes of the given polygonal complex. Two faces of complex lie in the same face-anomaly-class if they are incident to the same vertices.

The method FaceAnomalyClassOfFace only returns the face-anomaly-class of the given face (as set). The NC-version does not check if face is a face of complex.

Consider the open bag from the start of section 17.1:

gap> FaceAnomalyClassOfFace( bag, 1 );
[ 1, 2 ]
gap> FaceAnomalyClasses( bag );
[ [ 1, 2 ] ]

17.2 Drawing a net in TikZ

While it is very hard to compute an embedding into \(ℝ^3\) it is quite easy to draw the net of a ramified polygonal surface into a plane.

For example, the net of an octahedron can be drawn like this:

gap> oct := Octahedron();;
gap> DrawSurfaceToTikz( oct, "Octahedron_example" );;

This will write a file Octahedron_example.tex that contains the net of the octahedron, written in TikZ:

To customize this drawing, a record is used (called the printRecord). Each call of the drawing method creates one of those:

gap> pr := DrawSurfaceToTikz( oct, "Octahedron_example" );;

Maybe the edges should not be labelled. Then they can be turned off:

gap> pr.edgeLabelsActive := false;;

The colours can also be changed very easily (especially if all colours should be changed at once). For example, let's make all vertices green:

gap> pr.vertexColours := "green";;

After compiling we get the following net.

gap> DrawSurfaceToTikz( oct, "Octahedron_recoloured.tex", pr );;



It should be mentioned that all of these calls modify their printRecord.

Since it is impractical to always call LaTeX for every customization we can call it directly from within GAP:

gap> pr.compileLaTeX := true;;

Still the picture looks quite small. To see how big it currently is, we can look at the parameter scale:

gap> pr.scale;
2

So the default scale is 2. Since there is a lot of space left, we can set the scale to 3. Furthermore we label the faces with roman numbers.

gap> pr.scale := 3;;
gap> pr.faceLabels := ["I","II","III","IV","V","VI","VII","VIII"];;
gap> DrawSurfaceToTikz( oct, "Octahedron_customized.tex", pr );;



Next we would like to change the shapes of the triangles. To do so we need to know how long the edges are.

gap> pr.edgeLabelsActive := true;;
gap> DrawSurfaceToTikz( oct, "Octahedron_edgeLabels", pr );;
gap> pr.edgeLengths;
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]



We want to make the angles around vertex 1 larger, for example:

gap> pr.edgeLengths := [ 1, 1, 1, 1, 1.5, 1.5, 1, 1.5, 1, 1.5, 1, 1 ];;

Since the printRecord also remembers the angles, this information has to be discarded before the recomputation.

gap> Unbind( pr.angles );
gap> DrawSurfaceToTikz( oct, "Octahedron_reshaped", pr );



We can see that the program chooses to display a different net to avoid self-intersections. If the system can not easily avoid intersections it will split up the surface and draw these components separately. This feature can be turned off by setting the parameter avoidIntersections to false.

17.2-1 DrawSurfaceToTikz
‣ DrawSurfaceToTikz( ramSurf, fileName[, printRecord] )( operation )

Returns: a record

Draw the net of the given ramSurf into a tex-file (using TikZ). An introduction to the use of this method (along with several examples) can be found at the start of section 17.2.

There are several parameters to change the output of this method, from cosmetic changes to exactly controlling in which order the faces are drawn. There are the following classes of parameters:

17.2-2 Colours

This subsection covers how to change the colours of vertices, edges and faces in the drawings from DrawSurfaceToTikz (17.2-1). It covers the following parameters:

We will exemplify them with the example of a cube. Here the cube has holes in the vertex, edge and face sets to make it more clear how the parameters work:

gap> cube := PolygonalComplexByDownwardIncidence([ [ 1, 2 ], [ 2, 3 ], [ 3, 4 ], 
> [ 1, 4 ], [ 2, 7 ], , [ 3, 8 ], [ 4, 9 ], [ 1, 6 ], [ 7, 8 ] ,[ 8, 9 ],
> [ 6, 9 ], [ 6, 7 ] ],[ [ 1, 2, 3, 4 ], ,[ 1, 5, 9, 13 ], [ 2, 5, 7, 10 ], 
> [ 4, 8, 9, 12 ], [ 3, 7, 8, 11 ], [ 10, 11, 12, 13 ] ]);;
gap> DrawSurfaceToTikz(cube, "Cube_example");;



17.2-3 Labels

This subsection covers the parameters that change the labels of vertices, edges and faces in the drawings of DrawSurfaceToTikz (17.2-1).

We will exemplify these parameters on the example of a tetrahedron. Here the tetrahedron has holes in the vertex, edge and face sets to make it more clear how the parameters work:

gap> tetra := SimplicialSurfaceByDownwardIncidence([ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], 
> [ 3, 4 ], ,[ 3, 5 ], [ 4, 5 ] ], [ [ 1, 2, 4 ], [ 1, 3, 6 ], ,
> [ 4, 6, 7 ], [ 2, 3, 7 ] ]);;
gap> DrawSurfaceToTikz( tetra, "Tetrahedron_example" );;



17.2-4 Lengths and angles

This subsection explains the parameters that modify the size and shapes of the faces that are drawn by the method DrawSurfaceToTikz (17.2-1). More specifically it explains the following parameters:

By default, all faces are drawn as regular polygons. To choose different polygons their edge lengths and inner angles have to be defined (exception: for triangles it is sufficient to define the edge lengths, as long as the angles are not set).

If the given information is inconsistent an error is thrown.

We will exemplify the first two parameters on the example of a tetrahedron. Here the tetrahedron has holes in the vertex, edge and face sets to make it more clear how the parameters work:

gap> tetra := SimplicialSurfaceByDownwardIncidence([ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ],
> [ 3, 4 ], ,[ 3, 5 ], [ 4, 5 ] ], [ [ 1, 2, 4 ], [ 1, 3, 6 ], ,
> [ 4, 6, 7 ], [ 2, 3, 7 ] ]);;
gap> DrawSurfaceToTikz( tetra, "Tetrahedron_example" );;



17.2-5 Draw order

This subsection is concerned with the parameters that control the draw order of the drawings from DrawSurfaceToTikz (17.2-1). The drawing order is decided by the following parameters:

We will exemplify these parameters on different examples.

17.2-6 Output control

This subsection contains miscellaneous parameters to control the output of DrawSurfaceToTikz (17.2-1). It contains the following options:

17.2-7 Data representation

This subsection contains miscellaneous parameters which cannot be influenced by the user and contain information to recreate the drawing of DrawSurfaceToTikz (17.2-1). These parameters are: vertexCoordinates, edgeEndPoint and faceVertices.

For each vertex v and each edge e the components that contain v respectively e are sorted in the order in which v respectively e were drawn. The variable index will play an essential role in describing the parameters. index(v) specifies the index of the component in the order described above in which the drawn node is located (analogously for e). Consider the parameters in detail:

17.2-8 SetFaceCoordinates2D
‣ SetFaceCoordinates2D( surface, coordinates[, printRecord] )( operation )
‣ SetFaceCoordinates2DNC( surface, coordinates[, printRecord] )( operation )

Returns: the updated print record

Save the given list of 2D-coordinates in the given or an empty print record. If the format of the 2D-coordinates (2D-coordinates have to be a list of 2 entries of floats) is not correct, then an error is shown. The NC-version does not check the coordinate format.

For an example consider the tetrahedron.

gap> printRecord:=rec();;
gap> SetFaceCoordinates2D(Tetrahedron(),[[0.,0.],[0.,1.],[1.,1.],[0.,1.]]);
rec( faceCoordinates2D := [ [ 0., 0. ], [ 0., 1. ], [ 1., 1. ], [ 0., 1. ] ] )
gap> SetFaceCoordinates2D(Tetrahedron(),[[0.,0.],[0.,1.],[1.,1.],[0.,1.]],
> printRecord);;
gap> printRecord;
rec( faceCoordinates2D := [ [ 0., 0. ], [ 0., 1. ], [ 1., 1. ], [ 0., 1. ] ] )

17.3 Drawing a net in SVG

As we saw in 17.2 it is quite easy to draw the net of a ramified polygonal surface into a plane. Instead of drawing them in a .tex file we can draw them in a .svg file and add for example flaps so that it is possible to clue the folding plan together to obatin an embedding in \(ℝ^3\).

For example, the net of an icosahedron can be drawn like this:

gap> ico:=Icosahedron();;
gap> pr:=DrawComplexToSVG(ico,"Icosahedron");;

This will write a file Icosahedron.svg that contains the net of the isocahedron:

To customize this drawing, a record is used (called the printRecord). We can change the edge lengths to 1,2 and 2 and give a specific edge draw order by the following:

gap> ico:=AllWildColouredSurfaces(ico)[1];;
gap> pr:=rec();;
gap> pr.edgeDrawOrder:=[[29,26,17,13,3,7,14,24,25,21,8,6,2,5,16,19,20,12,22,30]];;
gap> pr.edgeColourClassLengths:=[1,2,2];;
gap> pr.edgeColourClassColours:=["red","green","blue"];;
gap> pr.AddFlapTriangle:=true;;
gap> pr:=DrawComplexToSVG(ico,"Icosahedron_example",pr);;

Then we obtain the following net:

17.3-1 DrawComplexToSVG
‣ DrawComplexToSVG( complex, fileName[, printRecord] )( operation )

Returns: a record

Draw the net of the given complex into a svg-file. An introduction to the use of this method (along with several examples) can be found at the start of section 17.3. It is possible to use the svg-file as an input for a Cricut Maker to create a nice net which can be folded and glued together. A short description for this is written in 17.3-5.

There are several parameters to change the output of this method, similar to the options of DrawSurfaceToTikz as described in 17.2. This includes the parameters for changing the colours of edges and faces (17.2-2), the lengths (17.2-4), the edge draw order (17.2-5).

Moreover, there are additional parameters especially only for the method DrawComplexToSVG:

17.3-2 Flaps

This subsection contains parameters to add flaps to the drawing of DrawComplexToSVG (17.3-1). There are two different kind of flaps which can be added:

For example, consider icosahedron at the begin of this section. Here we added the flaps with four coners:

gap> ico:=Icosahedron();;
gap> pr:=rec();;
gap> pr.AddFlaps:=true;;
gap> pr:=DrawComplexToSVG(ico,"Icosahedron_Flaps");;



In the following the triangular flaps are drawn:

gap> ico:=Icosahedron();;
gap> pr:=rec();;
gap> pr.AddFlapTriangle:=true;;
gap> pr:=DrawComplexToSVG(ico,"Icosahedron_FlapTriangle");;



17.3-3 Circles

If the paramterer AddCircle is true (the default is false) circles are drawn at the center of each face. This can be used, for example, to place magnets in the surfaces that can be constructed by gluing the folding plan together.

Consider the icosahedron at the begin of this section where the circle are drawn:

gap> ico:=Icosahedron();;
gap> pr:=rec();;
gap> pr.AddCircle:=true;;
gap> pr:=DrawComplexToSVG(ico,"Icosahedron_Circle");;



17.3-4 Geodesic

If the paramterer AddGeodesic is true (the default is false) all geodesics are drawn on the surface. This only works for equilateral triangles otherwise a warning is printed.

Consider the icosahedron at the begin of this section with equilateral triangle where the geodesics are drawn:

gap> ico:=Icosahedron();;
gap> pr:=rec();;
gap> pr.AddGeodesic:=true;;
gap> pr:=DrawComplexToSVG(ico,"Icosahedron_Geodesic");;



17.3-5 Cricut Maker

This is a short manual on how to use the Cricut Maker together with the output from the DrawSurfaceToSVG method. After you have created an output-file with the name name.svg you can use the Cricut Maker to create a nice net which can be folded and glued together:

  1. Start Cricut Design Space on your Computer and sign in.

  2. Go to Canvas and then click on Upload.

  3. Click Upload Image and upload your SVG file. Then click Continue and then Upload

  4. First you need to select all groups and change the operation to Print then Cut and then click on Attach.

  5. Adjust the size of your model so that the Cricut Maker supports the size (currently up to 16.54cm x 25.22 cm). You can also rotate your model if that helps.

  6. Click Make and Continue. Choose a printer and then print the file.

  7. Then cancel the Make process to get back to Canvas.

  8. Delete all the groups which do not contain scoring and flap edges.

  9. Change the operation for the inner edges to score and keep the print then cut option for the flaps.

  10. Click Make and select then I've already printed option.

  11. Choose the correct paper setting and put the printed paper on the mat.

  12. First, you need to put the scoring wheel into the machine. After some time, the program tells you to switch to the cutter.

  13. After the Cricut Maker is done, you can take out the model and glue it together.

17.4 Drawing the face graph

The face graph of a simplicial surface is a graph whereby the vertices of the graph are given by the faces and the edges of the graph are given by the edges of the given simplicial surface. For more specific access to the face graph of a simplicial surface, compare (15.4-2). We can compute a straight-line embedding of the face graph by assigning 2D-coordinates to the faces. Note, DrawFacegraphToTikz (17.4-1) only computes face graphs of spherical vertex faithful surfaces.

For example the face graph of an octahedron can be drawn like this:

gap> oct := Octahedron();;
gap> DrawFacegraphToTikz( oct, "facephgraph_oct_example" );;

This will write a file facegraph_oct_example.tex that contains the face graph of the octahedron, written in TikZ:

To customize this drawing, a record is used (called the printRecord). Each call of the drawing method creates one of those:

gap> pr := DrawFacegraphToTikz( oct, "facegraph_oct" );;

If the edges should be labelled, they can be turned on as follows:

gap> pr.edgeLabelsActive := true;;



The labels of the vertices can be turned on with

gap> pr.vertexLabelsActive := true;;



The colours of the edges and vertices can also be changed very easily (especially if all colours should be changed at once). For example, let's make all edges green:

gap> pr.edgeColours := "green";;



We can even compute an embedding of the face graph with the corresponding geodesics of the simplicial surface.

If we are not happy with the position of a face node, we can change it by adjusting the 2D-coordinate of the face.

gap> pr.faceCoordinates2D[1]:=[-2.,4.];;

It is even possible to compute an embedding of the face graph of a given simplicial surface by manipulating all face coordinates. For example we can compute an embedding so that it is clear to see that the face graph of the octahedron is bipartite.

gap> pr.faceCoordinates2D[1]:=[0.,0.];;pr.faceCoordinates2D[4]:=[4.,0.];;
gap> pr.faceCoordinates2D[3]:=[4.,1.];;pr.faceCoordinates2D[7]:=[4.,2.];;
gap> pr.faceCoordinates2D[2]:=[0.,1.];;pr.faceCoordinates2D[6]:=[0.,2.];;
gap> pr.faceCoordinates2D[5]:=[0.,3.];;pr.faceCoordinates2D[8]:=[4.,3.];;

17.4-1 DrawFacegraphToTikz
‣ DrawFacegraphToTikz( surface, file[, printRecord] )( operation )

Returns: a record

Draw the face graph of the given surface into a tex-file (using TikZ). An introduction to the use of this method (along with several examples) can be found at the start of section 17.4. If surface is a simplicial vertex faithful sphere and the function is used without the argument printRecord, then the drawing printed into file is a planar embedding of the face graph of surface, where the vertices of the surface are identified by the faces of the embedding. Trying to use the function for a surface that is not a vertex-faithful sphere results in returning fail.

There are several parameters to change the output of this method. Since the design of the parameters is similar to the design of the parameters of DrawSurfaceToTikz(17.2-1), one can also refer to the corresponding subsections for a better understanding. There are the following classes of parameters:

If surface is a simplicial sphere without 2-waists, the function can be called without specifying the parameter faceCoordinates2D. In this case the implementation computes coordinates for the faces represented by vertices so that the embedded facegraph is planar.

17.4-2 Colours

This subsection covers how to change the colours of edges and faces represented as vertices in the drawings from DrawFacegraphToTikz (17.4-1). It covers the following parameters:

We will exemplify them with the tetrahedron to make clear how the parameters work:

gap> tetra :=SimplicialSurfaceByVerticesInFaces([[1,2,3],[1,2,4],
> [1,3,4],[2,3,4]]);;
gap> DrawFacegraphToTikz(tetra, "facegraph_tetrahedron");;



17.4-3 Labels

This subsection covers the parameters that change the labels of vertices, edges and faces in the drawings of DrawFacegraphToTikz (17.4-1).

We will exemplify these parameters on the example of a double-6-gon to make clear how the parameters work:

gap> double6Gon := SimplicialSurfaceByVerticesInFaces([[1,2,3],[1,3,4],[1,4,5],
> [1,5,6],[1,6,7],[1,2,7],[2,3,8],[3,4,8],[4,5,8],[5,6,8],[6,7,8],[2,7,8]]);;

gap> DrawFacegraphToTikz( double6Gon, "facegraph_Double6Gon.tex" );;

17.4-4 Scaling

This subsection explains the parameters that modify the size of the drawings produced by the method DrawFacegraphToTikz (17.4-1). More specifically it explains the following parameters:

We will exemplify the parameter scale on the octahedron to make it more clear how the parameters works:

gap> oct:=Octahedron();;
gap> DrawFacegraphToTikz( oct, "facegraph_oct" );;



17.4-5 Face coordinates

This subsection covers how to change the position of the faces in the drawing computed by DrawFacegraphToTikz (17.4-1). It covers the following parameters:

We will exemplify them with the tetrahedron to make clear how the parameters work:

gap> tetra := SimplicialSurfaceByVerticesInFaces([[1,2,3],[1,2,4],
> [1,3,4],[2,3,4]]);;
gap> DrawFacegraphToTikz(tetra, "facegraph_tetrahedron");;



17.4-6 Geodesics

This subsection covers the usage of the parameter that adds geodesics into the drawings of DrawFacegraphToTikz (17.4-1). This parameter is designed for simplicial surfaces whose face graphs are embedded with the help of the coordinates computed in the implementations.

It covers the following parameters:

We will exemplify these parameter on the example of a octahedron to make it more clear how the parameters work:

gap> oct:=Octahedron();
gap> DrawFacegraphToTikz( oct, "facegraph_Octahedron.tex" );;

17.4-7 Output control

This subsection contains miscellaneous parameters to control the output of DrawFacegraphToTikz (17.4-1). It contains the following options:

17.4-8 DrawConvexFacegraphToTikz
‣ DrawConvexFacegraphToTikz( surface, file[, printRecord] )( operation )

Returns: a record

Draw the face graph of the given surface into a tex-file (using TikZ). An introduction to the use of this method (along with several examples) can be found at the start of section 17.4. If surface is a simplicial vertex faithful sphere and the function is used without the argument printRecord, then the drawing printed into file is a planar embedding of the face graph of surface, where the vertices of the surface are identified by the faces of the embedding. DrawConvexFacegraphToTikz differs from DrawFacegraphToTikz (17.4-1) by constructing the face graph by successively manipulating a convex drawing plane and calculating new face coordinates. The new coordinates are then drawn with DrawFacegraphToTikz. This results in an embedding which maps the faces of one of the largest umbrella paths on the outer ring as a regular polygon. Trying to use the function for a surface that is not a vertex-faithful sphere results in returning fail.

There are several parameters to change the output of this method. Since the design of the parameters is the design of the parameters of DrawFacegraphToTikz(17.4-1), one can also refer to the corresponding subsections for a better understanding. There are the following classes of parameters:

Consider the following example of the double-6-gon:

gap> double6Gon := SimplicialSurfaceByVerticesInFaces([[1,2,3],[1,3,4],[1,4,5],
> [1,5,6],[1,6,7],[1,2,7],[2,3,8],[3,4,8],[4,5,8],[5,6,8],[6,7,8],[2,7,8]]);;



gap> DrawConvexFacegraphToTikz( double6Gon, "convex_facegraph_Double6Gon.tex" );;



 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Ind

generated by GAPDoc2HTML