@@ -29,7 +29,6 @@ Face index, connecting points to form a simplex
29
29
30
30
@fixed_vector SimplexFace AbstractSimplexFace
31
31
const LineFace{T} = SimplexFace{2 , T}
32
- Base. show (io:: IO , x:: Type{<: LineFace{T}} ) where T = print (io, " LineFace{" , T, " }" )
33
32
Face (:: Type{<: SimplexFace{N}} , :: Type{T} ) where {N, T} = SimplexFace{N, T}
34
33
35
34
@@ -40,7 +39,11 @@ Face index, connecting points to form an Ngon
40
39
41
40
@fixed_vector NgonFace AbstractNgonFace
42
41
const TriangleFace{T} = NgonFace{3 , T}
43
- Base. show (io:: IO , x:: Type{<: TriangleFace{T}} ) where T = print (io, " TriangleFace{" , T, " }" )
42
+
43
+ const QuadFace{T} = NgonFace{4 , T}
44
+
45
+ Base. show (io:: IO , x:: TriangleFace{T} ) where T = print (io, " TriangleFace(" , join (x, " , " ), " )" )
46
+
44
47
Face (:: Type{<: NgonFace{N}} , :: Type{T} ) where {N, T} = NgonFace{N, T}
45
48
46
49
@propagate_inbounds Base. getindex (x:: Polytope , i:: Integer ) = coordinates (x)[i]
93
96
# Since Ngon is supposed to be flat and a triangle is flat, lets prefer Ngon
94
97
# for triangle:
95
98
const TriangleP{Dim, T, P <: AbstractPoint{Dim, T} } = Ngon{Dim, T, 3 , P}
96
-
97
99
const Triangle{Dim, T} = TriangleP{Dim, T, Point{Dim, T}}
98
100
const Triangle3d{T} = Triangle{3 , T}
99
101
100
- function Base. show (io:: IO , :: Type{TriangleP{D, T, P}} ) where {D, T, P}
101
- print (io, " Tetrahedron{" , D, " , " , T, " }" )
102
- end
103
- Base. show (io:: IO , :: Type{Triangle} ) = print (io, " Triangle" )
104
102
Base. show (io:: IO , x:: TriangleP ) = print (io, " Triangle(" , join (x, " , " ), " )" )
105
103
106
104
const Quadrilateral{Dim, T} = Ngon{Dim, T, 4 , P} where P <: AbstractPoint{Dim, T}
@@ -136,14 +134,11 @@ const Line{Dim, T} = LineP{Dim, T, Point{Dim, T}}
136
134
const TetrahedronP{T, P <: AbstractPoint{3, T} } = Simplex{3 , T, 4 , P}
137
135
const Tetrahedron{T} = TetrahedronP{T, Point{3 , T}}
138
136
139
- function Base. show (io:: IO , :: Type{TetrahedronP{T, P}} ) where {T, P}
140
- print (io, " Tetrahedron{" , T, " }" )
141
- end
142
- Base. show (io:: IO , :: Type{Tetrahedron} ) = print (io, " Tetrahedron" )
143
137
Base. show (io:: IO , x:: TetrahedronP ) = print (io, " Tetrahedron(" , join (x, " , " ), " )" )
144
138
145
139
146
140
coordinates (x:: Simplex ) = x. points
141
+
147
142
function (:: Type{<: NSimplex{N}} )(points:: Vararg{P, N} ) where {P <: AbstractPoint{Dim, T} , N} where {Dim, T}
148
143
Simplex {Dim, T, N, P} (SVector (points))
149
144
end
@@ -165,11 +160,6 @@ The fully concrete Simplex type, when constructed from a point type!
165
160
function Polytope (:: Type{<: NSimplex{N}} , P:: Type{<: AbstractPoint{NDim, T}} ) where {N, NDim, T}
166
161
Simplex{NDim, T, N, P}
167
162
end
168
-
169
- function Base. show (io:: IO , :: Type{LineP{D, T, P}} ) where {D, T, P}
170
- print (io, " Line{" , D, " , " , T, " }" )
171
- end
172
- Base. show (io:: IO , :: Type{Line} ) = print (io, " Line" )
173
163
Base. show (io:: IO , x:: LineP ) = print (io, " Line(" , x[1 ], " => " , x[2 ], " )" )
174
164
175
165
"""
0 commit comments