NodeIcon SelectPointPairs

Lets you select point correspondences between two models. Also allows loading and saving points to file.

Point correspondences are used as an input to some nodes like Wrapping and RigidAlignment.

This node was previously named SelectPoints.


Editor

SelectPointPairs node has an editor that allows adding and editing user-defined point correspondences.

../../_images/SelectPointPairs.jpg

Within the editor two models are represented side by side. You can synchronize views by checking Sync views in node parameter panel.

LMB

to add a new point

CTRL + LMB

to remove a point

click and drag a point

to move it

Point correspondences should be specified in exactly the same order for the left and the right models.

Point position is stored relative to a mesh triangle in which the point is located so the same point selection is suitable for different models with the same topology.

Inputs

left geometry

Geometry Geometry that will be displayed on the left hand side in the editor

right geometry

Geometry Geometry that will be displayed on the left hand side in the editor

Output

PointCorrespondences Point correspondences

Parameters

Sync Views:

if set, synchronize left and right viewports inside the editor

Source:
User Input

Point selection can be edited by user. It can be loaded and saved to file specified in file name parameter.

File

Point selection is not editable. For each frame it is loaded from a file spiceified in file name parameter.

File Name:

a file path for saving and loading selection in user input mode, and for loading selection in file mode. Supports Path Interpretation.

Export:

saves currently selected points into file specified in file name parameter. Only available in user input mode.

Import:

loads selection from file specified in file name parameter. Only available in user input mode.

Clear:

clears current selection. Only available in user input mode.

Saving Points

Current point selection from each side can be saved to file and used later. Go to Left or Right tab in parameter panel, set source to user input, specify file name for your points and click Save button.

If you add # character in the file name (Points##.txt) it will be substituted with the current frame number (Points01.txt) during saving. With this approach you can switch between frames, modify selection and click save without changing the file name.

Loading Points

Go to Left or Right tab in parameter panel, set source to user input, set file name to your current file that stores points and click Load button.

If you have a sequence of files storing points for each frame (Points00.txt, Points01.txt, Points02.txt) and you want Wrap to load them automatically, set source to file, set file name to “Points##.txt”. Each time you switch to new frame Wrap will load a corresponding file for you.

File Format

Wrap can load and save points for left or right model into a textual JSON file compatible with WrapX.

Inside the file points are represented in the following format:

[[0,0.3,0.5],[1,0.0,1.0]]

This line stores two points. Each point is represented with 3 numbers:

  • index of triangle

  • first barycentric coordinate of the point inside triangle

  • second barycentric coordinate of the point inside triangle

Tip

If a model contains polygons with more that 3 vertices Wrap implicitly stores a triangulated version of the model. Wrap uses naive fan triangulation with the fan origin at the first vertex of the polygon.

Tip

Barycentric coordinates is a way to encode point position inside a triangle with two numbers U and V. If a triangle has 3 vertices with 3D coordinates A, B and C, barycentric coordinates U and V defines a point in 3D which position is calculated like:

P = A * U + B * V + C * (1 - U - V)