Hi, I am new to Julia. Could you please help me to understand the following line of codes. and how to define and access values @ Mesh struct. Thank you in advance.
using StaticArrays
struct Mesh{I <: Integer, F <: Real}
vertices::Vector{SVector{2, F}}
segments::Vector{SVector{2, I}}
end
Mh, this is essentially covered in the manual, here Types ยท The Julia Language
In your case
vertices = [ @SVector([ 1.5, 0.5]) ]
segments = [ @SVector([ 1, 1]) ]
m = Mesh( vertices, segments)
m.vertices[2] == 0.5
# etc...
(If you are the person defining the struct
you could also create helper functions for the construction
if that is needed in your application.)