<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>generalized_fold_box</class>
 <widget class="QWidget" name="Form">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>835</width>
    <height>4762</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string notr="true">generalized_fold_box</string>
  </property>
  <layout class="QVBoxLayout" name="verticalLayout">
   <property name="spacing">
    <number>2</number>
   </property>
   <property name="leftMargin">
    <number>2</number>
   </property>
   <property name="topMargin">
    <number>2</number>
   </property>
   <property name="rightMargin">
    <number>2</number>
   </property>
   <property name="bottomMargin">
    <number>2</number>
   </property>
   <item>
    <widget class="QGroupBox" name="groupBox">
     <property name="title">
      <string>Main parameters</string>
     </property>
     <layout class="QVBoxLayout" name="verticalLayout_2" stretch="0">
      <property name="spacing">
       <number>2</number>
      </property>
      <property name="leftMargin">
       <number>2</number>
      </property>
      <property name="topMargin">
       <number>2</number>
      </property>
      <property name="rightMargin">
       <number>2</number>
      </property>
      <property name="bottomMargin">
       <number>2</number>
      </property>
      <item>
       <layout class="QGridLayout" name="gridLayout" columnstretch="0,0,1">
        <property name="spacing">
         <number>2</number>
        </property>
        <item row="0" column="1" colspan="2">
         <widget class="MyComboBox" name="comboBox_mandelbox_generalized_fold_type">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <item>
           <property name="text">
            <string>Tetrahedron</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Cube</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Octahedron</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Dodecahedron</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>OctCube</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Icosahedron</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Box6</string>
           </property>
          </item>
          <item>
           <property name="text">
            <string>Box5</string>
           </property>
          </item>
         </widget>
        </item>
        <item row="6" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox3_mandelbox_offset_z">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-99.998999999999995</double>
          </property>
          <property name="maximum">
           <double>99.998999999999995</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="2" column="0">
         <widget class="QLabel" name="label_10">
          <property name="text">
           <string>Spherical folding
fixed radius:</string>
          </property>
         </widget>
        </item>
        <item row="3" column="0">
         <widget class="QLabel" name="label_11">
          <property name="text">
           <string>Spherical folding
min radius:</string>
          </property>
         </widget>
        </item>
        <item row="5" column="1">
         <widget class="QLabel" name="label_116">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="text">
           <string notr="true">y</string>
          </property>
          <property name="alignment">
           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
          </property>
         </widget>
        </item>
        <item row="4" column="1">
         <widget class="QLabel" name="label_115">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="text">
           <string notr="true">x</string>
          </property>
          <property name="alignment">
           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
          </property>
         </widget>
        </item>
        <item row="5" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox3_mandelbox_offset_y">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-99.998999999999995</double>
          </property>
          <property name="maximum">
           <double>99.998999999999995</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="4" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox3_mandelbox_offset_x">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-99.998999999999995</double>
          </property>
          <property name="maximum">
           <double>99.998999999999995</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="1" column="0">
         <widget class="QLabel" name="label_7">
          <property name="text">
           <string>Scale:</string>
          </property>
         </widget>
        </item>
        <item row="3" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_folding_min_radius">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="maximum">
           <double>99.998999999999995</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="2" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_folding_fixed_radius">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-99.998999999999995</double>
          </property>
          <property name="maximum">
           <double>99.998999999999995</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="4" column="0" rowspan="3">
         <widget class="QLabel" name="label_12">
          <property name="text">
           <string>Spherical folding
