Learn R Programming

molaR (version 6.0)

Check2D: Visual check of 2D footprint triangles (HTML widget; no Quartz)

Description

Plot the 2D footprint triangles and their vertices used in the RFI 2D area calculation, as a visual QA step to detect spurious triangles inside the footprint. The result is an HTML widget (no Quartz/X11 window) with an optional legend, suitable for RStudio Viewer, Quarto/HTML, and browsers.

Usage

Check2D(
  RFI_Output,
  FootColor = "red",
  TriPointsColor = "black",
  main = "",
  cex = 1,
  legend = TRUE,
  widget_size_px = 768,
  scene_zoom = 1.5,
  leftOffset = 0,
  fieldofview = 0,
  title_font_size_px = 30,
  legend_magnify = 1,
  point_size = 5,
  alpha = 0.35
)

Value

An htmltools-browsable object containing the title, 3D widget, and legend.

Arguments

RFI_Output

An object that stores the output of RFI()

FootColor

Character; fill color for the footprint triangles (default "red")

TriPointsColor

Character; point color for footprint triangle vertices (default "black")

main

Character; plot title (default "")

cex

Numeric; relative size multiplier for legend text (default 1)

legend

Logical; show a right-hand legend (default TRUE)

widget_size_px

Integer; square size of the widget in pixels (default 768)

scene_zoom

Numeric; initial zoom of the 3D scene (default 1.5)

leftOffset

Numeric (-1..1); small horizontal camera nudge (default 0)

fieldofview

Numeric; field of view in degrees; 0 = isometric (default 0)

title_font_size_px

Integer; title font size in pixels (default 30)

legend_magnify

Numeric; additional legend scale factor (default 1)

point_size

Numeric; size for triangle vertex points (default 5)

alpha

Numeric between 0 and 1; transparency for the footprint fill (default 0.35)

Details

This reproduces the same intent as the classic Check2D(): it draws the triangles from RFI_Output$Footprint_Triangles and the corresponding 2D coordinates in RFI_Output$Flattened_Pts. The triangles are plotted in the XY plane (z = 0). If you see points/triangles inside the footprint that shouldn’t be there, it typically indicates an alpha value that is too small in the RFI step, leading to an inflated 2D footprint.

The function uses a headless rgl device and returns an rglwidget embedded in an HTML layout (title atop, legend on the right)—matching the approach used in DNE3d().

Examples

Run this code
# RFI_out <- RFI(Tooth, alpha = 0.5)
# Check2D(RFI_out, FootColor = "tomato", TriPointsColor = "black",
# main = "RFI 2D Footprint QA")

Run the code above in your browser using DataLab