Questions about Plot / plot3d

I have several questions about the Plot library, especially plot3d.

  1. When clicking and dragging a 3D plot, the altitude won't go below zero, so I can't view the plot from below. Setting the altitude to a negative number using plot3d-altitude works fine, however. Is there a reason for not allowing a negative altitude when dragging a plot?

  2. Is it possible to have different colored polygons using a single call to polygons3d? It looks like I need to have multiple calls if I want different colors.

  3. The line-width parameter doesn't work with polygons3d. To get a different line width, I have to use the #:line-width optional argument. For example, this works:

(plot3d (polygons3d #:line-width 5 (list (list (list 0 0 0) (list 0 1/2 0) (list 1 0 0)))))

But this doesn't:

(parameterize ([line-width 5]) (plot3d (polygons3d (list (list (list 0 0 0) (list 0 1/2 0) (list 1 0 0))))))

Is this intentional?

1 Like

The altitude is clamped to 0-90 degrees when rotating the plot with the mouse. This might be a mistake and the clamping should be -90 .. 90:

No. You can use multiple renderers, one for each color. This is the same for all other plot renderers.

The parameter which controls line width for ploygons3d is surface-line-width. There is also a surface-line-color and surface-line-style for 3d surfaces (instead of line-color and line-style). This is documented in the plot manual as the default value for #:line-width, #:line-color and #:line-style. This works as you would expect:

(parameterize ([surface-line-width 5])
   (plot3d (polygons3d (list (list (list 0 0 0) (list 0 1/2 0) (list 1 0 0))))))

Hope this helps,

1 Like

Thank you. That was very helpful. For what I am doing, allowing an altitude from -90 to 90 would be very useful.