Mesh
What would we do without meshes? You can load one either from a file or a handmade one:
Builders
c++ Mesh::Add(std::string path, float scale,bool smooth = true);
std::string pathif relative then look in data path.float scalescalebool smoothpolyscope shading mode (if false then visible edges)
c++ Mesh::Add(const vecs& V,const faces& F, bool smooth = true);
const vecs& Vvecs =std::vector<Eigen::Vector3d>.const faces& Ffaces =std::vector<std::vector<size_t>.bool smoothpolyscope shading mode (if false then visible edges)
Scalar fields
While you could display a scalar field by using the common approach of Quantities, slope offers a custom wrapper for scalar fields for a proper continuous intro/outro display.
c++ MeshScalarField::Add(const Mesh::MeshPtr& mesh, const std::string& name, const Vec& values, const std::string& colormap = 'viridis');
const Mesh::MeshPtr& meshthe mesh carrying the field.const std::string& namethe quantity name, as polyscope shows it.const Vec& valuesone value per vertex (scalarsalso accepted).const std::string& colormapany polyscope colormap.
void setBaseline(scalar v) the value every vertex starts from,
the field's minimum by default.
scalar color_split fraction of the intro spent fading the mesh
colour to colormap(baseline) before the field grows, so the surface
colour does not change abruptly. 0 disables that stage.