Voronoi Joint

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VRTK;

//Set to Template option

public class Voronoi_Joint : MonoBehaviour
{
    public enum GEOMETRY
    {
        TETRA,
        OCTA,
    };

    public GEOMETRY geo = GEOMETRY.TETRA;

    public GameObject[] centerRbs = new GameObject[6];//4
    public GameObject[] connected_Joints = new GameObject[6];//4
    private Vector3[] cj_12_EndPoints = new Vector3[12];
    private Vector3[] cj_24_EndPoints = new Vector3[24];

    private Vector3 startPosition;

    //private int[,] vN_Points_to;

    private Six_Splines    six_splines;
    private Twelve_Splines twelve_Splines;

    public bool bPrint_Debug = false;

    public Button_VU bvToggle_Hi_Res;


    /// <image url="$(SolutionDir)\EMB\EMB_Edge_Vert.png" scale="0.36" /> 

    /// <image url="$(SolutionDir)\EMB\EMB_Edge_Vert_2.png" scale="0.1" /> 

    public float radius = 1;
    public float outerforceMag = 10;
    public float centering_Mult = 1;
    public float torque_Coefficient = 1f;
    private VRTK_InteractableObject vrtk_Interact_1;

    public enum Handle_States
    {
        NORMAL,
        TOUCHED,
        GRABBED,
    }

    private Handle_States handle_State = Handle_States.NORMAL;

    public Color handle_Base_Col;
    public Color handle_Touched_Col;
    public Color handle_Grabbed_Col;
    private Color handle_Base_Emissive_Col;

    private VU_UI_MANAGER VU_UI;

    public bool bUsePhysics = true;
    public bool bSetTetraPositions = false;
    public GameObject TetraVoronoi;

    void Start()
    {
        startPosition = transform.position;

        bvToggle_Hi_Res.isON = false;

        vrtk_Interact_1 = GetComponent<VRTK_InteractableObject>();
        VU_UI = VU_UI_MANAGER.Instance;

        if (geo == GEOMETRY.TETRA)
        {
            six_splines = GetComponentInChildren<Six_Splines>();
            six_splines.Set_CJ_0_GO(connected_Joints[0]);//For OutII
        }
        else if(geo == GEOMETRY.OCTA)
        {
            twelve_Splines = GetComponentInChildren<Twelve_Splines>();
        }

        vrtk_Interact_1.InteractableObjectTouched += new InteractableObjectEventHandler(DoObject_1_Touched);
        vrtk_Interact_1.InteractableObjectUntouched += new InteractableObjectEventHandler(DoObject_1_Untouched);

        vrtk_Interact_1.InteractableObjectGrabbed += new InteractableObjectEventHandler(DoObject_1_Grabbed);
        vrtk_Interact_1.InteractableObjectUngrabbed += new InteractableObjectEventHandler(DoObject_1_Ungrabbed);

        if (!bUsePhysics)
        {
            Rigidbody[] rbs = GetComponentsInChildren<Rigidbody>();
            foreach(Rigidbody rb in rbs)
            {
                rb.isKinematic = true;
            }
             
            for (int i = 0; i < centerRbs.Length; i++)
            {
                centerRbs[i].GetComponent<Rigidbody>().isKinematic = true;
                centerRbs[i].GetComponent<ConfigurableJoint>().enablePreprocessing = false;
                connected_Joints[i].GetComponent<Rigidbody>().isKinematic = true;
            }
        }
        if(bSetTetraPositions)
        {
            Voronoi_Joint vj = TetraVoronoi.GetComponent<Voronoi_Joint>();

            Vector3 thisBasePosition = transform.position;

            float edgeLength = (connected_Joints[0].transform.position - connected_Joints[1].transform.position).magnitude;

            Vector3 vfaceCenter = ( connected_Joints[0].transform.localPosition +
                                    connected_Joints[1].transform.localPosition +
                                    connected_Joints[2].transform.localPosition) / 3f;

            Vector3 vDir = vfaceCenter.normalized;

            float tetraHeight = edgeLength * Mathf.Sqrt(0.666666667f);

            TetraVoronoi.transform.position = transform.position + vfaceCenter + vDir * edgeLength * Mathf.Sqrt(6) / 12f;

            Vector3[] vTetraPos = new Vector3[4];

            vTetraPos[0] = connected_Joints[0].transform.position;
            vTetraPos[1] = connected_Joints[1].transform.position;
            vTetraPos[2] = connected_Joints[2].transform.position;
            vTetraPos[3] = thisBasePosition + vfaceCenter + vDir*edgeLength*Mathf.Sqrt(6)/3;

            vj.SetPositions(ref vTetraPos);
        }
    }

    public void SetPositions(ref Vector3[] positions)
    {
        for(int i = 0; i < connected_Joints.Length; i++)
        {
            connected_Joints[i].transform.position = positions[i];
        }
    }

    private void DoObject_1_Touched(object sender, InteractableObjectEventArgs e)
    {
        handle_State = Handle_States.TOUCHED;
        VU_UI.Report_Touched(vrtk_Interact_1.gameObject, e.interactingObject);
    }

    private void DoObject_1_Untouched(object sender, InteractableObjectEventArgs e)
    {
        handle_State = Handle_States.NORMAL;
        VU_UI.Report_UnTouched(vrtk_Interact_1.gameObject, e.interactingObject);
    }

    private void DoObject_1_Grabbed(object sender, InteractableObjectEventArgs e)
    {
        handle_State = Handle_States.GRABBED;
    }

    private void DoObject_1_Ungrabbed(object sender, InteractableObjectEventArgs e)
    {
        handle_State = Handle_States.NORMAL;
    }

    private bool isValid_Vector(Vector3 v)
    {
        if (!float.IsNaN(v.x) && !float.IsNaN(v.y) && !float.IsNaN(v.z))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public void Return_To_Start_Position()
    {
        transform.position = startPosition;
    }

    void FixedUpdate()
    {
        if (bUsePhysics)
        {
            //Angular Adjustment
            for (int j = 0; j < connected_Joints.Length; j++)
            {
                Vector3 vA = connected_Joints[j].transform.right;
                GameObject gAlign = connected_Joints[0];

                //subtract y component to get projection on current XZ plane
                float yDot = Vector3.Dot(connected_Joints[j].transform.up, gAlign.transform.up);
                Vector3 yProjected = gAlign.transform.up + yDot * gAlign.transform.up;

                float torque = torque_Coefficient * Vector3.Dot(yProjected, connected_Joints[j].transform.forward);
                Rigidbody rbc = connected_Joints[j].GetComponent<Rigidbody>();
                rbc.AddTorque(rbc.transform.up * torque);
            }

            //Distribute around sphere - Voronoi Action
            foreach (GameObject go in connected_Joints)
            {
                Rigidbody rb = go.GetComponent<Rigidbody>();
                Rigidbody rbInner;
                Vector3 vFrom;
                Vector3 vSum;
                Vector3 vRecip;

                foreach (GameObject gInner in connected_Joints)
                {
                    vSum = Vector3.zero;
                    float r;//Radius from Neighbor

                    if (go != gInner)
                    {
                        rbInner = gInner.GetComponent<Rigidbody>();
                        vFrom = rb.position - rbInner.position;
                        r = vFrom.magnitude;
                        vRecip = (1f / r) * vFrom.normalized;
                        vSum += vRecip;
                    }
                    if (isValid_Vector(vSum))
                    {
                        rb.AddForce(outerforceMag * vSum);
                    }
                }
            }
            //Pull centerRbs into Center of Sphere
            Vector3 vDiff;
            foreach (GameObject gCent in centerRbs)
            {
                Rigidbody rb = gCent.GetComponent<Rigidbody>();
                vDiff = transform.position - rb.position;

                rb.velocity = vDiff / Time.fixedDeltaTime;
            }

            if (bPrint_Debug)
            {
                //for (int i = 0; i < 4; i++)
                //{
                //    for (int j = 0; j < 3; j++)
                //    {
                //        print("VN_[" + i.ToString() + "," + j.ToString() + "] points to " + vN_Points_to[i, j].ToString());
                //    }
                //}
                bPrint_Debug = false;
            }
        }
    }

    Color curr_Color;
    Color curr_dot_Color;
    Color targ_Color;
    Color targ_dot_Color;

    float theta = 390;
    float target_theta = 0;

    public void Animate_Handle_Material()//UI HANDLE
    {
        curr_Color = Color.Lerp(curr_Color, targ_Color, Time.deltaTime * 1.61803f);
        curr_dot_Color = Color.Lerp(curr_dot_Color, targ_dot_Color, Time.deltaTime * 1.61803f);

        if (handle_State == Handle_States.NORMAL)
        {
            //target_theta = 300;
            targ_Color = handle_Base_Col;

        }
        else if (handle_State == Handle_States.TOUCHED)
        {
            //target_theta = 390;
            targ_Color = handle_Touched_Col;
        }
        else if (handle_State == Handle_States.GRABBED)
        {
            //target_theta = 570;
            targ_Color = handle_Grabbed_Col;

        }
        Renderer rend = GetComponent<Renderer>();
        rend.material.SetColor("_Color", curr_Color);
        rend.material.SetColor("_EmissionColor", curr_Color);
    }

    public void Toggle_Hi_Res_From_Voronoi()
    {
        bvToggle_Hi_Res.isON = !bvToggle_Hi_Res.isON;
        six_splines = TetraVoronoi.GetComponentInChildren<Six_Splines>();
        six_splines.Set_Hi_Res(bvToggle_Hi_Res.isON);
        twelve_Splines.Set_Hi_Res(bvToggle_Hi_Res.isON);
    }

    private void Update()
    {
        //Animate_Handle_Material();
        if (geo == GEOMETRY.TETRA)
        {
            cj_12_EndPoints[0] = connected_Joints[0].transform.localPosition;
            cj_12_EndPoints[1] = connected_Joints[1].transform.localPosition;
            cj_12_EndPoints[2] = connected_Joints[0].transform.localPosition;
            cj_12_EndPoints[3] = connected_Joints[2].transform.localPosition;
            cj_12_EndPoints[4] = connected_Joints[0].transform.localPosition;
            cj_12_EndPoints[5] = connected_Joints[3].transform.localPosition;

            cj_12_EndPoints[6] = connected_Joints[1].transform.localPosition;
            cj_12_EndPoints[7] = connected_Joints[2].transform.localPosition;
            cj_12_EndPoints[8] = connected_Joints[1].transform.localPosition;
            cj_12_EndPoints[9] = connected_Joints[3].transform.localPosition;
            cj_12_EndPoints[10] = connected_Joints[2].transform.localPosition;
            cj_12_EndPoints[11] = connected_Joints[3].transform.localPosition;

            six_splines.Generate_Splines(cj_12_EndPoints, transform.position);
        }
        else if(geo == GEOMETRY.OCTA)
        {
            cj_24_EndPoints[0] = connected_Joints[0].transform.localPosition;
            cj_24_EndPoints[1] = connected_Joints[1].transform.localPosition;
            cj_24_EndPoints[2] = connected_Joints[0].transform.localPosition;
            cj_24_EndPoints[3] = connected_Joints[2].transform.localPosition;

            cj_24_EndPoints[4] = connected_Joints[0].transform.localPosition;
            cj_24_EndPoints[5] = connected_Joints[3].transform.localPosition;
            cj_24_EndPoints[6] = connected_Joints[0].transform.localPosition;
            cj_24_EndPoints[7] = connected_Joints[4].transform.localPosition;

            cj_24_EndPoints[8] = connected_Joints[1].transform.localPosition;
            cj_24_EndPoints[9] = connected_Joints[2].transform.localPosition;
            cj_24_EndPoints[10] = connected_Joints[1].transform.localPosition;
            cj_24_EndPoints[11] = connected_Joints[5].transform.localPosition;

            cj_24_EndPoints[12] = connected_Joints[1].transform.localPosition;
            cj_24_EndPoints[13] = connected_Joints[4].transform.localPosition;
            cj_24_EndPoints[14] = connected_Joints[2].transform.localPosition;
            cj_24_EndPoints[15] = connected_Joints[5].transform.localPosition;

            cj_24_EndPoints[16] = connected_Joints[2].transform.localPosition;
            cj_24_EndPoints[17] = connected_Joints[3].transform.localPosition;
            cj_24_EndPoints[18] = connected_Joints[3].transform.localPosition;
            cj_24_EndPoints[19] = connected_Joints[5].transform.localPosition;

            cj_24_EndPoints[20] = connected_Joints[3].transform.localPosition;
            cj_24_EndPoints[21] = connected_Joints[4].transform.localPosition;
            cj_24_EndPoints[22] = connected_Joints[4].transform.localPosition;
            cj_24_EndPoints[23] = connected_Joints[5].transform.localPosition;

            twelve_Splines.Generate_Splines(cj_24_EndPoints, transform.position);
        }
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ProceduralToolkit;
using VRTK;
using UnityEngine.UI;
using VRTK.GrabAttachMechanics;

public class Six_Splines : MonoBehaviour
{
    public Face_Tetra faces;
    public GameObject test_Octahedron;

    public GameObject Horn_Handle_Prefab;
    private GameObject[] tangent_Handles = new GameObject[14];
    [Range(0, 100f)]
    public  float scale_tangent_Handles = 27f;
    private bool  bEdge_Rotation_On = false;
    private float edge_Angular_Rate = 0f;
    public Slider sld_Edge_Angular_Rate;
    private bool bHandles_On = true;
    public Button_VU bvAngular_On;

    private GameObject go_cj_0;

    public Button_VU[] bvEdge_Switches;

    private bool[] bEdge_Switch = new bool[6];

    public Button_VU bvHorns_Handles_On;

    public Slider sld_Tangent;
    public Slider sld_Extend;

    public float tan_Slide_Val = 0;
    public float extend_Slide_Val = 0;

    public Slider_VU sv_Tangent_Adjust;
    public Slider_VU sv_Extend_Adjust;

    public bool bHi_Res_On = false;
    public bool bRun_Once = false;

    public Button_VU bv_Outii; //One Face Opposite Tangents

    public Vector3[] tetra_Edges = new Vector3[12]; //edge 0 -> 0,1 | edge 1 -> 2-3 etc.

    private VRTK_InteractableObject interact;

    private ArgosMeshDraft aMD_Spline_Green;
    private ArgosMeshDraft aMD_Spline_Red;
    private ArgosMeshDraft aMD_Spline_Blue;
    private ArgosMeshDraft aMD_Spline_Yellow;
    private ArgosMeshDraft aMD_Spline_Orange;
    private ArgosMeshDraft aMD_Spline_Violet;

    private ArgosMeshDraft aMD_Spline_Cross;

    public GameObject spline_Green;
    public GameObject spline_Red;
    public GameObject spline_Blue;
    public GameObject spline_Yellow;
    public GameObject spline_Orange;
    public GameObject spline_Violet;

    public GameObject spline_Cross;

    public float[] spline_lens_Green  = new float[256];
    public float[] spline_lens_Red    = new float[256];
    public float[] spline_lens_Blue   = new float[256];
    public float[] spline_lens_Yellow = new float[256];
    public float[] spline_lens_Orange = new float[256];
    public float[] spline_lens_Violet = new float[256];

    public float[] spline_lens_Cross = new float[256];

    private List<Vector3> lst_SplineGreen  = new List<Vector3>();
    private List<Vector3> lst_SplineRed    = new List<Vector3>();
    private List<Vector3> lst_SplineBlue   = new List<Vector3>();
    private List<Vector3> lst_SplineYellow = new List<Vector3>();
    private List<Vector3> lst_SplineOrange = new List<Vector3>();
    private List<Vector3> lst_SplineViolet = new List<Vector3>();

    //private List<Vector3> lst_SplineCross = new List<Vector3>();

    private Vector3 p0_1, p0_2;
    private Vector3 p1_1, p1_2;
    private Vector3 p2_1, p2_2;
    private Vector3 p3_1, p3_2;
    private Vector3 p4_1, p4_2;
    private Vector3 p5_1, p5_2;

    [Range(0, 0.5f)]
    public float radial_Mag = 0.5f;

    [Range(-20, 20f)]
    public float tangent_Mag = 1f;

    [Range(-20, 20f)]
    public float tRad = 0.0f;

    public bool bUpdate = false;
    public bool bTangents_From_Octahedron = false;
    public Twelve_Splines twelve_Splines;

    private VU_UI_MANAGER VU_UI;

    void Start ()
    {
        bv_Outii.isON = false;

        //tan_Slide_Val = sld_Tangent.value;
        //extend_Slide_Val = sld_Extend.value;
        //edge_Angular_Rate = sld_Edge_Angular_Rate.value;

        for (int i = 0; i<6; i++)
        {
            bEdge_Switch[i] = false;
        }

        VU_UI = VU_UI_MANAGER.Instance;

        aMD_Spline_Green  = new ArgosMeshDraft();
        aMD_Spline_Red    = new ArgosMeshDraft();
        aMD_Spline_Blue   = new ArgosMeshDraft();
        aMD_Spline_Yellow = new ArgosMeshDraft();
        aMD_Spline_Orange = new ArgosMeshDraft();
        aMD_Spline_Violet = new ArgosMeshDraft();

        aMD_Spline_Cross = new ArgosMeshDraft();

        //Generate_Splines();

        spline_Green.GetComponent<MeshFilter>().mesh.MarkDynamic(); 
        spline_Red.GetComponent<MeshFilter>().mesh.MarkDynamic();
        spline_Blue.GetComponent<MeshFilter>().mesh.MarkDynamic();
        spline_Yellow.GetComponent<MeshFilter>().mesh.MarkDynamic();
        spline_Orange.GetComponent<MeshFilter>().mesh.MarkDynamic();
        spline_Violet.GetComponent<MeshFilter>().mesh.MarkDynamic();

        spline_Cross.GetComponent<MeshFilter>().mesh.MarkDynamic();

        for (int i = 0; i < 12; i++)
        {
            tangent_Handles[i] = Instantiate(Horn_Handle_Prefab);
            tangent_Handles[i].transform.localPosition = Vector3.zero;
            tangent_Handles[i].transform.localRotation = Quaternion.identity;

            if (!GetComponentInParent<Voronoi_Joint>().bUsePhysics)
            {
                tangent_Handles[i].GetComponent<Rigidbody>().isKinematic = true;
            }
        }
        for (int i = 0; i < 12; i++)
        {
            if (i % 2 == 0)
            {
                tangent_Handles[i].GetComponent<Handle_Tangent_Interact>().Set_Dual(tangent_Handles[i + 1].GetComponent<Handle_Tangent_Interact>());
            }
            else
            {
                tangent_Handles[i].GetComponent<Handle_Tangent_Interact>().Set_Dual(tangent_Handles[i - 1].GetComponent<Handle_Tangent_Interact>());
            }
        }
    }

    public void Set_CJ_0_GO(GameObject cj_0_go)
    {
        go_cj_0 = cj_0_go;
    }

    public void Show_Handles(bool bON)
    {
        for (int i = 0; i < 14; i++)
        {
            tangent_Handles[i].SetActive(bON);
        }
    }

    //public Slider sld_Tangent;
    //public Slider sld_Extend;

    public void onSld_Tangent()
    {
        tan_Slide_Val = sld_Tangent.value;
        VU_UI.Set_Active_Slider(sv_Tangent_Adjust.gameObject);
        UI_Ladder.Instance.fine_Tuner.Active_FTS(sld_Tangent);
    }

    public void onSld_Extend()
    {
        extend_Slide_Val = sld_Extend.value;
        VU_UI.Set_Active_Slider(sv_Extend_Adjust.gameObject);
        UI_Ladder.Instance.fine_Tuner.Active_FTS(sld_Extend);
    }

    public void Set_Hi_Res(bool bON)
    {
        bHi_Res_On = bON;
        faces.Set_Hi_Res(bON);
        bRun_Once = bON;
    }

    public void onBV_Outii()
    {
        bv_Outii.isON = !bv_Outii.isON;
    }

    public void On_Edge_Switch_BV(int i)
    {
        bEdge_Switch[i] = !bEdge_Switch[i];
        if(bvEdge_Switches[0] != null)
        {
            bvEdge_Switches[i].isON = bEdge_Switch[i];
        }      
    }

    public void onSld_Cross_Tangent()
    {
        tan_Slide_Val = sld_Tangent.value;
        VU_UI.Set_Active_Slider(sv_Tangent_Adjust.gameObject);
        UI_Ladder.Instance.fine_Tuner.Active_FTS(sld_Tangent);
    }

    public void onSld_Cross_Extend()
    {
        extend_Slide_Val = sld_Extend.value;
        VU_UI.Set_Active_Slider(sv_Extend_Adjust.gameObject);
        UI_Ladder.Instance.fine_Tuner.Active_FTS(sld_Extend);
    }

    public void On_Edge_Angular_Rotation_sld()
    {
        edge_Angular_Rate = sld_Edge_Angular_Rate.value;
    }

    public void On_Edge_Rotation_Button()
    {
        bEdge_Rotation_On = !bEdge_Rotation_On;
        bvAngular_On.isON = bEdge_Rotation_On;
    }

    public void OnHandles_OnOff()
    {
        bHandles_On = !bHandles_On;
        bvHorns_Handles_On.isON = bHandles_On;

        for(int i = 0; i<12; i++)
        {
            tangent_Handles[i].GetComponent<Handle_Tangent_Interact>().Show(bHandles_On);
        }
    }

    float ang = 0;
    void Update()
    {
        if (bUpdate)
        {
            if (bEdge_Rotation_On)
            {
                ang += edge_Angular_Rate * Time.deltaTime;
            }
            else
            {
                ang = 0;
            }
            for (int i = 0; i < 12; i++)
            {
                tangent_Handles[i].transform.localScale = scale_tangent_Handles * Vector3.one;
                tangent_Handles[i].transform.position   = transform.position + transform.parent.TransformVector(tetra_Edges[i]);
            }
            Vector3 v_i1_i0;
            Quaternion q0, q1;
            Quaternion qZ_0, qZ_1; 
            for (int i = 0; i < 6; i++)
            {
                v_i1_i0 = tangent_Handles[i*2].transform.position - tangent_Handles[i*2+1].transform.position;

                q0 = Quaternion.LookRotation(-v_i1_i0, tangent_Handles[i * 2].transform.position - transform.position);
                q1 = Quaternion.LookRotation(v_i1_i0, tangent_Handles[i * 2 + 1].transform.position - transform.position);

                float direction = 1f;
                if(bEdge_Switch[i])
                {
                    direction = -1f;
                }

                float tanDir = 1f;

                Quaternion q0_bub = Quaternion.identity;
                Quaternion q1_bub = Quaternion.identity;

                qZ_0 = Quaternion.Euler(0, 0, direction*ang);
                qZ_1 = Quaternion.Euler(0, 0, -direction*ang);

                tangent_Handles[i * 2].transform.rotation = q0 * qZ_0 * Quaternion.Euler(new Vector3(tanDir*tan_Slide_Val, 0, 0))*q0_bub;
                tangent_Handles[i * 2 + 1].transform.rotation = q1 * qZ_1 * Quaternion.Euler(new Vector3(tanDir*tan_Slide_Val, 0, 0)) * q1_bub;

                //if (bv_Outii.isON && i > 2)
                //{
                //    if (i == 4)
                //    {

                //        //tanDir = -1f;
                //        Vector3 nYellow0 = Vector3.Cross(go_cj_0.transform.up, tangent_Handles[i * 2].transform.forward).normalized;
                //        Vector3 nYellow1 = Vector3.Cross(tangent_Handles[i * 2 + 1].transform.forward, go_cj_0.transform.up).normalized;

                //        Vector3 nPlanar0 = Vector3.Cross(go_cj_0.transform.up, nYellow0).normalized;
                //        Vector3 nPlanar1 = Vector3.Cross(go_cj_0.transform.up, nYellow1).normalized;

                //        float cosTheta0 = Vector3.Dot(nPlanar0, nYellow0);
                //        float cosTheta1 = Vector3.Dot(nPlanar1, nYellow1);

                //        float ang0_R = Mathf.Acos(cosTheta0);
                //        float ang1_R = Mathf.Acos(cosTheta1);

                //        float convR_to_D = 180f / Mathf.PI;
                //        float ang0_D = ang0_R * convR_to_D;
                //        float ang1_D = ang1_R * convR_to_D;

                //        q0_bub = Quaternion.AngleAxis(ang0_D, nYellow0);
                //        q1_bub = Quaternion.AngleAxis(2 * ang1_D, nYellow1);

                //        tangent_Handles[i * 2].transform.localRotation = q0_bub * tangent_Handles[i * 2].transform.localRotation;
                //        //tangent_Handles[i * 2 + 1].transform.rotation = q1_bub;
                //    }
                //}

                tangent_Handles[i * 2].GetComponent<Handle_Tangent_Interact>().Set_Tangent_Position(extend_Slide_Val);
                tangent_Handles[i * 2 + 1].GetComponent<Handle_Tangent_Interact>().Set_Tangent_Position(extend_Slide_Val);
            }       
        }
    }

    public void Generate_Splines(Vector3[] points, Vector3 vCenter)
    {
        if (!bHi_Res_On || bRun_Once)
        {
            bRun_Once = false;

            aMD_Spline_Green.Clear();
            aMD_Spline_Red.Clear();
            aMD_Spline_Blue.Clear();
            aMD_Spline_Yellow.Clear();
            aMD_Spline_Orange.Clear();
            aMD_Spline_Violet.Clear();

            //aMD_Spline_Cross.Clear();

            lst_SplineGreen.Clear();
            lst_SplineRed.Clear();
            lst_SplineBlue.Clear();
            lst_SplineYellow.Clear();
            lst_SplineOrange.Clear();
            lst_SplineViolet.Clear();

            //lst_SplineCross.Clear();

            for (int i = 0; i < 12; i++)
            {
                tetra_Edges[i] = points[i];
            }

            p0_1 = points[0];//0
            p0_2 = points[1];//1
            p1_1 = points[2];//0
            p1_2 = points[3];//2
            p2_1 = points[4];//0
            p2_2 = points[5];//3

            p3_1 = points[6];//1
            p3_2 = points[7];//2
            p4_1 = points[8];//1
            p4_2 = points[9];//3
            p5_1 = points[10];//2
            p5_2 = points[11];//3

            Vector3 vTn_01, vTn_02, vTn_11, vTn_12, vTn_31, vTn_32;

            if (bTangents_From_Octahedron)
            {
                //0-1
                vTn_01 = twelve_Splines.getTan_Han(0).GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_01 = transform.parent.InverseTransformVector(vTn_01);

                //1-0
                vTn_02 = twelve_Splines.getTan_Han(1).GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_02 = transform.parent.InverseTransformVector(vTn_02);

                //--------------------------
                //0-2
                vTn_11 = twelve_Splines.getTan_Han(2).GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_11 = transform.parent.InverseTransformVector(vTn_11);
                
                //2-0
                vTn_12 = twelve_Splines.getTan_Han(3).GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_12 = transform.parent.InverseTransformVector(vTn_12);

                //---------------------------
                //1-2
                vTn_31 = twelve_Splines.getTan_Han(8).GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_31 = transform.parent.InverseTransformVector(vTn_31);
                
                //2-1
                vTn_32 = twelve_Splines.getTan_Han(9).GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_32 = transform.parent.InverseTransformVector(vTn_32);
            }
            else
            {
                //0-1
                vTn_01 = tangent_Handles[0].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_01 = transform.parent.InverseTransformVector(vTn_01);

                //1-0
                vTn_02 = tangent_Handles[1].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_02 = transform.parent.InverseTransformVector(vTn_02);

                //--------------------------
                //0-2
                vTn_11 = tangent_Handles[2].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_11 = transform.parent.InverseTransformVector(vTn_11);
                //2-0
                vTn_12 = tangent_Handles[3].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_12 = transform.parent.InverseTransformVector(vTn_12);

                //---------------------------
                //1-2
                vTn_31 = tangent_Handles[6].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_31 = transform.parent.InverseTransformVector(vTn_31);
                //2-1
                vTn_32 = tangent_Handles[7].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
                vTn_32 = transform.parent.InverseTransformVector(vTn_32);
            }
            
            //---------------------------
            //0-3
            Vector3 vTn_21 = tangent_Handles[4].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
            vTn_21 = transform.parent.InverseTransformVector(vTn_21);
            //3-0
            Vector3 vTn_22 = tangent_Handles[5].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
            vTn_22 = transform.parent.InverseTransformVector(vTn_22);

            //---------------------------
            //1-3
            Vector3 vTn_41 = tangent_Handles[8].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
            vTn_41 = transform.parent.InverseTransformVector(vTn_41);
            //3-1
            Vector3 vTn_42 = tangent_Handles[9].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
            vTn_42 = transform.parent.InverseTransformVector(vTn_42);

            //---------------------------
            //2-3
            Vector3 vTn_51 = tangent_Handles[10].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
            vTn_51 = transform.parent.InverseTransformVector(vTn_51);
            //3-2
            Vector3 vTn_52 = tangent_Handles[11].GetComponent<Handle_Tangent_Interact>().Get_Tangent_Position() - vCenter;
            vTn_52 = transform.parent.InverseTransformVector(vTn_52);

            //Local Coordinates
            if (bv_Outii.isON)
            {
                //Mirror
                Vector3 vLocal_Up_0 = transform.parent.InverseTransformVector(go_cj_0.transform.up).normalized;

                Vector3 vHandle_Pos = tangent_Handles[6].gameObject.transform.position - vCenter;
                vHandle_Pos = transform.parent.InverseTransformVector(vHandle_Pos);

                Vector3 vTo_Tangent = vTn_31 - vHandle_Pos;

                float dot;
                dot = Vector3.Dot(vTo_Tangent, vLocal_Up_0);
                float mir = -2f * dot;
                vTn_31 += mir * vLocal_Up_0;
                vTn_32 += mir * vLocal_Up_0;
                vTn_41 += mir * vLocal_Up_0;
                vTn_42 += mir * vLocal_Up_0;
                vTn_51 += mir * vLocal_Up_0;
                vTn_52 += mir * vLocal_Up_0;
            }

            //---------------------------
            Compute_Dist_Spline(ref lst_SplineGreen, ref spline_lens_Green, p0_1, vTn_01, vTn_02, p0_2);
            Compute_Dist_Spline(ref lst_SplineRed, ref spline_lens_Red, p1_1, vTn_11, vTn_12, p1_2);
            Compute_Dist_Spline(ref lst_SplineBlue, ref spline_lens_Blue, p2_1, vTn_21, vTn_22, p2_2);

            //---------------------------
            Compute_Dist_Spline(ref lst_SplineYellow, ref spline_lens_Yellow, p3_1, vTn_31, vTn_32, p3_2);
            Compute_Dist_Spline(ref lst_SplineOrange, ref spline_lens_Orange, p4_1, vTn_41, vTn_42, p4_2);
            Compute_Dist_Spline(ref lst_SplineViolet, ref spline_lens_Violet, p5_1, vTn_51, vTn_52, p5_2);

            aMD_Spline_Green.Add(MeshDraft.Along_Spline(radial_Mag, 6, lst_SplineGreen));
            aMD_Spline_Red.Add(MeshDraft.Along_Spline(radial_Mag, 6, lst_SplineRed));
            aMD_Spline_Blue.Add(MeshDraft.Along_Spline(radial_Mag, 6, lst_SplineBlue));
            aMD_Spline_Yellow.Add(MeshDraft.Along_Spline(radial_Mag, 6, lst_SplineYellow));
            aMD_Spline_Orange.Add(MeshDraft.Along_Spline(radial_Mag, 6, lst_SplineOrange));
            aMD_Spline_Violet.Add(MeshDraft.Along_Spline(radial_Mag, 6, lst_SplineViolet));

            spline_Green.GetComponent<MeshFilter>().mesh = aMD_Spline_Green.ToMeshInternal();
            spline_Red.GetComponent<MeshFilter>().mesh = aMD_Spline_Red.ToMeshInternal();
            spline_Blue.GetComponent<MeshFilter>().mesh = aMD_Spline_Blue.ToMeshInternal();
            spline_Yellow.GetComponent<MeshFilter>().mesh = aMD_Spline_Yellow.ToMeshInternal();
            spline_Orange.GetComponent<MeshFilter>().mesh = aMD_Spline_Orange.ToMeshInternal();
            spline_Violet.GetComponent<MeshFilter>().mesh = aMD_Spline_Violet.ToMeshInternal();

            //p0 = p0_1
            //p1 = p1_1
            //p2 = p2_1

            //Tangents
            //  6 & 7 -> tan 1,2 tu1 & tu2
            //
            //  tv1 = 

            //cj_12_EndPoints[0] = connected_Joints[0].transform.localPosition;
            //cj_12_EndPoints[1] = connected_Joints[1].transform.localPosition;
            //cj_12_EndPoints[2] = connected_Joints[0].transform.localPosition;
            //cj_12_EndPoints[3] = connected_Joints[2].transform.localPosition;
            //cj_12_EndPoints[4] = connected_Joints[0].transform.localPosition;
            //cj_12_EndPoints[5] = connected_Joints[3].transform.localPosition;

            //cj_12_EndPoints[6] = connected_Joints[1].transform.localPosition;
            //cj_12_EndPoints[7] = connected_Joints[2].transform.localPosition;
            //cj_12_EndPoints[8] = connected_Joints[1].transform.localPosition;
            //cj_12_EndPoints[9] = connected_Joints[3].transform.localPosition;
            //cj_12_EndPoints[10] = connected_Joints[2].transform.localPosition;
            //cj_12_EndPoints[11] = connected_Joints[3].transform.localPosition;

            /*test_Octahedron.transform.localPosition = */

            faces.Clear_Faces();
            faces.Generate_Face(tetra_Edges[0],  tetra_Edges[3], tetra_Edges[1],  vTn_32, vTn_31,  vTn_12, vTn_02, vTn_11, vTn_01 );
            faces.Generate_Face(tetra_Edges[0],  tetra_Edges[5], tetra_Edges[3],  vTn_52, vTn_51,  vTn_22, vTn_12, vTn_21, vTn_11 );
            faces.Generate_Face(tetra_Edges[0],  tetra_Edges[1], tetra_Edges[5],  vTn_41, vTn_42,  vTn_02, vTn_22, vTn_01, vTn_21 );
            faces.Generate_Face(tetra_Edges[6],  tetra_Edges[7], tetra_Edges[9],  vTn_51, vTn_52,  vTn_32, vTn_42, vTn_31, vTn_41 );

            faces.toMesh_Internal();

            //Generate_Face(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 tu1, Vector3 tu2, Vector3 tv1, Vector3 tv2, Vector3 tv01, Vector3 tv02)
        }
        /// <image url="$(SolutionDir)\EMB\EMB_tetra_Faces.png" scale="0.15" /> 

        //aMD_Spline_Red.Add(MeshDraft.Along_Spline(0.007f, 6, lst_SplineRed));
        //aMD_Spline_Blue.Add(MeshDraft.Along_Spline(0.007f, 6, lst_SplineBlue));
    }

    private void Compute_Spline(ref List<Vector3> spline_lst, ref float[] lengths,  Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3)
    {
        float t = 0.0f;
        float dt = 1f / 72f;

        Vector3 vB = GetPointOnBezierCurve(p0, p1, p2, p3, get_Adjusted(t, ref lengths));

        for (int i = 0; i < 72; i++)
        {
            vB = GetPointOnBezierCurve(p0, p1, p2, p3, get_Adjusted(t, ref lengths));

            spline_lst.Add(vB);
            t += dt;
        }
    }

    private float get_Adjusted(float t, ref float[] lengths)
    {
        int i = 0;
        while (i < 256 && lengths[i] < t)
        {
            i++;
        }
        return (float)i / 256;
    }

    private void Compute_Dist_Spline(ref List<Vector3> spline_lst, ref float[] lengths, Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3)
    {
        float t = 0.0f;
        float dt = 1f / 256;

        Vector3 vB = GetPointOnBezierCurve(p0, p1, p2, p3, t);
        Vector3 vB_Last = vB;
        float running_Len = 0;

        for (int i = 0; i < 256; i++)
        {
            vB = GetPointOnBezierCurve(p0, p1, p2, p3, t);
            running_Len += (vB - vB_Last).magnitude;
            lengths[i] = running_Len;
            vB_Last = vB;
            t += dt;
        }
        for (int i = 0; i < 256; i++)
        {
            lengths[i] /= running_Len;
        }
        Compute_Spline(ref spline_lst, ref lengths, p0, p1, p2, p3);
    }

    public Vector3 GetPointOnBezierCurve(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t)
    {
        float u = 1f - t;
        float t2 = t * t;
        float u2 = u * u;
        float u3 = u2 * u;
        float t3 = t2 * t;

        Vector3 result =
            (u3) * p0 +
            (3f * u2 * t) * p1 +
            (3f * u * t2) * p2 +
            (t3) * p3;

        return result;
    }
}

 

020 EU Meetup January 30, 2018

 EU Meetup January 30, 2018

 Do electrons and protons maintain their identity ?
1 message

Juan Calsiano <juancalsiano@gmail.com> Mon, Jan 29, 2018 at 1:39 PM
To: Edo Kael <edwinkaal00@gmail.com>
Cc: Jim Weninger <jwen1@yahoo.com>, "dj@argos.vu" <dj@argos.vu>
"Does any portion of the universe maintain its identity?"

If one assumes an absolutely boundless universe, then the answer is no. Any portion of a Boundless Universe is endlessly integrated and endlessly divided and fluctuates in a permanent process of becoming. Each portion is absolutely unique with respect to all other portions, and each portion is different from itself from one instant to the next.

Regarding that last part as it relates to identity: we all know that all portions of the universe with which we relate everyday are ever-changing and in constant flux. If it doesn't seem so, it is just that we haven't observed or measured it carefully, or waited long enough. The only constant is change. A triangle is changeless, but a triangle is just an idea. The totality of evidence indicates that the external world is in permanent flux.

That doesn't mean that portions of the universe cannot have qualities with remarkably persistent properties, of course, not only protons and electrons but all portions of matter have such qualities. The important point is that, in a Boundless Universe, all such portions also have countless other qualities that are fluctuating. So, overall, any portion of the universe is constantly evolving and has a unique inexhaustible structure that is never absolutely the same moment to moment.

As I said before, a galactic observer would be amazed by the remarkably persistent properties of the solar system. A remarkably persistent solar system mass, orbits following geometrical proportions, the main solar cycle and a large etcétera. If you were only to measure such properties (something reasonable considering their relative simplicity), one could postulate that those are only the variables that actually exist and pose that the solar system is remarkably simple. So, in terms of such variables, the solar system "identity" is maintained. As we know, the solar system is mindbogglingly complex, not only in terms of its fruit salad planetary system, but also even in terms of all the aspects of the sun itself, which is as far as a perfect geometrical platonic sphere as one could imagine, something we now know thanks to the incredible data gathered since the space age beginnings.

In sum, we know for a fact that, even if it has a fascinating array of persistent regularities, the solar system is unique and unrepeatable compared to the rest of the universe, and each moment of the solar system is unique and unrepeatable compared to any moment in the past or in the future. So, pondering on such indisputable facts, how are we going to think about the atomic scale? Well, one must necessarily assume one of two things:

1) That this observed quality of the universe of uniqueness and non-repeatability continues to be true at any deeper scales (a consequence of assuming a boundless universe).
2) That this observed quality of the universe changes at a given deeper unobservant scale (a consequence of assuming a finite universe that implies an hypothetical fundamental and irreducible simplicity at some deeper scale, a simplicity not observed in any other scale that we can observe).
I think that Ockham said something about these situations!
In any case, we can go through the empirical way: everything that we have measured at the atomic scales or smaller is constantly waving, i.e. in permanent flux. Any physical wave requires a deeper wave-conducting medium with deeper complexity (e.g. compressions and rarefactions) to enact the waving.

In terms of such worldview, each and every electron is different and unique, as all of the protons. That said, all electrons have crucial similarities as attested in the very precise regularities that they demonstrate. In a more general way, in a boundless universe, all things have characteristics that make them similar to all other things as well as characteristics that make them dissimilar to all other things.

Think about a huge field with 100.000 tuning forks, all of slightly different sizes, shapes, and materials, but all tuned to 440 Hz. You very carefully measure the sizes, shapes and composition of each one and find out that they are all completely different. But then you hit them and force all of them to vibrate, and you measure that the fundamental frequency is always 440 Hz. They are absolutely identical!

The truth, of course, is that those 100.000 units are neither completely different nor absolutely identical. All portions of the universe exist in a similarity-dissimilarity continuum. And that applies to protons and electrons as well. You must always remember that experimental physicists do not measure the momentum of the electron (as if they were a "classical particle"), they measure wavelength and frequency, two basic wave properties. Tuning forks are very educational.

Cheers!

Scientists unveil new form of matter: time crystals

Edo Kael <edwinkaal00@gmail.com> Mon, Jan 29, 2018 at 7:40 AM
To: Jim Weninger <jwen1@yahoo.com>
Cc: "dj@argos.vu" <dj@argos.vu>, Juan Calsiano <juancalsiano@gmail.com>

Jim,

I cannot attest to planets and such and fall back myself to the explanation Wal Thornhill has for a "hollow earth". In my mind i consider it an option due to the electric effect, meaning IF that is shown to be the case, i would go for it, but would still want some proof.
The reason is that despite the fact that the atom is "hollow' that is only true to a certain extent. The Carbon is hollow like and since the elements are more or less made up of those one could argue that is has room.  However the atom is more fractal in nature and does try to gather all the mass / matter in the smallest sphere as possible and does this in the densest packing manner. The fact that Carbon is hollow has to do with the fact that the individual protons cannot fall further into the center because they support each other in a static and equilibrium situation. This in my view also implies that the atom and in particular the nucleus resist absorption of energy...
I have said my  goodbye's to QM and anything it tries to tell us. That means i do not adhere to the theory, i do pay close attention and consider that good science, the isotopic data for example, mass number, proton / electron numbers, melting points, ionization energy levels, spin, valence value etc etc. One might argue that this is also QM, but i would say that is can be done without QM.... and has been at first for sure when no one heard of QM and we still did physics and chemistry.
 If the mass or charge is concentrated into a hollow shell of radius=1, the inverse square law works at infinity, but fails spectaculary at radius= 1. Inside r=1 there is no field/force.
Well that is how i see the proton and even the electron, having a radius / being a sphere, there are no dots i believe.
Could this conclusion at radius one have something to do with the decay of the neutron? into an electron proton pair? I am unsure as to why you reach that conclusion (fails at r=1)
Edo

Jim Weninger

7:09 PM 

to djEdoJuan
Sorry if the last post was again cryptic, but I'll share my viewpoint in a little more detail, and as always,  I'm looking  for objections before I go too far out with ill conceived ideas:
We've talked before about ideas of a hollow Sun and Earth, compared to the mainstream idea of a Sun or Earth which increase in density towards center.  Also, I am arguing that the atom is a nearly exact replication of the solar system, just on another scale.  (by the way, the arrangement of mass in Edo's model of the nucleus also does NOT give us a concentration of mass at the center of the nucleus)
So here is the question (on each scale):  How could we know if solar system objects, like Sun and Earth, are hollow?  Or, how could we know if atomic scale objects (in this article, it is the proton), are hollow?  That is how could we tell if the mass of the sun (or a proton), were located at the center of the object, compared to the periphery?  Comparing nearby orbits to farther out orbits, that is how.
Whether we are talking planetary orbits around the sun, or electron orbits around a proton, if we move out to a large radius, it does not matter where the mass is located.  We can treat a planet as if it is attracted to the sun's center , or an electron as if it is attracted to a protons center.  But, if we close in on either object, we see the problem.
I would like you guys to draw this for yourselves, because it WILL explain the muon vs electron orbits.
And tell us the mass distribution in a proton.  Or on the solar system scale, the mass distribution of the sun.
In even simpler terms (just so you can see what I'm saying), if mass or charge  is concentrated at a point, the inverse square law works all the way from radius =infinity , to radius = 0.    If the mass or charge is concentrated into a hollow shell of radius=1, the inverse square law works at infinity, but fails spectaculary at radius= 1. Inside r=1 there is no field/force.
This IS the source of the proton radius problem.  The proton, just like the sun, IS (relatively) hollow.     The nucleus too, is again relatively hollow, but Edo must already know this.
 Jim
On Saturday, January 27, 2018, 6:15:46 PM MST, Jim Weninger <jwen1@yahoo.com> wrote:
Edo,
Just wandering through a bunch of stuff - and finding this idea interesting in regards to why the electron may maintain it's identity when bound so closely with the proton and visa versa of course.
Interested in your thoughts.
Also a Sympathetic Vibratory Model keeps "Ringing Down" in my head:
Extrapolate this as r decreases to zero - Harmonically resonate the frequencies "back down" and consider what "White Light" may perhaps be:

🙂
/dj

Steric Repulsion

Sterically Stabilized Dispersion

For sterically stabilized dispersions, the resulting energy-distance curve often shows a shallow minimum, Vmin, at a particle-particle separation distance h comparable to twice the adsorbed layer thickness delta. For a given material, the depth of this minimum depends on the particle size R and adsorbed layer thickness delta.

Vmin vs d per R.jpg

Hence Vmin decreases with increase in <math>\frac{\delta }{R}</math>, as illustrated in the figure above. This is because as we increase the layer thickness, the van der Waals attraction weakness so the superposition of attraction and repulsion will have a smaller minimum. For very small steric layers, <math>V_{\min }</math> may become deep enough to cause weak flocculation, resulting in a weak attractive gel.

On the other hand, if the layer thickness is too large, the viscosity is also increased due to repulsion. This is due to the much higher effective volume fraction <math>\Phi _{eff}</math> of the dispersion compared with the core volume fraction. We can calculate the effective volume fraction of particles plus dispersant layer by geometry and we see that it depends on the thickness of that adsorbed layer, as illustrated in the figure below.

Steric layer.jpg

The effective volume fraction increases with relative increase in the dispersant layer thickness. Even at 10% volume fraction we can soon reach maximum packing (<math>\Phi =0.67</math>) with an adsorbed layer comparable to the particle radius. In this case, overlap of the steric layers will result in significant viscosity increases. Such considerations help to explain why the solids loading can be severely limited, especially with small particles. In practice, solids loading curves can be used to characterize the system and will take the form of those illustrated below:

Solids loading.jpg

A higher solids loading might be achieved with thinner adsorbed layers but may also lead to interparticle attraction, resulting in particle aggregation. Clearly a compromise is needed: choosing an appropriate steric stabilizer for the particle size of the pigment.

Super Blue Blood Moon 2018:

During the early hours of Jan. 31, there will be a full moon, a total lunar eclipse, a blue moon and a supermoon. None of these things is all that unusual. What is rare is that they’re happening all together on one day.


DAHL_RC

Entering CLI Mode, type ‘exit’ to return, or ‘help’ #
# Building AutoComplete Cache … Done!
#
# dump

# version
# Betaflight / EXF722DUAL (EX7P) 4.1.0 Aug 9 2019 / 11:17:48 (41a0b5938) MSP API: 1.42

# start the command batch
batch start

board_name EXF722DUAL
manufacturer_id

# name: –

# resources
resource BEEPER 1 C15
resource MOTOR 1 C08
resource MOTOR 2 C06
resource MOTOR 3 C09
resource MOTOR 4 C07
resource MOTOR 5 B06
resource MOTOR 6 B07
resource MOTOR 7 B01
resource MOTOR 8 B00
resource SERVO 1 NONE
resource SERVO 2 NONE
resource SERVO 3 NONE
resource SERVO 4 NONE
resource SERVO 5 NONE
resource SERVO 6 NONE
resource SERVO 7 NONE
resource SERVO 8 NONE
resource PPM 1 A03
resource PWM 1 NONE
resource PWM 2 NONE
resource PWM 3 NONE
resource PWM 4 NONE
resource PWM 5 NONE
resource PWM 6 NONE
resource PWM 7 NONE
resource PWM 8 NONE
resource LED_STRIP 1 A01
resource SERIAL_TX 1 A09
resource SERIAL_TX 2 A02
resource SERIAL_TX 3 B10
resource SERIAL_TX 4 C10
resource SERIAL_TX 5 C12
resource SERIAL_TX 6 NONE
resource SERIAL_TX 7 NONE
resource SERIAL_TX 8 NONE
resource SERIAL_TX 9 NONE
resource SERIAL_TX 10 NONE
resource SERIAL_TX 11 NONE
resource SERIAL_TX 12 NONE
resource SERIAL_RX 1 A10
resource SERIAL_RX 2 A03
resource SERIAL_RX 3 B11
resource SERIAL_RX 4 C11
resource SERIAL_RX 5 D02
resource SERIAL_RX 6 NONE
resource SERIAL_RX 7 NONE
resource SERIAL_RX 8 NONE
resource SERIAL_RX 9 NONE
resource SERIAL_RX 10 NONE
resource SERIAL_RX 11 NONE
resource SERIAL_RX 12 NONE
resource I2C_SCL 1 NONE
resource I2C_SCL 2 B10
resource I2C_SCL 3 NONE
resource I2C_SCL 4 NONE
resource I2C_SDA 1 NONE
resource I2C_SDA 2 B11
resource I2C_SDA 3 NONE
resource I2C_SDA 4 NONE
resource LED 1 C04
resource LED 2 NONE
resource LED 3 NONE
resource RX_BIND 1 NONE
resource RX_BIND_PLUG 1 NONE
resource TRANSPONDER 1 NONE
resource SPI_SCK 1 A05
resource SPI_SCK 2 B13
resource SPI_SCK 3 B03
resource SPI_SCK 4 NONE
resource SPI_MISO 1 A06
resource SPI_MISO 2 B14
resource SPI_MISO 3 B04
resource SPI_MISO 4 NONE
resource SPI_MOSI 1 A07
resource SPI_MOSI 2 B15
resource SPI_MOSI 3 B05
resource SPI_MOSI 4 NONE
resource CAMERA_CONTROL 1 A00
resource ADC_BATT 1 C01
resource ADC_RSSI 1 C00
resource ADC_CURR 1 C02
resource ADC_EXT 1 NONE
resource BARO_CS 1 NONE
resource BARO_EOC 1 NONE
resource BARO_XCLR 1 NONE
resource PINIO 1 C13
resource PINIO 2 C14
resource PINIO 3 B08
resource PINIO 4 NONE
resource USB_MSC_PIN 1 NONE
resource FLASH_CS 1 B09
resource OSD_CS 1 B12
resource GYRO_EXTI 1 A08
resource GYRO_EXTI 2 B02
resource GYRO_CS 1 A15
resource GYRO_CS 2 C03

# timer
timer A00 AF2
# pin A00: TIM5 CH1 (AF2)
timer A03 AF3
# pin A03: TIM9 CH2 (AF3)
timer C08 AF3
# pin C08: TIM8 CH3 (AF3)
timer C06 AF3
# pin C06: TIM8 CH1 (AF3)
timer C09 AF3
# pin C09: TIM8 CH4 (AF3)
timer C07 AF3
# pin C07: TIM8 CH2 (AF3)
timer B06 AF2
# pin B06: TIM4 CH1 (AF2)
timer B07 AF2
# pin B07: TIM4 CH2 (AF2)
timer B01 AF2
# pin B01: TIM3 CH4 (AF2)
timer B00 AF2
# pin B00: TIM3 CH3 (AF2)
timer A01 AF1
# pin A01: TIM2 CH2 (AF1)

# dma
dma SPI_TX 1 NONE
dma SPI_TX 2 NONE
dma SPI_TX 3 NONE
dma SPI_TX 4 NONE
dma SPI_RX 1 NONE
dma SPI_RX 2 NONE
dma SPI_RX 3 NONE
dma SPI_RX 4 NONE
dma ADC 1 NONE
dma ADC 2 NONE
dma ADC 3 0
# ADC 3: DMA2 Stream 0 Channel 2
dma UART_TX 1 NONE
dma UART_TX 2 NONE
dma UART_TX 3 NONE
dma UART_TX 4 NONE
dma UART_TX 5 NONE
dma UART_TX 6 NONE
dma UART_TX 7 NONE
dma UART_TX 8 NONE
dma UART_RX 1 NONE
dma UART_RX 2 NONE
dma UART_RX 3 NONE
dma UART_RX 4 NONE
dma UART_RX 5 NONE
dma UART_RX 6 NONE
dma UART_RX 7 NONE
dma UART_RX 8 NONE
dma pin A00 0
# pin A00: DMA1 Stream 2 Channel 6
dma pin A03 NONE
dma pin C08 1
# pin C08: DMA2 Stream 4 Channel 7
dma pin C06 0
# pin C06: DMA2 Stream 2 Channel 0
dma pin C09 0
# pin C09: DMA2 Stream 7 Channel 7
dma pin C07 1
# pin C07: DMA2 Stream 3 Channel 7
dma pin B06 0
# pin B06: DMA1 Stream 0 Channel 2
dma pin B07 0
# pin B07: DMA1 Stream 3 Channel 2
dma pin B01 0
# pin B01: DMA1 Stream 2 Channel 5
dma pin B00 0
# pin B00: DMA1 Stream 7 Channel 5
dma pin A01 0
# pin A01: DMA1 Stream 6 Channel 3

# mixer
mixer QUADX

mmix reset

# servo
servo 0 1000 2000 1500 100 -1
servo 1 1000 2000 1500 100 -1
servo 2 1000 2000 1500 100 -1
servo 3 1000 2000 1500 100 -1
servo 4 1000 2000 1500 100 -1
servo 5 1000 2000 1500 100 -1
servo 6 1000 2000 1500 100 -1
servo 7 1000 2000 1500 100 -1

# servo mixer
smix reset

# feature
feature -RX_PPM
feature -INFLIGHT_ACC_CAL
feature -RX_SERIAL
feature -MOTOR_STOP
feature -SERVO_TILT
feature -SOFTSERIAL
feature -GPS
feature -RANGEFINDER
feature -TELEMETRY
feature -3D
feature -RX_PARALLEL_PWM
feature -RX_MSP
feature -RSSI_ADC
feature -LED_STRIP
feature -DISPLAY
feature -OSD
feature -CHANNEL_FORWARDING
feature -TRANSPONDER
feature -AIRMODE
feature -RX_SPI
feature -SOFTSPI
feature -ESC_SENSOR
feature -ANTI_GRAVITY
feature -DYNAMIC_FILTER
feature RX_SERIAL
feature TELEMETRY
feature RSSI_ADC
feature LED_STRIP
feature OSD
feature TRANSPONDER
feature AIRMODE
feature ANTI_GRAVITY
feature DYNAMIC_FILTER

# beeper
beeper GYRO_CALIBRATED
beeper RX_LOST
beeper RX_LOST_LANDING
beeper DISARMING
beeper ARMING
beeper ARMING_GPS_FIX
beeper ARMING_GPS_NO_FIX
beeper BAT_CRIT_LOW
beeper BAT_LOW
beeper GPS_STATUS
beeper RX_SET
beeper ACC_CALIBRATION
beeper ACC_CALIBRATION_FAIL
beeper READY_BEEP
beeper MULTI_BEEPS
beeper DISARM_REPEAT
beeper ARMED
beeper SYSTEM_INIT
beeper ON_USB
beeper BLACKBOX_ERASE
beeper CRASH_FLIP
beeper CAM_CONNECTION_OPEN
beeper CAM_CONNECTION_CLOSE
beeper RC_SMOOTHING_INIT_FAIL

# beacon
beacon -RX_LOST
beacon -RX_SET

# map
map AETR1234

# serial
serial 20 1 115200 57600 0 115200
serial 0 64 115200 57600 0 115200
serial 1 1 115200 57600 0 115200
serial 2 0 115200 57600 0 115200
serial 3 0 115200 57600 0 115200
serial 4 0 115200 57600 0 115200

# led
led 0 6,13::CTOBVIW:0
led 1 7,13::CTOBVIW:0
led 2 8,13::CTOBVIW:0
led 3 9,13::CTOBVIW:0
led 4 0,0::C:0
led 5 0,0::C:0
led 6 0,0::C:0
led 7 0,0::C:0
led 8 0,0::C:0
led 9 0,0::C:0
led 10 0,0::C:0
led 11 0,0::C:0
led 12 0,0::C:0
led 13 0,0::C:0
led 14 0,0::C:0
led 15 0,0::C:0
led 16 0,0::C:0
led 17 0,0::C:0
led 18 0,0::C:0
led 19 0,0::C:0
led 20 0,0::C:0
led 21 0,0::C:0
led 22 0,0::C:0
led 23 0,0::C:0
led 24 0,0::C:0
led 25 0,0::C:0
led 26 0,0::C:0
led 27 0,0::C:0
led 28 0,0::C:0
led 29 0,0::C:0
led 30 0,0::C:0
led 31 0,0::C:0

# color
color 0 0,0,0
color 1 0,255,255
color 2 0,0,255
color 3 30,0,255
color 4 60,0,255
color 5 90,0,255
color 6 120,0,255
color 7 150,0,255
color 8 180,0,255
color 9 210,0,255
color 10 240,0,255
color 11 270,0,255
color 12 300,0,255
color 13 330,0,255
color 14 0,0,0
color 15 0,0,0

# mode_color
mode_color 0 0 1
mode_color 0 1 11
mode_color 0 2 2
mode_color 0 3 13
mode_color 0 4 10
mode_color 0 5 3
mode_color 1 0 5
mode_color 1 1 11
mode_color 1 2 3
mode_color 1 3 13
mode_color 1 4 10
mode_color 1 5 3
mode_color 2 0 10
mode_color 2 1 11
mode_color 2 2 4
mode_color 2 3 13
mode_color 2 4 10
mode_color 2 5 3
mode_color 3 0 8
mode_color 3 1 11
mode_color 3 2 4
mode_color 3 3 13
mode_color 3 4 10
mode_color 3 5 3
mode_color 4 0 7
mode_color 4 1 11
mode_color 4 2 3
mode_color 4 3 13
mode_color 4 4 10
mode_color 4 5 3
mode_color 5 0 0
mode_color 5 1 0
mode_color 5 2 0
mode_color 5 3 0
mode_color 5 4 0
mode_color 5 5 0
mode_color 6 0 6
mode_color 6 1 10
mode_color 6 2 1
mode_color 6 3 0
mode_color 6 4 0
mode_color 6 5 2
mode_color 6 6 3
mode_color 6 7 6
mode_color 6 8 0
mode_color 6 9 0
mode_color 6 10 0
mode_color 7 0 3

# aux
aux 0 0 0 900 1300 0 0
aux 1 1 1 900 1300 0 0
aux 2 2 1 1300 1700 0 0
aux 3 13 2 1700 2100 0 0
aux 4 0 0 900 900 0 0
aux 5 0 0 900 900 0 0
aux 6 0 0 900 900 0 0
aux 7 0 0 900 900 0 0
aux 8 0 0 900 900 0 0
aux 9 0 0 900 900 0 0
aux 10 0 0 900 900 0 0
aux 11 0 0 900 900 0 0
aux 12 0 0 900 900 0 0
aux 13 0 0 900 900 0 0
aux 14 0 0 900 900 0 0
aux 15 0 0 900 900 0 0
aux 16 0 0 900 900 0 0
aux 17 0 0 900 900 0 0
aux 18 0 0 900 900 0 0
aux 19 0 0 900 900 0 0

# adjrange
adjrange 0 0 0 900 900 0 0 0 0
adjrange 1 0 0 900 900 0 0 0 0
adjrange 2 0 0 900 900 0 0 0 0
adjrange 3 0 0 900 900 0 0 0 0
adjrange 4 0 0 900 900 0 0 0 0
adjrange 5 0 0 900 900 0 0 0 0
adjrange 6 0 0 900 900 0 0 0 0
adjrange 7 0 0 900 900 0 0 0 0
adjrange 8 0 0 900 900 0 0 0 0
adjrange 9 0 0 900 900 0 0 0 0
adjrange 10 0 0 900 900 0 0 0 0
adjrange 11 0 0 900 900 0 0 0 0
adjrange 12 0 0 900 900 0 0 0 0
adjrange 13 0 0 900 900 0 0 0 0
adjrange 14 0 0 900 900 0 0 0 0
adjrange 15 0 0 900 900 0 0 0 0
adjrange 16 0 0 900 900 0 0 0 0
adjrange 17 0 0 900 900 0 0 0 0
adjrange 18 0 0 900 900 0 0 0 0
adjrange 19 0 0 900 900 0 0 0 0
adjrange 20 0 0 900 900 0 0 0 0
adjrange 21 0 0 900 900 0 0 0 0
adjrange 22 0 0 900 900 0 0 0 0
adjrange 23 0 0 900 900 0 0 0 0
adjrange 24 0 0 900 900 0 0 0 0
adjrange 25 0 0 900 900 0 0 0 0
adjrange 26 0 0 900 900 0 0 0 0
adjrange 27 0 0 900 900 0 0 0 0
adjrange 28 0 0 900 900 0 0 0 0
adjrange 29 0 0 900 900 0 0 0 0

# rxrange
rxrange 0 1000 2000
rxrange 1 1000 2000
rxrange 2 1000 2000
rxrange 3 1000 2000

# vtx
vtx 0 0 0 0 0 900 900
vtx 1 0 0 0 0 900 900
vtx 2 0 0 0 0 900 900
vtx 3 0 0 0 0 900 900
vtx 4 0 0 0 0 900 900
vtx 5 0 0 0 0 900 900
vtx 6 0 0 0 0 900 900
vtx 7 0 0 0 0 900 900
vtx 8 0 0 0 0 900 900
vtx 9 0 0 0 0 900 900

# vtxtable
vtxtable bands 0
vtxtable channels 0
vtxtable powerlevels 0
vtxtable powervalues
vtxtable powerlabels

# rxfail
rxfail 0 a
rxfail 1 a
rxfail 2 a
rxfail 3 a
rxfail 4 h
rxfail 5 h
rxfail 6 h
rxfail 7 h
rxfail 8 h
rxfail 9 h
rxfail 10 h
rxfail 11 h
rxfail 12 h
rxfail 13 h
rxfail 14 h
rxfail 15 h
rxfail 16 h
rxfail 17 h

# master
set gyro_hardware_lpf = NORMAL
set gyro_sync_denom = 1
set gyro_lowpass_type = PT1
set gyro_lowpass_hz = 150
set gyro_lowpass2_type = PT1
set gyro_lowpass2_hz = 250
set gyro_notch1_hz = 0
set gyro_notch1_cutoff = 0
set gyro_notch2_hz = 0
set gyro_notch2_cutoff = 0
set gyro_calib_duration = 125
set gyro_calib_noise_limit = 48
set gyro_offset_yaw = 0
set gyro_overflow_detect = ALL
set yaw_spin_recovery = ON
set yaw_spin_threshold = 1950
set gyro_to_use = BOTH
set dyn_notch_range = AUTO
set dyn_notch_width_percent = 8
set dyn_notch_q = 120
set dyn_notch_min_hz = 150
set dyn_lpf_gyro_min_hz = 200
set dyn_lpf_gyro_max_hz = 500
set gyro_filter_debug_axis = ROLL
set acc_hardware = AUTO
set acc_lpf_hz = 10
set acc_trim_pitch = 0
set acc_trim_roll = 0
set acc_calibration = 228,-53,-25
set baro_bustype = I2C
set baro_spi_device = 0
set baro_i2c_device = 2
set baro_i2c_address = 0
set baro_hardware = NONE
set baro_tab_size = 21
set baro_noise_lpf = 600
set baro_cf_vel = 985
set mid_rc = 1500
set min_check = 1050
set max_check = 1900
set rssi_channel = 0
set rssi_src_frame_errors = OFF
set rssi_scale = 100
set rssi_offset = 0
set rssi_invert = OFF
set rssi_src_frame_lpf_period = 30
set rc_interp = AUTO
set rc_interp_ch = RPYT
set rc_interp_int = 19
set rc_smoothing_type = FILTER
set rc_smoothing_input_hz = 0
set rc_smoothing_derivative_hz = 0
set rc_smoothing_debug_axis = ROLL
set rc_smoothing_input_type = BIQUAD
set rc_smoothing_derivative_type = BIQUAD
set rc_smoothing_auto_smoothness = 10
set fpv_mix_degrees = 0
set max_aux_channels = 14
set serialrx_provider = CRSF
set serialrx_inverted = OFF
set spektrum_sat_bind = 0
set spektrum_sat_bind_autoreset = ON
set srxl2_unit_id = 1
set srxl2_baud_fast = ON
set airmode_start_throttle_percent = 25
set rx_min_usec = 885
set rx_max_usec = 2115
set serialrx_halfduplex = OFF
set adc_device = 3
set adc_vrefint_calibration = 0
set adc_tempsensor_calibration30 = 0
set adc_tempsensor_calibration110 = 0
set input_filtering_mode = OFF
set blackbox_p_ratio = 32
set blackbox_device = SPIFLASH
set blackbox_record_acc = ON
set blackbox_mode = NORMAL
set min_throttle = 1070
set max_throttle = 2000
set min_command = 1000
set dshot_idle_value = 550
set dshot_burst = ON
set dshot_bidir = OFF
set use_unsynced_pwm = OFF
set motor_pwm_protocol = MULTISHOT
set motor_pwm_rate = 480
set motor_pwm_inversion = OFF
set motor_poles = 14
set thr_corr_value = 0
set thr_corr_angle = 800
set failsafe_delay = 4
set failsafe_off_delay = 10
set failsafe_throttle = 1000
set failsafe_switch_mode = STAGE1
set failsafe_throttle_low_delay = 100
set failsafe_procedure = DROP
set failsafe_recovery_delay = 20
set failsafe_stick_threshold = 30
set align_board_roll = 0
set align_board_pitch = 0
set align_board_yaw = -90
set gimbal_mode = NORMAL
set bat_capacity = 0
set vbat_max_cell_voltage = 430
set vbat_full_cell_voltage = 410
set vbat_min_cell_voltage = 330
set vbat_warning_cell_voltage = 350
set vbat_hysteresis = 1
set current_meter = ADC
set battery_meter = ADC
set vbat_detect_cell_voltage = 300
set use_vbat_alerts = ON
set use_cbat_alerts = OFF
set cbat_alert_percent = 10
set vbat_cutoff_percent = 100
set force_battery_cell_count = 0
set vbat_lpf_period = 30
set ibat_lpf_period = 10
set vbat_duration_for_warning = 0
set vbat_duration_for_critical = 0
set vbat_scale = 110
set vbat_divider = 10
set vbat_multiplier = 1
set ibata_scale = 100
set ibata_offset = 0
set ibatv_scale = 0
set ibatv_offset = 0
set beeper_inversion = ON
set beeper_od = OFF
set beeper_frequency = 0
set beeper_dshot_beacon_tone = 1
set yaw_motors_reversed = OFF
set crashflip_motor_percent = 0
set 3d_deadband_low = 1406
set 3d_deadband_high = 1514
set 3d_neutral = 1460
set 3d_deadband_throttle = 50
set 3d_limit_low = 1000
set 3d_limit_high = 2000
set 3d_switched_mode = OFF
set servo_center_pulse = 1500
set servo_pwm_rate = 50
set servo_lowpass_hz = 0
set tri_unarmed_servo = ON
set channel_forwarding_start = 4
set reboot_character = 82
set serial_update_rate_hz = 100
set imu_dcm_kp = 2500
set imu_dcm_ki = 0
set small_angle = 180
set auto_disarm_delay = 5
set gyro_cal_on_first_arm = OFF
set gps_provider = NMEA
set gps_sbas_mode = AUTO
set gps_auto_config = ON
set gps_auto_baud = OFF
set gps_ublox_use_galileo = OFF
set gps_set_home_point_once = OFF
set gps_rescue_angle = 32
set gps_rescue_initial_alt = 50
set gps_rescue_descent_dist = 200
set gps_rescue_landing_alt = 5
set gps_rescue_landing_dist = 10
set gps_rescue_ground_speed = 2000
set gps_rescue_throttle_p = 150
set gps_rescue_throttle_i = 20
set gps_rescue_throttle_d = 50
set gps_rescue_velocity_p = 80
set gps_rescue_velocity_i = 20
set gps_rescue_velocity_d = 15
set gps_rescue_yaw_p = 40
set gps_rescue_throttle_min = 1100
set gps_rescue_throttle_max = 1600
set gps_rescue_ascend_rate = 500
set gps_rescue_descend_rate = 150
set gps_rescue_throttle_hover = 1280
set gps_rescue_sanity_checks = RESCUE_SANITY_ON
set gps_rescue_min_sats = 8
set gps_rescue_min_dth = 100
set gps_rescue_allow_arming_without_fix = OFF
set gps_rescue_alt_mode = MAX_ALT
set deadband = 0
set yaw_deadband = 0
set yaw_control_reversed = OFF
set pid_process_denom = 1
set runaway_takeoff_prevention = ON
set runaway_takeoff_deactivate_delay = 500
set runaway_takeoff_deactivate_throttle_percent = 20
set thrust_linear = 0
set transient_throttle_limit = 15
set tlm_inverted = OFF
set tlm_halfduplex = ON
set frsky_default_lat = 0
set frsky_default_long = 0
set frsky_gps_format = 0
set frsky_unit = IMPERIAL
set frsky_vfas_precision = 0
set hott_alarm_int = 5
set pid_in_tlm = OFF
set report_cell_voltage = OFF
set ibus_sensor = 1,2,3,0,0,0,0,0,0,0,0,0,0,0,0
set mavlink_mah_as_heading_divisor = 0
set telemetry_disabled_voltage = OFF
set telemetry_disabled_current = OFF
set telemetry_disabled_fuel = OFF
set telemetry_disabled_mode = OFF
set telemetry_disabled_acc_x = OFF
set telemetry_disabled_acc_y = OFF
set telemetry_disabled_acc_z = OFF
set telemetry_disabled_pitch = OFF
set telemetry_disabled_roll = OFF
set telemetry_disabled_heading = OFF
set telemetry_disabled_altitude = OFF
set telemetry_disabled_vario = OFF
set telemetry_disabled_lat_long = OFF
set telemetry_disabled_ground_speed = OFF
set telemetry_disabled_distance = OFF
set telemetry_disabled_esc_current = ON
set telemetry_disabled_esc_voltage = ON
set telemetry_disabled_esc_rpm = ON
set telemetry_disabled_esc_temperature = ON
set telemetry_disabled_temperature = OFF
set ledstrip_visual_beeper = OFF
set ledstrip_visual_beeper_color = WHITE
set ledstrip_grb_rgb = GRB
set ledstrip_profile = STATUS
set ledstrip_race_color = ORANGE
set ledstrip_beacon_color = WHITE
set ledstrip_beacon_period_ms = 500
set ledstrip_beacon_percent = 50
set ledstrip_beacon_armed_only = OFF
set osd_units = METRIC
set osd_warn_arming_disable = ON
set osd_warn_batt_not_full = ON
set osd_warn_batt_warning = ON
set osd_warn_batt_critical = ON
set osd_warn_visual_beeper = ON
set osd_warn_crash_flip = ON
set osd_warn_esc_fail = ON
set osd_warn_core_temp = ON
set osd_warn_rc_smoothing = ON
set osd_warn_fail_safe = ON
set osd_warn_launch_control = ON
set osd_warn_no_gps_rescue = ON
set osd_warn_gps_rescue_disabled = ON
set osd_warn_rssi = OFF
set osd_warn_link_quality = OFF
set osd_rssi_alarm = 20
set osd_link_quality_alarm = 80
set osd_rssi_dbm_alarm = 60
set osd_cap_alarm = 2200
set osd_alt_alarm = 100
set osd_esc_temp_alarm = -128
set osd_esc_rpm_alarm = -1
set osd_esc_current_alarm = -1
set osd_core_temp_alarm = 70
set osd_ah_max_pit = 20
set osd_ah_max_rol = 40
set osd_ah_invert = OFF
set osd_tim1 = 2560
set osd_tim2 = 2561
set osd_vbat_pos = 234
set osd_rssi_pos = 234
set osd_link_quality_pos = 234
set osd_rssi_dbm_pos = 234
set osd_tim_1_pos = 234
set osd_tim_2_pos = 234
set osd_remaining_time_estimate_pos = 234
set osd_flymode_pos = 234
set osd_anti_gravity_pos = 234
set osd_g_force_pos = 234
set osd_throttle_pos = 234
set osd_vtx_channel_pos = 234
set osd_crosshairs_pos = 205
set osd_ah_sbar_pos = 206
set osd_ah_pos = 78
set osd_current_pos = 234
set osd_mah_drawn_pos = 234
set osd_motor_diag_pos = 234
set osd_craft_name_pos = 234
set osd_display_name_pos = 234
set osd_gps_speed_pos = 234
set osd_gps_lon_pos = 234
set osd_gps_lat_pos = 234
set osd_gps_sats_pos = 234
set osd_home_dir_pos = 234
set osd_home_dist_pos = 234
set osd_flight_dist_pos = 234
set osd_compass_bar_pos = 234
set osd_altitude_pos = 234
set osd_pid_roll_pos = 234
set osd_pid_pitch_pos = 234
set osd_pid_yaw_pos = 234
set osd_debug_pos = 234
set osd_power_pos = 234
set osd_pidrate_profile_pos = 234
set osd_warnings_pos = 14665
set osd_avg_cell_voltage_pos = 234
set osd_pit_ang_pos = 234
set osd_rol_ang_pos = 234
set osd_battery_usage_pos = 234
set osd_disarmed_pos = 234
set osd_nheading_pos = 234
set osd_nvario_pos = 234
set osd_esc_tmp_pos = 234
set osd_esc_rpm_pos = 234
set osd_esc_rpm_freq_pos = 234
set osd_rtc_date_time_pos = 234
set osd_adjustment_range_pos = 234
set osd_flip_arrow_pos = 234
set osd_core_temp_pos = 234
set osd_log_status_pos = 234
set osd_stick_overlay_left_pos = 234
set osd_stick_overlay_right_pos = 234
set osd_stick_overlay_radio_mode = 2
set osd_rate_profile_name_pos = 234
set osd_pid_profile_name_pos = 234
set osd_profile_name_pos = 234
set osd_stat_rtc_date_time = OFF
set osd_stat_tim_1 = OFF
set osd_stat_tim_2 = ON
set osd_stat_max_spd = ON
set osd_stat_max_dist = OFF
set osd_stat_min_batt = ON
set osd_stat_endbatt = OFF
set osd_stat_battery = OFF
set osd_stat_min_rssi = ON
set osd_stat_max_curr = ON
set osd_stat_used_mah = ON
set osd_stat_max_alt = OFF
set osd_stat_bbox = ON
set osd_stat_bb_no = ON
set osd_stat_max_g_force = OFF
set osd_stat_max_esc_temp = OFF
set osd_stat_max_esc_rpm = OFF
set osd_stat_min_link_quality = OFF
set osd_stat_flight_dist = OFF
set osd_stat_max_fft = OFF
set osd_stat_total_flights = OFF
set osd_stat_total_time = OFF
set osd_stat_total_dist = OFF
set osd_stat_min_rssi_dbm = OFF
set osd_profile = 1
set osd_profile_1_name = –
set osd_profile_2_name = –
set osd_profile_3_name = –
set task_statistics = ON
set debug_mode = NONE
set rate_6pos_switch = OFF
set cpu_overclock = OFF
set pwr_on_arm_grace = 5
set scheduler_optimize_rate = OFF
set vtx_band = 0
set vtx_channel = 0
set vtx_power = 0
set vtx_low_power_disarm = OFF
set vtx_freq = 0
set vtx_pit_mode_freq = 0
set vtx_halfduplex = ON
set vcd_video_system = AUTO
set vcd_h_offset = 0
set vcd_v_offset = 0
set max7456_clock = DEFAULT
set max7456_spi_bus = 2
set max7456_preinit_opu = OFF
set displayport_msp_col_adjust = 0
set displayport_msp_row_adjust = 0
set displayport_max7456_col_adjust = 0
set displayport_max7456_row_adjust = 0
set displayport_max7456_inv = OFF
set displayport_max7456_blk = 0
set displayport_max7456_wht = 2
set esc_sensor_halfduplex = OFF
set esc_sensor_current_offset = 0
set led_inversion = 0
set dashboard_i2c_bus = 2
set dashboard_i2c_addr = 60
set camera_control_mode = HARDWARE_PWM
set camera_control_ref_voltage = 330
set camera_control_key_delay = 180
set camera_control_internal_resistance = 470
set camera_control_button_resistance = 450,270,150,68,0
set camera_control_inverted = OFF
set pinio_config = 1,1,1,1
set pinio_box = 255,255,255,255
set usb_hid_cdc = OFF
set usb_msc_pin_pullup = ON
set flash_spi_bus = 3
set rcdevice_init_dev_attempts = 6
set rcdevice_init_dev_attempt_interval = 1000
set rcdevice_protocol_version = 0
set rcdevice_feature = 0
set gyro_1_bustype = SPI
set gyro_1_spibus = 1
set gyro_1_i2cBus = 0
set gyro_1_i2c_address = 0
set gyro_1_sensor_align = CW0
set gyro_1_align_roll = 0
set gyro_1_align_pitch = 0
set gyro_1_align_yaw = 0
set gyro_2_bustype = SPI
set gyro_2_spibus = 1
set gyro_2_i2cBus = 0
set gyro_2_i2c_address = 0
set gyro_2_sensor_align = CW90
set gyro_2_align_roll = 0
set gyro_2_align_pitch = 0
set gyro_2_align_yaw = 900
set mco2_on_pc9 = OFF
set timezone_offset_minutes = 0
set gyro_rpm_notch_harmonics = 3
set gyro_rpm_notch_q = 500
set gyro_rpm_notch_min = 100
set dterm_rpm_notch_harmonics = 0
set dterm_rpm_notch_q = 500
set dterm_rpm_notch_min = 100
set rpm_notch_lpf = 150
set stats = OFF
set stats_total_flights = 0
set stats_total_time_s = 0
set stats_total_dist_m = 0
set name = –
set display_name = –
set position_alt_source = DEFAULT

profile 0

# profile 0
set profile_name = –
set dyn_lpf_dterm_min_hz = 70
set dyn_lpf_dterm_max_hz = 170
set dterm_lowpass_type = BIQUAD
set dterm_lowpass_hz = 150
set dterm_lowpass2_type = PT1
set dterm_lowpass2_hz = 150
set dterm_notch_hz = 0
set dterm_notch_cutoff = 0
set vbat_pid_gain = OFF
set pid_at_min_throttle = ON
set anti_gravity_mode = SMOOTH
set anti_gravity_threshold = 250
set anti_gravity_gain = 5000
set feedforward_transition = 0
set acc_limit_yaw = 0
set acc_limit = 0
set crash_dthreshold = 50
set crash_gthreshold = 400
set crash_setpoint_threshold = 350
set crash_time = 500
set crash_delay = 0
set crash_recovery_angle = 10
set crash_recovery_rate = 100
set crash_limit_yaw = 200
set crash_recovery = OFF
set iterm_rotation = OFF
set iterm_relax = RP
set iterm_relax_type = SETPOINT
set iterm_relax_cutoff = 20
set iterm_windup = 100
set iterm_limit = 400
set pidsum_limit = 500
set pidsum_limit_yaw = 400
set yaw_lowpass_hz = 0
set throttle_boost = 5
set throttle_boost_cutoff = 15
set acro_trainer_angle_limit = 20
set acro_trainer_lookahead_ms = 50
set acro_trainer_debug_axis = ROLL
set acro_trainer_gain = 75
set p_pitch = 42
set i_pitch = 60
set d_pitch = 36
set f_pitch = 70
set p_roll = 42
set i_roll = 60
set d_roll = 35
set f_roll = 70
set p_yaw = 30
set i_yaw = 50
set d_yaw = 30
set f_yaw = 70
set angle_level_strength = 50
set horizon_level_strength = 50
set horizon_transition = 75
set level_limit = 55
set horizon_tilt_effect = 75
set horizon_tilt_expert_mode = OFF
set abs_control_gain = 0
set abs_control_limit = 90
set abs_control_error_limit = 20
set abs_control_cutoff = 11
set use_integrated_yaw = OFF
set integrated_yaw_relax = 200
set d_min_roll = 20
set d_min_pitch = 20
set d_min_yaw = 0
set d_min_boost_gain = 27
set d_min_advance = 20
set motor_output_limit = 100
set auto_profile_cell_count = 0
set launch_control_mode = NORMAL
set launch_trigger_allow_reset = ON
set launch_trigger_throttle_percent = 20
set launch_angle_limit = 0
set launch_control_gain = 40
set ff_interpolate_sp = OFF
set ff_spread = 0
set ff_max_rate_limit = 0
set ff_lookahead_limit = 0
set ff_boost = 15
set idle_min_rpm = 0
set idle_adjustment_speed = 50
set idle_p = 50
set idle_pid_limit = 200
set idle_max_increase = 150

rateprofile 0

# rateprofile 0
set rateprofile_name = –
set thr_mid = 50
set thr_expo = 0
set rates_type = BETAFLIGHT
set roll_rc_rate = 100
set pitch_rc_rate = 100
set yaw_rc_rate = 100
set roll_expo = 0
set pitch_expo = 0
set yaw_expo = 0
set roll_srate = 70
set pitch_srate = 70
set yaw_srate = 70
set tpa_rate = 50
set tpa_breakpoint = 1500
set tpa_mode = D
set throttle_limit_type = OFF
set throttle_limit_percent = 100
set roll_rate_limit = 1998
set pitch_rate_limit = 1998
set yaw_rate_limit = 1998

# end the command batch
batch end