Hi, I have trouble finding the isocurve in the middle of the domain in the attached object, I don’t understand exactly why, this is the code I’m developing:
var gs = new GetObject();
gs.SetCommandPrompt("Select the face");
gs.GeometryFilter = ObjectType.Surface;
gs.Get();
if (gs.CommandResult() != Result.Success)
return gs.CommandResult();
var face = gs.Object(0).Face();
if (face == null)
{
Dialogs.ShowMessage("No Face Found", "Face Error");
return Result.Failure;
}
var c = face.ShrinkSurfaceToEdge();
Surface surface = face;
var midU = surface.Domain(0).Mid;
var midV = surface.Domain(1).Mid;
var midD = Math.Min(Math.Abs(midU), Math.Abs(midV));
Curve isoCurveH = surface.IsoCurve(0, midD); //also using midU and midV still the result doesn't change
Curve isoCurveV = surface.IsoCurve(1, midD);
Curve isoCurve = null;
if (isoCurveH.GetLength() > isoCurveV.GetLength())
isoCurve = isoCurveH;
else
isoCurve = isoCurveV;
if (isoCurve == null)
return Result.Failure;
doc.Objects.Add(isoCurve);
doc.Views.Redraw();
In the attached file there are also all the curves generated by the code
IsoCurve Wrong Result.3dm (341.1 KB)