diff src/Grids/manifolds.jl @ 1869:20bd8887db0d feature/grids/manifolds

Fix Aqua and JET fails
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 24 Jan 2025 23:40:28 +0100
parents de4b4f2aee4f
children 04c251bccbd4
line wrap: on
line diff
--- a/src/Grids/manifolds.jl	Thu Jan 23 23:22:11 2025 +0100
+++ b/src/Grids/manifolds.jl	Fri Jan 24 23:40:28 2025 +0100
@@ -60,6 +60,9 @@
 
 struct Simplex{T,D,NV} <: ParameterSpace{D}
     verticies::NTuple{NV,SVector{D,T}}
+
+    Simplex(verticies::Tuple{SVector{D,T}, Vararg{SVector{D,T},N}}) where {T,D,N} = new{T,D,N+1}(verticies)
+    Simplex(::Tuple{}) = throw(ArgumentError("Must provide at least one vertex."))
 end
 
 function Simplex(verticies::Vararg{AbstractArray})
@@ -191,7 +194,7 @@
 
 function polygon_edges(ps...)
     n = length(ps)
-    return [LineSegment(ps[i], ps[mod1(i+1,n)]) for i ∈ eachindex(Ps)]
+    return [LineSegment(ps[i], ps[mod1(i+1,n)]) for i ∈ eachindex(ps)]
 end
 
 struct Circle{T,PT} <: Curve
@@ -199,7 +202,10 @@
     r::T
 end
 
-(c::Circle)(θ) = c.c + r*@SVector[cos(Θ), sin(Θ)]
+function (C::Circle)(θ)
+    (;c, r) = C
+    c + r*@SVector[cos(θ), sin(θ)]
+end
 
 struct TransfiniteInterpolationSurface{T1,T2,T3,T4} <: Surface
     c₁::T1