Target Edge Length, QuadRemeshParameters Class

https://developer.rhino3d.com/wip/api/RhinoCommon/html/T_Rhino_Geometry_QuadRemeshParameters.htm

Does the QuadRemeshParameters Class have a target edge length property somewhere that I haven’t noticed?


No, but you can compute TargetQuadCount like this:

private void RunScript(Mesh m, double edgeLength, ref object A)
{
  var parameters = new QuadRemeshParameters();
  var area = AreaMassProperties.Compute(m).Area;   parameters.TargetQuadCount = Convert.ToInt32(Math.Round(area / (edgeLength * edgeLength), 0));
  parameters.AdaptiveSize = 0.0;
  parameters.AdaptiveQuadCount = false;
  A = m.QuadRemesh(parameters);
}

QuadRemesh.gh (140.2 KB)

3 Likes
def TargetQuadCountFromTargetEdgeLength( mesh, targetEdgeLength ):
    parameters =  rh.Geometry.QuadRemeshParameters()
    area = rh.Geometry.AreaMassProperties.Compute(mesh).Area
    parameters.TargetQuadCount = round( area / (targetEdgeLength * targetEdgeLength), 0 );
    return parameters.TargetQuadCount

I tried to add a Python version.