Parameterization Quantities
A parameterization is a set of 2D coordinates associated with a surface, often referred to as “UV coordinates”.
Typically parameterizations are used on meshes (which is also supported in Polyscope!) but at times it may be useful to visualize a parameterization at the points of a point cloud.
Adding¶
PointCloud::addParameterizationQuantity(std::string name, const T& coords, ParamCoordsType type=ParamCoordsType::UNIT)
Add a new parameterization quantity to the structure, defined per-point of the point cloud.
-
coordsis the array of 2D UV coordinates at points. The type should be adaptable to an array offloat-valued 2-vectors. The length should be the number of points in the point cloud. -
typethe default interpretation of the coordinate scale, see below
PointCloud::addLocalParameterizationQuantity(std::string name, const T& coords, ParamCoordsType type=ParamCoordsType::WORLD)
Add a new parameterization quantity to the structure, defined per-point of the point cloud.
This is similar to addParameterizationQuantity, but has preset settings for style and type which are suitable for local parameterizations about a point.
-
coordsis the array of 2D UV coordinates at points. The type should be adaptable to an array offloat-valued 2-vectors. The length should be the number of points in the point cloud. -
typethe default interpretation of the coordinate scale, see below
Parameterization Quantity Options¶
These options and behaviors are available for all types of parameterization quantities on any structure.
Styles¶
Several styles are available for how a parameterization is displayed.
The enum class ParamVizStyle has options for how parameterizations are visualized:
CHECKER: a two-color checker patternGRID: a grid with thin linesLOCAL_CHECK: a checkboard over a radial colormap, centered around(0,0)LOCAL_RAD: distance stripes over a radial colormap, centered around(0,0)CHECKER_ISLANDS: a checkerboard where islands are colored according to the island labels integer, which must be given explicitly (meshes only)
The function SurfaceParameterizationQuantity::setStyle(ParamVizStyle newStyle) can be used to programmatically change the style.
Types¶
The enum class ParamCoordsType has options that control how parameter coordinates are interpreted:
UNIT: UV coords are assumed to lie on the[0,1]intervalWORLD: UV coords are assumed to be scaled like the world-space positions of the mesh
These enums can be passed as an optional third argument when a parameterization is registered.
Options¶
| Parameter | Meaning | Getter | Setter | Persistent? |
|---|---|---|---|---|
| enabled | is the quantity enabled? | bool isEnabled() |
setEnabled(bool newVal) |
yes |
| style | the visualization style (see above) | ParamVizStyle getStyle |
setStyle(ParamVizStyle style) |
yes |
| checker colors | two colors to use for checkerboards | std::pair<glm::vec3,glm::vec3>getCheckerColors() |
setCheckerColors(std::pair<glm::vec3, glm::vec3> colors) |
yes |
| grid colors | two colors to use for line and background of grid | std::pair<glm::vec3,glm::vec3>getGridColors() |
setGridColors(std::pair<glm::vec3, glm::vec3> colors) |
yes |
| checker size | the width of checkers / stripes, always used as a relative value, unless the coord tpe is UNIT |
double getCheckerSize() |
setCheckerSize(double val) |
yes |
| color map | the color map to use for radial displays | std::string getColorMap() |
setColorMap(std::string newMap) |
yes |
(all setters return this to support chaining. setEnabled() returns generic quantity, so chain it last)