offset:</string>
          </property>
         </widget>
        </item>
        <item row="6" column="1">
         <widget class="QLabel" name="label_117">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="text">
           <string notr="true">z</string>
          </property>
          <property name="alignment">
           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
          </property>
         </widget>
        </item>
        <item row="1" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_scale">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-99.998999999999995</double>
          </property>
          <property name="maximum">
           <double>99.998999999999995</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="7" column="0">
         <widget class="QLabel" name="label_16">
          <property name="text">
           <string>Solid:</string>
          </property>
         </widget>
        </item>
        <item row="0" column="0">
         <widget class="QLabel" name="label_8">
          <property name="text">
           <string>Box type:</string>
          </property>
         </widget>
        </item>
        <item row="8" column="0">
         <widget class="QLabel" name="label_17">
          <property name="text">
           <string>Melt:</string>
          </property>
         </widget>
        </item>
        <item row="7" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_solid">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>3</number>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="8" column="2">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_melt">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>3</number>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
       </layout>
      </item>
     </layout>
    </widget>
   </item>
   <item>
    <widget class="MyGroupBox" name="groupCheck_mandelbox_main_rotation_enabled">
     <property name="title">
      <string>&amp;Main rotation</string>
     </property>
     <property name="checkable">
      <bool>true</bool>
     </property>
     <layout class="QVBoxLayout" name="verticalLayout_3" stretch="0">
      <property name="spacing">
       <number>2</number>
      </property>
      <property name="leftMargin">
       <number>2</number>
      </property>
      <property name="topMargin">
       <number>2</number>
      </property>
      <property name="rightMargin">
       <number>2</number>
      </property>
      <property name="bottomMargin">
       <number>2</number>
      </property>
      <item>
       <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
        <property name="spacing">
         <number>2</number>
        </property>
        <item row="2" column="1">
         <widget class="MyDoubleSpinBox" name="spinboxd3_mandelbox_rotation_main_z">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-36000.000000000000000</double>
          </property>
          <property name="maximum">
           <double>36000.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>1.000000000000000</double>
          </property>
         </widget>
        </item>
        <item row="2" column="0">
         <widget class="QLabel" name="label_15">
          <property name="text">
           <string notr="true">gamma</string>
          </property>
         </widget>
        </item>
        <item row="1" column="0">
         <widget class="QLabel" name="label_14">
          <property name="text">
           <string notr="true">beta</string>
          </property>
         </widget>
        </item>
        <item row="0" column="0">
         <widget class="QLabel" name="label_13">
          <property name="text">
           <string notr="true">alpha</string>
          </property>
         </widget>
        </item>
        <item row="1" column="1">
         <widget class="MyDoubleSpinBox" name="spinboxd3_mandelbox_rotation_main_y">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-36000.000000000000000</double>
          </property>
          <property name="maximum">
           <double>36000.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>1.000000000000000</double>
          </property>
         </widget>
        </item>
        <item row="0" column="1">
         <widget class="MyDoubleSpinBox" name="spinboxd3_mandelbox_rotation_main_x">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-36000.000000000000000</double>
          </property>
          <property name="maximum">
           <double>36000.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>1.000000000000000</double>
          </property>
         </widget>
        </item>
       </layout>
      </item>
     </layout>
    </widget>
   </item>
   <item>
    <widget class="QGroupBox" name="groupBox_4">
     <property name="title">
      <string>Coloring parameters</string>
     </property>
     <layout class="QGridLayout" name="gridLayout_5">
      <property name="leftMargin">
       <number>2</number>
      </property>
      <property name="topMargin">
       <number>2</number>
      </property>
      <property name="rightMargin">
       <number>2</number>
      </property>
      <property name="bottomMargin">
       <number>2</number>
      </property>
      <property name="spacing">
       <number>2</number>
      </property>
      <item row="0" column="0">
       <layout class="QGridLayout" name="gridLayout_4" columnstretch="0,1">
        <property name="spacing">
         <number>2</number>
        </property>
        <item row="4" column="0">
         <widget class="QLabel" name="label_28">
          <property name="text">
           <string>Min radius component:</string>
          </property>
         </widget>
        </item>
        <item row="2" column="0">
         <widget class="QLabel" name="label_26">
          <property name="text">
           <string>Y plane component:</string>
          </property>
         </widget>
        </item>
        <item row="1" column="1">
         <widget class="MyDoubleSpinBox" name="spinbox3_mandelbox_color_x">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-100.000000000000000</double>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="3" column="1">
         <widget class="MyDoubleSpinBox" name="spinbox3_mandelbox_color_z">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-100.000000000000000</double>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="1" column="0">
         <widget class="QLabel" name="label_25">
          <property name="text">
           <string>X plane component:</string>
          </property>
         </widget>
        </item>
        <item row="3" column="0">
         <widget class="QLabel" name="label_27">
          <property name="text">
           <string>Z plane component:</string>
          </property>
         </widget>
        </item>
        <item row="0" column="1">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_color_R">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-100.000000000000000</double>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="0" column="0">
         <widget class="QLabel" name="label_24">
          <property name="text">
           <string>Absolute value of z:</string>
          </property>
         </widget>
        </item>
        <item row="2" column="1">
         <widget class="MyDoubleSpinBox" name="spinbox3_mandelbox_color_y">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-100.000000000000000</double>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="5" column="0">
         <widget class="QLabel" name="label_29">
          <property name="text">
           <string>Fixed radius component:</string>
          </property>
         </widget>
        </item>
        <item row="4" column="1">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_color_Sp1">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-100.000000000000000</double>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
        <item row="5" column="1">
         <widget class="MyDoubleSpinBox" name="spinbox_mandelbox_color_Sp2">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
          <property name="prefix">
           <string/>
          </property>
          <property name="suffix">
           <string/>
          </property>
          <property name="decimals">
           <number>6</number>
          </property>
          <property name="minimum">
           <double>-100.000000000000000</double>
          </property>
          <property name="maximum">
           <double>100.000000000000000</double>
          </property>
          <property name="singleStep">
           <double>0.100000000000000</double>
          </property>
         </widget>
        </item>
       </layout>
      </item>
     </layout>
    </widget>
   </item>
   <item>
    <widget class="MyGroupBox" name="groupCheck_info">
     <property name="title">
      <string>Info&amp;rmation</string>
     </property>
     <property name="flat">
      <bool>false</bool>
     </property>
     <property name="checkable">
      <bool>true</bool>
     </property>
     <layout class="QVBoxLayout" name="verticalLayout_4">
      <property name="spacing">
       <number>2</number>
      </property>
      <property name="leftMargin">
       <number>2</number>
      </property>
      <property name="topMargin">
       <number>2</number>
      </property>
      <property name="rightMargin">
       <number>2</number>
      </property>
      <property name="bottomMargin">
       <number>2</number>
      </property>
      <item>
       <widget class="QLabel" name="label_information_general">
        <property name="text">
         <string notr="true">&lt;p&gt;GeneralizedFoldBoxIteration - Quaternion fractal with extended controls&lt;/p&gt;&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Reference&lt;/th&gt;&lt;td&gt;&lt;a href=&quot;http://www.fractalforums.com/new-theories-and-research/generalized-box-fold/&quot;&gt;http://www.fractalforums.com/new-theories-and-research/generalized-box-fold/&lt;br&gt;
&lt;a href=&quot;This formula contains aux.color&quot;&gt;This formula contains aux.color&lt;br&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;&lt;b&gt;Examples using this formula&lt;/b&gt;&lt;br&gt;Krzysztof Marczak collection - license Creative Commons (CC-BY 4.0)/GeneralizedFoldBox01.fract&lt;br&gt;Krzysztof Marczak collection - license Creative Commons (CC-BY 4.0)/GeneralizedFoldBox02.fract&lt;br&gt;Krzysztof Marczak collection - license Creative Commons (CC-BY 4.0)/GeneralizedFoldBox03_2.fract&lt;br&gt;Krzysztof Marczak collection - license Creative Commons (CC-BY 4.0)/hybrid31.fract&lt;br&gt;Krzysztof Marczak collection - license Creative Commons (CC-BY 4.0)/mandelbox56.fract&lt;h3&gt;Code&lt;/h3&gt;</string>
        </property>
        <property name="wordWrap">
         <bool>true</bool>
        </property>
        <property name="openExternalLinks">
         <bool>true</bool>
        </property>
        <property name="textInteractionFlags">
         <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLabel" name="label_code_content">
        <property name="styleSheet">
         <string notr="true">border-style: outset; border-width: 2px; border-radius: 3px; border-color: black; background-color: #fff5ee; padding: 4px;</string>
        </property>
        <property name="text">
         <string notr="true">&lt;body style=&quot;background-color:#fff5ee&quot;&gt;
