Product : Engine, Version : 5.0.1.1036, ArticleID : 41023913

HowTo : CmdPlineToMesh shows top/bottom edges

Article41023913
TypeHowTo
ProductEngine
Version5.0.1.1036
Date Added4/6/2005
Submitted byMario Pellegrino
Keywords

Subject

CmdPlineToMesh shows top/bottom edges

Summary

If I set Edges Invisibility to True, then setting as 3D view "SHADE" or "SHADE EDGE ON"
the top/bottom edges is alway shown! see file attached.

Solution

This is the way that is supposed to work. However
you can make your own function very easily to do this with the way you want.

So you can use the following function instead of CmdPlinetoMesh.

Private Sub MakePolyface(mypoly As vdPolyline, thickness As Double)
    Dim spoints As Variant
    Dim addedpoints() As Double
    Dim i
    Dim polyface As vdPolyface
    Dim pfacepoints() As Double
    Dim facelist() As Long
   
    spoints = mypoly.GetSamplePoints(100, 0)
   
    ReDim addedpoints(UBound(spoints), 2)
    For i = 0 To UBound(spoints)
        addedpoints(i, 0) = spoints(i, 0)
        addedpoints(i, 1) = spoints(i, 1)
        addedpoints(i, 2) = spoints(i, 2) + thickness
    Next
   
    ReDim facelist(UBound(spoints) * 5 + 4)
    ReDim pfacepoints(UBound(spoints) * 2 + 1, 2)
    numofverticies = UBound(spoints)
   
    For i = 0 To UBound(spoints)
        pfacepoints(i, 0) = spoints(i, 0)
        pfacepoints(i, 1) = spoints(i, 1)
        pfacepoints(i, 2) = spoints(i, 2)
       
        pfacepoints(i + UBound(spoints) + 1, 0) = addedpoints(i, 0)
        pfacepoints(i + UBound(spoints) + 1, 1) = addedpoints(i, 1)
        pfacepoints(i + UBound(spoints) + 1, 2) = addedpoints(i, 2)
    Next
   
    For i = 0 To numofverticies
        facelist(i * 5) = i
        facelist(i * 5 + 1) = i + 1
        facelist(i * 5 + 2) = numofverticies + i + 1 + 1
        facelist(i * 5 + 3) = numofverticies + i + 1
        facelist(i * 5 + 4) = 0 'color
    Next
   
    Set polyface = vdraw.CreateInstance(OBJ_POLYFACE)
    polyface.VertexList = pfacepoints
    polyface.facelist = facelist
    vdraw.ActiveDocument.Entities.AddItem polyface
End Sub