Skip to content

Type changes when using faces to index points #262

Open
@Kevin-Mattheus-Moerman

Description

@Kevin-Mattheus-Moerman

When defining a face vector F and a point vector V one could access the points for face 1 like this:

V[F[1]]

I've noticed that the type returned by the above is first of all not the same type as V (which would be desirable for my applications, but perhaps you have reasons to change the type) but also that the type depends on the face integer type.

For instance here using Int32:

T = Int32
F = TriangleFace{T}[ [1,2,3] ]
V = Point{3,Float64}[ [0.0,0.0,0.0], [1.0,0.0,0.0], [1.0,1.0,0.0]]

vf = V[F[1]]
println(typeof(vf))

The type of vf is: StaticArraysCore.SVector{3, Point{3, Float64}}
Whereas when using Int64,

T = Int64
F = TriangleFace{T}[ [1,2,3] ]
V = Point{3,Float64}[ [0.0,0.0,0.0], [1.0,0.0,0.0], [1.0,1.0,0.0]]

vf = V[F[1]]
println(typeof(vf))

The type of vf is: StaticArraysCore.SizedVector{3, Point{3, Float64}, Vector{Point{3, Float64}}}.

The returned types should probably be the same right?

Side note, V[F[1][1:end]] returns a Vector of Points so is different from V[F[1]] again. Would it not be best to always just return a vector of Points?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions