Eyeshot 11 Documentation
WinForms Control / Tutorials / Extracting surface edge curves
In This Topic
    Extracting surface edge curves
    In This Topic

    The Surface entity in Eyeshot contains a list of trim loops as a collection of curves properly oriented (counter-clockwise for outer one, clockwise for inners).

    To check if the surface is trimmed you can query the mySurf.Trimmed property. To loop over loops or loop curves use the mySurf.Trimming.ContourList property as you can see in the code snippet below.

    The following code snippet demonstrates how to extract surface edge curves from the entity ent and to add them to the ViewportLayout master entity collection with red color.

    Surface surf = (Surface) ent;
    ICurve[] curves = surf.ExtractEdges();
    Entity[] entArray = new Entity[curves.Length];
    
    for (int i = 0; i < curves.Length; i++)
                       
       entArray[i] = (Entity) curves[i];
                       
    viewportLayout1.Entities.AddRange(entArray, Color.Red);
    Dim surf As Surface = DirectCast(ent, Surface)
    Dim curves As ICurve() = surf.ExtractEdges()
    Dim entArray As Entity() = New Entity(curves.Length - 1) {}
    
    For i As Integer = 0 To curves.Length - 1
       
        entArray(i) = DirectCast(curves(i), Entity)
       
    Next
    
    viewportLayout1.Entities.AddRange(entArray, Color.Red)