&lt;pre style=&quot;color:#000000; background-color:#fff5ee;  font-family:'Courier New',monospace;&quot;&gt;&lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color:#00008f&quot;&gt;GeneralizedFoldBoxIteration&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;CVector4 &lt;span style=&quot;color:#676767&quot;&gt;&amp;amp;&lt;/span&gt;z&lt;span style=&quot;color:#676767&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;const&lt;/span&gt; sFractal &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt;fractal&lt;span style=&quot;color:#676767&quot;&gt;,&lt;/span&gt; sExtendedAux &lt;span style=&quot;color:#676767&quot;&gt;&amp;amp;&lt;/span&gt;aux&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
  CVector3 zXYZ &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; z&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;GetXYZ&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;();&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;const&lt;/span&gt; CVector3 &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt;Nv&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;int&lt;/span&gt; sides&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;switch&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;type&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldTet&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_tet&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_tet&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldCube&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_cube&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_cube&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldOct&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_oct&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_oct&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldDodeca&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_dodeca&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_dodeca&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldOctCube&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_oct_cube&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_oct_cube&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldIcosa&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_icosa&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_icosa&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldBox6&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_box6&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_box6&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;case&lt;/span&gt; generalizedFoldBoxType_foldBox5&lt;span style=&quot;color:#676767&quot;&gt;:&lt;/span&gt;
      Nv &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;Nv_box5&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      sides &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;genFoldBox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;sides_box5&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;

  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; melt &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;melt&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; solid &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;solid&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

  &lt;span style=&quot;color:#2929cc&quot;&gt;// Find the closest cutting plane if any that cuts the line between the origin and z.&lt;/span&gt;
  &lt;span style=&quot;color:#2929cc&quot;&gt;// Line is parameterized as X = Y + L*a;&lt;/span&gt;
  &lt;span style=&quot;color:#2929cc&quot;&gt;// Cutting plane is X.Dot(Nv) = Solid.&lt;/span&gt;
  &lt;span style=&quot;color:#2929cc&quot;&gt;// (Y + L*a).Dot(Nv) = solid.&lt;/span&gt;
  &lt;span style=&quot;color:#2929cc&quot;&gt;// a = (solid - Y.Dot(Nv))/L.Dot(Nv) = b/c&lt;/span&gt;
  CVector3 L &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; zXYZ&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; a &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  CVector3 Y&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color:#2929cc&quot;&gt;// Y is the origin in this case.&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;int&lt;/span&gt; side &lt;span style=&quot;color:#676767&quot;&gt;= -&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; b&lt;span style=&quot;color:#676767&quot;&gt;,&lt;/span&gt; c&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt; i &lt;span style=&quot;color:#676767&quot;&gt;&amp;lt;&lt;/span&gt; sides&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt; i&lt;span style=&quot;color:#676767&quot;&gt;++)&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
    b &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; solid&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    c &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; L&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;Nv&lt;span style=&quot;color:#676767&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color:#676767&quot;&gt;]);&lt;/span&gt;
    &lt;span style=&quot;color:#2929cc&quot;&gt;// A bit subtle here. a_r must be positive and I want to avoid divide by zero.&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;((&lt;/span&gt;c &lt;span style=&quot;color:#676767&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;0.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;) &amp;amp;&amp;amp; ((&lt;/span&gt;a &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; c&lt;span style=&quot;color:#676767&quot;&gt;) &amp;gt;&lt;/span&gt; b&lt;span style=&quot;color:#676767&quot;&gt;))&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
      side &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; i&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      a &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; b &lt;span style=&quot;color:#676767&quot;&gt;/&lt;/span&gt; c&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;

  &lt;span style=&quot;color:#2929cc&quot;&gt;// If z is above the foldingValue we may have to fold. Else early out.&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;side &lt;span style=&quot;color:#676767&quot;&gt;!= -&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color:#2929cc&quot;&gt;// mirror check&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;int&lt;/span&gt; side_m &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; side&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    CVector3 Nv_m &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Nv&lt;span style=&quot;color:#676767&quot;&gt;[&lt;/span&gt;side_m&lt;span style=&quot;color:#676767&quot;&gt;];&lt;/span&gt;
    CVector3 X_m &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; zXYZ &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; Nv_m &lt;span style=&quot;color:#676767&quot;&gt;* (&lt;/span&gt;zXYZ&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;Nv_m&lt;span style=&quot;color:#676767&quot;&gt;) -&lt;/span&gt; solid&lt;span style=&quot;color:#676767&quot;&gt;);&lt;/span&gt;

    &lt;span style=&quot;color:#2929cc&quot;&gt;// Find any plane (Nv_r) closest to X_m that cuts the line between Nv_m and X_m.&lt;/span&gt;
    &lt;span style=&quot;color:#2929cc&quot;&gt;// Nv_m cross Nv_r will define a possible rotation axis.&lt;/span&gt;
    &lt;span style=&quot;color:#2929cc&quot;&gt;// a = (solid - Y.Dot(Nv)/L.Dot(Nv) = b/c.&lt;/span&gt;
    L &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; X_m &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; Nv_m&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    Y &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Nv_m&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    a &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    side &lt;span style=&quot;color:#676767&quot;&gt;= -&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt; i &lt;span style=&quot;color:#676767&quot;&gt;&amp;lt;&lt;/span&gt; sides&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt; i&lt;span style=&quot;color:#676767&quot;&gt;++)&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color:#676767&quot;&gt;!=&lt;/span&gt; side_m&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
        b &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; solid &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; Y&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;Nv&lt;span style=&quot;color:#676767&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color:#676767&quot;&gt;]);&lt;/span&gt;
        c &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; L&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;Nv&lt;span style=&quot;color:#676767&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color:#676767&quot;&gt;]);&lt;/span&gt;
        &lt;span style=&quot;color:#2929cc&quot;&gt;// A bit subtle here. a_r must be positive and I want to avoid divide by zero.&lt;/span&gt;
        &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;((&lt;/span&gt;c &lt;span style=&quot;color:#676767&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;0.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;) &amp;amp;&amp;amp; ((&lt;/span&gt;a &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; c&lt;span style=&quot;color:#676767&quot;&gt;) &amp;gt;&lt;/span&gt; b&lt;span style=&quot;color:#676767&quot;&gt;))&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
          side &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; i&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
          a &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; b &lt;span style=&quot;color:#676767&quot;&gt;/&lt;/span&gt; c&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;

    &lt;span style=&quot;color:#2929cc&quot;&gt;// Was a cutting plane found?&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;side &lt;span style=&quot;color:#676767&quot;&gt;!= -&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color:#2929cc&quot;&gt;// rotation check&lt;/span&gt;
      CVector3 Xmr_intersect &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Y &lt;span style=&quot;color:#676767&quot;&gt;+&lt;/span&gt; L &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; a&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;int&lt;/span&gt; side_r &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; side&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      CVector3 Nv_r &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Nv&lt;span style=&quot;color:#676767&quot;&gt;[&lt;/span&gt;side_r&lt;span style=&quot;color:#676767&quot;&gt;];&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// The axis of rotation is define by the cross product of Nv_m and Nv_r and&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// the intersection of the line between Nv_m and Nv_r and  Xmr_intersect.&lt;/span&gt;
      CVector3 L_r &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Nv_m&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Cross&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;Nv_r&lt;span style=&quot;color:#676767&quot;&gt;);&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// The closest point between z and the line of rotation can be found by minimizing&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// the square of the distance (D) between z and the line&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// X = Xmr_intersect + L_r * a_rmin.&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// Setting dD/da_rmin equal to zero and solving for a_rmin.&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; a_rmin &lt;span style=&quot;color:#676767&quot;&gt;= (&lt;/span&gt;zXYZ&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;L_r&lt;span style=&quot;color:#676767&quot;&gt;) -&lt;/span&gt; Xmr_intersect&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;L_r&lt;span style=&quot;color:#676767&quot;&gt;)) / (&lt;/span&gt;L_r&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;L_r&lt;span style=&quot;color:#676767&quot;&gt;));&lt;/span&gt;

      &lt;span style=&quot;color:#2929cc&quot;&gt;// force a_rmin to be positive. I think I made an even number of sign errors here.&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;a_rmin &lt;span style=&quot;color:#676767&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;0.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
        a_rmin &lt;span style=&quot;color:#676767&quot;&gt;= -&lt;/span&gt;a_rmin&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
        L_r &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; L_r &lt;span style=&quot;color:#676767&quot;&gt;* (-&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;);&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
      CVector3 X_r &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Xmr_intersect &lt;span style=&quot;color:#676767&quot;&gt;+&lt;/span&gt; L_r &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; a_rmin&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

      &lt;span style=&quot;color:#2929cc&quot;&gt;// Find any plane (Nv_i) closest to Xmr_intersect that cuts the line between&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// Xmr_intersect and X_r. This will define a possible inversion point.&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// a = (solid - Y.Dot(Nv)/L.Dot(Nv) = b/c.&lt;/span&gt;
      L &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; X_r &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; Xmr_intersect&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      Y &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Xmr_intersect&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      a &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      side &lt;span style=&quot;color:#676767&quot;&gt;= -&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt; i &lt;span style=&quot;color:#676767&quot;&gt;&amp;lt;&lt;/span&gt; sides&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt; i&lt;span style=&quot;color:#676767&quot;&gt;++)&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;((&lt;/span&gt;i &lt;span style=&quot;color:#676767&quot;&gt;!=&lt;/span&gt; side_m&lt;span style=&quot;color:#676767&quot;&gt;) &amp;amp;&amp;amp; (&lt;/span&gt;i &lt;span style=&quot;color:#676767&quot;&gt;!=&lt;/span&gt; side_r&lt;span style=&quot;color:#676767&quot;&gt;))&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
          b &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; solid &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; Y&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;Nv&lt;span style=&quot;color:#676767&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color:#676767&quot;&gt;]);&lt;/span&gt;
          c &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; L&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;Nv&lt;span style=&quot;color:#676767&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color:#676767&quot;&gt;]);&lt;/span&gt;
          &lt;span style=&quot;color:#2929cc&quot;&gt;// A bit subtle here. a must be positive and I want to avoid divide by zero.&lt;/span&gt;
          &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;((&lt;/span&gt;c &lt;span style=&quot;color:#676767&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;0.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;) &amp;amp;&amp;amp; ((&lt;/span&gt;a &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; c&lt;span style=&quot;color:#676767&quot;&gt;) &amp;gt;&lt;/span&gt; b&lt;span style=&quot;color:#676767&quot;&gt;))&lt;/span&gt;
          &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
            side &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; i&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
            a &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; b &lt;span style=&quot;color:#676767&quot;&gt;/&lt;/span&gt; c&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
          &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;

      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;side &lt;span style=&quot;color:#676767&quot;&gt;!= -&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color:#2929cc&quot;&gt;// inversion check&lt;/span&gt;
        &lt;span style=&quot;color:#2929cc&quot;&gt;// Only inversion point possible but still need to check for melt.&lt;/span&gt;

        CVector3 X_i &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; Y &lt;span style=&quot;color:#676767&quot;&gt;+&lt;/span&gt; L &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; a&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
        CVector3 z2X &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; X_i &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; zXYZ&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color:#2929cc&quot;&gt;// Is z above the melt layer.&lt;/span&gt;
        &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;z2X&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;z2X&lt;span style=&quot;color:#676767&quot;&gt;) &amp;gt; (&lt;/span&gt;melt &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; melt&lt;span style=&quot;color:#676767&quot;&gt;))&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
          &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; z2X&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;();&lt;/span&gt;
          zXYZ &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; z2X &lt;span style=&quot;color:#676767&quot;&gt;* (&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;2.0&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;* (&lt;/span&gt;z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; melt&lt;span style=&quot;color:#676767&quot;&gt;) / (&lt;/span&gt;z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;.00000001&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;));&lt;/span&gt;
          aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;factor&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;z&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;else&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color:#2929cc&quot;&gt;// Only rotation line possible but still need to check for melt.&lt;/span&gt;
        &lt;span style=&quot;color:#2929cc&quot;&gt;// Is z above the melt layer.&lt;/span&gt;
        CVector3 z2X &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; X_r &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; zXYZ&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;z2X&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;z2X&lt;span style=&quot;color:#676767&quot;&gt;) &amp;gt; (&lt;/span&gt;melt &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; melt&lt;span style=&quot;color:#676767&quot;&gt;))&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
          &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; z2X&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;();&lt;/span&gt;
          zXYZ &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; z2X &lt;span style=&quot;color:#676767&quot;&gt;* (&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;2.0&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;* (&lt;/span&gt;z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; melt&lt;span style=&quot;color:#676767&quot;&gt;) / (&lt;/span&gt;z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;.00000001&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;));&lt;/span&gt;
          aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;factor&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;y&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;else&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color:#2929cc&quot;&gt;// Only mirror plane possible but still need to check for melt.&lt;/span&gt;
      CVector3 z2X &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; X_m &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; zXYZ&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;z2X&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;z2X&lt;span style=&quot;color:#676767&quot;&gt;) &amp;gt; (&lt;/span&gt;melt &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; melt&lt;span style=&quot;color:#676767&quot;&gt;))&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; z2X&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Length&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;();&lt;/span&gt;
        zXYZ &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; z2X &lt;span style=&quot;color:#676767&quot;&gt;* (&lt;/span&gt;&lt;span style=&quot;color:#ff1493&quot;&gt;2.0&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;* (&lt;/span&gt;z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;-&lt;/span&gt; melt&lt;span style=&quot;color:#676767&quot;&gt;) / (&lt;/span&gt;z2X_mag &lt;span style=&quot;color:#676767&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;.00000001&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;));&lt;/span&gt;
        aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;factor&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;x&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color:#2929cc&quot;&gt;// outside solid&lt;/span&gt;

  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; r2 &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; zXYZ&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;Dot&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;zXYZ&lt;span style=&quot;color:#676767&quot;&gt;);&lt;/span&gt;

  z &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#00008f&quot;&gt;CVector4&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;zXYZ&lt;span style=&quot;color:#676767&quot;&gt;,&lt;/span&gt; z&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;w&lt;span style=&quot;color:#676767&quot;&gt;);&lt;/span&gt;

  z &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;offset&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;r2 &lt;span style=&quot;color:#676767&quot;&gt;&amp;lt;&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;mR2&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
    z &lt;span style=&quot;color:#676767&quot;&gt;*=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;mboxFactor1&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;DE &lt;span style=&quot;color:#676767&quot;&gt;*=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;mboxFactor1&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;factorSp1&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;else if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;r2 &lt;span style=&quot;color:#676767&quot;&gt;&amp;lt;&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;fR2&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;double&lt;/span&gt; tglad_factor2 &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;fR2 &lt;span style=&quot;color:#676767&quot;&gt;/&lt;/span&gt; r2&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    z &lt;span style=&quot;color:#676767&quot;&gt;*=&lt;/span&gt; tglad_factor2&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;DE &lt;span style=&quot;color:#676767&quot;&gt;*=&lt;/span&gt; tglad_factor2&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
    aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color &lt;span style=&quot;color:#676767&quot;&gt;+=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;color&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;factorSp2&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;

  z &lt;span style=&quot;color:#676767&quot;&gt;-=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;offset&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;

  &lt;span style=&quot;color:#2e8b57; font-weight:bold&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;mainRotationEnabled&lt;span style=&quot;color:#676767&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;{&lt;/span&gt;
    z &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;mainRot&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#00008f&quot;&gt;RotateVector&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;z&lt;span style=&quot;color:#676767&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;

  z &lt;span style=&quot;color:#676767&quot;&gt;*=&lt;/span&gt; fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;scale&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
  aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;DE &lt;span style=&quot;color:#676767&quot;&gt;=&lt;/span&gt; aux&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;DE &lt;span style=&quot;color:#676767&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color:#00008f&quot;&gt;fabs&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;(&lt;/span&gt;fractal&lt;span style=&quot;color:#676767&quot;&gt;-&amp;gt;&lt;/span&gt;mandelbox&lt;span style=&quot;color:#676767&quot;&gt;.&lt;/span&gt;scale&lt;span style=&quot;color:#676767&quot;&gt;) +&lt;/span&gt; &lt;span style=&quot;color:#ff1493&quot;&gt;1.0&lt;/span&gt;&lt;span style=&quot;color:#676767&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color:#676767&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/body&gt;</string>
        </property>
        <property name="wordWrap">
         <bool>true</bool>
        </property>
        <property name="openExternalLinks">
         <bool>true</bool>
        </property>
        <property name="textInteractionFlags">
         <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
        </property>
       </widget>
      </item>
     </layout>
    </widget>
   </item>
   <item>
    <spacer name="verticalSpacer_2">
     <property name="orientation">
      <enum>Qt::Vertical</enum>
     </property>
     <property name="sizeHint" stdset="0">
      <size>
       <width>20</width>
       <height>40</height>
      </size>
     </property>
    </spacer>
   </item>
  </layout>
 </widget>
 <customwidgets>
  <customwidget>
   <class>MyDoubleSpinBox</class>
   <extends>QDoubleSpinBox</extends>
   <header>my_double_spin_box.h</header>
  </customwidget>
  <customwidget>
   <class>MyGroupBox</class>
   <extends>QGroupBox</extends>
   <header>my_group_box.h</header>
   <container>1</container>
  </customwidget>
  <customwidget>
   <class>MyComboBox</class>
   <extends>QComboBox</extends>
   <header>my_combo_box.h</header>
  </customwidget>
 </customwidgets>
 <tabstops>
  <tabstop>comboBox_mandelbox_generalized_fold_type</tabstop>
  <tabstop>spinbox_mandelbox_scale</tabstop>
  <tabstop>spinbox_mandelbox_folding_fixed_radius</tabstop>
  <tabstop>spinbox_mandelbox_folding_min_radius</tabstop>
  <tabstop>spinbox3_mandelbox_offset_x</tabstop>
  <tabstop>spinbox3_mandelbox_offset_y</tabstop>
  <tabstop>spinbox3_mandelbox_offset_z</tabstop>
  <tabstop>spinbox_mandelbox_solid</tabstop>
  <tabstop>spinbox_mandelbox_melt</tabstop>
  <tabstop>groupCheck_mandelbox_main_rotation_enabled</tabstop>
  <tabstop>spinboxd3_mandelbox_rotation_main_y</tabstop>
  <tabstop>spinbox_mandelbox_color_R</tabstop>
  <tabstop>spinbox3_mandelbox_color_x</tabstop>
  <tabstop>spinbox3_mandelbox_color_y</tabstop>
  <tabstop>spinbox3_mandelbox_color_z</tabstop>
  <tabstop>spinbox_mandelbox_color_Sp1</tabstop>
  <tabstop>spinbox_mandelbox_color_Sp2</tabstop>
  <tabstop>groupCheck_info</tabstop>
 </tabstops>
 <resources/>
 <connections/>
</ui>
