/// <summary> /// /// </summary> /// <param name="DA"></param> private void InitializeSolver(IGH_DataAccess DA, DynamicRemesher.Settings settings) { GH_HeMesh3d source = null; if (!DA.GetData(0, ref source)) { return; } IGH_Goo targetGoo = null; if (!DA.GetData(1, ref targetGoo)) { return; } var featsGoo = new List <GH_ObjectWrapper>(); DA.GetDataList(2, featsGoo); var target = CreateSurfaceFeature(targetGoo); var features = featsGoo.Select(obj => (IFeature)obj.Value).Concat(CreateBoundaryFeatures(source)); _solver = DynamicRemesher.Solver.Create(source.Value, target, features, settings); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object can be used to retrieve data from input parameters and /// to store data in output parameters.</param> protected override void SolveInstance(IGH_DataAccess DA) { Interval lengthRng = new Interval(); if (!DA.GetData(0, ref lengthRng)) { return; } double lengthTol = 0.0; if (!DA.GetData(1, ref lengthTol)) { return; } double feature = 0.0; if (!DA.GetData(2, ref feature)) { return; } double timeStep = 0.0; if (!DA.GetData(3, ref timeStep)) { return; } double damping = 0.0; if (!DA.GetData(4, ref damping)) { return; } int refineFreq = 0; if (!DA.GetData(5, ref refineFreq)) { return; } var settings = new DynamicRemesher.Settings(); settings.LengthRange = lengthRng; settings.LengthTolerance = lengthTol; settings.FeatureWeight = feature; settings.TimeStep = timeStep; settings.Damping = damping; settings.RefineFrequency = refineFreq; DA.SetData(0, settings); }