4
$\begingroup$

The following wls file surprisingly creates an instance of Mathematica (v12.1) on OS X 10.15.7:

#!/usr/bin/env wolframscript
plato = "Icosahedron";
SetDirectory["./hp-d-wbps-t6-s1-wls/"];

Range2[from_, to_, step_] := 
  {#, Length@#} &[
  Join[Range[from, to, step], Range[to - step, from + step, -step]]
];
  
Get["../../../../HyperPlatonics.m"];

Block[
    {
       full = Range2[.1, 1.5, .01],
       viewpoints
    },
  viewpoints = 
   Table[
       2.9 {2.5 Cos@\[Phi], 2 Sin@\[Phi], .3 Sin@\[Phi]}, 
       {\[Phi], 0, 2 Pi, 2 Pi/(Last[full] - 1)}
   ];
  Map[
   Export[
     "img" <> IntegerString[# , 10, 6] <> ".jpg",
     WarpedBeamedPlatonicSolid[
          plato,
          3, .9, .7, {5, 5},
          First[full][[#]],
          ViewVector -> {viewpoints[[#]], {0, 0, 0}},
          ViewVertical -> {0, 0, 1},
          ViewAngle -> 35 Degree,
          ImageSize -> Large
      ]
   ] &,
   Range[Last@full]
  ]
];

Why does this happen? Any chance to suppress this behavior?

$\endgroup$
3
  • 3
    $\begingroup$ "Any chance to suppress this behavior?" I don't think so, but why do you want to suppress it? If you ask about the actual problem that the FE is causing, there may be a solution. As for exporting graphics without the FE—that is not possible. $\endgroup$ – Szabolcs Jan 20 at 15:57
  • 1
    $\begingroup$ @Szabolcs: "exporting graphics without FE not possible" answers the question - tnx 1m $\endgroup$ – rlj Jan 20 at 16:03
  • 1
    $\begingroup$ I'm not 100% clear about what exactly the FE is required for. Converting a Graphics[...] to a bitmap definitely relies on the FE (this is your case). However, if you already have a bitmap, you can export that without the FE. Technically, it's not the exporting but rasterization/rendering that needs the FE. $\endgroup$ – Szabolcs Jan 20 at 17:32
8
$\begingroup$

Certain functionality, most notably rasterizing graphics, is implemented by the front end. In your case it is the JPEG export that triggers this.

$\endgroup$
1
  • $\begingroup$ Would the function UsingFrontEnd help in this case? $\endgroup$ – enano9314 Jan 20 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.