Example #1
0
        public static DependentSphere dSphere(AbstractPoint center, AbstractPoint edge)
        {
            DependentSphere thisSphere = DependentSphere.Constructor();

            thisSphere.center         = center;
            thisSphere.centerPosition = center.Position3;
            thisSphere.edge           = edge;
            thisSphere.edgePosition   = edge.Position3;
            thisSphere.Position3      = center.Position3;

            HW_GeoSolver.ins.AddDependence(thisSphere, center);
            HW_GeoSolver.ins.AddDependence(thisSphere, edge);

            thisSphere.InitializeFigure();
            return(thisSphere);
        }
Example #2
0
        public void makeSphere(Transform attachedArc, float radius)
        {
            #region initalize a sphere

            DependentCircle circle = attachedArc.GetComponent <DependentCircle>();
            //Transform sphereMesh = new GameObject("Sphere").transform;

            DependentSphere sphere = DependentSphere.Constructor();
            sphere.edge           = circle.edge;
            sphere.center         = circle.center;
            sphere.edgePosition   = circle.edgePos;
            sphere.centerPosition = circle.centerPos;

            sphere.InitializeFigure();
            sphere.AddToRManager();


            sphere.gameObject.tag = "Sphere";
            sphere.GetComponent <MasterGeoObj>().figType = GeoObjType.sphere;
            HW_GeoSolver.ins.addComponent(sphere.GetComponent <MasterGeoObj>());
            HW_GeoSolver.ins.AddDependence(sphere, attachedArc.GetComponent <MasterGeoObj>());
            #endregion
        }