This method is called when a tessellated polymesh of a 3d face is being output.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
void OnPolymesh(
PolymeshTopology node
)
Parameters
- node PolymeshTopology
-
A node representing topology of the polymesh
Example
C#
public void OnPolymesh(PolymeshTopology node)
{
Transform currentTransform = m_TransformationStack.Peek();
int numberOfFacet = node.NumberOfFacets;
int numberOfPoints = node.NumberOfPoints;
int numberOfUVs = node.NumberOfUVs;
int numberOfNormal = node.NumberOfNormals;
if( node.DistributionOfNormals == DistributionOfNormals.AtEachPoint )
{
ExportMeshPoints(node.GetPoints(), currentTransform, node.GetNormals() );
}
else if( node.DistributionOfNormals == DistributionOfNormals.OnePerFace )
{
ExportMeshPoints(node.GetPoints(), currentTransform, node.GetNormal(0) );
}
else
{
ExportMeshPoints(node.GetPoints(), currentTransform );
}
if( node.DistributionOfNormals == DistributionOfNormals.OnEachFacet )
{
ExportMeshFacets(node.GetFacets(), node.GetNormals() );
}
else
{
ExportMeshFacets(node.GetFacets(), null );
}
if( node.NumberOfUVs > 0 )
{
ExportMeshUVs( node.GetUVs() );
}
}
private void ExportMeshPoints(IList<XYZ> points, Transform trf, IList<XYZ> normals)
{
}
private void ExportMeshPoints(IList<XYZ> points, Transform trf, XYZ normal)
{
}
private void ExportMeshPoints(IList<XYZ> points, Transform trf)
{
}
private void ExportMeshFacets(IList<PolymeshFacet> facets, IList<XYZ> normals)
{
if (normals == null)
{
}
else
{
}
}
private void ExportMeshUVs(IList<UV> UVs)
{
}
VB
Public Sub OnPolymesh(node As PolymeshTopology) Implements IExportContext.OnPolymesh
Dim currentTransform As Transform = m_TransformationStack.Peek()
Dim numberOfFacet As Integer = node.NumberOfFacets
Dim numberOfPoints As Integer = node.NumberOfPoints
Dim numberOfUVs As Integer = node.NumberOfUVs
Dim numberOfNormal As Integer = node.NumberOfNormals
If node.DistributionOfNormals = DistributionOfNormals.AtEachPoint Then
ExportMeshPoints(node.GetPoints(), currentTransform, node.GetNormals())
ElseIf node.DistributionOfNormals = DistributionOfNormals.OnePerFace Then
ExportMeshPoints(node.GetPoints(), currentTransform, node.GetNormal(0))
Else
ExportMeshPoints(node.GetPoints(), currentTransform)
End If
If node.DistributionOfNormals = DistributionOfNormals.OnEachFacet Then
ExportMeshFacets(node.GetFacets(), node.GetNormals())
Else
ExportMeshFacets(node.GetFacets(), Nothing)
End If
If node.NumberOfUVs > 0 Then
ExportMeshUVs(node.GetUVs())
End If
End Sub
Private Sub ExportMeshPoints(points As IList(Of XYZ), trf As Transform, normals As IList(Of XYZ))
End Sub
Private Sub ExportMeshPoints(points As IList(Of XYZ), trf As Transform, normal As XYZ)
End Sub
Private Sub ExportMeshPoints(points As IList(Of XYZ), trf As Transform)
End Sub
Private Sub ExportMeshFacets(facets As IList(Of PolymeshFacet), normals As IList(Of XYZ))
If normals Is Nothing Then
Else
End If
End Sub
Private Sub ExportMeshUVs(UVs As IList(Of UV))
End Sub
See Also
Reference