Inverting Geometric errors

Here we define functions giving the required number of polygons
required to reach a maximum geometric distortion.
We do this by inverting the geometric error functions that we derived in "geometry error.nb".

The following defines functions
PolySimpErr
VptDepSimpErr
SimpleImposterErr
MeshedImposterErr
IwDErr
LDIErr
  [npolygons, radius, distance, θ, komplexity]

<< "geometry error.nb"

Evaluate manually if Mathematica complains.. You dont need it to get definitions made in this file, only if you want to check the derivations.

Calculating the inverses

Clear[npolys, r, d, distance, θ, k]

Simplified polygon objects

Solve[
      Distortion == 
        PolygonSimpErr[npolys, r, distance, θ, 
          k], {npolys}]

PolygonSimpN[r_, distance_, Distortion_, θ_, k_] := 
        Module[{n}, 
n = 
            Ceiling[((2 k ArcTan[(r/distance)])/Distortion)]; 
If[n < 4, 4, n]
];

Vpt dependent simp poly objs

Solve[
      Distortion == 
        VptDepSimpErr[npolys, r, distance, θ, k], {npolys}]

VptDepSimpN[r_, distance_, Distortion_, θ_, k_] := 
        Module[{n}, 
n = 
            Ceiling[((21 k ArcTan[(r/distance)] - 19 k ArcTan[(r/distance)] Cos[2 θ])/(2 Distortion))]; 
If[n < 4, 4, 
            n]
];

No inversion for simple imposter, as no effect of #polygons

Solve[
      Distortion == 
        MeshedImposterErr[npolys, r, distance, θ, 
          k], {npolys}]

MeshedImposterN[r_, distance_, Distortion_, θ_, k_] := 
        Module[{n}, 
n = 
            Ceiling[((k ArcTan[(r/distance)] Sin[θ] + k ArcTan[(r/distance)] Sin[3 θ])/(2 (Distortion - 2 ArcTan[(r/distance)] + 2 ArcTan[(r/distance)] Cos[2 θ])))]; 
If[n < 4, 4, n]
];

Some plots

<< "lifetime integr.nb"

Required for DandθAfterT[]

Number of polygons vs lifetime and distance

os = 1;   
mind = 0.1;   
DI = 0.001;
k = 5;
r = 1;

ppoly = 
      Plot3D[
d = 
          (10^dstart); 
{distance, θ} = 
          DandθAfterT[d, r, (10^T), os, mind]; 
        Log[10, PolygonSimpN[r, distance, DI, θ, 
            k]], 
{T, -1, 1}, {dstart, 1, 
          2}, 
PlotRange -> {0, 
            4}
]

pvptd = 
      Plot3D[
d = 
          (10^dstart); 
{distance, θ} = 
          DandθAfterT[d, r, (10^T), os, mind]; 
        Log[10, VptDepSimpN[r, distance, DI, θ, 
            k]], 
{T, -1, 1}, {dstart, 1, 
          2}, 
PlotRange -> {0, 
            4}
]

psimple = 
      Plot3D[
d = 
          (10^dstart); 
{distance, θ} = 
          DandθAfterT[d, r, (10^T), os, mind]; 
        If[SimpleImposterErr[Infinity, r, d, θ, k] < 
            DI, 
Log[1], 
          Invalid], 
{T, -1, 1}, {dstart, 1, 
          2}
]

pmesh = 
      Plot3D[
d = 
          (10^dstart); 
{distance, θ} = 
          DandθAfterT[d, r, (10^T), os, mind]; 
        If[MeshedImposterErr[Infinity, r, d, θ, k] < 
            DI, 
Log[10, 
            MeshedImposterN[r, distance, DI, θ, 
              k]], 
Invalid], 
{T, -1, 1}, {dstart, 1, 
          2}, 
PlotRange -> {0, 
            4}
]

Show[Graphics3D[{
	PolygonColor,ConvertToMesh[ppoly],
	VptDepColor,ConvertToMesh[pvptd],
	SimpleImposterColor,ConvertToMesh[psimple],
	MeshedImposterColor,ConvertToMesh[pmesh]
},
Lighting->False,AspectRatio->Automatic,
AxesLabel->{"log lifetime(s)","log distance","log #polys"},ViewPoint->{-1.661,-1.204,
    0.947},
PlotRange->{0,4},
Axes->True,BoxRatios->{1,1,.5}]]