File tree 4 files changed +5
-13
lines changed
src/main/scala/io/github/scala_tessella/tessella
4 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import conversion.DOT
10
10
import conversion .DOT .toDOT
11
11
import conversion .SVGInvalid .*
12
12
import utility .Utils .*
13
- import utility .UtilsOption .getDefined
14
13
15
14
import scala .xml .Elem
16
15
@@ -134,11 +133,10 @@ object TilingErrorMessages:
134
133
sideCouples.map((s1, s2) => (edgeFromSide(s1), edgeFromSide(s2)))
135
134
val crossings : List [Point ] =
136
135
edgeCouples
137
- .map ({
136
+ .flatMap ({
138
137
case (edge1, edge2) => List (edge1, edge2).toSegments(tiling.perimeterCoords).toCouple match
139
138
case (f, s) => f.intersection(s)
140
139
})
141
- .getDefined
142
140
val svg : String =
143
141
addInvalidPerimeterSVG(
144
142
Description (" Invalid intersecting edges" ),
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import RegularPolygon.Vertex
10
10
import Topology .{Edge , Node , NodeOrdering }
11
11
import TilingUniformity .groupUniformsNestedComplete
12
12
import utility .Utils .toCouple
13
- import utility .UtilsOption .getDefined
14
13
import io .github .scala_tessella .ring_seq .RingSeq .Index
15
14
16
15
import scala .xml .Elem
@@ -203,7 +202,7 @@ object SVG extends ConverterSVG:
203
202
)
204
203
.withStyle(Style (
205
204
(
206
- if isMono then attributes
205
+ if isMono then attributes
207
206
else fill(fillUniform(index)) :: attributes
208
207
) *
209
208
))
@@ -366,7 +365,7 @@ object SVG extends ConverterSVG:
366
365
growthSVG(showGrowth),
367
366
marksSVG(markStyle),
368
367
labelsSVG(labelledNodes)
369
- ).getDefined *
368
+ ).flatten *
370
369
)
371
370
372
371
/** `svg` element with metadata and `viewBox` fitting the tiling */
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import TilingGrowth.OtherNodeStrategy.BEFORE_PERIMETER
6
6
import RegularPolygon .{Polygon , Vertex }
7
7
import TilingSymmetry .perimeterRotationalSymmetry
8
8
import Topology .{Edge , Node }
9
- import utility .UtilsOption .getDefined
10
9
11
10
import io .github .scala_tessella .ring_seq .RingSeq .{Index , applyO }
12
11
@@ -86,7 +85,7 @@ object Symmetric:
86
85
yield
87
86
grown
88
87
)
89
- tilings.getDefined .distinct
88
+ tilings.flatten .distinct
90
89
91
90
/** Expands by symmetric axes
92
91
*
Original file line number Diff line number Diff line change @@ -17,12 +17,8 @@ object UtilsOption:
17
17
yield
18
18
c
19
19
20
- /** Filters and gets defined options only */
21
- def getDefined : CC [A ] =
22
- options.filter(_.isDefined).map(_.get)
23
-
24
20
private def emptied : CC [A ] =
25
- getDefined .take(0 )
21
+ options.flatten .take(0 )
26
22
27
23
/** Option of a sequence */
28
24
def sequence : Option [CC [A ]] =
You can’t perform that action at this time.
0 commit comments