Learn R Programming

molaR (version 6.0)

Slope3d: Plot results of a Slope analysis of a surface (HTML widget)

Description

A function that produces a three-dimensional HTML-based rendering of surface slope. The Slope() function must be performed prior to using Slope3d().

Usage

Slope3d(
  Slope_File,
  colors = c("blue", "cornflowerblue", "green", "yellowgreen", "yellow", "orangered",
    "red"),
  maskNegatives = TRUE,
  legend = TRUE,
  main = "",
  cex = 1,
  widget_size_px = 768,
  scene_zoom = 1.5,
  leftOffset = 0,
  fieldofview = 0,
  title_font_size_px = 30,
  legend_magnify = 1,
  fileName = NA,
  binary = FALSE
)

Arguments

Slope_File

An object that stores the output of the Slope function

colors

Character vector of colors to build a continuous color gradient

maskNegatives

Logical; if TRUE, negative slopes are masked in black. If FALSE, negatives are reflected into the positive range (original behavior).

legend

Logical; draw a legend (right side of the widget)

main

Plot title

cex

Base scaling for legend/ticks (relative multiplier)

widget_size_px

Square widget size in pixels (default 768)

scene_zoom

Initial zoom for the 3d scene (default 1.5)

leftOffset

Horizontal camera nudge (-1..1 recommended)

fieldofview

Field of view in degrees (0 = isometric)

title_font_size_px

Title font size in pixels (default 30)

legend_magnify

Additional scale factor for the legend/tick text

fileName

Optional file base name to save a colored *.ply (no legend)

binary

Binary PLY if TRUE (smaller files)

Details

Colors represent face slope magnitudes. With maskNegatives = TRUE, negative slopes are shown in black. With maskNegatives = FALSE, negative magnitudes are reflected into the positive range for coloring continuity (original behavior).

The plotting window is an HTML widget (no Quartz/rgl window). The legend is rendered in HTML/CSS and aligned vertically at the right of the scene.

Examples

Run this code
s <- Slope(Tooth)
if(interactive()){Slope3d(s)}

Run the code above in your browser using DataLab