FacetFace method


Your Ad Here


Topsolid online Help Index

Created : v6.6

 

IShape.FacetFace(FaceId, SurfaceTol, AngleTol, StripLength, VertX, VertY, VertZ, NormX, NormY, NormZ)

 

Description

This method facets a face.

Parameters

 

IN:

 

Long FaceId

Id of the face

 

IN:

 

Double SurfaceTol

Surface tolerance.

IN:

Double AngleTol

Angular tolerance.

 

OUT:

Variant StripLength (array)

Array of the number of vertices of each strip (array of long).

 

OUT:

Variant VertX (array)

Array of the X coordinates of the vertices (array of double).

 

OUT:

Variant VertY (array)

Array of the Y coordinates of the vertices (array of double).

 

OUT:

Variant VertZ (array)

Array of the Z coordinates of the vertices (array of double).

 

OUT:

Variant NormX (array)

Array of the X coordinates of the vertex normal (array of double).

 

OUT:

Variant NormY (array)

Array of the Y coordinates of the vertex normal (array of double).

 

OUT:

Variant NormZ (array)

Array of the Z coordinates of the vertex normal (array of double).

 

 

Example

To rebuild the triangle strips:

 

Dim vertexCountInStrip As Variant

Dim vertX As Variant

Dim vertY As Variant

Dim vertZ As Variant

Dim normX As Variant

Dim normY As Variant

Dim normZ As Variant

Dim verticesNumber As Long

Dim stripNumber As Long

Dim verticesCount As long

Dim Cv As TopSolid.Curve

......

 

' To get the FaceCount and the Faceids, see GetShellFaces or GetBodyFaces.

For i = 0 To FaceCount

 

'Face tessellation.

SetShape.FacetFace FaceIds(i), -1, -1, vertexCountInStrip, vertX, vertY, vertZ, normX, normY, normZ

                

verticesNumber = UBound(vertX, 1) + 1

stripNumber = UBound(vertexCountInStrip, 1) + 1

                

verticesCount = 0

 

For j = 0 To stripNumber – 1

 

For k = 0 To vertexCountInStrip(j) – 3

 

' Creation of the lines to form triangles.

Set Cv = TopDoc3D.Curves.AddBasicLine(vertX(k + verticesCount), vertY(k + verticesCount), vertZ(k + verticesCount), vertX(k + verticesCount + 1), vertY(k + verticesCount + 1), vertZ(k + verticesCount + 1))

 

Set Cv = TopDoc3D.Curves.AddBasicLine(vertX(k + verticesCount+ 1), vertY(k + verticesCount + 1), vertZ(k + verticesCount + 1), vertX(k + verticesCount + 2), vertY(k + verticesCount + 2), vertZ(k + verticesCount + 2))

 

Set Cv = TopDoc3D.Curves.AddBasicLine(vertX(k + verticesCount + 2), vertY(k + verticesCount + 2), vertZ(k + verticesCount + 2), vertX(k + verticesCount), vertY(k + verticesCount), vertZ(k + verticesCount))

 

Next k

verticesCount = verticesCount + vertexCountInStrip(j)

 

Next j

Next i

 

Topsolid online Help Index

Your Ad Here