示例#1
0
        private static void addConnectorsToVisualizer(VisualizerNamespace.Visualizer viz, ParticleStructure structure,
                                                      FEEngineAdapter adapter)
        {
            var projectiles = adapter.GetProjectiles();

            foreach (var connect in structure.Connectors)
            {
                viz.AddConnector(projectiles[connect.Item1], projectiles[connect.Item2]);
            }
        }
示例#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();
        }