RWPly
OCCT package RWPly: RWPly_CafWriter, RWPly_PlyWriterContext.
RWPly_CafWriter
PLY writer context from XCAF document.
Constructors(1)
- constructor(theFile: TCollection_AsciiString): RWPly_CafWriter
Main constructor.
Parameters (1)theFile—path to output PLY file
Static methods(1)
Instance methods(20)
Return transformation from OCCT to PLY coordinate system.
Return transformation from OCCT to PLY coordinate system.
- SetCoordinateSystemConverter(theConverter: RWMesh_CoordinateSystemConverter): void
Set transformation from OCCT to PLY coordinate system.
Parameters (1)theConverter
Return default material definition to be used for nodes with only color defined.
- SetDefaultStyle(theStyle: XCAFPrs_Style): void
Set default material definition to be used for nodes with only color defined.
Parameters (1)theStyle
- IsDoublePrecision(): boolean
Return TRUE if vertex position should be stored with double floating point precision; FALSE by default.
- SetDoublePrecision(theDoublePrec: boolean): void
Set if vertex position should be stored with double floating point precision.
Parameters (1)theDoublePrec
- HasNormals(): boolean
Return TRUE if normals should be written; TRUE by default.
- SetNormals(theHasNormals: boolean): void
Set if normals are defined.
Parameters (1)theHasNormals
- HasTexCoords(): boolean
Return TRUE if UV / texture coordinates should be written; FALSE by default.
- SetTexCoords(theHasTexCoords: boolean): void
Set if UV / texture coordinates should be written.
Parameters (1)theHasTexCoords
- HasColors(): boolean
Return TRUE if point colors should be written; TRUE by default.
- SetColors(theToWrite: boolean): void
Set if point colors should be written.
Parameters (1)theToWrite
- HasPartId(): boolean
Return TRUE if part Id should be written as element attribute; TRUE by default.
- SetPartId(theSurfId: boolean): void
Set if part Id should be written as element attribute; FALSE by default. Cannot be combined with
HasFaceId().Parameters (1)theSurfId
- HasFaceId(): boolean
Return TRUE if face Id should be written as element attribute; FALSE by default.
- SetFaceId(theSurfId: boolean): void
Set if face Id should be written as element attribute; FALSE by default. Cannot be combined with
HasPartId().Parameters (1)theSurfId
- Perform(theDocument: TDocStd_Document, theRootLabels: NCollection_Sequence_TDF_Label, theLabelFilter: NCollection_Map_TCollection_AsciiString, theFileInfo: any, theProgress: Message_ProgressRange): boolean
Write PLY file and associated MTL material file. Triangulation data should be precomputed within shapes!
Parameters (5)theDocument—input documenttheRootLabels—list of root shapes to exporttheLabelFilter—optional filter with document nodes to export, with keys defined byXCAFPrs_DocumentExplorer::DefineChildId()and filled recursively (leaves and parent assembly nodes at all levels); when not NULL, all nodes not included into the map will be ignoredtheFileInfo—map with file metadata to put into PLY header sectiontheProgress—optional progress indicator
ReturnsFALSE on file writing failure
- Perform(theDocument: TDocStd_Document, theFileInfo: any, theProgress: Message_ProgressRange): boolean
Write PLY file and associated MTL material file. Triangulation data should be precomputed within shapes!
Parameters (3)theDocument—input documenttheFileInfo—map with file metadata to put into PLY header sectiontheProgress—optional progress indicator
ReturnsFALSE on file writing failure
RWPly_PlyWriterContext
Auxiliary low-level tool writing PLY file.
Constructors(1)
Empty constructor.
Instance methods(19)
- IsDoublePrecision(): boolean
- SetDoublePrecision(theDoublePrec: boolean): voidParameters (1)
theDoublePrec
- HasNormals(): boolean
- SetNormals(theHasNormals: boolean): voidParameters (1)
theHasNormals
- HasTexCoords(): boolean
- SetTexCoords(theHasTexCoords: boolean): voidParameters (1)
theHasTexCoords
- HasColors(): boolean
- SetColors(theToWrite: boolean): voidParameters (1)
theToWrite
- HasSurfaceId(): boolean
- SetSurfaceId(theSurfId: boolean): voidParameters (1)
theSurfId
- SetSurfaceId(theSurfId: number): voidParameters (1)
theSurfId
- IsOpened(): boolean
- WriteHeader(theNbNodes: number, theNbElems: number, theFileInfo: any): booleanParameters (3)
theNbNodestheNbElemstheFileInfo
- NbWrittenVertices(): number
- VertexOffset(): number
- SetVertexOffset(theOffset: number): voidParameters (1)
theOffset
- SurfaceId(): number
- NbWrittenElements(): number
- Close(theIsAborted?: boolean): booleanParameters (1)
theIsAborted