devDept home page
Home
| Support | Purchase | Company
 
 
Tickets
Submit a Ticket
View your Tickets
License Profile
Resources
Documentation
Knowledge Base
FAQ
Change Log
Other
Contact Support
Extracting Surface Edge Curves

 

  Info & Tags
 
Article #: 2
Created: 2010-01-27
Modified: 2010-05-19
Tags: eyeshot3, surface

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.TrimLoops 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 viewport master entity collection with red color.

 

C#
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];
                    
mainViewport.Entities.AddRange(entArray, 0, Color.Red);

Visual Basic
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

mainViewport.Entities.AddRange(entArray, 0, Color.Red)
 
Copyright © 2009 devDept Software. All rights reserved.