public VerletIntegrator(ParticleSystem ps) { s = ps; }
public Integrator(ParticleSystem s) { }
public dynDynamicRelaxationOnFace() { InPortData.Add(new PortData("face", "The face to use for distribution of particles.", typeof(object))); InPortData.Add(new PortData("d", "Dampening.", typeof(double))); InPortData.Add(new PortData("s", "Spring Constant.", typeof(double))); InPortData.Add(new PortData("r", "Rest Length.", typeof(double))); InPortData.Add(new PortData("m", "Nodal Mass.", typeof(double))); InPortData.Add(new PortData("numU", "Number of Particles in U.", typeof(int))); InPortData.Add(new PortData("numV", "Number of Particles in V.", typeof(int))); InPortData.Add(new PortData("gravity", "Gravity in Z.", typeof(double))); OutPortData = new PortData("ps", "Particle System", typeof(ParticleSystem)); base.RegisterInputsAndOutputs(); particleSystem = new ParticleSystem(); }
public override Expression Evaluate(FSharpList<Expression> args) { var input = args[0]; this.Dispatcher.Invoke(new Action( delegate { //If we are receiving a list, we test to see if they are XYZs or curves and then make Preview3d elements. if (input.IsList) { #region points and curves //FSharpList<Expression> list = ((Expression.List)args[0]).Item; var inList = (input as Expression.List).Item; DetachVisuals(); ClearPointsCollections(); //test the first item in the list. //if it's an XYZ, assume XYZs for the list //create points. otherwise, create curves XYZ ptTest = (inList.First() as Expression.Container).Item as XYZ; Curve cvTest = (inList.First() as Expression.Container).Item as Curve; if (ptTest != null) isDrawingPoints = true; foreach (Expression e in inList) { if (isDrawingPoints) { pt = (e as Expression.Container).Item as XYZ; DrawPoint(pt); } else { c = (e as Expression.Container).Item as Curve; DrawCurve(c); } } RaisePropertyChanged("Points"); #endregion } else if (input.IsContainer) //if not a list, presume it's a a particle system { var test = ((Expression.Container)(input)).Item; if (test is ParticleSystem) { ps = (ParticleSystem)test; try { UpdateVisualsFromParticleSystem(); RaisePropertyChanged("Points"); } catch (Exception e) { dynElementSettings.SharedInstance.Bench.Log("Something wrong drawing 3d preview. " + e.ToString()); } } else if (test is Curve) { DetachVisuals(); ClearPointsCollections(); c = (Curve)test; DrawCurve(c); RaisePropertyChanged("Points"); } else if (test is XYZ) { DetachVisuals(); ClearPointsCollections(); pt = (XYZ)test; DrawCurve(c); RaisePropertyChanged("Points"); } } })); return input; //watch 3d should be a 'pass through' node }
public dynDynamicRelaxation() { InPortData.Add(new PortData("points", "The points to use as fixed nodes.", typeof(object))); InPortData.Add(new PortData("curves", "The curves to make into spring chains", typeof(object))); InPortData.Add(new PortData("d", "Dampening.", typeof(double))); InPortData.Add(new PortData("s", "Spring Constant.", typeof(double))); InPortData.Add(new PortData("r", "Rest Length.", typeof(double))); InPortData.Add(new PortData("m", "Nodal Mass.", typeof(double))); InPortData.Add(new PortData("numX", "Number of Particles in X.", typeof(int))); InPortData.Add(new PortData("numY", "Number of Particles in Y.", typeof(int))); InPortData.Add(new PortData("gravity", "Gravity in Z.", typeof(double))); OutPortData = new PortData("ps", "Particle System", typeof(ParticleSystem)); base.RegisterInputsAndOutputs(); particleSystem = new ParticleSystem(); }