Closed ederag closed 1 month ago
The problem is that the VPolygon
type assumes that the outer container is a Vector
. The matrix constructor is just a convenience constructor. An SMatrix
does not work because the code below does not create a Vector
but a SizedVector
.
I added an implementation for SMatrix
in #3632, but it may take time until this gets merged and released.
My suggestion is to not use the matrix constructor, at least not for SMatrix
, and rather manually convert the matrix to a Vector
and then pass that to VPolygon
:
julia> M = [@SVector[0, 0.], @SVector[1, 0.], @SVector[0, 1.]]
3-element Vector{SVector{2, Float64}}:
[0.0, 0.0]
[1.0, 0.0]
[0.0, 1.0]
julia> P = VPolygon(M)
VPolygon{Float64, SVector{2, Float64}}(SVector{2, Float64}[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]])
Thanks for the PR and the advice, that indeed allowed to work around this issue.
@ederag The extension has now been released.
VPolygon(M)
fails ifM
is anSMatrix
:This is breaking OpticSim.jl tests: https://github.com/brianguenter/OpticSim.jl/actions/runs/10272550301/job/28442096437?pr=34 Is this a bug in
LazySets
or a breaking changeOpticSim
has to adapt to ?