RFFace.Transform



Your Ad Here

Description

Transforms the face by the specified transformation matrix.

Syntax

Function RFFace.Transform(pTMat As RFTMatrix) As RFErrorCode

The Transform syntax has these parts:

Part Description
pTMat [INRFTMatrix Required. Transformation matrix to apply.

Remarks

Sample

Dim rfErr As RapidForm.RFErrorCode
Dim fcObj As RapidForm.RFFace

    ' Assign the RFFace interface object
    Set fcObj = RapidForm.Face
    
    ' Pick a face
    Dim pickedID As RFEntityID
    rfErr = RapidForm.SelectTools.PickEntity(RF_PICK_FACE, 1, pickedID)
    
    ' If an error happens, exit the subroutine.
    If rfErr <> RF_SUCCESS Then
        MsgBox RapidForm.Application.GetErrorMessage(rfErr)
        Exit Sub
    End If
    
    rfErr = fcObj.SetID(pickedID)

    ' Translate the face
    rfErr = fcObj.Translate(10, 0, 0)
    
    ' Rotate the face
    rfErr = fcObj.Rotate(PI / 3, 0, 0)
    
    ' Scale the face
    rfErr = fcObj.Resize(2, 1, 1)
    
    ' Transform the face
    Dim trMat As RFTMatrix
    trMat.m(0, 0) = 1
    trMat.m(0, 1) = 1
    trMat.m(0, 2) = 1
    
    trMat.m(1, 0) = 1
    trMat.m(1, 1) = 1
    trMat.m(1, 2) = 1
    
    trMat.m(2, 0) = 1
    trMat.m(2, 1) = 1
    trMat.m(2, 2) = 1
    
    rfErr = fcObj.Transform(trMat)
    
    ' Retrieves the shell ID
    Dim shID As RFEntityID
    rfErr = fcObj.GetShell(shID)

    ' Regenerate the display list of the shell.
    RapidForm.Document.RegenShell shID
    
    ' Redraw the document scene.
    RapidForm.Document.RedrawScene

Return to Rapidform Index


Your Ad Here