| OPC3d | R Documentation |
Produces a three-dimensional rendering of face orientation on a surface and returns an HTML widget with a clean, numbered pie legend Wedges can be scaled by patch counts. Default colors emphasize clarity.
OPC3d(
OPC_File,
binColors = NULL,
patchOutline = FALSE,
outlineColor = "black",
maskDiscard = FALSE,
legend = TRUE,
main = "",
cex = 1,
scaleLegend = FALSE,
legendTextCol = "black",
legendLineCol = "black",
leftOffset = 0,
fieldofview = 0,
widget_size_px = 768,
scene_zoom = 1.5,
title_font_size_px = 30,
title_font_family =
"system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",
legend_magnify = 1,
fileName = NA,
binary = FALSE
)
OPC_File |
An object that stores the output of |
binColors |
Optional character vector of colors for each directional bin. If not supplied, a high-contrast set is generated automatically (OkabeāIto <= 12 bins; vivid HCL rainbow for more). |
patchOutline |
Logical; draw patch boundary outlines on the mesh (default |
outlineColor |
Color for patch outlines (default |
maskDiscard |
Logical; color discarded/small patches black in the mesh (default |
legend |
Logical; show a right-hand legend (default |
main |
Character; plot title (default |
cex |
Numeric; relative size multiplier for legend text (default |
scaleLegend |
Logical; scale legend pie wedges by patch counts (default |
legendTextCol |
Color for legend text (default |
legendLineCol |
Color for legend ring/lines (default |
leftOffset |
Numeric (-1..1); small horizontal camera nudge (default |
fieldofview |
Numeric; field of view in degrees; 0 = isometric (default |
widget_size_px |
Integer; square size of the 3D widget in pixels (default |
scene_zoom |
Numeric; initial zoom on the 3D scene (default |
title_font_size_px |
Integer; title font size in pixels (default |
title_font_family |
CSS font-family for title/legend (default system UI stack) |
legend_magnify |
Numeric; additional legend scale factor (default |
fileName |
Character or |
binary |
Logical; write PLY as binary (default |
Run OPC() first to compute patches and directional bins.
Legend Wedges are numbered (1..N) and can be scaled to patch counts.
Saving a PLY
When fileName is provided, a colorized PLY is written. Colors are assigned per face via a
vertex-duplication strategy so external tools (e.g., MeshLab) show the same appearance. For ascii
PLY, a comment line notes the generator/version.
Interactive: an htmltools-browsable object (title, 3D widget, legend).
Non-interactive: (invisibly) a list with class "OPC3d_spec" containing:
title, bin_colors, face_colors, bin_sizes, bin_labels, legend, scaled.
# OPC_out <- OPC(Tooth)
if (interactive()) {
OPC3d(OPC_out, legend = TRUE, scaleLegend = TRUE,
main = "OPC -- Numbered Bins")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.