View source: R/plot_applications.R
| vc_plot_revolution | R Documentation |
Display a solid of revolution and optional section playback
vc_plot_revolution(
result,
f,
g = NULL,
n = 81L,
nt = 61L,
colors = c(outer = "#24476b", inner = "#188367", axis = "#333333", profile = "#c44736",
section = "#dd8800"),
alpha = 0.6,
line_width = 3,
title = NULL,
show_axis = TRUE,
show_profiles = TRUE,
show_caps = TRUE,
curve_thetas = 0,
curve_opacity = 1,
sections = NULL,
animate = TRUE,
frame_ms = 600,
scene = list(aspectmode = "data", xaxis = list(title = "x"), yaxis = list(title = "y"),
zaxis = list(title = "z"))
)
result |
Result from vc_revolution(). |
f, g |
The same scalar boundary functions used in calculation; NULL g means zero. Functions are sampled, but quadrature is not recomputed. |
n |
Integer curve sample count, at least two. Known stored breaks are also sampled to show supplied crossings. |
nt |
Integer angular sample count, at least four, including both 0 and 2*pi to close circles. |
colors |
Named outer, inner, axis, profile and section Plotly/CSS colors. |
alpha |
Finite fill opacity between zero and one. |
line_width |
Positive finite curve width. |
title |
Optional scalar title; default reports the stored volume, method and quadrature tolerance diagnostic. |
show_axis, show_profiles, show_caps |
Logical switches for rotation axis, generating boundary profiles and end faces. Caps affect graphics only. |
curve_thetas |
Finite real vector of profile angles in radians. |
curve_opacity |
Finite profile opacity between zero and one. |
sections |
Optional finite vector of independent coordinates within interval for section rings/connectors. NULL draws none. |
animate |
Logical; multiple sections get playback and a slider; FALSE displays the last section, one section is static. |
frame_ms |
Positive finite frame duration in milliseconds. |
scene |
Plotly scene list for axis labels, aspect ratio, camera and display scales. Default uses geometric data proportions and linear axes. |
Coordinates reuse the same radii/height rules as the calculation. Sampled surfaces can miss features and are not a geometric proof. Curves are generating profiles; when a region straddles its axis, an interior profile need not lie on the outer boundary. Cap display does not compute cap area or change the reported volume/lateral area. Use the same f/g as the calculation; default g remains zero even for a shifted rotation axis.
Plotly 3D widget with washer outer/inner surfaces or shell upper/lower boundaries, optional end faces, generating profiles and rotation axis. Sections are rings/connectors of the stored procedure, not new integrals.
if(requireNamespace("plotly",quietly=TRUE)) {
identity |> vc_revolution(c(0,1)) |> vc_plot_revolution(f=identity,sections=c(0,.5,1))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.