RFShell.AddFace



Your Ad Here

Description

Adds a new face which consists of three ordered vertices to the shell, and retrieves an RFEntityID value indicating an entity ID of the new face.

Syntax

Function RFShell.AddFace(vertexID1 As RFEntityID, vertexID2 As RFEntityID, vertexID3 As RFEntityID, bCheckManifold As Boolean, pFaceID As RFEntityID) As RFErrorCode

The AddFace syntax has these parts:

Part Description
vertexID1 [INRFEntityID Required. EntityID of the first vertex.
vertexID2 [INRFEntityID Required. EntityID of the second vertex.
vertexID3 [INRFEntityID Required. EntityID of the third vertex.
bCheckManifold [INBoolean Required. It should be set TRUE to prevent a non-manifold edge from being generated.
pFaceID [OUTRFEntityID Required. EntityID of the new face.

Remarks

Sample

Dim rfErr As RFErrorCode
Dim mdObj As RapidForm.RFModel
Dim shObj As RapidForm.RFShell

    Set mdObj = RapidForm.Model
    Set shObj = RapidForm.Shell
    
    Dim shID As RFEntityID
    
    ' Add a blank sell.
    shID = mdObj.AddShell(RF_GENERIC_SHELL, "Simple shell")
    
    ' Register the shell in the GUI database.
    rfErr = RapidForm.UserInterface.AddShellToProjectTree(shID)
    
    rfErr = shObj.SetID(shID)
    
    ' Add three vertices in the shell.
    Dim vtID(2) As RFEntityID
    rfErr = shObj.AddVertex(0, 0, 0, vtID(0))
    rfErr = shObj.AddVertex(10, 0, 0, vtID(1))
    rfErr = shObj.AddVertex(0, 10, 0, vtID(2))
    
    ' Add a face composed by the three vertices.
    Dim fcID As RFEntityID
    rfErr = shObj.AddFace(vtID(0), vtID(1), vtID(2), False, fcID)
    
    ' Update the GUI database and redraw the scene.
    rfErr = RapidForm.Document.RegenShell(shID)
    RapidForm.Document.RedrawScene

Return to Rapidform Index


Your Ad Here