static public void Bridge()
        {
            var bridge = new FiniteElement.GoldenGate(); // Replace this with your own class

            bridge.AddForce(new Vector3D(5, 0, 5), new Vector3D(0, 0, -10000), 25);

            var adapter = new BridgeEngineAdapter(bridge);

            VisualizerNamespace.Visualizer.Radius = .05;
            VisualizerNamespace.Visualizer viz = new VisualizerNamespace.Visualizer(adapter);
            viz.SpherePrecision = 40;
            viz.CylinderRadius  = .01;
            viz.TimeIncrement   = .001;
            viz.AddGround(5, new Vector3D(-5, 0, 0), "dirt.jpg");
            viz.AddGround(5, new Vector3D(15, 0, 0), "dirt.jpg");
            viz.AddGround(5, new Vector3D(5, 0, 0), "lava.jpg");

            addConnectorsToVisualizer(viz, adapter);
            viz.Show();
        }
Esempio n. 2
0
        public static void FiniteElement()
        {
            var structure = new ParticleStructure();

            structure.GroundForceOn = true;

            var engine = new StructureEngine();

            engine.Structure = structure;

            var adapter = new FEEngineAdapter(engine);

            VisualizerNamespace.Visualizer.Radius = .1;
            VisualizerNamespace.Visualizer viz = new VisualizerNamespace.Visualizer(adapter);
            viz.SpherePrecision = 40;
            viz.CylinderRadius  = .01;
            viz.TimeIncrement   = .01;
            viz.AddGround(10, new Vector3D(0, 0, 0), "dirt.jpg");

            //viz.Add3DGraph("Center of Mass", (() => viz.Time), structure.CenterOfMass, "Time (s)", "Position (m)");

            addConnectorsToVisualizer(viz, structure, adapter);
            viz.Show();
        }