This repository was archived by the owner on Feb 1, 2023. It is now read-only.
Commit 92dcaf2
Release Manager
Trac #30613: Fix clipping issue for plots with small/large extents in Three.js
Plots that are very small/large in world-space coordinates can run into
clipping issues with the default near and far clipping distances set in
the Three.js viewer.
For example, the large "cool self-intersecting surface (Eppener
surface?)" near the bottom of the documentation for [https://doc.sagemat
h.org/html/en/reference/plot3d/sage/plot/plot3d/parametric_plot3d.html
Parametric Plots] appears completely blank due to far clipping:
{{{
#!python
sage: var('u,v')
sage: f_x = u - u^3/3 + u*v^2
sage: f_y = v - v^3/3 + v*u^2
sage: f_z = u^2 - v^2
sage: parametric_plot3d([f_x, f_y, f_z], (u,-25,25), (v,-25,25),
plot_points=[50,50], frame=False, color="green")
Graphics3d Object
}}}
...and the following small plot appears empty due to near clipping:
{{{
#!python
dodecahedron().scale(1/1000)
}}}
This ticket proposes to fix this problem by scaling both the near and
far clipping distances based on the overall size of the plot in world-
space coordinates.
URL: https://trac.sagemath.org/30613
Reported by: gh-jcamp0x2a
Ticket author(s): Joshua Campbell
Reviewer(s): Eric Gourgoulhon1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
214 | 218 | | |
215 | | - | |
| 219 | + | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
220 | | - | |
| 224 | + | |
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
| |||
0 commit comments