plotCones3D: Plot a cone defined by a point in 3D.

View source: R/plot.R

plotCones3DR Documentation

Plot a cone defined by a point in 3D.

Description

The cones are defined as the point plus R3+.

Usage

plotCones3D(
  pts,
  drawPoint = TRUE,
  drawLines = TRUE,
  drawPolygons = TRUE,
  direction = 1,
  rectangle = FALSE,
  useRGLBBox = TRUE,
  ...
)

Arguments

pts

A matrix with a point in each row.

drawPoint

Draw the points defining the cone.

drawLines

Draw lines of the cone.

drawPolygons

Draw polygons of the cone.

direction

Ray direction. If i'th entry is positive, consider the i'th column of pts plus a value greater than on equal zero (minimize objective $i$). If negative, consider the i'th column of pts minus a value greater than on equal zero (maximize objective $i$).

rectangle

Draw the cone as a rectangle.

useRGLBBox

Use the RGL bounding box as ray limits for the cone.

...

Further arguments passed on the the RGL plotting functions. This must be done as lists (see examples). Currently the following arguments are supported:

  • argsPlot3d: A list of arguments for rgl::plot3d.

  • argsSegments3d: A list of arguments for rgl::segments3d.

  • argsPolygon3d: A list of arguments for rgl::polygon3d.

Value

Object ids (invisible).

Examples


ini3D(argsPlot3d = list(xlim = c(0,6), ylim = c(0,6), zlim = c(0,6)))
plotCones3D(c(4,4,4), drawLines = FALSE, drawPoint = TRUE,
           argsPlot3d = list(col = "red", size = 10),
           argsPolygon3d = list(alpha = 1), rectangle = TRUE)
plotCones3D(c(1,1,1), rectangle = FALSE)
plotCones3D(matrix(c(3,3,3,2,2,2), ncol = 3, byrow = TRUE))
finalize3D()

ini3D(argsPlot3d = list(xlim = c(0,6), ylim = c(0,6), zlim = c(0,6)))
plotCones3D(c(4,4,4), direction = 1)
plotCones3D(c(2,2,2), direction = -1)
plotCones3D(c(4,2,2), direction = c(1,-1,-1))
ids <- plotCones3D(c(2,2,4), direction = c(-1,-1,1))
finalize3D()
# pop3d(id = ids) # remove last cone


relund/gMOIP documentation built on Feb. 23, 2024, 12:11 p.m.