View source: R/mesh_mark_pois.R
mesh_mark_pois | R Documentation |
mesh_mark_pois(
mesh,
pois = data.frame(),
button = "right",
prev_color = NA,
color = "red",
size = 12
)
mesh |
A triangular mesh object ( |
pois |
(Optional) A data frame representing previously marked POIs. It
should be the output of a previous run of this or the |
button |
The mouse button used for marking POIs. Defaults to "right".
See |
prev_color |
The color used to display previously marked POIs.
Defaults to NA, which results in automatically generated colors along a
reversed "Blue-Red 2" palette (see |
color |
The color for newly marked POIs. Defaults to "red". |
size |
The size of the POI markers. Defaults to 12. Adjust as needed for visibility. |
This function enables interactive recording of POIs on a 3D mesh. It displays the mesh along with any previously marked POIs and allows users to select new POIs using a mouse-driven interface. POIs are marked by clicking on the mesh surface. The function returns a data frame containing the marked POIs.
This function uses the 'rgl' package to provide an interactive 3D environment for marking POIs. It requires an open RGL window to function properly. If no window is open, it plots the mesh and previously marked POIs, if any.
Users can mark new POIs by clicking on the mesh surface and hitting the ESC button on the keyboard when done (note: the RGL window should not be closed while the function is running). The marked POIs are displayed as colored markers, and their coordinates are stored in the returned data frame.
A data frame containing the marked POIs with columns "x", "y", "z", and "Tag".
drop_poi()
for removing bad POIs; material3d()
for details
on the prev_color, color, and size parameters.
## Not run:
# Example usage:
# Create a dataset with marked POIs
mesh <- mesh_recenter(demoFlake2$mesh)$mesh # Ensure the mesh is centered
pois <- mesh_mark_pois(mesh)
# Drop the last POI and update the 3D scene
pois <- drop_poi(pois)
# Close the 3D scene
rgl::close3d()
# Plot the mesh again, showing previously marked POIs
pois <- mesh_mark_pois(mesh, pois)
# Close the 3D scene
rgl::close3d()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.