From 7fe982a7bbb1c1fb444b0543ed11a830a892d12d Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Wed, 31 Dec 2025 17:57:04 -0500 Subject: [PATCH 01/33] Handle list of exprs --- mathics/core/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mathics/core/util.py b/mathics/core/util.py index ed9fd3628..4cf650b69 100644 --- a/mathics/core/util.py +++ b/mathics/core/util.py @@ -134,7 +134,10 @@ def print_expression_tree( if file is None: file = sys.stdout - if isinstance(expr, Symbol): + if isinstance(expr, (tuple, list)): + for e in expr: + print_expression_tree(e, indent, marker, file, approximate) + elif isinstance(expr, Symbol): print(f"{indent}{marker(expr)}{expr}", file=file) elif not hasattr(expr, "elements"): if isinstance(expr, MachineReal) and approximate: From 8df6e64d5aa6c227254011c071768672aec5e1d0 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Wed, 31 Dec 2025 17:57:47 -0500 Subject: [PATCH 02/33] Allow CLI to specify yaml file on command line Helpful during development --- test/builtin/drawing/test_plot_detail.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/builtin/drawing/test_plot_detail.py b/test/builtin/drawing/test_plot_detail.py index a469798db..6701a578f 100644 --- a/test/builtin/drawing/test_plot_detail.py +++ b/test/builtin/drawing/test_plot_detail.py @@ -349,8 +349,8 @@ def yaml_tests_generator(fn: str): ] -def all_yaml_tests_generator(): - for fn in YAML_TESTS: +def all_yaml_tests_generator(fns=None): + for fn in fns or YAML_TESTS: yield from yaml_tests_generator(fn) @@ -370,14 +370,14 @@ def test_yaml(parms): one_test(**parms) -def do_test_all(): +def do_test_all(fns): # several of these tests failed on pyodide due to apparent differences # in numpy (and/or the blas library backing it) between pyodide and other platforms # including numerical instability, different data types (integer vs real) # the tests above seem so far to be ok on pyodide, but generally they are # simpler than these doc_tests if not pyodide: - for parms in all_yaml_tests_generator(): + for parms in all_yaml_tests_generator(fns): one_test(**parms) @@ -386,11 +386,12 @@ def do_test_all(): parser = argparse.ArgumentParser(description="manage plot tests") parser.add_argument("--update", action="store_true", help="update reference files") + parser.add_argument("files", nargs="*", help="yaml test files") args = parser.parse_args() UPDATE_MODE = args.update try: - do_test_all() + do_test_all(args.files) except AssertionError as oops: print(oops) print("FAIL") From 27cee4b369114822e03eb0eb6f6743a693f9e633 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Wed, 31 Dec 2025 17:58:53 -0500 Subject: [PATCH 03/33] Initial ParametricPlot3D --- mathics/builtin/drawing/plot.py | 14 ++++- mathics/builtin/drawing/plot_plot.py | 4 +- mathics/builtin/drawing/plot_plot3d.py | 53 +++++++++++++----- mathics/eval/drawing/plot3d.py | 7 +++ mathics/eval/drawing/plot3d_vectorized.py | 67 ++++++++++++++++------- 5 files changed, 108 insertions(+), 37 deletions(-) diff --git a/mathics/builtin/drawing/plot.py b/mathics/builtin/drawing/plot.py index a44ca3e05..5318d0949 100644 --- a/mathics/builtin/drawing/plot.py +++ b/mathics/builtin/drawing/plot.py @@ -22,7 +22,7 @@ from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.list import ListExpression -from mathics.core.symbols import Symbol +from mathics.core.symbols import Symbol, SymbolList from mathics.core.systemsymbols import ( SymbolAll, SymbolAutomatic, @@ -413,11 +413,21 @@ class PlotOptions: plot_points: list maxdepth: int - def __init__(self, builtin, range_exprs, options, dim, evaluation): + def __init__(self, builtin, functions, range_exprs, options, dim, evaluation): def error(*args, **kwargs): evaluation.message(builtin.get_name(), *args, **kwargs) raise ValueError() + # convert functions to list of lists of exprs + def to_list(expr): + if isinstance(expr, Expression) and expr.head is SymbolList: + return [to_list(e) for e in expr.elements] + else: + return expr + + functions = to_list(functions) + self.functions = functions if isinstance(functions, list) else [functions] + # plot ranges of the form {x,xmin,xmax} etc. (returns Symbol) self.ranges = [] for range_expr in range_exprs: diff --git a/mathics/builtin/drawing/plot_plot.py b/mathics/builtin/drawing/plot_plot.py index 0ee93d302..cf97853a3 100644 --- a/mathics/builtin/drawing/plot_plot.py +++ b/mathics/builtin/drawing/plot_plot.py @@ -74,7 +74,9 @@ def eval(self, functions, ranges, evaluation: Evaluation, options: dict): # parse options, bailing out if anything is wrong try: ranges = ranges.elements if ranges.head is SymbolSequence else [ranges] - plot_options = plot.PlotOptions(self, ranges, options, 2, evaluation) + plot_options = plot.PlotOptions( + self, functions, ranges, options, 2, evaluation + ) except ValueError: return None diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index ac4f17f65..6749ce833 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -101,22 +101,21 @@ def eval( try: dim = 3 if self.graphics_class is Graphics3D else 2 ranges = ranges.elements if ranges.head is SymbolSequence else [ranges] - plot_options = plot.PlotOptions(self, ranges, options, dim, evaluation) + plot_options = plot.PlotOptions( + self, functions, ranges, options, dim, evaluation + ) except ValueError: return None - # TODO: consult many_functions variable set by subclass and error - # if many_functions is False but multiple are supplied - if functions.has_form("List", None): - plot_options.functions = functions.elements - else: - plot_options.functions = [functions] - # supply default value if plot_options.plot_points is None: default_plot_points = (200, 200) if plot.use_vectorized_plot else (7, 7) plot_options.plot_points = default_plot_points + # supply apply_function which knows how to take the plot parameters + # and produce xs, ys, and zs + plot_options.apply_function = self.apply_function + # subclass must set eval_function and graphics_class eval_function = plot.get_plot_eval_function(self.__class__) with np.errstate(all="ignore"): # suppress numpy warnings @@ -127,11 +126,14 @@ def eval( # now we have a list of length dim # handle Automatic ~ {xmin,xmax} etc. # TODO: dowstream consumers might be happier if we used data range where applicable - for i, (pr, r) in enumerate(zip(plot_options.plot_range, plot_options.ranges)): - # TODO: this treats Automatic and Full as the same, which isn't quite right - if isinstance(pr, (str, Symbol)) and not isinstance(r[1], complex): - # extract {xmin,xmax} from {x,xmin,xmax} - plot_options.plot_range[i] = r[1:] + if not isinstance(self, ParametricPlot3D): + for i, (pr, r) in enumerate( + zip(plot_options.plot_range, plot_options.ranges) + ): + # TODO: this treats Automatic and Full as the same, which isn't quite right + if isinstance(pr, (str, Symbol)) and not isinstance(r[1], complex): + # extract {xmin,xmax} from {x,xmin,xmax} + plot_options.plot_range[i] = r[1:] # unpythonize and update PlotRange option options[str(SymbolPlotRange)] = to_mathics_list(*plot_options.plot_range) @@ -142,6 +144,10 @@ def eval( ) return graphics_expr + def apply_function(self, function, names, us, vs): + parms = {str(names[0]): us, str(names[1]): vs} + return us, vs, function(**parms) + class ComplexPlot3D(_Plot3D): """ @@ -165,6 +171,10 @@ class ComplexPlot3D(_Plot3D): many_functions = True graphics_class = Graphics3D + def apply_function(self, function, names, us, vs): + parms = {str(names[0]): us + vs * 1j} + return us, vs, function(**parms) + class ComplexPlot(_Plot3D): """ @@ -188,6 +198,10 @@ class ComplexPlot(_Plot3D): many_functions = False graphics_class = Graphics + def apply_function(self, function, names, us, vs): + parms = {str(names[0]): us + vs * 1j} + return us, vs, function(**parms) + class ContourPlot(_Plot3D): """ @@ -246,6 +260,19 @@ class DensityPlot(_Plot3D): graphics_class = Graphics +class ParametricPlot3D(_Plot3D): + summary_text = "plot a parametric surface" + expected_args = 3 + options = _Plot3D.options3d + + many_functions = True + graphics_class = Graphics3D + + def apply_function(self, functions, names, us, vs): + parms = {str(names[0]): us, str(names[1]): vs} + return [f(**parms) for f in functions] + + class Plot3D(_Plot3D): """ :WMA link: https://reference.wolfram.com/language/ref/Plot3D.html diff --git a/mathics/eval/drawing/plot3d.py b/mathics/eval/drawing/plot3d.py index 512460881..62b616a2e 100644 --- a/mathics/eval/drawing/plot3d.py +++ b/mathics/eval/drawing/plot3d.py @@ -513,3 +513,10 @@ def eval_ContourPlot( evaluation: Evaluation, ): return None + + +def eval_ParametricPlot3D( + plot_options, + evaluation: Evaluation, +): + return None diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 34b50ab1d..2a0e14bc0 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -4,6 +4,7 @@ """ import math +from typing import Sequence import numpy as np @@ -29,13 +30,13 @@ def make_plot(plot_options, evaluation: Evaluation, dim: int, is_complex: bool, # pull out plot options if not is_complex: - _, xmin, xmax = plot_options.ranges[0] - _, ymin, ymax = plot_options.ranges[1] + _, umin, umax = plot_options.ranges[0] + _, vmin, vmax = plot_options.ranges[1] else: # will generate xs and ys as for real, then combine to form complex cs _, cmin, cmax = plot_options.ranges[0] - xmin, xmax = cmin.real, cmax.real - ymin, ymax = cmin.imag, cmax.imag + umin, umax = cmin.real, cmax.real + vmin, vmax = cmin.imag, cmax.imag names = [strip_context(str(range[0])) for range in plot_options.ranges] # Mesh option @@ -44,13 +45,16 @@ def make_plot(plot_options, evaluation: Evaluation, dim: int, is_complex: bool, nmesh = 0 # compile the functions + def compile_exprs(expr_or_list: Sequence | Expression) -> Sequence: + if isinstance(expr_or_list, (list, tuple)): + return [compile_exprs(e) for e in expr_or_list] + else: + return lambdify_compile(evaluation, expr_or_list, names) + with Timer("compile"): - compiled_functions = [ - lambdify_compile(evaluation, function, names) - for function in plot_options.functions - ] + compiled_functions = compile_exprs(plot_options.functions) - def compute_over_grid(nx, ny): + def compute_over_grid(nu, nv): """ For each function, computes an (nx*ny, 3) array of coordinates (xyzs), and an (nx, ny) array of indices (inxs) into xyzs representing @@ -62,24 +66,21 @@ def compute_over_grid(nx, ny): grid used to display a mesh of lines on the surface. """ - # compute (nx, ny) grids of xs and ys for corresponding vertexes - xs = np.linspace(xmin, xmax, nx) - ys = np.linspace(ymin, ymax, ny) - xs, ys = np.meshgrid(xs, ys) + # compute (nu, nv) grids of us and vs for corresponding vertexes + us = np.linspace(umin, umax, nu) + vs = np.linspace(vmin, vmax, nv) + us, vs = np.meshgrid(us, vs) - # (nx,ny) array of numbers from 0 to n-1 that are + # (nu,nv) array of numbers from 0 to n-1 that are # indexes into xyzs array for corresponding vertex # +1 because these will be used as WL indexes, which are 1-based - inxs = np.arange(math.prod(xs.shape)).reshape(xs.shape) + 1 + inxs = np.arange(math.prod(us.shape)).reshape(us.shape) + 1 for function in compiled_functions: # compute zs from xs and ys using compiled function - with Timer("compute zs"): - if not is_complex: - zs = function(**{str(names[0]): xs, str(names[1]): ys}) - else: - cs = xs + ys * 1j # TODO: fast enough? - zs = function(**{str(names[0]): cs}) + with Timer("compute xs, ys, zs"): + # xs, ys, zs = function(**{str(names[0]): us, str(names[1]): vs}) + xs, ys, zs = plot_options.apply_function(function, names, us, vs) # sometimes expr gets compiled into something that returns a complex # even though the imaginary part is 0 @@ -87,6 +88,8 @@ def compute_over_grid(nx, ny): # TODO: needed this for Hypergeometric - look into that # assert np.all(np.isreal(zs)), "array contains complex values" if not is_complex: + xs = np.real(xs) + ys = np.real(ys) zs = np.real(zs) # if it's a constant, make it a full array @@ -95,6 +98,7 @@ def compute_over_grid(nx, ny): # (nx*ny, 3) array of points, to be indexed by quads xyzs = np.stack([xs, ys, zs]).transpose(1, 2, 0).reshape(-1, 3) + print("xxx xyzs.shape", xyzs.shape) yield xyzs, inxs @@ -307,3 +311,24 @@ def emit(graphics, i, xyzs, quads): graphics.add_complex(xyzs_re, lines=None, polys=quads, colors=rgb) return make_plot(plot_options, evaluation, dim=2, is_complex=True, emit=emit) + + +@Timer("eval_ParametricPlot3D") +def eval_ParametricPlot3D( + plot_options, + evaluation: Evaluation, +): + def emit(graphics, i, xyzs, quads): + # choose a color + color_directive = palette_color_directive(palette3, i) + graphics.add_directives(color_directive) + + # add a GraphicsComplex displaying a surface for this function + graphics.add_complex(xyzs, lines=None, polys=quads) + + # we want a list, each element of which is a list of 2 or 3 functions + # to compute the coordinates of the lines or surface + if not isinstance(plot_options.functions[0], (list, tuple)): + plot_options.functions = [plot_options.functions] + + return make_plot(plot_options, evaluation, dim=3, is_complex=False, emit=emit) From fbaa7d33d751c036bb1acb37794001d046f63822 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Wed, 31 Dec 2025 22:16:51 -0500 Subject: [PATCH 04/33] Small reorg --- mathics/builtin/drawing/plot_plot.py | 9 +++++++-- mathics/eval/drawing/plot3d_vectorized.py | 11 ++--------- mathics/eval/drawing/util.py | 9 +++++++++ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot.py b/mathics/builtin/drawing/plot_plot.py index cf97853a3..4cb462f49 100644 --- a/mathics/builtin/drawing/plot_plot.py +++ b/mathics/builtin/drawing/plot_plot.py @@ -86,10 +86,15 @@ def eval(self, functions, ranges, evaluation: Evaluation, options: dict): apply_function = self.apply_function if not plot.use_vectorized_plot: apply_function = lru_cache(apply_function) + plot_options.apply_function = apply_function - # additional options specific to this class + # TODO: PlotOptions has already regularized .functions to be a list + # (of lists) of functions, used by the _Plot3d builtins. + # But _Plot builtins still need to be reworked to use it, + # so we still use the old mechanism here. plot_options.functions = self.get_functions_param(functions) - plot_options.apply_function = apply_function + + # additional options specific to this class plot_options.use_log_scale = self.use_log_scale plot_options.expect_list = self.expect_list if plot_options.plot_points is None: diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 2a0e14bc0..9c27f8acc 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -9,7 +9,6 @@ import numpy as np from mathics.builtin.colors.color_internals import convert_color -from mathics.core.convert.lambdify import lambdify_compile from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.symbols import strip_context @@ -22,7 +21,7 @@ from mathics.timing import Timer from .colors import palette2, palette3, palette_color_directive -from .util import GraphicsGenerator +from .util import GraphicsGenerator, compile_exprs def make_plot(plot_options, evaluation: Evaluation, dim: int, is_complex: bool, emit): @@ -45,14 +44,8 @@ def make_plot(plot_options, evaluation: Evaluation, dim: int, is_complex: bool, nmesh = 0 # compile the functions - def compile_exprs(expr_or_list: Sequence | Expression) -> Sequence: - if isinstance(expr_or_list, (list, tuple)): - return [compile_exprs(e) for e in expr_or_list] - else: - return lambdify_compile(evaluation, expr_or_list, names) - with Timer("compile"): - compiled_functions = compile_exprs(plot_options.functions) + compiled_functions = compile_exprs(evaluation, plot_options.functions, names) def compute_over_grid(nu, nv): """ diff --git a/mathics/eval/drawing/util.py b/mathics/eval/drawing/util.py index d6e5c8ec4..4929843aa 100644 --- a/mathics/eval/drawing/util.py +++ b/mathics/eval/drawing/util.py @@ -5,6 +5,7 @@ from mathics.core.atoms import NumericArray from mathics.core.convert.expression import to_expression, to_mathics_list +from mathics.core.convert.lambdify import lambdify_compile from mathics.core.expression import Expression from mathics.core.list import ListExpression from mathics.core.symbols import Symbol @@ -102,3 +103,11 @@ def generate(self, options): ) return graphics_expr + + +def compile_exprs(evaluation, expr_or_list, names): + """Traverse a nested list structure and compile the functions at the leaves""" + if isinstance(expr_or_list, (list, tuple)): + return [compile_exprs(evaluation, e, names) for e in expr_or_list] + else: + return lambdify_compile(evaluation, expr_or_list, names) From b18dc6802f3fcb7dd47c4d7fe90db47117179e11 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 00:32:44 -0500 Subject: [PATCH 05/33] ParametricPlot with one independent variable making a curve --- mathics/builtin/drawing/plot_plot3d.py | 12 ++- mathics/core/systemsymbols.py | 1 + mathics/eval/drawing/plot3d_vectorized.py | 95 ++++++++++++++++++----- 3 files changed, 86 insertions(+), 22 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 6749ce833..69ba58a48 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -109,7 +109,13 @@ def eval( # supply default value if plot_options.plot_points is None: - default_plot_points = (200, 200) if plot.use_vectorized_plot else (7, 7) + if isinstance(self, ParametricPlot3D) and len(plot_options.ranges) == 1: + # ParametricPlot3D with one independent variable generating a curve + default_plot_points = (1000,) + elif plot.use_vectorized_plot: + default_plot_points = (200, 200) + else: + default_plot_points = (7, 7) plot_options.plot_points = default_plot_points # supply apply_function which knows how to take the plot parameters @@ -268,8 +274,8 @@ class ParametricPlot3D(_Plot3D): many_functions = True graphics_class = Graphics3D - def apply_function(self, functions, names, us, vs): - parms = {str(names[0]): us, str(names[1]): vs} + def apply_function(self, functions, names, *parms): + parms = {str(n): p for n, p in zip(names, parms)} return [f(**parms) for f in functions] diff --git a/mathics/core/systemsymbols.py b/mathics/core/systemsymbols.py index 258ec92ef..deafd0d95 100644 --- a/mathics/core/systemsymbols.py +++ b/mathics/core/systemsymbols.py @@ -26,6 +26,7 @@ SymbolAborted = Symbol("System`$Aborted") SymbolAbs = Symbol("System`Abs") SymbolAbsoluteTime = Symbol("AbsoluteTime") +SymbolAbsoluteThickness = Symbol("System`AbsoluteThickness") SymbolAccuracy = Symbol("System`Accuracy") SymbolAlignmentPoint = Symbol("System`AlignmentPoint") SymbolAll = Symbol("System`All") diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 9c27f8acc..414650698 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -13,18 +13,23 @@ from mathics.core.expression import Expression from mathics.core.symbols import strip_context from mathics.core.systemsymbols import ( + Symbol, + SymbolAbsoluteThickness, SymbolEqual, SymbolNone, SymbolRGBColor, SymbolSubtract, ) +from mathics.core.util import print_expression_tree # noqa from mathics.timing import Timer from .colors import palette2, palette3, palette_color_directive from .util import GraphicsGenerator, compile_exprs -def make_plot(plot_options, evaluation: Evaluation, dim: int, is_complex: bool, emit): +def make_surfaces( + plot_options, evaluation: Evaluation, dim: int, is_complex: bool, emit +): graphics = GraphicsGenerator(dim) # pull out plot options @@ -59,6 +64,9 @@ def compute_over_grid(nu, nv): grid used to display a mesh of lines on the surface. """ + # Note on naming: we use u,v to refer to the independent variable initially. + # For Plot3D etc. those will be x and y, but for ParametricPlot3D and + # and for SpericalPlot3D the xs, ys, and zs will all be computed. # compute (nu, nv) grids of us and vs for corresponding vertexes us = np.linspace(umin, umax, nu) vs = np.linspace(vmin, vmax, nv) @@ -89,10 +97,8 @@ def compute_over_grid(nu, nv): if isinstance(zs, (float, int, complex)): zs = np.full(xs.shape, zs) - # (nx*ny, 3) array of points, to be indexed by quads + # (nu*nv, 3) array of points, to be indexed by quads xyzs = np.stack([xs, ys, zs]).transpose(1, 2, 0).reshape(-1, 3) - print("xxx xyzs.shape", xyzs.shape) - yield xyzs, inxs # generate the quads and emit a GraphicsComplex containing them @@ -105,7 +111,7 @@ def compute_over_grid(nu, nv): quads = quads.T.reshape(-1, 4) # pass the xyzs and quads back to the caller to add colors and emit quads as appropriate - emit(graphics, i, xyzs, quads) + emit(graphics, i, xyzs, None, quads) # If requested by the Mesh attribute create a mesh of lines covering the surfaces # For now only for Plot3D @@ -128,6 +134,46 @@ def compute_over_grid(nu, nv): return graphics +# For ParametricPlot3D with just one independent variable we generate a curve +# TODO: consider whether we can DRY this with similar code in ParmetricPlot +def make_curvess(plot_options, evaluation: Evaluation, dim: int, emit): + graphics = GraphicsGenerator(dim) + + # pull out plot options + _, tmin, tmax = plot_options.ranges[0] + nt = plot_options.plot_points[0] + + # compile + print_expression_tree(plot_options.functions) + names = [strip_context(str(range[0])) for range in plot_options.ranges] + with Timer("compile"): + compiled_functions = compile_exprs(evaluation, plot_options.functions, names) + + # sample points and indexes for making line + ts = np.linspace(tmin, tmax, nt) + line = np.arange(nt) + 1 + + # compute curve for each function + for i, function in enumerate(compiled_functions): + # compute xs, ys, zs from ts + with Timer("compute xs, ys, zs"): + xs, ys, zs = plot_options.apply_function(function, names, ts) + + # if it's a constant, make it a full array + def full_array(a): + return np.full(ts.shape, a) if isinstance(a, (float, int, complex)) else a + + xs = full_array(xs) + ys = full_array(ys) + zs = full_array(zs) + + # stack 'em + xyzs = np.stack([xs, ys, zs]).T + emit(graphics, i, xyzs, [line], None) + + return graphics + + @Timer("density_colors") def density_colors(zs): """default color palette for DensityPlot and ContourPlot (f(x) form)""" @@ -148,7 +194,7 @@ def eval_Plot3D( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # choose a color color_directive = palette_color_directive(palette3, i) graphics.add_directives(color_directive) @@ -156,7 +202,7 @@ def emit(graphics, i, xyzs, quads): # add a GraphicsComplex displaying a surface for this function graphics.add_complex(xyzs, lines=None, polys=quads) - return make_plot(plot_options, evaluation, dim=3, is_complex=False, emit=emit) + return make_surfaces(plot_options, evaluation, dim=3, is_complex=False, emit=emit) @Timer("eval_DensityPlot") @@ -164,7 +210,7 @@ def eval_DensityPlot( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # Fixed palette for now # TODO: accept color options colors = density_colors(xyzs[:, 2]) @@ -172,7 +218,7 @@ def emit(graphics, i, xyzs, quads): # flatten the points and add the quads graphics.add_complex(xyzs[:, 0:2], lines=None, polys=quads, colors=colors) - return make_plot(plot_options, evaluation, dim=2, is_complex=False, emit=emit) + return make_surfaces(plot_options, evaluation, dim=2, is_complex=False, emit=emit) @Timer("eval_ContourPlot") @@ -195,7 +241,7 @@ def eval_ContourPlot( contour_levels = [0] background = False - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # set line color if background: # showing a background, so just black lines @@ -251,7 +297,7 @@ def emit(graphics, i, xyzs, quads): ) # plot_options.plot_points = [n * 10 for n in plot_options.plot_points] - return make_plot(plot_options, evaluation, dim=2, is_complex=False, emit=emit) + return make_surfaces(plot_options, evaluation, dim=2, is_complex=False, emit=emit) @Timer("complex colors") @@ -283,13 +329,13 @@ def eval_ComplexPlot3D( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): zs = xyzs[:, 2] rgb = complex_colors(zs, s=0.8) xyzs[:, 2] = abs(zs) graphics.add_complex(xyzs.real, lines=None, polys=quads, colors=rgb) - return make_plot(plot_options, evaluation, dim=3, is_complex=True, emit=emit) + return make_surfaces(plot_options, evaluation, dim=3, is_complex=True, emit=emit) @Timer("eval_ComplexPlot") @@ -297,13 +343,13 @@ def eval_ComplexPlot( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # flatten the points and add the quads rgb = complex_colors(xyzs[:, 2]) xyzs_re = xyzs[:, 0:2].real graphics.add_complex(xyzs_re, lines=None, polys=quads, colors=rgb) - return make_plot(plot_options, evaluation, dim=2, is_complex=True, emit=emit) + return make_surfaces(plot_options, evaluation, dim=2, is_complex=True, emit=emit) @Timer("eval_ParametricPlot3D") @@ -311,17 +357,28 @@ def eval_ParametricPlot3D( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + # ParametericPlot3D can make curves or surfaces depending on number of independent variables + is_surface = len(plot_options.ranges) > 1 + + def emit(graphics, i, xyzs, lines, polys): # choose a color - color_directive = palette_color_directive(palette3, i) + palette = palette3 if is_surface else palette2 + color_directive = palette_color_directive(palette, i) graphics.add_directives(color_directive) + if not is_surface: + graphics.add_directives([SymbolAbsoluteThickness, 4]) # add a GraphicsComplex displaying a surface for this function - graphics.add_complex(xyzs, lines=None, polys=quads) + graphics.add_complex(xyzs, lines=lines, polys=polys) # we want a list, each element of which is a list of 2 or 3 functions # to compute the coordinates of the lines or surface if not isinstance(plot_options.functions[0], (list, tuple)): plot_options.functions = [plot_options.functions] - return make_plot(plot_options, evaluation, dim=3, is_complex=False, emit=emit) + if is_surface: + return make_surfaces( + plot_options, evaluation, dim=3, is_complex=False, emit=emit + ) + else: + return make_curves(plot_options, evaluation, dim=3, emit=emit) From 6b5da3cc4877b497a3e65f13db1d82bfcc81598a Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 00:37:08 -0500 Subject: [PATCH 06/33] typo --- mathics/eval/drawing/plot3d_vectorized.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 414650698..9869a5d38 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -136,7 +136,7 @@ def compute_over_grid(nu, nv): # For ParametricPlot3D with just one independent variable we generate a curve # TODO: consider whether we can DRY this with similar code in ParmetricPlot -def make_curvess(plot_options, evaluation: Evaluation, dim: int, emit): +def make_curves(plot_options, evaluation: Evaluation, dim: int, emit): graphics = GraphicsGenerator(dim) # pull out plot options From 0a22cea0a4d2b1f4fedbc3f5c0098dd3b2e83598 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 01:01:15 -0500 Subject: [PATCH 07/33] Tests --- test/builtin/drawing/test_plot_detail.py | 2 +- .../vec-parametricplot3d-multi-vec.txt | 455 ++++++++++++++++++ .../vec-parametricplot3d-rings-vec.txt | 366 ++++++++++++++ ...c-parametricplot3d-torus-plotrange-vec.txt | 253 ++++++++++ .../vec-parametricplot3d-torus-vec.txt | 250 ++++++++++ .../vec-parametricplot3d-trefoil-vec.txt | 277 +++++++++++ test/builtin/drawing/vec_tests.yaml | 42 ++ 7 files changed, 1644 insertions(+), 1 deletion(-) create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt diff --git a/test/builtin/drawing/test_plot_detail.py b/test/builtin/drawing/test_plot_detail.py index 6701a578f..416f60fc8 100644 --- a/test/builtin/drawing/test_plot_detail.py +++ b/test/builtin/drawing/test_plot_detail.py @@ -343,8 +343,8 @@ def yaml_tests_generator(fn: str): YAML_TESTS = [ - "doc_tests.yaml", "vec_tests.yaml", + "doc_tests.yaml", "parameters.yaml", ] diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt new file mode 100644 index 000000000..2c3732d7a --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt @@ -0,0 +1,455 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 0.392157 + System`Real 0.560784 + System`Real 1.0 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 -1.00000000e+00 -0.00000000e+00] + [ 3.14466690e-02 -9.99861551e-01 -1.88673048e-02] + [ 6.28891086e-02 -9.99446227e-01 -3.77278927e-02] + ... + [-6.28891086e-02 -9.99446227e-01 3.77278927e-02] + [-3.14466690e-02 -9.99861551e-01 1.88673048e-02] + [-1.22464680e-15 -1.00000000e+00 7.34788079e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 2.00000000e+00 0.00000000e+00] + [ 1.25788666e-02 1.99996044e+00 2.48933554e-01] + [ 2.51572357e-02 1.99984177e+00 4.82194534e-01] + ... + [-2.51572357e-02 1.99984177e+00 -4.82194534e-01] + [-1.25788666e-02 1.99996044e+00 -2.48933554e-01] + [-4.89858720e-16 2.00000000e+00 -9.79717439e-15]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`RGBColor + System`Real 0.196078 + System`Real 0.588235 + System`Real 0.54902 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 2.00000000e+00 0.00000000e+00] + [ 1.25788666e-02 1.99996044e+00 0.00000000e+00] + [ 2.51572357e-02 1.99984177e+00 0.00000000e+00] + ... + [-2.51572357e-02 1.99984177e+00 0.00000000e+00] + [-1.25788666e-02 1.99996044e+00 0.00000000e+00] + [-4.89858720e-16 2.00000000e+00 0.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt new file mode 100644 index 000000000..9c479dd67 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt @@ -0,0 +1,366 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 6.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 5.99700953e+00 1.89411299e-01 0.00000000e+00] + [ 5.98804112e+00 3.78633788e-01 0.00000000e+00] + ... + [ 5.98804112e+00 -3.78633788e-01 -2.44929360e-16] + [ 5.99700953e+00 -1.89411299e-01 -2.44929360e-16] + [ 6.00000000e+00 -1.46957616e-15 -2.44929360e-16]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Real 0.392157 + System`Real 0.560784 + System`Real 1.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 6.00000000e+00] + [ 1.89411299e-01 0.00000000e+00 5.99700953e+00] + [ 3.78633788e-01 0.00000000e+00 5.98804112e+00] + ... + [-3.78633788e-01 -2.44929360e-16 5.98804112e+00] + [-1.89411299e-01 -2.44929360e-16 5.99700953e+00] + [-1.46957616e-15 -2.44929360e-16 6.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Real 0.862745 + System`Real 0.14902 + System`Real 0.498039 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 6.00000000e+00 0.00000000e+00] + [ 0.00000000e+00 5.99700953e+00 1.89411299e-01] + [ 0.00000000e+00 5.98804112e+00 3.78633788e-01] + ... + [-2.44929360e-16 5.98804112e+00 -3.78633788e-01] + [-2.44929360e-16 5.99700953e+00 -1.89411299e-01] + [-2.44929360e-16 6.00000000e+00 -1.46957616e-15]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 6.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 5.99700953e+00 1.89411299e-01 0.00000000e+00] + [ 5.98804112e+00 3.78633788e-01 0.00000000e+00] + ... + [ 5.98804112e+00 -3.78633788e-01 -2.44929360e-16] + [ 5.99700953e+00 -1.89411299e-01 -2.44929360e-16] + [ 6.00000000e+00 -1.46957616e-15 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 6.00000000e+00] + [ 1.89411299e-01 0.00000000e+00 5.99700953e+00] + [ 3.78633788e-01 0.00000000e+00 5.98804112e+00] + ... + [-3.78633788e-01 -2.44929360e-16 5.98804112e+00] + [-1.89411299e-01 -2.44929360e-16 5.99700953e+00] + [-1.46957616e-15 -2.44929360e-16 6.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 6.00000000e+00 0.00000000e+00] + [ 0.00000000e+00 5.99700953e+00 1.89411299e-01] + [ 0.00000000e+00 5.98804112e+00 3.78633788e-01] + ... + [-2.44929360e-16 5.98804112e+00 -3.78633788e-01] + [-2.44929360e-16 5.99700953e+00 -1.89411299e-01] + [-2.44929360e-16 6.00000000e+00 -1.46957616e-15]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 6.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 5.67490345e+00 1.94819682e+00 0.00000000e+00] + [ 4.73484306e+00 3.68527628e+00 0.00000000e+00] + ... + [ 4.73484306e+00 -3.68527628e+00 -2.44929360e-16] + [ 5.67490345e+00 -1.94819682e+00 -2.44929360e-16] + [ 6.00000000e+00 -1.46957616e-15 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 6.00000000e+00] + [ 1.94819682e+00 0.00000000e+00 5.67490345e+00] + [ 3.68527628e+00 0.00000000e+00 4.73484306e+00] + ... + [-3.68527628e+00 -2.44929360e-16 4.73484306e+00] + [-1.94819682e+00 -2.44929360e-16 5.67490345e+00] + [-1.46957616e-15 -2.44929360e-16 6.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 6.00000000e+00 0.00000000e+00] + [ 0.00000000e+00 5.67490345e+00 1.94819682e+00] + [ 0.00000000e+00 4.73484306e+00 3.68527628e+00] + ... + [-2.44929360e-16 4.73484306e+00 -3.68527628e+00] + [-2.44929360e-16 5.67490345e+00 -1.94819682e+00] + [-2.44929360e-16 6.00000000e+00 -1.46957616e-15]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Integer 1 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt new file mode 100644 index 000000000..d6ac1342b --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt @@ -0,0 +1,253 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.83745173e+00 9.74098408e-01 0.00000000e+00] + [ 2.36742153e+00 1.84263814e+00 0.00000000e+00] + ... + [ 2.36742153e+00 -1.84263814e+00 -2.44929360e-16] + [ 2.83745173e+00 -9.74098408e-01 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`List + System`Real 0.0 + System`Real 3.0 + System`List + System`Real 0.0 + System`Real 3.0 + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt new file mode 100644 index 000000000..29229bb83 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt @@ -0,0 +1,250 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.83745173e+00 9.74098408e-01 0.00000000e+00] + [ 2.36742153e+00 1.84263814e+00 0.00000000e+00] + ... + [ 2.36742153e+00 -1.84263814e+00 -2.44929360e-16] + [ 2.83745173e+00 -9.74098408e-01 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt new file mode 100644 index 000000000..30f8deed9 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt @@ -0,0 +1,277 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 0.392157 + System`Real 0.560784 + System`Real 1.0 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 -1.00000000e+00 -0.00000000e+00] + [ 3.14466690e-02 -9.99861551e-01 -1.88673048e-02] + [ 6.28891086e-02 -9.99446227e-01 -3.77278927e-02] + ... + [-6.28891086e-02 -9.99446227e-01 3.77278927e-02] + [-3.14466690e-02 -9.99861551e-01 1.88673048e-02] + [-1.22464680e-15 -1.00000000e+00 7.34788079e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/vec_tests.yaml b/test/builtin/drawing/vec_tests.yaml index 976423075..daeda4138 100644 --- a/test/builtin/drawing/vec_tests.yaml +++ b/test/builtin/drawing/vec_tests.yaml @@ -65,6 +65,48 @@ vec-parametricplot-zeta-sideways: ] ' # +# ParametricPlot3D +# +vec-parametricplot3d-trefoil: + expr: ParametricPlot3D[{Sin[t] + 2 Sin[2 t], Cos[t] - 2 Cos[2 t], -Sin[3 t]}, {t, 0, 2 Pi}] +vec-parametricplot3d-multi: + expr: ' + ParametricPlot3D[ + {{Sin[t] + 2 Sin[2 t], Cos[t] - 2 Cos[2 t], -Sin[3 t]}, + {2 Sin[t], 2 Cos[t], Sin[40 t]}, + {2 Sin[t], 2 Cos[t], 0}}, + {t, 0, 2 Pi} + ] + ' +vec-parametricplot3d-torus: + expr: ' + ParametricPlot3D[ + {(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, + {u, 0, 2 Pi}, {v, 0, 2 Pi} + ] + ' +vec-parametricplot3d-torus-plotrange: + expr: ' + ParametricPlot3D[ + {(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, + {u, 0, 2 Pi}, {v, 0, 2 Pi}, + PlotRange -> {{0,3},{0,3}} + ] + ' +vec-parametricplot3d-rings: + expr: ' + Module[{R, r, x, y, z}, + R=5; r=1; + x = (R + r Cos[v]) Cos[u]; + y = (R + r Cos[v]) Sin[u]; + z = r Sin[v]; + ParametricPlot3D[ + {{x, y, z}, {y, z, x}, {z, x, y}}, + {u, 0, 2 Pi}, {v, 0, 2 Pi}, BoxRatios->{1,1,1} + ] + ] + ' +# # Plot # vec-plot-exclusions: From a8fd5e7d812b5462f74c2ee81c82266b386aaa8d Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 08:34:05 -0500 Subject: [PATCH 08/33] Formatting --- mathics/eval/drawing/plot3d_vectorized.py | 2 -- mathics/eval/drawing/util.py | 4 ---- 2 files changed, 6 deletions(-) diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 9869a5d38..f48998eb0 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -4,7 +4,6 @@ """ import math -from typing import Sequence import numpy as np @@ -13,7 +12,6 @@ from mathics.core.expression import Expression from mathics.core.symbols import strip_context from mathics.core.systemsymbols import ( - Symbol, SymbolAbsoluteThickness, SymbolEqual, SymbolNone, diff --git a/mathics/eval/drawing/util.py b/mathics/eval/drawing/util.py index 4929843aa..10850f9cf 100644 --- a/mathics/eval/drawing/util.py +++ b/mathics/eval/drawing/util.py @@ -2,7 +2,6 @@ Common utilities for plotting """ - from mathics.core.atoms import NumericArray from mathics.core.convert.expression import to_expression, to_mathics_list from mathics.core.convert.lambdify import lambdify_compile @@ -21,10 +20,7 @@ ) -# TODO: this will be extended with support for GraphicsComplex in a -# subsequent PR, which may involve a little more refactoring class GraphicsGenerator: - """ Support for generating Graphics and Graphics3D expressions """ From 118e8a81ee277f8c703fd6d16e67cead7e0e02ce Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 08:48:54 -0500 Subject: [PATCH 09/33] Description --- mathics/builtin/drawing/plot_plot3d.py | 17 ++++++++++++++++- mathics/eval/drawing/util.py | 7 ++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 69ba58a48..a5f9236f6 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -267,7 +267,22 @@ class DensityPlot(_Plot3D): class ParametricPlot3D(_Plot3D): - summary_text = "plot a parametric surface" + """ + :WMA link: https://reference.wolfram.com/language/ref/ParametricPlot3D.html +
+
'ParametricPlot3D'[${x(u,v), y(u,v), z(u,v)}$, {$u$, $u_{min}$, $u_{max}$}, {$v$, $v_{min}$, $v_{max}$}] +
creates a three-dimensional surface using the functions $x$, $y$, $z$ over the specified ranges for parameters $u$ and $v$. + +
'ParametricPlot3D'[${x(u), y(u), z(u)}$, {$u$, $u_{min}$, $u_{max}$}] +
creates a three-dimensional space curve using the functions $x$, $y$, $z$ over the specified range for parameter $u$. + + See :Drawing Option and Option Values: + /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values + for a list of Plot options. +
+ """ + + summary_text = "plot a parametric surface or curve in three dimensions" expected_args = 3 options = _Plot3D.options3d diff --git a/mathics/eval/drawing/util.py b/mathics/eval/drawing/util.py index 10850f9cf..8645b6bf3 100644 --- a/mathics/eval/drawing/util.py +++ b/mathics/eval/drawing/util.py @@ -2,9 +2,12 @@ Common utilities for plotting """ +from typing import Sequence, String + from mathics.core.atoms import NumericArray from mathics.core.convert.expression import to_expression, to_mathics_list from mathics.core.convert.lambdify import lambdify_compile +from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.list import ListExpression from mathics.core.symbols import Symbol @@ -101,7 +104,9 @@ def generate(self, options): return graphics_expr -def compile_exprs(evaluation, expr_or_list, names): +def compile_exprs( + evaluation: Evaluation, expr_or_list: Expression | Sequence, names: Sequence[String] +): """Traverse a nested list structure and compile the functions at the leaves""" if isinstance(expr_or_list, (list, tuple)): return [compile_exprs(evaluation, e, names) for e in expr_or_list] From ed03fcdaf05b23f95eebea8a37c128492fa03bbf Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 10:08:29 -0500 Subject: [PATCH 10/33] Formatting --- mathics/eval/drawing/plot3d_vectorized.py | 2 -- mathics/eval/drawing/util.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index f48998eb0..99ab3d59b 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -18,7 +18,6 @@ SymbolRGBColor, SymbolSubtract, ) -from mathics.core.util import print_expression_tree # noqa from mathics.timing import Timer from .colors import palette2, palette3, palette_color_directive @@ -142,7 +141,6 @@ def make_curves(plot_options, evaluation: Evaluation, dim: int, emit): nt = plot_options.plot_points[0] # compile - print_expression_tree(plot_options.functions) names = [strip_context(str(range[0])) for range in plot_options.ranges] with Timer("compile"): compiled_functions = compile_exprs(evaluation, plot_options.functions, names) diff --git a/mathics/eval/drawing/util.py b/mathics/eval/drawing/util.py index 8645b6bf3..0276d3e8b 100644 --- a/mathics/eval/drawing/util.py +++ b/mathics/eval/drawing/util.py @@ -2,7 +2,7 @@ Common utilities for plotting """ -from typing import Sequence, String +from typing import Sequence from mathics.core.atoms import NumericArray from mathics.core.convert.expression import to_expression, to_mathics_list @@ -105,7 +105,7 @@ def generate(self, options): def compile_exprs( - evaluation: Evaluation, expr_or_list: Expression | Sequence, names: Sequence[String] + evaluation: Evaluation, expr_or_list: Expression | Sequence, names: Sequence[str] ): """Traverse a nested list structure and compile the functions at the leaves""" if isinstance(expr_or_list, (list, tuple)): From 96a5e36d6d5180befe7a9d694cbbba772666b80c Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 12:35:25 -0500 Subject: [PATCH 11/33] Add Moebius strip test --- mathics/builtin/drawing/plot.py | 11 +- mathics/eval/drawing/plot3d_vectorized.py | 17 +- .../vec-parametricplot-moebius-vec.txt | 318 ++++++++++++++++++ test/builtin/drawing/vec_tests.yaml | 10 + 4 files changed, 346 insertions(+), 10 deletions(-) create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt diff --git a/mathics/builtin/drawing/plot.py b/mathics/builtin/drawing/plot.py index 5318d0949..5262c0e8a 100644 --- a/mathics/builtin/drawing/plot.py +++ b/mathics/builtin/drawing/plot.py @@ -481,11 +481,14 @@ def to_list(expr): self.exclusions = exclusions # Mesh option (returns Symbol) - mesh = builtin.get_option(options, "Mesh", evaluation) - if mesh not in (SymbolNone, SymbolFull, SymbolAll): + mesh = builtin.get_option(options, "Mesh", evaluation).to_python(preserve_symbols=True) + if isinstance(mesh, (list, tuple)) and all(isinstance(m, int) for m in mesh): + self.mesh = mesh + elif mesh not in (SymbolNone, SymbolFull, SymbolAll): evaluation.message("Mesh", "ilevels", mesh) - mesh = SymbolFull - self.mesh = mesh + self.mesh = SymbolFull + else: + self.mesh = mesh # PlotPoints option (returns Symbol) plot_points_option = builtin.get_option(options, "PlotPoints", evaluation) diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 99ab3d59b..8f24526f5 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -41,9 +41,14 @@ def make_surfaces( names = [strip_context(str(range[0])) for range in plot_options.ranges] # Mesh option - nmesh = 20 - if plot_options.mesh is SymbolNone: - nmesh = 0 + mesh = plot_options.mesh + nmeshx = nmeshy = 20 + if mesh is SymbolNone: + nmeshx = nmeshy = 0 + elif isinstance(plot_options.mesh, int): + nmeshx = nmeshy = plot_options.mesh + elif isinstance(mesh, (list, tuple)) and all(isinstance(m, int) for m in mesh): + nmeshx, nmeshy = mesh # compile the functions with Timer("compile"): @@ -113,7 +118,7 @@ def compute_over_grid(nu, nv): # If requested by the Mesh attribute create a mesh of lines covering the surfaces # For now only for Plot3D # TODO: mesh for DensityPlot? - if nmesh and dim == 3: + if nmeshx and nmeshy and dim == 3: # meshes are black for now graphics.add_directives([SymbolRGBColor, 0, 0, 0]) @@ -123,9 +128,9 @@ def compute_over_grid(nu, nv): # from one row or one column of the inxs array. # Each mesh line has high res (nx or ny) so it follows # the contours of the surface. - for xyzs, inxs in compute_over_grid(nx, nmesh): + for xyzs, inxs in compute_over_grid(nx, nmeshy): graphics.add_complex(xyzs.real, lines=inxs, polys=None) - for xyzs, inxs in compute_over_grid(nmesh, ny): + for xyzs, inxs in compute_over_grid(nmeshx, ny): graphics.add_complex(xyzs.real, lines=inxs.T, polys=None) return graphics diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt new file mode 100644 index 000000000..3422baf35 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt @@ -0,0 +1,318 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] + [ 4.99813069e-01 1.57862418e-02 -7.89312101e-03] + [ 4.99252135e-01 3.15685419e-02 -1.57842749e-02] + ... + [ 4.99252135e-01 -3.15685419e-02 1.57842749e-02] + [ 4.99813069e-01 -1.57862418e-02 7.89312101e-03] + [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] + [ 4.99813069e-01 1.57862418e-02 -7.89312101e-03] + [ 4.99252135e-01 3.15685419e-02 -1.57842749e-02] + ... + [ 4.99252135e-01 -3.15685419e-02 1.57842749e-02] + [ 4.99813069e-01 -1.57862418e-02 7.89312101e-03] + [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] + System`Line + System`NumericArray NumericArray[Integer*, 5×200] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200] + [ 201 202 203 204 205 206 207 208 209 210 211 212 213 214 + 215 216 217 218 219 220 221 222 223 224 225 226 227 228 + 229 230 231 232 233 234 235 236 237 238 239 240 241 242 + 243 244 245 246 247 248 249 250 251 252 253 254 255 256 + 257 258 259 260 261 262 263 264 265 266 267 268 269 270 + 271 272 273 274 275 276 277 278 279 280 281 282 283 284 + 285 286 287 288 289 290 291 292 293 294 295 296 297 298 + 299 300 301 302 303 304 305 306 307 308 309 310 311 312 + 313 314 315 316 317 318 319 320 321 322 323 324 325 326 + 327 328 329 330 331 332 333 334 335 336 337 338 339 340 + 341 342 343 344 345 346 347 348 349 350 351 352 353 354 + 355 356 357 358 359 360 361 362 363 364 365 366 367 368 + 369 370 371 372 373 374 375 376 377 378 379 380 381 382 + 383 384 385 386 387 388 389 390 391 392 393 394 395 396 + 397 398 399 400] + [ 401 402 403 404 405 406 407 408 409 410 411 412 413 414 + 415 416 417 418 419 420 421 422 423 424 425 426 427 428 + 429 430 431 432 433 434 435 436 437 438 439 440 441 442 + 443 444 445 446 447 448 449 450 451 452 453 454 455 456 + 457 458 459 460 461 462 463 464 465 466 467 468 469 470 + 471 472 473 474 475 476 477 478 479 480 481 482 483 484 + 485 486 487 488 489 490 491 492 493 494 495 496 497 498 + 499 500 501 502 503 504 505 506 507 508 509 510 511 512 + 513 514 515 516 517 518 519 520 521 522 523 524 525 526 + 527 528 529 530 531 532 533 534 535 536 537 538 539 540 + 541 542 543 544 545 546 547 548 549 550 551 552 553 554 + 555 556 557 558 559 560 561 562 563 564 565 566 567 568 + 569 570 571 572 573 574 575 576 577 578 579 580 581 582 + 583 584 585 586 587 588 589 590 591 592 593 594 595 596 + 597 598 599 600] + [ 601 602 603 604 605 606 607 608 609 610 611 612 613 614 + 615 616 617 618 619 620 621 622 623 624 625 626 627 628 + 629 630 631 632 633 634 635 636 637 638 639 640 641 642 + 643 644 645 646 647 648 649 650 651 652 653 654 655 656 + 657 658 659 660 661 662 663 664 665 666 667 668 669 670 + 671 672 673 674 675 676 677 678 679 680 681 682 683 684 + 685 686 687 688 689 690 691 692 693 694 695 696 697 698 + 699 700 701 702 703 704 705 706 707 708 709 710 711 712 + 713 714 715 716 717 718 719 720 721 722 723 724 725 726 + 727 728 729 730 731 732 733 734 735 736 737 738 739 740 + 741 742 743 744 745 746 747 748 749 750 751 752 753 754 + 755 756 757 758 759 760 761 762 763 764 765 766 767 768 + 769 770 771 772 773 774 775 776 777 778 779 780 781 782 + 783 784 785 786 787 788 789 790 791 792 793 794 795 796 + 797 798 799 800] + [ 801 802 803 804 805 806 807 808 809 810 811 812 813 814 + 815 816 817 818 819 820 821 822 823 824 825 826 827 828 + 829 830 831 832 833 834 835 836 837 838 839 840 841 842 + 843 844 845 846 847 848 849 850 851 852 853 854 855 856 + 857 858 859 860 861 862 863 864 865 866 867 868 869 870 + 871 872 873 874 875 876 877 878 879 880 881 882 883 884 + 885 886 887 888 889 890 891 892 893 894 895 896 897 898 + 899 900 901 902 903 904 905 906 907 908 909 910 911 912 + 913 914 915 916 917 918 919 920 921 922 923 924 925 926 + 927 928 929 930 931 932 933 934 935 936 937 938 939 940 + 941 942 943 944 945 946 947 948 949 950 951 952 953 954 + 955 956 957 958 959 960 961 962 963 964 965 966 967 968 + 969 970 971 972 973 974 975 976 977 978 979 980 981 982 + 983 984 985 986 987 988 989 990 991 992 993 994 995 996 + 997 998 999 1000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 3000×3] + [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] + [ 4.61779019e-01 2.22381055e-01 -1.11260467e-01] + [ 3.42617351e-01 4.29628570e-01 -2.16941870e-01] + ... + [ 3.42617351e-01 -4.29628570e-01 2.16941870e-01] + [ 4.61779019e-01 -2.22381055e-01 1.11260467e-01] + [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] + System`Line + System`NumericArray NumericArray[Integer*, 15×200] + [[ 1 16 31 ... 2956 2971 2986] + [ 2 17 32 ... 2957 2972 2987] + [ 3 18 33 ... 2958 2973 2988] + ... + [ 13 28 43 ... 2968 2983 2998] + [ 14 29 44 ... 2969 2984 2999] + [ 15 30 45 ... 2970 2985 3000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/vec_tests.yaml b/test/builtin/drawing/vec_tests.yaml index daeda4138..035c0c801 100644 --- a/test/builtin/drawing/vec_tests.yaml +++ b/test/builtin/drawing/vec_tests.yaml @@ -106,6 +106,16 @@ vec-parametricplot3d-rings: ] ] ' +vec-parametricplot-moebius: + expr: ' + ParametricPlot3D[ + {(1 + (v/2) Cos[u/2]) Cos[u], + (1 + (v/2) Cos[u/2]) Sin[u], + (v/2) Sin[u/2]}, + {u, 0, 2 Pi}, {v, -1, 1}, + Mesh -> {15, 5} + ] + ' # # Plot # From a0c6fd273de66a65cd1d0d958b415ef1cfcb0acb Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Thu, 1 Jan 2026 12:35:59 -0500 Subject: [PATCH 12/33] Formatting --- mathics/builtin/drawing/plot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot.py b/mathics/builtin/drawing/plot.py index 5262c0e8a..2958f6353 100644 --- a/mathics/builtin/drawing/plot.py +++ b/mathics/builtin/drawing/plot.py @@ -481,7 +481,9 @@ def to_list(expr): self.exclusions = exclusions # Mesh option (returns Symbol) - mesh = builtin.get_option(options, "Mesh", evaluation).to_python(preserve_symbols=True) + mesh = builtin.get_option(options, "Mesh", evaluation).to_python( + preserve_symbols=True + ) if isinstance(mesh, (list, tuple)) and all(isinstance(m, int) for m in mesh): self.mesh = mesh elif mesh not in (SymbolNone, SymbolFull, SymbolAll): From 5d0c69e16490d3dd3a30f42189767bcb6bad2214 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Fri, 2 Jan 2026 00:08:20 -0500 Subject: [PATCH 13/33] Implement SphericalPlot3D --- mathics/builtin/drawing/plot.py | 9 ++--- mathics/builtin/drawing/plot_plot3d.py | 43 +++++++++++++++++++++-- mathics/eval/drawing/plot3d.py | 7 ++++ mathics/eval/drawing/plot3d_vectorized.py | 11 ++++++ 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/mathics/builtin/drawing/plot.py b/mathics/builtin/drawing/plot.py index 2958f6353..6b41082b2 100644 --- a/mathics/builtin/drawing/plot.py +++ b/mathics/builtin/drawing/plot.py @@ -430,7 +430,10 @@ def to_list(expr): # plot ranges of the form {x,xmin,xmax} etc. (returns Symbol) self.ranges = [] - for range_expr in range_exprs: + for i, range_expr in enumerate(range_exprs): + if isinstance(range_expr, Symbol) and hasattr(builtin, "default_ranges"): + self.ranges.append([range_expr, *builtin.default_ranges[i]]) + continue if not range_expr.has_form("List", 3): error("invrange", range_expr) if not isinstance(range_expr.elements[0], Symbol): @@ -495,9 +498,7 @@ def to_list(expr): # PlotPoints option (returns Symbol) plot_points_option = builtin.get_option(options, "PlotPoints", evaluation) pp = plot_points_option.to_python(preserve_symbols=True) - npp = len(self.ranges) - if builtin.get_name() in ("System`ComplexPlot3D", "System`ComplexPlot"): - npp = 2 + npp = builtin.num_plot_points if hasattr(builtin, "num_plot_points") else len(self.ranges) if pp == SymbolNone: pp = None else: diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index a5f9236f6..2689cfe84 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -37,6 +37,7 @@ class _Plot3D(Builtin): # Check for correct number of args eval_error = Builtin.generic_argument_error expected_args = 3 + is_cartesian = True messages = { "invmaxrec": ( @@ -107,7 +108,7 @@ def eval( except ValueError: return None - # supply default value + # supply default value for PlotPoints if plot_options.plot_points is None: if isinstance(self, ParametricPlot3D) and len(plot_options.ranges) == 1: # ParametricPlot3D with one independent variable generating a curve @@ -130,9 +131,9 @@ def eval( return # now we have a list of length dim - # handle Automatic ~ {xmin,xmax} etc. + # handle Automatic ~ {xmin,xmax} etc., but only if is_cartesion: the independent variables are x and y # TODO: dowstream consumers might be happier if we used data range where applicable - if not isinstance(self, ParametricPlot3D): + if self.is_cartesian: for i, (pr, r) in enumerate( zip(plot_options.plot_range, plot_options.ranges) ): @@ -175,6 +176,7 @@ class ComplexPlot3D(_Plot3D): options = _Plot3D.options3d | {"Mesh": "None"} many_functions = True + num_plot_points = 2 # different from number of ranges graphics_class = Graphics3D def apply_function(self, function, names, us, vs): @@ -202,6 +204,7 @@ class ComplexPlot(_Plot3D): options = _Plot3D.options2d many_functions = False + num_plot_points = 2 # different from number of ranges graphics_class = Graphics def apply_function(self, function, names, us, vs): @@ -286,6 +289,7 @@ class ParametricPlot3D(_Plot3D): expected_args = 3 options = _Plot3D.options3d + is_cartesian = False many_functions = True graphics_class = Graphics3D @@ -329,3 +333,36 @@ class Plot3D(_Plot3D): many_functions = True graphics_class = Graphics3D + + +class SphericalPlot3D(_Plot3D): + """ + :WMA link: https://reference.wolfram.com/language/ref/SphericalPlot3D.html +
+
'ParametricPlot3D'[$r(θ, φ)$, {$θ$, $θ_{min}$, $θ_{max}$}, {$φ$, $φ_{min}$, $φ_{max}$}] +
creates a three-dimensional surface at radius $r(θ, φ) for spherical angles θ and φ over the specified ranges + +
'ParametricPlot3D'[$r(θ, φ)$, $θ$, $φ$] +
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles θ and φ + in the ranges 0 < θ < π and 0 < φ < 2π covering the entire sphere + + See :Drawing Option and Option Values: + /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values + for a list of Plot options. +
+ """ + + summary_text = "produce a surface plot functions spherical angles θ and φ" + expected_args = 3 + options = _Plot3D.options3d | {"BoxRatios": "{1,1,1}"} + + is_cartesian = False + many_functions = True + graphics_class = Graphics3D + default_ranges = [[0, np.pi], [0, 2 * np.pi]] + + def apply_function(self, function, names, θ, φ): + parms = {names[0]: θ, names[1]: φ} + r = function(**parms) + x, y, z = r * np.sin(θ) * np.cos(φ), r * np.sin(θ) * np.sin(φ), r * np.cos(θ) + return x, y, z diff --git a/mathics/eval/drawing/plot3d.py b/mathics/eval/drawing/plot3d.py index 62b616a2e..c603902bc 100644 --- a/mathics/eval/drawing/plot3d.py +++ b/mathics/eval/drawing/plot3d.py @@ -520,3 +520,10 @@ def eval_ParametricPlot3D( evaluation: Evaluation, ): return None + + +def eval_SphericalPlot3D( + plot_options, + evaluation: Evaluation, +): + return None diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 8f24526f5..0074eb7dd 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -383,3 +383,14 @@ def emit(graphics, i, xyzs, lines, polys): ) else: return make_curves(plot_options, evaluation, dim=3, emit=emit) + + +@Timer("eval_SphericalPlot3D") +def eval_SphericalPlot3D( + plot_options, + evaluation: Evaluation, +): + # At this point it's just like Plot3D - the apply_function that has been passed + # in plot_options will converts spherical coordinates to cartesian coordinates + # after evaluating the function(s) to get r + return eval_Plot3D(plot_options, evaluation) From 9456f2fb154a8f1dab60043af67413f5a75453eb Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Fri, 2 Jan 2026 00:09:38 -0500 Subject: [PATCH 14/33] Formatting --- mathics/builtin/drawing/plot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot.py b/mathics/builtin/drawing/plot.py index 6b41082b2..4f70138dc 100644 --- a/mathics/builtin/drawing/plot.py +++ b/mathics/builtin/drawing/plot.py @@ -498,7 +498,11 @@ def to_list(expr): # PlotPoints option (returns Symbol) plot_points_option = builtin.get_option(options, "PlotPoints", evaluation) pp = plot_points_option.to_python(preserve_symbols=True) - npp = builtin.num_plot_points if hasattr(builtin, "num_plot_points") else len(self.ranges) + npp = ( + builtin.num_plot_points + if hasattr(builtin, "num_plot_points") + else len(self.ranges) + ) if pp == SymbolNone: pp = None else: From 72eb8d581a81af3624ed033696098a6ee84e71fb Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Fri, 2 Jan 2026 00:13:49 -0500 Subject: [PATCH 15/33] Tests --- .../vec-sphericalplot3d-harmonics-vec.txt | 250 ++++++++++++ .../vec-sphericalplot3d-onion-vec.txt | 252 ++++++++++++ .../vec-sphericalplot3d-orbital-vec.txt | 250 ++++++++++++ .../vec-sphericalplot3d-shells-vec.txt | 366 ++++++++++++++++++ .../vec-sphericalplot3d-spiral-vec.txt | 210 ++++++++++ test/builtin/drawing/vec_tests.yaml | 13 + 6 files changed, 1341 insertions(+) create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-harmonics-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-onion-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-orbital-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-shells-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-spiral-vec.txt diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-harmonics-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-harmonics-vec.txt new file mode 100644 index 000000000..bd2c4736a --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-harmonics-vec.txt @@ -0,0 +1,250 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 1.00000000e+00] + [ 1.57862565e-02 0.00000000e+00 9.99876309e-01] + [ 3.15690122e-02 0.00000000e+00 9.99516232e-01] + ... + [ 3.15690122e-02 -7.73217796e-18 -9.99516232e-01] + [ 1.57862565e-02 -3.86651770e-18 -9.99876309e-01] + [ 1.22464680e-16 -2.99951957e-32 -1.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 1.00000000e+00] + [ 1.57862565e-02 0.00000000e+00 9.99876309e-01] + [ 3.15690122e-02 0.00000000e+00 9.99516232e-01] + ... + [ 3.15690122e-02 -7.73217796e-18 -9.99516232e-01] + [ 1.57862565e-02 -3.86651770e-18 -9.99876309e-01] + [ 1.22464680e-16 -2.99951957e-32 -1.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 1.00000000e+00] + [ 1.66174628e-01 0.00000000e+00 9.95829949e-01] + [ 3.56414758e-01 0.00000000e+00 1.03820072e+00] + ... + [ 3.56414758e-01 -8.72964386e-17 -1.03820072e+00] + [ 1.66174628e-01 -4.07010452e-17 -9.95829949e-01] + [ 1.22464680e-16 -2.99951957e-32 -1.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Integer 1 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-onion-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-onion-vec.txt new file mode 100644 index 000000000..6903fb963 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-onion-vec.txt @@ -0,0 +1,252 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 1.00000000e+00 0.00000000e+00 6.12323400e-17] + [ 9.99968847e-01 0.00000000e+00 -7.89336691e-03] + [ 9.99875390e-01 0.00000000e+00 -1.57862420e-02] + ... + [ 1.57862420e-02 -3.86651415e-18 -9.99875390e-01] + [ 7.89336691e-03 -1.93331730e-18 -9.99968847e-01] + [ 1.22464680e-16 -2.99951957e-32 -1.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 1.00000000e+00 0.00000000e+00 6.12323400e-17] + [ 9.99968847e-01 0.00000000e+00 -7.89336691e-03] + [ 9.99875390e-01 0.00000000e+00 -1.57862420e-02] + ... + [ 1.57862420e-02 -3.86651415e-18 -9.99875390e-01] + [ 7.89336691e-03 -1.93331730e-18 -9.99968847e-01] + [ 1.22464680e-16 -2.99951957e-32 -1.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 2000×3] + [[ 1.00000000e+00 0.00000000e+00 6.12323400e-17] + [ 9.84807753e-01 0.00000000e+00 -1.73648178e-01] + [ 9.39692621e-01 0.00000000e+00 -3.42020143e-01] + ... + [ 3.42020143e-01 -8.37707748e-17 -9.39692621e-01] + [ 1.73648178e-01 -4.25315370e-17 -9.84807753e-01] + [ 1.22464680e-16 -2.99951957e-32 -1.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 10×200] + [[ 1 11 21 ... 1971 1981 1991] + [ 2 12 22 ... 1972 1982 1992] + [ 3 13 23 ... 1973 1983 1993] + ... + [ 8 18 28 ... 1978 1988 1998] + [ 9 19 29 ... 1979 1989 1999] + [ 10 20 30 ... 1980 1990 2000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Integer 1 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`List + System`Real -1.2 + System`Real 1.0 + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-orbital-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-orbital-vec.txt new file mode 100644 index 000000000..82c906ad6 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-orbital-vec.txt @@ -0,0 +1,250 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 3.00000000e+00] + [ 4.73429900e-02 0.00000000e+00 2.99862947e+00] + [ 9.45798078e-02 0.00000000e+00 2.99452046e+00] + ... + [ 9.45798078e-02 -2.31653718e-17 -2.99452046e+00] + [ 4.73429900e-02 -1.15956882e-17 -2.99862947e+00] + [ 3.67394040e-16 -8.99855870e-32 -3.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 3.00000000e+00] + [ 4.73429900e-02 0.00000000e+00 2.99862947e+00] + [ 9.45798078e-02 0.00000000e+00 2.99452046e+00] + ... + [ 9.45798078e-02 -2.31653718e-17 -2.99452046e+00] + [ 4.73429900e-02 -1.15956882e-17 -2.99862947e+00] + [ 3.67394040e-16 -8.99855870e-32 -3.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 3.00000000e+00] + [ 4.75947393e-01 0.00000000e+00 2.85219636e+00] + [ 8.37166478e-01 0.00000000e+00 2.43858264e+00] + ... + [ 8.37166478e-01 -2.05046650e-16 -2.43858264e+00] + [ 4.75947393e-01 -1.16573490e-16 -2.85219636e+00] + [ 3.67394040e-16 -8.99855870e-32 -3.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 1.5 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Integer 10 + System`Integer -20 + System`Integer 5 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-shells-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-shells-vec.txt new file mode 100644 index 000000000..32653756f --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-shells-vec.txt @@ -0,0 +1,366 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 3.00000000e+00] + [ 4.73587260e-02 0.00000000e+00 2.99962617e+00] + [ 9.47056493e-02 0.00000000e+00 2.99850477e+00] + ... + [-1.73971455e-17 -9.47056493e-02 -2.99850477e+00] + [-8.69965684e-18 -4.73587260e-02 -2.99962617e+00] + [-6.74891902e-32 -3.67394040e-16 -3.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Real 0.392157 + System`Real 0.560784 + System`Real 1.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 2.00000000e+00] + [ 3.15724840e-02 0.00000000e+00 1.99975078e+00] + [ 6.31370995e-02 0.00000000e+00 1.99900318e+00] + ... + [-1.15980970e-17 -6.31370995e-02 -1.99900318e+00] + [-5.79977123e-18 -3.15724840e-02 -1.99975078e+00] + [-4.49927935e-32 -2.44929360e-16 -2.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Real 0.862745 + System`Real 0.14902 + System`Real 0.498039 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 1.00000000e+00] + [ 1.57862420e-02 0.00000000e+00 9.99875390e-01] + [ 3.15685498e-02 0.00000000e+00 9.99501589e-01] + ... + [-5.79904851e-18 -3.15685498e-02 -9.99501589e-01] + [-2.89988561e-18 -1.57862420e-02 -9.99875390e-01] + [-2.24963967e-32 -1.22464680e-16 -1.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 3.00000000e+00] + [ 4.73587260e-02 0.00000000e+00 2.99962617e+00] + [ 9.47056493e-02 0.00000000e+00 2.99850477e+00] + ... + [-1.73971455e-17 -9.47056493e-02 -2.99850477e+00] + [-8.69965684e-18 -4.73587260e-02 -2.99962617e+00] + [-6.74891902e-32 -3.67394040e-16 -3.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 2.00000000e+00] + [ 3.15724840e-02 0.00000000e+00 1.99975078e+00] + [ 6.31370995e-02 0.00000000e+00 1.99900318e+00] + ... + [-1.15980970e-17 -6.31370995e-02 -1.99900318e+00] + [-5.79977123e-18 -3.15724840e-02 -1.99975078e+00] + [-4.49927935e-32 -2.44929360e-16 -2.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 1.00000000e+00] + [ 1.57862420e-02 0.00000000e+00 9.99875390e-01] + [ 3.15685498e-02 0.00000000e+00 9.99501589e-01] + ... + [-5.79904851e-18 -3.15685498e-02 -9.99501589e-01] + [-2.89988561e-18 -1.57862420e-02 -9.99875390e-01] + [-2.24963967e-32 -1.22464680e-16 -1.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 3.00000000e+00] + [ 4.93783771e-01 0.00000000e+00 2.95908391e+00] + [ 9.74098408e-01 0.00000000e+00 2.83745173e+00] + ... + [-1.78938975e-16 -9.74098408e-01 -2.83745173e+00] + [-9.07066072e-17 -4.93783771e-01 -2.95908391e+00] + [-6.74891902e-32 -3.67394040e-16 -3.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 2.00000000e+00] + [ 3.29189181e-01 0.00000000e+00 1.97272261e+00] + [ 6.49398938e-01 0.00000000e+00 1.89163448e+00] + ... + [-1.19292650e-16 -6.49398938e-01 -1.89163448e+00] + [-6.04710714e-17 -3.29189181e-01 -1.97272261e+00] + [-4.49927935e-32 -2.44929360e-16 -2.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 1.00000000e+00] + [ 1.64594590e-01 0.00000000e+00 9.86361303e-01] + [ 3.24699469e-01 0.00000000e+00 9.45817242e-01] + ... + [-5.96463248e-17 -3.24699469e-01 -9.45817242e-01] + [-3.02355357e-17 -1.64594590e-01 -9.86361303e-01] + [-2.24963967e-32 -1.22464680e-16 -1.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Integer 1 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-spiral-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-spiral-vec.txt new file mode 100644 index 000000000..2598b30c6 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-sphericalplot3d-spiral-vec.txt @@ -0,0 +1,210 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 1.00000000e+00] + [ 1.62341599e-02 0.00000000e+00 1.02824580e+00] + [ 3.33519676e-02 0.00000000e+00 1.05596693e+00] + ... + [ 2.97851319e-02 -7.29525329e-18 -9.43036246e-01] + [ 1.53383241e-02 -3.75680590e-18 -9.71504983e-01] + [ 1.22464680e-16 -2.99951957e-32 -1.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Integer 1 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/vec_tests.yaml b/test/builtin/drawing/vec_tests.yaml index 035c0c801..8609cab16 100644 --- a/test/builtin/drawing/vec_tests.yaml +++ b/test/builtin/drawing/vec_tests.yaml @@ -157,6 +157,19 @@ vec-plot3d-stack: vec-polarplot-theataxxx-8: expr: PolarPlot[1+0.5 Cos[3 θ],{θ,0,2 Pi}] # +# SphericalPlot3D +# +vec-sphericalplot3d-harmonics: + expr: SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] +vec-sphericalplot3d-spiral: + expr: SphericalPlot3D[1 + 0.3 Sin[6 θ + 4 φ], {θ, 0, Pi}, {φ, 0, 2 Pi}, Mesh -> None] +vec-sphericalplot3d-orbital: + expr: SphericalPlot3D[1 + 2 Cos[2 θ], θ, φ, BoxRatios->{1,1,1.5}, ViewPoint->{10,-20,5}] +vec-sphericalplot3d-shells: + expr: SphericalPlot3D[{3, 2, 1}, {θ, 0, π}, {φ, 0, 3π/2}] +vec-sphericalplot3d-onion: + expr: SphericalPlot3D[1 + Sin[5φ] / 5, {θ, π/2, π}, φ, PlotRange->{Automatic,Automatic,{-1.2,1}}, Mesh->{10,20}] +# # Following is a curated subset of doc_tests.yaml that have vectorized implementation. # Culled to remove repetitive tests. # If the switch is flipped in doc_tests.yaml so that it does vectorized tests on everything From def106be9ba6d8396266805d291caff141762bb9 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 09:13:03 -0500 Subject: [PATCH 16/33] Add examples and links --- mathics/builtin/drawing/plot_plot3d.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index a5f9236f6..ae46d623a 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -269,6 +269,7 @@ class DensityPlot(_Plot3D): class ParametricPlot3D(_Plot3D): """ :WMA link: https://reference.wolfram.com/language/ref/ParametricPlot3D.html + :Parametric equation: https://en.wikipedia.org/wiki/Parametric_equation
'ParametricPlot3D'[${x(u,v), y(u,v), z(u,v)}$, {$u$, $u_{min}$, $u_{max}$}, {$v$, $v_{min}$, $v_{max}$}]
creates a three-dimensional surface using the functions $x$, $y$, $z$ over the specified ranges for parameters $u$ and $v$. @@ -280,6 +281,18 @@ class ParametricPlot3D(_Plot3D): /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values for a list of Plot options.
+ + >> ParametricPlot3D[{Sin[t] + 2 Sin[2 t], Cos[t] - 2 Cos[2 t], -Sin[3 t]}, {t, 0, 2 Pi}] + = -Graphics- + + A function of a single parameter $t$ generates a trefoil knot. + + >> ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi} + ] + = -Graphics- + + A function of two parameters $u$ and $v$ generates a torus. + """ summary_text = "plot a parametric surface or curve in three dimensions" From d4a3f5dcf6a59dd434e604f4482080e8b746ee6c Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 09:17:45 -0500 Subject: [PATCH 17/33] Correct doctest test output --- mathics/builtin/drawing/plot_plot3d.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index ae46d623a..341f81c37 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -283,13 +283,12 @@ class ParametricPlot3D(_Plot3D): >> ParametricPlot3D[{Sin[t] + 2 Sin[2 t], Cos[t] - 2 Cos[2 t], -Sin[3 t]}, {t, 0, 2 Pi}] - = -Graphics- + = ParametricPlot3D[{Sin[t] + 2 Sin[2 t], Cos[t] - 2 Cos[2 t], -Sin[3 t]}, {t, 0, 2 Pi}] A function of a single parameter $t$ generates a trefoil knot. - >> ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi} - ] - = -Graphics- + >> ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}] + = ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}] A function of two parameters $u$ and $v$ generates a torus. From 7784fd3dffe91417aafab1b2276fedd50a7de27a Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 09:27:13 -0500 Subject: [PATCH 18/33] Fix test name --- .../vec-parametricplot-moebius-vec.txt | 318 ------------------ test/builtin/drawing/vec_tests.yaml | 2 +- 2 files changed, 1 insertion(+), 319 deletions(-) delete mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt deleted file mode 100644 index 3422baf35..000000000 --- a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot-moebius-vec.txt +++ /dev/null @@ -1,318 +0,0 @@ -System`Graphics3D - System`List - System`RGBColor - System`Real 1.0 - System`Real 0.690196 - System`Real 0.0 - System`GraphicsComplex - System`NumericArray NumericArray[Real*, 40000×3] - [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] - [ 4.99813069e-01 1.57862418e-02 -7.89312101e-03] - [ 4.99252135e-01 3.15685419e-02 -1.57842749e-02] - ... - [ 4.99252135e-01 -3.15685419e-02 1.57842749e-02] - [ 4.99813069e-01 -1.57862418e-02 7.89312101e-03] - [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] - System`Polygon - System`NumericArray NumericArray[Integer*, 39601×4] - [[ 1 2 202 201] - [ 201 202 402 401] - [ 401 402 602 601] - ... - [39399 39400 39600 39599] - [39599 39600 39800 39799] - [39799 39800 40000 39999]] - System`RGBColor - System`Integer 0 - System`Integer 0 - System`Integer 0 - System`GraphicsComplex - System`NumericArray NumericArray[Real*, 1000×3] - [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] - [ 4.99813069e-01 1.57862418e-02 -7.89312101e-03] - [ 4.99252135e-01 3.15685419e-02 -1.57842749e-02] - ... - [ 4.99252135e-01 -3.15685419e-02 1.57842749e-02] - [ 4.99813069e-01 -1.57862418e-02 7.89312101e-03] - [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] - System`Line - System`NumericArray NumericArray[Integer*, 5×200] - [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - 15 16 17 18 19 20 21 22 23 24 25 26 27 28 - 29 30 31 32 33 34 35 36 37 38 39 40 41 42 - 43 44 45 46 47 48 49 50 51 52 53 54 55 56 - 57 58 59 60 61 62 63 64 65 66 67 68 69 70 - 71 72 73 74 75 76 77 78 79 80 81 82 83 84 - 85 86 87 88 89 90 91 92 93 94 95 96 97 98 - 99 100 101 102 103 104 105 106 107 108 109 110 111 112 - 113 114 115 116 117 118 119 120 121 122 123 124 125 126 - 127 128 129 130 131 132 133 134 135 136 137 138 139 140 - 141 142 143 144 145 146 147 148 149 150 151 152 153 154 - 155 156 157 158 159 160 161 162 163 164 165 166 167 168 - 169 170 171 172 173 174 175 176 177 178 179 180 181 182 - 183 184 185 186 187 188 189 190 191 192 193 194 195 196 - 197 198 199 200] - [ 201 202 203 204 205 206 207 208 209 210 211 212 213 214 - 215 216 217 218 219 220 221 222 223 224 225 226 227 228 - 229 230 231 232 233 234 235 236 237 238 239 240 241 242 - 243 244 245 246 247 248 249 250 251 252 253 254 255 256 - 257 258 259 260 261 262 263 264 265 266 267 268 269 270 - 271 272 273 274 275 276 277 278 279 280 281 282 283 284 - 285 286 287 288 289 290 291 292 293 294 295 296 297 298 - 299 300 301 302 303 304 305 306 307 308 309 310 311 312 - 313 314 315 316 317 318 319 320 321 322 323 324 325 326 - 327 328 329 330 331 332 333 334 335 336 337 338 339 340 - 341 342 343 344 345 346 347 348 349 350 351 352 353 354 - 355 356 357 358 359 360 361 362 363 364 365 366 367 368 - 369 370 371 372 373 374 375 376 377 378 379 380 381 382 - 383 384 385 386 387 388 389 390 391 392 393 394 395 396 - 397 398 399 400] - [ 401 402 403 404 405 406 407 408 409 410 411 412 413 414 - 415 416 417 418 419 420 421 422 423 424 425 426 427 428 - 429 430 431 432 433 434 435 436 437 438 439 440 441 442 - 443 444 445 446 447 448 449 450 451 452 453 454 455 456 - 457 458 459 460 461 462 463 464 465 466 467 468 469 470 - 471 472 473 474 475 476 477 478 479 480 481 482 483 484 - 485 486 487 488 489 490 491 492 493 494 495 496 497 498 - 499 500 501 502 503 504 505 506 507 508 509 510 511 512 - 513 514 515 516 517 518 519 520 521 522 523 524 525 526 - 527 528 529 530 531 532 533 534 535 536 537 538 539 540 - 541 542 543 544 545 546 547 548 549 550 551 552 553 554 - 555 556 557 558 559 560 561 562 563 564 565 566 567 568 - 569 570 571 572 573 574 575 576 577 578 579 580 581 582 - 583 584 585 586 587 588 589 590 591 592 593 594 595 596 - 597 598 599 600] - [ 601 602 603 604 605 606 607 608 609 610 611 612 613 614 - 615 616 617 618 619 620 621 622 623 624 625 626 627 628 - 629 630 631 632 633 634 635 636 637 638 639 640 641 642 - 643 644 645 646 647 648 649 650 651 652 653 654 655 656 - 657 658 659 660 661 662 663 664 665 666 667 668 669 670 - 671 672 673 674 675 676 677 678 679 680 681 682 683 684 - 685 686 687 688 689 690 691 692 693 694 695 696 697 698 - 699 700 701 702 703 704 705 706 707 708 709 710 711 712 - 713 714 715 716 717 718 719 720 721 722 723 724 725 726 - 727 728 729 730 731 732 733 734 735 736 737 738 739 740 - 741 742 743 744 745 746 747 748 749 750 751 752 753 754 - 755 756 757 758 759 760 761 762 763 764 765 766 767 768 - 769 770 771 772 773 774 775 776 777 778 779 780 781 782 - 783 784 785 786 787 788 789 790 791 792 793 794 795 796 - 797 798 799 800] - [ 801 802 803 804 805 806 807 808 809 810 811 812 813 814 - 815 816 817 818 819 820 821 822 823 824 825 826 827 828 - 829 830 831 832 833 834 835 836 837 838 839 840 841 842 - 843 844 845 846 847 848 849 850 851 852 853 854 855 856 - 857 858 859 860 861 862 863 864 865 866 867 868 869 870 - 871 872 873 874 875 876 877 878 879 880 881 882 883 884 - 885 886 887 888 889 890 891 892 893 894 895 896 897 898 - 899 900 901 902 903 904 905 906 907 908 909 910 911 912 - 913 914 915 916 917 918 919 920 921 922 923 924 925 926 - 927 928 929 930 931 932 933 934 935 936 937 938 939 940 - 941 942 943 944 945 946 947 948 949 950 951 952 953 954 - 955 956 957 958 959 960 961 962 963 964 965 966 967 968 - 969 970 971 972 973 974 975 976 977 978 979 980 981 982 - 983 984 985 986 987 988 989 990 991 992 993 994 995 996 - 997 998 999 1000]] - System`GraphicsComplex - System`NumericArray NumericArray[Real*, 3000×3] - [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] - [ 4.61779019e-01 2.22381055e-01 -1.11260467e-01] - [ 3.42617351e-01 4.29628570e-01 -2.16941870e-01] - ... - [ 3.42617351e-01 -4.29628570e-01 2.16941870e-01] - [ 4.61779019e-01 -2.22381055e-01 1.11260467e-01] - [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] - System`Line - System`NumericArray NumericArray[Integer*, 15×200] - [[ 1 16 31 ... 2956 2971 2986] - [ 2 17 32 ... 2957 2972 2987] - [ 3 18 33 ... 2958 2973 2988] - ... - [ 13 28 43 ... 2968 2983 2998] - [ 14 29 44 ... 2969 2984 2999] - [ 15 30 45 ... 2970 2985 3000]] - System`Rule - System`AlignmentPoint - System`Center - System`Rule - System`AspectRatio - System`Integer 1 - System`Rule - System`Axes - System`True - System`Rule - System`AxesEdge - System`Automatic - System`Rule - System`AxesLabel - System`None - System`Rule - System`AxesOrigin - System`Automatic - System`Rule - System`AxesStyle - System`List - System`Rule - System`Background - System`Automatic - System`Rule - System`BaseStyle - System`List - System`Rule - System`BaselinePosition - System`Automatic - System`Rule - System`BoxRatios - System`List - System`Integer 1 - System`Integer 1 - System`Real 0.4 - System`Rule - System`BoxStyle - System`List - System`Rule - System`Boxed - System`True - System`Rule - System`ClipPlanes - System`None - System`Rule - System`ClipPlanesStyle - System`Automatic - System`Rule - System`ContentSelectable - System`Automatic - System`Rule - System`ControllerLinking - System`False - System`Rule - System`ControllerPath - System`Automatic - System`Rule - System`CoordinatesToolOptions - System`Automatic - System`Rule - System`Epilog - System`List - System`Rule - System`FaceGrids - System`None - System`Rule - System`FaceGridsStyle - System`List - System`Rule - System`FormatType - System`TraditionalForm - System`Rule - System`Frame - System`False - System`Rule - System`FrameLabel - System`None - System`Rule - System`FrameStyle - System`List - System`Rule - System`FrameTicks - System`Automatic - System`Rule - System`FrameTicksStyle - System`List - System`Rule - System`GridLines - System`None - System`Rule - System`GridLinesStyle - System`List - System`Rule - System`ImageMargins - System`Real 0.0 - System`Rule - System`ImagePadding - System`All - System`Rule - System`ImageSize - System`Automatic - System`Rule - System`LabelStyle - System`List - System`Rule - System`Lighting - System`Automatic - System`Rule - System`LogPlot - System`False - System`Rule - System`Method - System`Automatic - System`Rule - System`PlotLabel - System`None - System`Rule - System`PlotRange - System`List - System`Automatic - System`Automatic - System`Automatic - System`Rule - System`PlotRangeClipping - System`False - System`Rule - System`PlotRangePadding - System`Automatic - System`Rule - System`PlotRegion - System`Automatic - System`Rule - System`PreserveImageOptions - System`Automatic - System`Rule - System`Prolog - System`List - System`Rule - System`RotateLabel - System`True - System`Rule - System`RotationAction - System`Fit - System`Rule - System`SphericalRegion - System`Automatic - System`Rule - System`Ticks - System`Automatic - System`Rule - System`TicksStyle - System`List - System`Rule - System`TouchscreenAutoZoom - System`False - System`Rule - System`ViewAngle - System`Automatic - System`Rule - System`ViewCenter - System`Automatic - System`Rule - System`ViewMatrix - System`Automatic - System`Rule - System`ViewPoint - System`List - System`Real 1.3 - System`Real -2.4 - System`Real 2.0 - System`Rule - System`ViewProjection - System`Automatic - System`Rule - System`ViewRange - System`All - System`Rule - System`ViewVector - System`Automatic - System`Rule - System`ViewVertical - System`List - System`Integer 0 - System`Integer 0 - System`Integer 1 diff --git a/test/builtin/drawing/vec_tests.yaml b/test/builtin/drawing/vec_tests.yaml index 035c0c801..63bc77a46 100644 --- a/test/builtin/drawing/vec_tests.yaml +++ b/test/builtin/drawing/vec_tests.yaml @@ -106,7 +106,7 @@ vec-parametricplot3d-rings: ] ] ' -vec-parametricplot-moebius: +vec-parametricplot3d-moebius: expr: ' ParametricPlot3D[ {(1 + (v/2) Cos[u/2]) Cos[u], From 17975c31ee1bd40290ee17a3c62556cc81bd16cd Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 09:31:55 -0500 Subject: [PATCH 19/33] Formatting --- mathics/builtin/drawing/plot_plot3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 341f81c37..37c0e42bc 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -289,7 +289,7 @@ class ParametricPlot3D(_Plot3D): >> ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}] = ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}] - + A function of two parameters $u$ and $v$ generates a torus. """ From 5d0a92aa74d4135f9045f1bc914d59d8299317df Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 09:41:47 -0500 Subject: [PATCH 20/33] Add example and link --- mathics/builtin/drawing/plot_plot3d.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 2689cfe84..2b33b5a5a 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -338,15 +338,21 @@ class Plot3D(_Plot3D): class SphericalPlot3D(_Plot3D): """ :WMA link: https://reference.wolfram.com/language/ref/SphericalPlot3D.html + :Spherical coordinate system: https://en.wikipedia.org/wiki/Spherical_coordinate_system
-
'ParametricPlot3D'[$r(θ, φ)$, {$θ$, $θ_{min}$, $θ_{max}$}, {$φ$, $φ_{min}$, $φ_{max}$}] -
creates a three-dimensional surface at radius $r(θ, φ) for spherical angles θ and φ over the specified ranges +
'SphericalPlot3D'[$r(θ, φ)$, {$θ$, $θ_{min}$, $θ_{max}$}, {$φ$, $φ_{min}$, $φ_{max}$}] +
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles $θ$ and $φ$ over the specified ranges -
'ParametricPlot3D'[$r(θ, φ)$, $θ$, $φ$] -
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles θ and φ - in the ranges 0 < θ < π and 0 < φ < 2π covering the entire sphere +
'SphericalPlot3D'[$r(θ, φ)$, $θ$, $φ$] +
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles $θ$ and $φ$ + in the ranges $0 < θ < π$ and $0 < φ < 2π$ covering the entire sphere - See :Drawing Option and Option Values: + >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] + - SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] + + Spherical harmonics are the canonical use case for spherical plots. + + See :Drawing Option and Option Values: /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values for a list of Plot options.
From 811144368653af77859780bcf89b5ca1241ad000 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 09:42:05 -0500 Subject: [PATCH 21/33] Formatting --- mathics/builtin/drawing/plot_plot3d.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 2b33b5a5a..b451d07e2 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -349,8 +349,8 @@ class SphericalPlot3D(_Plot3D): >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] - SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] - - Spherical harmonics are the canonical use case for spherical plots. + + Spherical harmonics are the canonical use case for spherical plots. See :Drawing Option and Option Values: /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values From 70c80d66fae1c1bec73b6ed4f6d98c8577a62154 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 09:52:21 -0500 Subject: [PATCH 22/33] Fix example output --- mathics/builtin/drawing/plot_plot3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index b451d07e2..a3be7aa28 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -348,7 +348,7 @@ class SphericalPlot3D(_Plot3D): in the ranges $0 < θ < π$ and $0 < φ < 2π$ covering the entire sphere >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] - - SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] + = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] Spherical harmonics are the canonical use case for spherical plots. From 3b2e854da3f89baa4c22a6f710132689b1db7f1c Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 10:16:58 -0500 Subject: [PATCH 23/33] Add test --- .gitignore | 2 +- .../vec-parametricplot3d-moebius-vec.txt | 318 ++++++++++++++++++ 2 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-moebius-vec.txt diff --git a/.gitignore b/.gitignore index 039c83dc8..a26b3ba0e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,7 @@ ChangeLog.orig ChangeLog.rej Documents/ Homepage/ -Test/ +#Test/ _Copies_/ _Database_/ build/ diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-moebius-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-moebius-vec.txt new file mode 100644 index 000000000..3422baf35 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-moebius-vec.txt @@ -0,0 +1,318 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] + [ 4.99813069e-01 1.57862418e-02 -7.89312101e-03] + [ 4.99252135e-01 3.15685419e-02 -1.57842749e-02] + ... + [ 4.99252135e-01 -3.15685419e-02 1.57842749e-02] + [ 4.99813069e-01 -1.57862418e-02 7.89312101e-03] + [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] + [ 4.99813069e-01 1.57862418e-02 -7.89312101e-03] + [ 4.99252135e-01 3.15685419e-02 -1.57842749e-02] + ... + [ 4.99252135e-01 -3.15685419e-02 1.57842749e-02] + [ 4.99813069e-01 -1.57862418e-02 7.89312101e-03] + [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] + System`Line + System`NumericArray NumericArray[Integer*, 5×200] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200] + [ 201 202 203 204 205 206 207 208 209 210 211 212 213 214 + 215 216 217 218 219 220 221 222 223 224 225 226 227 228 + 229 230 231 232 233 234 235 236 237 238 239 240 241 242 + 243 244 245 246 247 248 249 250 251 252 253 254 255 256 + 257 258 259 260 261 262 263 264 265 266 267 268 269 270 + 271 272 273 274 275 276 277 278 279 280 281 282 283 284 + 285 286 287 288 289 290 291 292 293 294 295 296 297 298 + 299 300 301 302 303 304 305 306 307 308 309 310 311 312 + 313 314 315 316 317 318 319 320 321 322 323 324 325 326 + 327 328 329 330 331 332 333 334 335 336 337 338 339 340 + 341 342 343 344 345 346 347 348 349 350 351 352 353 354 + 355 356 357 358 359 360 361 362 363 364 365 366 367 368 + 369 370 371 372 373 374 375 376 377 378 379 380 381 382 + 383 384 385 386 387 388 389 390 391 392 393 394 395 396 + 397 398 399 400] + [ 401 402 403 404 405 406 407 408 409 410 411 412 413 414 + 415 416 417 418 419 420 421 422 423 424 425 426 427 428 + 429 430 431 432 433 434 435 436 437 438 439 440 441 442 + 443 444 445 446 447 448 449 450 451 452 453 454 455 456 + 457 458 459 460 461 462 463 464 465 466 467 468 469 470 + 471 472 473 474 475 476 477 478 479 480 481 482 483 484 + 485 486 487 488 489 490 491 492 493 494 495 496 497 498 + 499 500 501 502 503 504 505 506 507 508 509 510 511 512 + 513 514 515 516 517 518 519 520 521 522 523 524 525 526 + 527 528 529 530 531 532 533 534 535 536 537 538 539 540 + 541 542 543 544 545 546 547 548 549 550 551 552 553 554 + 555 556 557 558 559 560 561 562 563 564 565 566 567 568 + 569 570 571 572 573 574 575 576 577 578 579 580 581 582 + 583 584 585 586 587 588 589 590 591 592 593 594 595 596 + 597 598 599 600] + [ 601 602 603 604 605 606 607 608 609 610 611 612 613 614 + 615 616 617 618 619 620 621 622 623 624 625 626 627 628 + 629 630 631 632 633 634 635 636 637 638 639 640 641 642 + 643 644 645 646 647 648 649 650 651 652 653 654 655 656 + 657 658 659 660 661 662 663 664 665 666 667 668 669 670 + 671 672 673 674 675 676 677 678 679 680 681 682 683 684 + 685 686 687 688 689 690 691 692 693 694 695 696 697 698 + 699 700 701 702 703 704 705 706 707 708 709 710 711 712 + 713 714 715 716 717 718 719 720 721 722 723 724 725 726 + 727 728 729 730 731 732 733 734 735 736 737 738 739 740 + 741 742 743 744 745 746 747 748 749 750 751 752 753 754 + 755 756 757 758 759 760 761 762 763 764 765 766 767 768 + 769 770 771 772 773 774 775 776 777 778 779 780 781 782 + 783 784 785 786 787 788 789 790 791 792 793 794 795 796 + 797 798 799 800] + [ 801 802 803 804 805 806 807 808 809 810 811 812 813 814 + 815 816 817 818 819 820 821 822 823 824 825 826 827 828 + 829 830 831 832 833 834 835 836 837 838 839 840 841 842 + 843 844 845 846 847 848 849 850 851 852 853 854 855 856 + 857 858 859 860 861 862 863 864 865 866 867 868 869 870 + 871 872 873 874 875 876 877 878 879 880 881 882 883 884 + 885 886 887 888 889 890 891 892 893 894 895 896 897 898 + 899 900 901 902 903 904 905 906 907 908 909 910 911 912 + 913 914 915 916 917 918 919 920 921 922 923 924 925 926 + 927 928 929 930 931 932 933 934 935 936 937 938 939 940 + 941 942 943 944 945 946 947 948 949 950 951 952 953 954 + 955 956 957 958 959 960 961 962 963 964 965 966 967 968 + 969 970 971 972 973 974 975 976 977 978 979 980 981 982 + 983 984 985 986 987 988 989 990 991 992 993 994 995 996 + 997 998 999 1000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 3000×3] + [[ 5.00000000e-01 0.00000000e+00 -0.00000000e+00] + [ 4.61779019e-01 2.22381055e-01 -1.11260467e-01] + [ 3.42617351e-01 4.29628570e-01 -2.16941870e-01] + ... + [ 3.42617351e-01 -4.29628570e-01 2.16941870e-01] + [ 4.61779019e-01 -2.22381055e-01 1.11260467e-01] + [ 5.00000000e-01 -1.22464680e-16 6.12323400e-17]] + System`Line + System`NumericArray NumericArray[Integer*, 15×200] + [[ 1 16 31 ... 2956 2971 2986] + [ 2 17 32 ... 2957 2972 2987] + [ 3 18 33 ... 2958 2973 2988] + ... + [ 13 28 43 ... 2968 2983 2998] + [ 14 29 44 ... 2969 2984 2999] + [ 15 30 45 ... 2970 2985 3000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 From cd3d2cd7885c794fa7e05952a3c7ca1f2888a5d3 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 11:09:19 -0500 Subject: [PATCH 24/33] Revert "Merge branch 'master' into sphericalplot3d" This reverts commit 88e610b65dbf4cbdc96256d145cddc4c7c07bd3d, reversing changes made to 3648ccaef5d7e8b279ee0c68fc14a17ee4de4ead. --- mathics/builtin/drawing/plot.py | 27 +- mathics/builtin/drawing/plot_plot.py | 13 +- mathics/builtin/drawing/plot_plot3d.py | 36 +- mathics/core/systemsymbols.py | 1 + mathics/core/util.py | 5 +- mathics/eval/drawing/plot3d_vectorized.py | 128 +++-- mathics/eval/drawing/util.py | 16 +- test/builtin/drawing/test_plot_detail.py | 13 +- .../vec-parametricplot3d-multi-vec.txt | 455 ++++++++++++++++++ .../vec-parametricplot3d-rings-vec.txt | 366 ++++++++++++++ ...c-parametricplot3d-torus-plotrange-vec.txt | 253 ++++++++++ .../vec-parametricplot3d-torus-vec.txt | 250 ++++++++++ .../vec-parametricplot3d-trefoil-vec.txt | 277 +++++++++++ 13 files changed, 1769 insertions(+), 71 deletions(-) create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt create mode 100644 test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt diff --git a/mathics/builtin/drawing/plot.py b/mathics/builtin/drawing/plot.py index a54b7da86..4f70138dc 100644 --- a/mathics/builtin/drawing/plot.py +++ b/mathics/builtin/drawing/plot.py @@ -22,7 +22,7 @@ from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.list import ListExpression -from mathics.core.symbols import Symbol +from mathics.core.symbols import Symbol, SymbolList from mathics.core.systemsymbols import ( SymbolAll, SymbolAutomatic, @@ -413,11 +413,21 @@ class PlotOptions: plot_points: list maxdepth: int - def __init__(self, builtin, range_exprs, options, dim, evaluation): + def __init__(self, builtin, functions, range_exprs, options, dim, evaluation): def error(*args, **kwargs): evaluation.message(builtin.get_name(), *args, **kwargs) raise ValueError() + # convert functions to list of lists of exprs + def to_list(expr): + if isinstance(expr, Expression) and expr.head is SymbolList: + return [to_list(e) for e in expr.elements] + else: + return expr + + functions = to_list(functions) + self.functions = functions if isinstance(functions, list) else [functions] + # plot ranges of the form {x,xmin,xmax} etc. (returns Symbol) self.ranges = [] for i, range_expr in enumerate(range_exprs): @@ -474,11 +484,16 @@ def error(*args, **kwargs): self.exclusions = exclusions # Mesh option (returns Symbol) - mesh = builtin.get_option(options, "Mesh", evaluation) - if mesh not in (SymbolNone, SymbolFull, SymbolAll): + mesh = builtin.get_option(options, "Mesh", evaluation).to_python( + preserve_symbols=True + ) + if isinstance(mesh, (list, tuple)) and all(isinstance(m, int) for m in mesh): + self.mesh = mesh + elif mesh not in (SymbolNone, SymbolFull, SymbolAll): evaluation.message("Mesh", "ilevels", mesh) - mesh = SymbolFull - self.mesh = mesh + self.mesh = SymbolFull + else: + self.mesh = mesh # PlotPoints option (returns Symbol) plot_points_option = builtin.get_option(options, "PlotPoints", evaluation) diff --git a/mathics/builtin/drawing/plot_plot.py b/mathics/builtin/drawing/plot_plot.py index 0ee93d302..4cb462f49 100644 --- a/mathics/builtin/drawing/plot_plot.py +++ b/mathics/builtin/drawing/plot_plot.py @@ -74,7 +74,9 @@ def eval(self, functions, ranges, evaluation: Evaluation, options: dict): # parse options, bailing out if anything is wrong try: ranges = ranges.elements if ranges.head is SymbolSequence else [ranges] - plot_options = plot.PlotOptions(self, ranges, options, 2, evaluation) + plot_options = plot.PlotOptions( + self, functions, ranges, options, 2, evaluation + ) except ValueError: return None @@ -84,10 +86,15 @@ def eval(self, functions, ranges, evaluation: Evaluation, options: dict): apply_function = self.apply_function if not plot.use_vectorized_plot: apply_function = lru_cache(apply_function) + plot_options.apply_function = apply_function - # additional options specific to this class + # TODO: PlotOptions has already regularized .functions to be a list + # (of lists) of functions, used by the _Plot3d builtins. + # But _Plot builtins still need to be reworked to use it, + # so we still use the old mechanism here. plot_options.functions = self.get_functions_param(functions) - plot_options.apply_function = apply_function + + # additional options specific to this class plot_options.use_log_scale = self.use_log_scale plot_options.expect_list = self.expect_list if plot_options.plot_points is None: diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 6e18dda34..3153897ce 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -102,23 +102,27 @@ def eval( try: dim = 3 if self.graphics_class is Graphics3D else 2 ranges = ranges.elements if ranges.head is SymbolSequence else [ranges] - plot_options = plot.PlotOptions(self, ranges, options, dim, evaluation) + plot_options = plot.PlotOptions( + self, functions, ranges, options, dim, evaluation + ) except ValueError: return None # supply default value for PlotPoints - # TODO: consult many_functions variable set by subclass and error - # if many_functions is False but multiple are supplied - if functions.has_form("List", None): - plot_options.functions = functions.elements - else: - plot_options.functions = [functions] - - # supply default value if plot_options.plot_points is None: - default_plot_points = (200, 200) if plot.use_vectorized_plot else (7, 7) + if isinstance(self, ParametricPlot3D) and len(plot_options.ranges) == 1: + # ParametricPlot3D with one independent variable generating a curve + default_plot_points = (1000,) + elif plot.use_vectorized_plot: + default_plot_points = (200, 200) + else: + default_plot_points = (7, 7) plot_options.plot_points = default_plot_points + # supply apply_function which knows how to take the plot parameters + # and produce xs, ys, and zs + plot_options.apply_function = self.apply_function + # subclass must set eval_function and graphics_class eval_function = plot.get_plot_eval_function(self.__class__) with np.errstate(all="ignore"): # suppress numpy warnings @@ -147,6 +151,10 @@ def eval( ) return graphics_expr + def apply_function(self, function, names, us, vs): + parms = {str(names[0]): us, str(names[1]): vs} + return us, vs, function(**parms) + class ComplexPlot3D(_Plot3D): """ @@ -171,6 +179,10 @@ class ComplexPlot3D(_Plot3D): num_plot_points = 2 # different from number of ranges graphics_class = Graphics3D + def apply_function(self, function, names, us, vs): + parms = {str(names[0]): us + vs * 1j} + return us, vs, function(**parms) + class ComplexPlot(_Plot3D): """ @@ -195,6 +207,10 @@ class ComplexPlot(_Plot3D): num_plot_points = 2 # different from number of ranges graphics_class = Graphics + def apply_function(self, function, names, us, vs): + parms = {str(names[0]): us + vs * 1j} + return us, vs, function(**parms) + class ContourPlot(_Plot3D): """ diff --git a/mathics/core/systemsymbols.py b/mathics/core/systemsymbols.py index 258ec92ef..deafd0d95 100644 --- a/mathics/core/systemsymbols.py +++ b/mathics/core/systemsymbols.py @@ -26,6 +26,7 @@ SymbolAborted = Symbol("System`$Aborted") SymbolAbs = Symbol("System`Abs") SymbolAbsoluteTime = Symbol("AbsoluteTime") +SymbolAbsoluteThickness = Symbol("System`AbsoluteThickness") SymbolAccuracy = Symbol("System`Accuracy") SymbolAlignmentPoint = Symbol("System`AlignmentPoint") SymbolAll = Symbol("System`All") diff --git a/mathics/core/util.py b/mathics/core/util.py index ed9fd3628..4cf650b69 100644 --- a/mathics/core/util.py +++ b/mathics/core/util.py @@ -134,7 +134,10 @@ def print_expression_tree( if file is None: file = sys.stdout - if isinstance(expr, Symbol): + if isinstance(expr, (tuple, list)): + for e in expr: + print_expression_tree(e, indent, marker, file, approximate) + elif isinstance(expr, Symbol): print(f"{indent}{marker(expr)}{expr}", file=file) elif not hasattr(expr, "elements"): if isinstance(expr, MachineReal) and approximate: diff --git a/mathics/eval/drawing/plot3d_vectorized.py b/mathics/eval/drawing/plot3d_vectorized.py index 21d418324..0074eb7dd 100644 --- a/mathics/eval/drawing/plot3d_vectorized.py +++ b/mathics/eval/drawing/plot3d_vectorized.py @@ -8,11 +8,11 @@ import numpy as np from mathics.builtin.colors.color_internals import convert_color -from mathics.core.convert.lambdify import lambdify_compile from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.symbols import strip_context from mathics.core.systemsymbols import ( + SymbolAbsoluteThickness, SymbolEqual, SymbolNone, SymbolRGBColor, @@ -21,36 +21,40 @@ from mathics.timing import Timer from .colors import palette2, palette3, palette_color_directive -from .util import GraphicsGenerator +from .util import GraphicsGenerator, compile_exprs -def make_plot(plot_options, evaluation: Evaluation, dim: int, is_complex: bool, emit): +def make_surfaces( + plot_options, evaluation: Evaluation, dim: int, is_complex: bool, emit +): graphics = GraphicsGenerator(dim) # pull out plot options if not is_complex: - _, xmin, xmax = plot_options.ranges[0] - _, ymin, ymax = plot_options.ranges[1] + _, umin, umax = plot_options.ranges[0] + _, vmin, vmax = plot_options.ranges[1] else: # will generate xs and ys as for real, then combine to form complex cs _, cmin, cmax = plot_options.ranges[0] - xmin, xmax = cmin.real, cmax.real - ymin, ymax = cmin.imag, cmax.imag + umin, umax = cmin.real, cmax.real + vmin, vmax = cmin.imag, cmax.imag names = [strip_context(str(range[0])) for range in plot_options.ranges] # Mesh option - nmesh = 20 - if plot_options.mesh is SymbolNone: - nmesh = 0 + mesh = plot_options.mesh + nmeshx = nmeshy = 20 + if mesh is SymbolNone: + nmeshx = nmeshy = 0 + elif isinstance(plot_options.mesh, int): + nmeshx = nmeshy = plot_options.mesh + elif isinstance(mesh, (list, tuple)) and all(isinstance(m, int) for m in mesh): + nmeshx, nmeshy = mesh # compile the functions with Timer("compile"): - compiled_functions = [ - lambdify_compile(evaluation, function, names) - for function in plot_options.functions - ] + compiled_functions = compile_exprs(evaluation, plot_options.functions, names) - def compute_over_grid(nx, ny): + def compute_over_grid(nu, nv): """ For each function, computes an (nx*ny, 3) array of coordinates (xyzs), and an (nx, ny) array of indices (inxs) into xyzs representing @@ -62,24 +66,24 @@ def compute_over_grid(nx, ny): grid used to display a mesh of lines on the surface. """ - # compute (nx, ny) grids of xs and ys for corresponding vertexes - xs = np.linspace(xmin, xmax, nx) - ys = np.linspace(ymin, ymax, ny) - xs, ys = np.meshgrid(xs, ys) + # Note on naming: we use u,v to refer to the independent variable initially. + # For Plot3D etc. those will be x and y, but for ParametricPlot3D and + # and for SpericalPlot3D the xs, ys, and zs will all be computed. + # compute (nu, nv) grids of us and vs for corresponding vertexes + us = np.linspace(umin, umax, nu) + vs = np.linspace(vmin, vmax, nv) + us, vs = np.meshgrid(us, vs) - # (nx,ny) array of numbers from 0 to n-1 that are + # (nu,nv) array of numbers from 0 to n-1 that are # indexes into xyzs array for corresponding vertex # +1 because these will be used as WL indexes, which are 1-based - inxs = np.arange(math.prod(xs.shape)).reshape(xs.shape) + 1 + inxs = np.arange(math.prod(us.shape)).reshape(us.shape) + 1 for function in compiled_functions: # compute zs from xs and ys using compiled function - with Timer("compute zs"): - if not is_complex: - zs = function(**{str(names[0]): xs, str(names[1]): ys}) - else: - cs = xs + ys * 1j # TODO: fast enough? - zs = function(**{str(names[0]): cs}) + with Timer("compute xs, ys, zs"): + # xs, ys, zs = function(**{str(names[0]): us, str(names[1]): vs}) + xs, ys, zs = plot_options.apply_function(function, names, us, vs) # sometimes expr gets compiled into something that returns a complex # even though the imaginary part is 0 @@ -87,15 +91,16 @@ def compute_over_grid(nx, ny): # TODO: needed this for Hypergeometric - look into that # assert np.all(np.isreal(zs)), "array contains complex values" if not is_complex: + xs = np.real(xs) + ys = np.real(ys) zs = np.real(zs) # if it's a constant, make it a full array if isinstance(zs, (float, int, complex)): zs = np.full(xs.shape, zs) - # (nx*ny, 3) array of points, to be indexed by quads + # (nu*nv, 3) array of points, to be indexed by quads xyzs = np.stack([xs, ys, zs]).transpose(1, 2, 0).reshape(-1, 3) - yield xyzs, inxs # generate the quads and emit a GraphicsComplex containing them @@ -108,12 +113,12 @@ def compute_over_grid(nx, ny): quads = quads.T.reshape(-1, 4) # pass the xyzs and quads back to the caller to add colors and emit quads as appropriate - emit(graphics, i, xyzs, quads) + emit(graphics, i, xyzs, None, quads) # If requested by the Mesh attribute create a mesh of lines covering the surfaces # For now only for Plot3D # TODO: mesh for DensityPlot? - if nmesh and dim == 3: + if nmeshx and nmeshy and dim == 3: # meshes are black for now graphics.add_directives([SymbolRGBColor, 0, 0, 0]) @@ -123,14 +128,53 @@ def compute_over_grid(nx, ny): # from one row or one column of the inxs array. # Each mesh line has high res (nx or ny) so it follows # the contours of the surface. - for xyzs, inxs in compute_over_grid(nx, nmesh): + for xyzs, inxs in compute_over_grid(nx, nmeshy): graphics.add_complex(xyzs.real, lines=inxs, polys=None) - for xyzs, inxs in compute_over_grid(nmesh, ny): + for xyzs, inxs in compute_over_grid(nmeshx, ny): graphics.add_complex(xyzs.real, lines=inxs.T, polys=None) return graphics +# For ParametricPlot3D with just one independent variable we generate a curve +# TODO: consider whether we can DRY this with similar code in ParmetricPlot +def make_curves(plot_options, evaluation: Evaluation, dim: int, emit): + graphics = GraphicsGenerator(dim) + + # pull out plot options + _, tmin, tmax = plot_options.ranges[0] + nt = plot_options.plot_points[0] + + # compile + names = [strip_context(str(range[0])) for range in plot_options.ranges] + with Timer("compile"): + compiled_functions = compile_exprs(evaluation, plot_options.functions, names) + + # sample points and indexes for making line + ts = np.linspace(tmin, tmax, nt) + line = np.arange(nt) + 1 + + # compute curve for each function + for i, function in enumerate(compiled_functions): + # compute xs, ys, zs from ts + with Timer("compute xs, ys, zs"): + xs, ys, zs = plot_options.apply_function(function, names, ts) + + # if it's a constant, make it a full array + def full_array(a): + return np.full(ts.shape, a) if isinstance(a, (float, int, complex)) else a + + xs = full_array(xs) + ys = full_array(ys) + zs = full_array(zs) + + # stack 'em + xyzs = np.stack([xs, ys, zs]).T + emit(graphics, i, xyzs, [line], None) + + return graphics + + @Timer("density_colors") def density_colors(zs): """default color palette for DensityPlot and ContourPlot (f(x) form)""" @@ -151,7 +195,7 @@ def eval_Plot3D( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # choose a color color_directive = palette_color_directive(palette3, i) graphics.add_directives(color_directive) @@ -159,7 +203,7 @@ def emit(graphics, i, xyzs, quads): # add a GraphicsComplex displaying a surface for this function graphics.add_complex(xyzs, lines=None, polys=quads) - return make_plot(plot_options, evaluation, dim=3, is_complex=False, emit=emit) + return make_surfaces(plot_options, evaluation, dim=3, is_complex=False, emit=emit) @Timer("eval_DensityPlot") @@ -167,7 +211,7 @@ def eval_DensityPlot( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # Fixed palette for now # TODO: accept color options colors = density_colors(xyzs[:, 2]) @@ -175,7 +219,7 @@ def emit(graphics, i, xyzs, quads): # flatten the points and add the quads graphics.add_complex(xyzs[:, 0:2], lines=None, polys=quads, colors=colors) - return make_plot(plot_options, evaluation, dim=2, is_complex=False, emit=emit) + return make_surfaces(plot_options, evaluation, dim=2, is_complex=False, emit=emit) @Timer("eval_ContourPlot") @@ -198,7 +242,7 @@ def eval_ContourPlot( contour_levels = [0] background = False - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # set line color if background: # showing a background, so just black lines @@ -254,7 +298,7 @@ def emit(graphics, i, xyzs, quads): ) # plot_options.plot_points = [n * 10 for n in plot_options.plot_points] - return make_plot(plot_options, evaluation, dim=2, is_complex=False, emit=emit) + return make_surfaces(plot_options, evaluation, dim=2, is_complex=False, emit=emit) @Timer("complex colors") @@ -286,13 +330,13 @@ def eval_ComplexPlot3D( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): zs = xyzs[:, 2] rgb = complex_colors(zs, s=0.8) xyzs[:, 2] = abs(zs) graphics.add_complex(xyzs.real, lines=None, polys=quads, colors=rgb) - return make_plot(plot_options, evaluation, dim=3, is_complex=True, emit=emit) + return make_surfaces(plot_options, evaluation, dim=3, is_complex=True, emit=emit) @Timer("eval_ComplexPlot") @@ -300,7 +344,7 @@ def eval_ComplexPlot( plot_options, evaluation: Evaluation, ): - def emit(graphics, i, xyzs, quads): + def emit(graphics, i, xyzs, _, quads): # flatten the points and add the quads rgb = complex_colors(xyzs[:, 2]) xyzs_re = xyzs[:, 0:2].real diff --git a/mathics/eval/drawing/util.py b/mathics/eval/drawing/util.py index d6e5c8ec4..0276d3e8b 100644 --- a/mathics/eval/drawing/util.py +++ b/mathics/eval/drawing/util.py @@ -2,9 +2,12 @@ Common utilities for plotting """ +from typing import Sequence from mathics.core.atoms import NumericArray from mathics.core.convert.expression import to_expression, to_mathics_list +from mathics.core.convert.lambdify import lambdify_compile +from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.list import ListExpression from mathics.core.symbols import Symbol @@ -20,10 +23,7 @@ ) -# TODO: this will be extended with support for GraphicsComplex in a -# subsequent PR, which may involve a little more refactoring class GraphicsGenerator: - """ Support for generating Graphics and Graphics3D expressions """ @@ -102,3 +102,13 @@ def generate(self, options): ) return graphics_expr + + +def compile_exprs( + evaluation: Evaluation, expr_or_list: Expression | Sequence, names: Sequence[str] +): + """Traverse a nested list structure and compile the functions at the leaves""" + if isinstance(expr_or_list, (list, tuple)): + return [compile_exprs(evaluation, e, names) for e in expr_or_list] + else: + return lambdify_compile(evaluation, expr_or_list, names) diff --git a/test/builtin/drawing/test_plot_detail.py b/test/builtin/drawing/test_plot_detail.py index a469798db..416f60fc8 100644 --- a/test/builtin/drawing/test_plot_detail.py +++ b/test/builtin/drawing/test_plot_detail.py @@ -343,14 +343,14 @@ def yaml_tests_generator(fn: str): YAML_TESTS = [ - "doc_tests.yaml", "vec_tests.yaml", + "doc_tests.yaml", "parameters.yaml", ] -def all_yaml_tests_generator(): - for fn in YAML_TESTS: +def all_yaml_tests_generator(fns=None): + for fn in fns or YAML_TESTS: yield from yaml_tests_generator(fn) @@ -370,14 +370,14 @@ def test_yaml(parms): one_test(**parms) -def do_test_all(): +def do_test_all(fns): # several of these tests failed on pyodide due to apparent differences # in numpy (and/or the blas library backing it) between pyodide and other platforms # including numerical instability, different data types (integer vs real) # the tests above seem so far to be ok on pyodide, but generally they are # simpler than these doc_tests if not pyodide: - for parms in all_yaml_tests_generator(): + for parms in all_yaml_tests_generator(fns): one_test(**parms) @@ -386,11 +386,12 @@ def do_test_all(): parser = argparse.ArgumentParser(description="manage plot tests") parser.add_argument("--update", action="store_true", help="update reference files") + parser.add_argument("files", nargs="*", help="yaml test files") args = parser.parse_args() UPDATE_MODE = args.update try: - do_test_all() + do_test_all(args.files) except AssertionError as oops: print(oops) print("FAIL") diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt new file mode 100644 index 000000000..2c3732d7a --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-multi-vec.txt @@ -0,0 +1,455 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 0.392157 + System`Real 0.560784 + System`Real 1.0 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 -1.00000000e+00 -0.00000000e+00] + [ 3.14466690e-02 -9.99861551e-01 -1.88673048e-02] + [ 6.28891086e-02 -9.99446227e-01 -3.77278927e-02] + ... + [-6.28891086e-02 -9.99446227e-01 3.77278927e-02] + [-3.14466690e-02 -9.99861551e-01 1.88673048e-02] + [-1.22464680e-15 -1.00000000e+00 7.34788079e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 2.00000000e+00 0.00000000e+00] + [ 1.25788666e-02 1.99996044e+00 2.48933554e-01] + [ 2.51572357e-02 1.99984177e+00 4.82194534e-01] + ... + [-2.51572357e-02 1.99984177e+00 -4.82194534e-01] + [-1.25788666e-02 1.99996044e+00 -2.48933554e-01] + [-4.89858720e-16 2.00000000e+00 -9.79717439e-15]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`RGBColor + System`Real 0.196078 + System`Real 0.588235 + System`Real 0.54902 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 2.00000000e+00 0.00000000e+00] + [ 1.25788666e-02 1.99996044e+00 0.00000000e+00] + [ 2.51572357e-02 1.99984177e+00 0.00000000e+00] + ... + [-2.51572357e-02 1.99984177e+00 0.00000000e+00] + [-1.25788666e-02 1.99996044e+00 0.00000000e+00] + [-4.89858720e-16 2.00000000e+00 0.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt new file mode 100644 index 000000000..9c479dd67 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-rings-vec.txt @@ -0,0 +1,366 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 6.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 5.99700953e+00 1.89411299e-01 0.00000000e+00] + [ 5.98804112e+00 3.78633788e-01 0.00000000e+00] + ... + [ 5.98804112e+00 -3.78633788e-01 -2.44929360e-16] + [ 5.99700953e+00 -1.89411299e-01 -2.44929360e-16] + [ 6.00000000e+00 -1.46957616e-15 -2.44929360e-16]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Real 0.392157 + System`Real 0.560784 + System`Real 1.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 0.00000000e+00 6.00000000e+00] + [ 1.89411299e-01 0.00000000e+00 5.99700953e+00] + [ 3.78633788e-01 0.00000000e+00 5.98804112e+00] + ... + [-3.78633788e-01 -2.44929360e-16 5.98804112e+00] + [-1.89411299e-01 -2.44929360e-16 5.99700953e+00] + [-1.46957616e-15 -2.44929360e-16 6.00000000e+00]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Real 0.862745 + System`Real 0.14902 + System`Real 0.498039 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 0.00000000e+00 6.00000000e+00 0.00000000e+00] + [ 0.00000000e+00 5.99700953e+00 1.89411299e-01] + [ 0.00000000e+00 5.98804112e+00 3.78633788e-01] + ... + [-2.44929360e-16 5.98804112e+00 -3.78633788e-01] + [-2.44929360e-16 5.99700953e+00 -1.89411299e-01] + [-2.44929360e-16 6.00000000e+00 -1.46957616e-15]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 6.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 5.99700953e+00 1.89411299e-01 0.00000000e+00] + [ 5.98804112e+00 3.78633788e-01 0.00000000e+00] + ... + [ 5.98804112e+00 -3.78633788e-01 -2.44929360e-16] + [ 5.99700953e+00 -1.89411299e-01 -2.44929360e-16] + [ 6.00000000e+00 -1.46957616e-15 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 6.00000000e+00] + [ 1.89411299e-01 0.00000000e+00 5.99700953e+00] + [ 3.78633788e-01 0.00000000e+00 5.98804112e+00] + ... + [-3.78633788e-01 -2.44929360e-16 5.98804112e+00] + [-1.89411299e-01 -2.44929360e-16 5.99700953e+00] + [-1.46957616e-15 -2.44929360e-16 6.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 6.00000000e+00 0.00000000e+00] + [ 0.00000000e+00 5.99700953e+00 1.89411299e-01] + [ 0.00000000e+00 5.98804112e+00 3.78633788e-01] + ... + [-2.44929360e-16 5.98804112e+00 -3.78633788e-01] + [-2.44929360e-16 5.99700953e+00 -1.89411299e-01] + [-2.44929360e-16 6.00000000e+00 -1.46957616e-15]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 6.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 5.67490345e+00 1.94819682e+00 0.00000000e+00] + [ 4.73484306e+00 3.68527628e+00 0.00000000e+00] + ... + [ 4.73484306e+00 -3.68527628e+00 -2.44929360e-16] + [ 5.67490345e+00 -1.94819682e+00 -2.44929360e-16] + [ 6.00000000e+00 -1.46957616e-15 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 0.00000000e+00 6.00000000e+00] + [ 1.94819682e+00 0.00000000e+00 5.67490345e+00] + [ 3.68527628e+00 0.00000000e+00 4.73484306e+00] + ... + [-3.68527628e+00 -2.44929360e-16 4.73484306e+00] + [-1.94819682e+00 -2.44929360e-16 5.67490345e+00] + [-1.46957616e-15 -2.44929360e-16 6.00000000e+00]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 0.00000000e+00 6.00000000e+00 0.00000000e+00] + [ 0.00000000e+00 5.67490345e+00 1.94819682e+00] + [ 0.00000000e+00 4.73484306e+00 3.68527628e+00] + ... + [-2.44929360e-16 4.73484306e+00 -3.68527628e+00] + [-2.44929360e-16 5.67490345e+00 -1.94819682e+00] + [-2.44929360e-16 6.00000000e+00 -1.46957616e-15]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Integer 1 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt new file mode 100644 index 000000000..d6ac1342b --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-plotrange-vec.txt @@ -0,0 +1,253 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.83745173e+00 9.74098408e-01 0.00000000e+00] + [ 2.36742153e+00 1.84263814e+00 0.00000000e+00] + ... + [ 2.36742153e+00 -1.84263814e+00 -2.44929360e-16] + [ 2.83745173e+00 -9.74098408e-01 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`List + System`Real 0.0 + System`Real 3.0 + System`List + System`Real 0.0 + System`Real 3.0 + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt new file mode 100644 index 000000000..29229bb83 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-torus-vec.txt @@ -0,0 +1,250 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 1.0 + System`Real 0.690196 + System`Real 0.0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 40000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Polygon + System`NumericArray NumericArray[Integer*, 39601×4] + [[ 1 2 202 201] + [ 201 202 402 401] + [ 401 402 602 601] + ... + [39399 39400 39600 39599] + [39599 39600 39800 39799] + [39799 39800 40000 39999]] + System`RGBColor + System`Integer 0 + System`Integer 0 + System`Integer 0 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.99850477e+00 9.47056493e-02 0.00000000e+00] + [ 2.99402056e+00 1.89316894e-01 0.00000000e+00] + ... + [ 2.99402056e+00 -1.89316894e-01 -2.44929360e-16] + [ 2.99850477e+00 -9.47056493e-02 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 2 3 ... 198 199 200] + [ 201 202 203 ... 398 399 400] + [ 401 402 403 ... 598 599 600] + ... + [3401 3402 3403 ... 3598 3599 3600] + [3601 3602 3603 ... 3798 3799 3800] + [3801 3802 3803 ... 3998 3999 4000]] + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 4000×3] + [[ 3.00000000e+00 0.00000000e+00 0.00000000e+00] + [ 2.83745173e+00 9.74098408e-01 0.00000000e+00] + [ 2.36742153e+00 1.84263814e+00 0.00000000e+00] + ... + [ 2.36742153e+00 -1.84263814e+00 -2.44929360e-16] + [ 2.83745173e+00 -9.74098408e-01 -2.44929360e-16] + [ 3.00000000e+00 -7.34788079e-16 -2.44929360e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 20×200] + [[ 1 21 41 ... 3941 3961 3981] + [ 2 22 42 ... 3942 3962 3982] + [ 3 23 43 ... 3943 3963 3983] + ... + [ 18 38 58 ... 3958 3978 3998] + [ 19 39 59 ... 3959 3979 3999] + [ 20 40 60 ... 3960 3980 4000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 diff --git a/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt new file mode 100644 index 000000000..30f8deed9 --- /dev/null +++ b/test/builtin/drawing/test_plot_detail_ref/vec-parametricplot3d-trefoil-vec.txt @@ -0,0 +1,277 @@ +System`Graphics3D + System`List + System`RGBColor + System`Real 0.392157 + System`Real 0.560784 + System`Real 1.0 + System`AbsoluteThickness + System`Integer 4 + System`GraphicsComplex + System`NumericArray NumericArray[Real*, 1000×3] + [[ 0.00000000e+00 -1.00000000e+00 -0.00000000e+00] + [ 3.14466690e-02 -9.99861551e-01 -1.88673048e-02] + [ 6.28891086e-02 -9.99446227e-01 -3.77278927e-02] + ... + [-6.28891086e-02 -9.99446227e-01 3.77278927e-02] + [-3.14466690e-02 -9.99861551e-01 1.88673048e-02] + [-1.22464680e-15 -1.00000000e+00 7.34788079e-16]] + System`Line + System`NumericArray NumericArray[Integer*, 1×1000] + [[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 + 43 44 45 46 47 48 49 50 51 52 53 54 55 56 + 57 58 59 60 61 62 63 64 65 66 67 68 69 70 + 71 72 73 74 75 76 77 78 79 80 81 82 83 84 + 85 86 87 88 89 90 91 92 93 94 95 96 97 98 + 99 100 101 102 103 104 105 106 107 108 109 110 111 112 + 113 114 115 116 117 118 119 120 121 122 123 124 125 126 + 127 128 129 130 131 132 133 134 135 136 137 138 139 140 + 141 142 143 144 145 146 147 148 149 150 151 152 153 154 + 155 156 157 158 159 160 161 162 163 164 165 166 167 168 + 169 170 171 172 173 174 175 176 177 178 179 180 181 182 + 183 184 185 186 187 188 189 190 191 192 193 194 195 196 + 197 198 199 200 201 202 203 204 205 206 207 208 209 210 + 211 212 213 214 215 216 217 218 219 220 221 222 223 224 + 225 226 227 228 229 230 231 232 233 234 235 236 237 238 + 239 240 241 242 243 244 245 246 247 248 249 250 251 252 + 253 254 255 256 257 258 259 260 261 262 263 264 265 266 + 267 268 269 270 271 272 273 274 275 276 277 278 279 280 + 281 282 283 284 285 286 287 288 289 290 291 292 293 294 + 295 296 297 298 299 300 301 302 303 304 305 306 307 308 + 309 310 311 312 313 314 315 316 317 318 319 320 321 322 + 323 324 325 326 327 328 329 330 331 332 333 334 335 336 + 337 338 339 340 341 342 343 344 345 346 347 348 349 350 + 351 352 353 354 355 356 357 358 359 360 361 362 363 364 + 365 366 367 368 369 370 371 372 373 374 375 376 377 378 + 379 380 381 382 383 384 385 386 387 388 389 390 391 392 + 393 394 395 396 397 398 399 400 401 402 403 404 405 406 + 407 408 409 410 411 412 413 414 415 416 417 418 419 420 + 421 422 423 424 425 426 427 428 429 430 431 432 433 434 + 435 436 437 438 439 440 441 442 443 444 445 446 447 448 + 449 450 451 452 453 454 455 456 457 458 459 460 461 462 + 463 464 465 466 467 468 469 470 471 472 473 474 475 476 + 477 478 479 480 481 482 483 484 485 486 487 488 489 490 + 491 492 493 494 495 496 497 498 499 500 501 502 503 504 + 505 506 507 508 509 510 511 512 513 514 515 516 517 518 + 519 520 521 522 523 524 525 526 527 528 529 530 531 532 + 533 534 535 536 537 538 539 540 541 542 543 544 545 546 + 547 548 549 550 551 552 553 554 555 556 557 558 559 560 + 561 562 563 564 565 566 567 568 569 570 571 572 573 574 + 575 576 577 578 579 580 581 582 583 584 585 586 587 588 + 589 590 591 592 593 594 595 596 597 598 599 600 601 602 + 603 604 605 606 607 608 609 610 611 612 613 614 615 616 + 617 618 619 620 621 622 623 624 625 626 627 628 629 630 + 631 632 633 634 635 636 637 638 639 640 641 642 643 644 + 645 646 647 648 649 650 651 652 653 654 655 656 657 658 + 659 660 661 662 663 664 665 666 667 668 669 670 671 672 + 673 674 675 676 677 678 679 680 681 682 683 684 685 686 + 687 688 689 690 691 692 693 694 695 696 697 698 699 700 + 701 702 703 704 705 706 707 708 709 710 711 712 713 714 + 715 716 717 718 719 720 721 722 723 724 725 726 727 728 + 729 730 731 732 733 734 735 736 737 738 739 740 741 742 + 743 744 745 746 747 748 749 750 751 752 753 754 755 756 + 757 758 759 760 761 762 763 764 765 766 767 768 769 770 + 771 772 773 774 775 776 777 778 779 780 781 782 783 784 + 785 786 787 788 789 790 791 792 793 794 795 796 797 798 + 799 800 801 802 803 804 805 806 807 808 809 810 811 812 + 813 814 815 816 817 818 819 820 821 822 823 824 825 826 + 827 828 829 830 831 832 833 834 835 836 837 838 839 840 + 841 842 843 844 845 846 847 848 849 850 851 852 853 854 + 855 856 857 858 859 860 861 862 863 864 865 866 867 868 + 869 870 871 872 873 874 875 876 877 878 879 880 881 882 + 883 884 885 886 887 888 889 890 891 892 893 894 895 896 + 897 898 899 900 901 902 903 904 905 906 907 908 909 910 + 911 912 913 914 915 916 917 918 919 920 921 922 923 924 + 925 926 927 928 929 930 931 932 933 934 935 936 937 938 + 939 940 941 942 943 944 945 946 947 948 949 950 951 952 + 953 954 955 956 957 958 959 960 961 962 963 964 965 966 + 967 968 969 970 971 972 973 974 975 976 977 978 979 980 + 981 982 983 984 985 986 987 988 989 990 991 992 993 994 + 995 996 997 998 999 1000]] + System`Rule + System`AlignmentPoint + System`Center + System`Rule + System`AspectRatio + System`Integer 1 + System`Rule + System`Axes + System`True + System`Rule + System`AxesEdge + System`Automatic + System`Rule + System`AxesLabel + System`None + System`Rule + System`AxesOrigin + System`Automatic + System`Rule + System`AxesStyle + System`List + System`Rule + System`Background + System`Automatic + System`Rule + System`BaseStyle + System`List + System`Rule + System`BaselinePosition + System`Automatic + System`Rule + System`BoxRatios + System`List + System`Integer 1 + System`Integer 1 + System`Real 0.4 + System`Rule + System`BoxStyle + System`List + System`Rule + System`Boxed + System`True + System`Rule + System`ClipPlanes + System`None + System`Rule + System`ClipPlanesStyle + System`Automatic + System`Rule + System`ContentSelectable + System`Automatic + System`Rule + System`ControllerLinking + System`False + System`Rule + System`ControllerPath + System`Automatic + System`Rule + System`CoordinatesToolOptions + System`Automatic + System`Rule + System`Epilog + System`List + System`Rule + System`FaceGrids + System`None + System`Rule + System`FaceGridsStyle + System`List + System`Rule + System`FormatType + System`TraditionalForm + System`Rule + System`Frame + System`False + System`Rule + System`FrameLabel + System`None + System`Rule + System`FrameStyle + System`List + System`Rule + System`FrameTicks + System`Automatic + System`Rule + System`FrameTicksStyle + System`List + System`Rule + System`GridLines + System`None + System`Rule + System`GridLinesStyle + System`List + System`Rule + System`ImageMargins + System`Real 0.0 + System`Rule + System`ImagePadding + System`All + System`Rule + System`ImageSize + System`Automatic + System`Rule + System`LabelStyle + System`List + System`Rule + System`Lighting + System`Automatic + System`Rule + System`LogPlot + System`False + System`Rule + System`Method + System`Automatic + System`Rule + System`PlotLabel + System`None + System`Rule + System`PlotRange + System`List + System`Automatic + System`Automatic + System`Automatic + System`Rule + System`PlotRangeClipping + System`False + System`Rule + System`PlotRangePadding + System`Automatic + System`Rule + System`PlotRegion + System`Automatic + System`Rule + System`PreserveImageOptions + System`Automatic + System`Rule + System`Prolog + System`List + System`Rule + System`RotateLabel + System`True + System`Rule + System`RotationAction + System`Fit + System`Rule + System`SphericalRegion + System`Automatic + System`Rule + System`Ticks + System`Automatic + System`Rule + System`TicksStyle + System`List + System`Rule + System`TouchscreenAutoZoom + System`False + System`Rule + System`ViewAngle + System`Automatic + System`Rule + System`ViewCenter + System`Automatic + System`Rule + System`ViewMatrix + System`Automatic + System`Rule + System`ViewPoint + System`List + System`Real 1.3 + System`Real -2.4 + System`Real 2.0 + System`Rule + System`ViewProjection + System`Automatic + System`Rule + System`ViewRange + System`All + System`Rule + System`ViewVector + System`Automatic + System`Rule + System`ViewVertical + System`List + System`Integer 0 + System`Integer 0 + System`Integer 1 From 7af37ccd821481f9aabd4a90cf4a9a2cb1d40c5f Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 11:14:54 -0500 Subject: [PATCH 25/33] Fix doc --- mathics/builtin/drawing/plot_plot3d.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 3153897ce..aba0fa206 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -358,16 +358,16 @@ class SphericalPlot3D(_Plot3D):
'SphericalPlot3D'[$r(θ, φ)$, $θ$, $φ$]
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles $θ$ and $φ$ in the ranges $0 < θ < π$ and $0 < φ < 2π$ covering the entire sphere + - >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] - = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] + >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] + = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] - Spherical harmonics are the canonical use case for spherical plots. + Spherical harmonics are the canonical use case for spherical plots. - See :Drawing Option and Option Values: + See :Drawing Option and Option Values: /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values for a list of Plot options. - """ summary_text = "produce a surface plot functions spherical angles θ and φ" From dd999c781d90b05e9464f86f82f345de5d2b6304 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 11:21:00 -0500 Subject: [PATCH 26/33] Fix doc --- mathics/builtin/drawing/plot_plot3d.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index aba0fa206..48bc8ed7f 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -358,6 +358,10 @@ class SphericalPlot3D(_Plot3D):
'SphericalPlot3D'[$r(θ, φ)$, $θ$, $φ$]
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles $θ$ and $φ$ in the ranges $0 < θ < π$ and $0 < φ < 2π$ covering the entire sphere + + See :Drawing Option and Option Values: + /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values + for a list of Plot options. >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] @@ -365,9 +369,7 @@ class SphericalPlot3D(_Plot3D): Spherical harmonics are the canonical use case for spherical plots. - See :Drawing Option and Option Values: - /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values - for a list of Plot options. + """ summary_text = "produce a surface plot functions spherical angles θ and φ" From 3812b70c5b764922dd038a4043c4b8f77fbc8874 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 11:35:21 -0500 Subject: [PATCH 27/33] Fix doc --- mathics/builtin/drawing/plot_plot3d.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 48bc8ed7f..05252dbae 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -364,8 +364,8 @@ class SphericalPlot3D(_Plot3D): for a list of Plot options. - >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] - = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], θ, φ] + >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], theta, phi] + = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], theta, phi] Spherical harmonics are the canonical use case for spherical plots. From 12b8a3d7efd8df0a6223a9595d558b5a35d9e339 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 11:41:53 -0500 Subject: [PATCH 28/33] Fix doc --- mathics/builtin/drawing/plot_plot3d.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 05252dbae..63c9760fe 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -364,8 +364,8 @@ class SphericalPlot3D(_Plot3D): for a list of Plot options. - >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], theta, phi] - = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, φ]], theta, phi] + >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, phi]], theta, phi] + = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, phi]], theta, phi] Spherical harmonics are the canonical use case for spherical plots. From 939ae8a8ac2733cd07e86f4d87715d18b2fe0bf1 Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 11:44:06 -0500 Subject: [PATCH 29/33] Update plot_plot3d.py --- mathics/builtin/drawing/plot_plot3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 37c0e42bc..b271c391e 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -268,8 +268,8 @@ class DensityPlot(_Plot3D): class ParametricPlot3D(_Plot3D): """ - :WMA link: https://reference.wolfram.com/language/ref/ParametricPlot3D.html :Parametric equation: https://en.wikipedia.org/wiki/Parametric_equation + :WMA link: https://reference.wolfram.com/language/ref/ParametricPlot3D.html
'ParametricPlot3D'[${x(u,v), y(u,v), z(u,v)}$, {$u$, $u_{min}$, $u_{max}$}, {$v$, $v_{min}$, $v_{max}$}]
creates a three-dimensional surface using the functions $x$, $y$, $z$ over the specified ranges for parameters $u$ and $v$. From 0a7982a3e99712a49a63eb31482bdbdf89cd723b Mon Sep 17 00:00:00 2001 From: Bruce Lucas Date: Sat, 3 Jan 2026 11:58:32 -0500 Subject: [PATCH 30/33] Make Windows happy (hopefully, we'll see) --- mathics/builtin/drawing/plot_plot3d.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index c33bd71ac..4ee3585f4 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -349,30 +349,30 @@ class Plot3D(_Plot3D): class SphericalPlot3D(_Plot3D): """ - :WMA link: https://reference.wolfram.com/language/ref/SphericalPlot3D.html :Spherical coordinate system: https://en.wikipedia.org/wiki/Spherical_coordinate_system + :WMA link: https://reference.wolfram.com/language/ref/SphericalPlot3D.html
-
'SphericalPlot3D'[$r(θ, φ)$, {$θ$, $θ_{min}$, $θ_{max}$}, {$φ$, $φ_{min}$, $φ_{max}$}] -
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles $θ$ and $φ$ over the specified ranges +
'SphericalPlot3D'[$r(theta, phi)$, {$theta$, $theta_{min}$, $theta_{max}$}, {$phi$, $phi_{min}$, $phi_{max}$}] +
creates a three-dimensional surface at radius $r(theta, phi)$ for spherical angles $theta$ and $phi$ over the specified ranges -
'SphericalPlot3D'[$r(θ, φ)$, $θ$, $φ$] -
creates a three-dimensional surface at radius $r(θ, φ)$ for spherical angles $θ$ and $φ$ - in the ranges $0 < θ < π$ and $0 < φ < 2π$ covering the entire sphere +
'SphericalPlot3D'[$r(theta, phi)$, $theta$, $phi$] +
creates a three-dimensional surface at radius $r(theta, phi)$ for spherical angles $theta$ and $phi$ + in the ranges $0 < theta < pi$ and $0 < phi < 2pi$ covering the entire sphere See :Drawing Option and Option Values: /doc/reference-of-built-in-symbols/graphics-and-drawing/drawing-options-and-option-values for a list of Plot options.
- >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, phi]], theta, phi] - = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, θ, phi]], theta, phi] + >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, theta, phi]], theta, phi] + = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, theta, phi]], theta, phi] Spherical harmonics are the canonical use case for spherical plots. """ - summary_text = "produce a surface plot functions spherical angles θ and φ" + summary_text = "produce a surface plot functions spherical angles theta and phi" expected_args = 3 options = _Plot3D.options3d | {"BoxRatios": "{1,1,1}"} From 31218b3f8cf8d6c28437582862b9c839390e5988 Mon Sep 17 00:00:00 2001 From: Juan Mauricio Matera Date: Sat, 10 Jan 2026 14:32:40 -0300 Subject: [PATCH 31/33] Update mathics/builtin/drawing/plot_plot3d.py --- mathics/builtin/drawing/plot_plot3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index bf2e5eaae..cfab5dddb 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -289,7 +289,7 @@ class ParametricPlot3D(_Plot3D): A function of a single parameter $t$ generates a trefoil knot. >> ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}] - = ParametricPlot3D[{(2 + Cos[v]) Cos[u], (2 + Cos[v]) Sin[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}] + = ... A function of two parameters $u$ and $v$ generates a torus. From d7fca6104e2aaa750049526e8d21fca0769aba7b Mon Sep 17 00:00:00 2001 From: Juan Mauricio Matera Date: Sat, 10 Jan 2026 14:32:59 -0300 Subject: [PATCH 32/33] Update mathics/builtin/drawing/plot_plot3d.py --- mathics/builtin/drawing/plot_plot3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index cfab5dddb..69905d868 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -284,7 +284,7 @@ class ParametricPlot3D(_Plot3D):
>> ParametricPlot3D[{Sin[t] + 2 Sin[2 t], Cos[t] - 2 Cos[2 t], -Sin[3 t]}, {t, 0, 2 Pi}] - = ParametricPlot3D[{Sin[t] + 2 Sin[2 t], Cos[t] - 2 Cos[2 t], -Sin[3 t]}, {t, 0, 2 Pi}] + = ... A function of a single parameter $t$ generates a trefoil knot. From 7abe2cef246b44eb8cf4288c2d69755121f4b0d4 Mon Sep 17 00:00:00 2001 From: Juan Mauricio Matera Date: Sat, 10 Jan 2026 14:33:09 -0300 Subject: [PATCH 33/33] Update mathics/builtin/drawing/plot_plot3d.py --- mathics/builtin/drawing/plot_plot3d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot_plot3d.py b/mathics/builtin/drawing/plot_plot3d.py index 69905d868..4dced462a 100644 --- a/mathics/builtin/drawing/plot_plot3d.py +++ b/mathics/builtin/drawing/plot_plot3d.py @@ -363,7 +363,7 @@ class SphericalPlot3D(_Plot3D): >> SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, theta, phi]], theta, phi] - = SphericalPlot3D[1 + 0.4 Abs[SphericalHarmonicY[10, 4, theta, phi]], theta, phi] + = ... Spherical harmonics are the canonical use case for spherical plots.