OpenCascade.js
API ReferenceDataExchangeTKRWMesh

RWMesh

OCCT package RWMesh: RWMesh, RWMesh_CafReader, RWMesh_CafReaderStatusEx, RWMesh_CoordinateSystem, and 11 more bound classes.

RWMesh_CafReader

The general interface for importing mesh data into XDE document.
The tool implements auxiliary structures for creating an XDE document in two steps: 1) Creating TopoDS_Shape hierarchy (myRootShapes) and Shape attributes (myAttribMap) separately within performMesh(). Attributes include names and styles. 2) Filling XDE document from these auxiliary structures. Named elements are expanded within document structure, while Compounds having no named children will remain collapsed.
In addition, unnamed nodes can be filled with generated names like "Face", "Compound" via generateNames() method, and the very root unnamed node can be filled from file name like "MyModel.obj".

Static methods(2)

Instance methods(29)

RWMesh_CoordinateSystem

Properties(7)

RWMesh_CoordinateSystemConverter

Coordinate system converter defining the following tools:

  • Initialization for commonly used coordinate systems Z-up and Y-up.
  • Perform length unit conversion (scaling).
  • Conversion of three basic elements: a) mesh node Positions, b) mesh node Normals, c) model nodes Transformations (locations).
    RWMesh_CoordinateSystem enumeration is used for convenient conversion between two commonly used coordinate systems, to make sure that imported model is oriented up. But gp_Ax3 can be used instead for defining a conversion between arbitrary systems (e.g. including non-zero origin).
    The converter requires defining explicitly both input and output systems, so that if either input or output is undefined, then conversion will be skipped. Length units conversion and coordinate system conversion are decomposed, so that application might specify no length units conversion but Y-up to Z-up coordinate system conversion.
    Class defines dedicated methods for parameters of input and output systems. This allows passing tool through several initialization steps, so that a reader can initialize input length units (only if file format defines such information), while application specifies output length units, and conversion will be done only when both defined.

Constructors(1)

Static methods(1)

Instance methods(16)

  • IsEmpty(): boolean

    Return TRUE if there is no transformation (target and current coordinates systems are same).

  • InputLengthUnit(): number

    Return source length units, defined as scale factor to m (meters). -1.0 by default, which means that NO conversion will be applied (regardless output length unit).

  • SetInputLengthUnit(theInputScale: number): void

    Set source length units as scale factor to m (meters).

    Parameters (1)
    • theInputScale
  • Return destination length units, defined as scale factor to m (meters). -1.0 by default, which means that NO conversion will be applied (regardless input length unit).

  • SetOutputLengthUnit(theOutputScale: number): void

    Set destination length units as scale factor to m (meters).

    Parameters (1)
    • theOutputScale
  • Return TRUE if source coordinate system has been set; FALSE by default.

  • Source coordinate system; UNDEFINED by default.

  • SetInputCoordinateSystem(theSysFrom: gp_Ax3): void

    Set source coordinate system.

    Parameters (1)
    • theSysFrom
  • Set source coordinate system.

    Parameters (1)
    • theSysFrom
  • Return TRUE if destination coordinate system has been set; FALSE by default.

  • Destination coordinate system; UNDEFINED by default.

  • Set destination coordinate system.

    Parameters (1)
    • theSysTo
  • Set destination coordinate system.

    Parameters (1)
    • theSysTo
  • Init(theInputSystem: gp_Ax3, theInputLengthUnit: number, theOutputSystem: gp_Ax3, theOutputLengthUnit: number): void

    Initialize transformation.

    Parameters (4)
    • theInputSystem
    • theInputLengthUnit
    • theOutputSystem
    • theOutputLengthUnit
  • Transform transformation.

    Parameters (1)
    • theTrsf
      Mutated in place; read the updated value from this argument after the call.
  • TransformPosition(thePos: gp_XYZ): void

    Transform position.

    Parameters (1)
    • thePos
      Mutated in place; read the updated value from this argument after the call.

RWMesh_EdgeIterator

Auxiliary class to iterate through edges. Provides functionality to iterate through the edges of a shape. It inherits from RWMesh_ShapeIterator and implements methods to access and manipulate edge data.

Constructors(2)

Instance methods(12)

  • More(): boolean

    Return true if iterator points to the valid triangulation.

  • Next(): void

    Find next value.

  • Return current edge.

  • Return current edge.

  • Return current edge data.

  • IsEmpty(): boolean

    Return true if geometry data is defined.

  • ElemLower(): number

    Lower element index in current triangulation.

  • ElemUpper(): number

    Upper element index in current triangulation.

  • NbNodes(): number

    Return number of nodes for the current edge.

  • NodeLower(): number

    Lower node index in current triangulation.

  • NodeUpper(): number

    Upper node index in current triangulation.

  • node(theNode: number): gp_Pnt

    Return the node with specified index with applied transformation.

    Parameters (1)
    • theNode

RWMesh_FaceIterator

Auxiliary class to iterate through triangulated faces. Class is designed to provide an interface for iterating over the faces of a shape, specifically focusing on triangulated faces. It inherits from the RWMesh_ShapeIterator base class and extends its functionality to handle faces with triangulation data.

Constructors(2)

Instance methods(24)

  • More(): boolean

    Return true if iterator points to the valid triangulation.

  • Next(): void

    Find next value.

  • Return current face.

  • Return current face.

  • Return current face triangulation.

  • IsEmptyMesh(): boolean

    Return true if mesh data is defined.

  • IsEmpty(): boolean

    Return true if mesh data is defined.

  • Return face material.

  • HasFaceColor(): boolean

    Return TRUE if face color is set.

  • Return face color.

  • NbTriangles(): number

    Return number of elements of specific type for the current face.

  • ElemLower(): number

    Lower element index in current triangulation.

  • ElemUpper(): number

    Upper element index in current triangulation.

  • TriangleOriented(theElemIndex: number): Poly_Triangle

    Return triangle with specified index with applied Face orientation.

    Parameters (1)
    • theElemIndex
  • HasNormals(): boolean

    Return true if triangulation has defined normals.

  • HasTexCoords(): boolean

    Return true if triangulation has defined normals.

  • NormalTransformed(theNode: number): gp_Dir

    Return normal at specified node index with face transformation applied and face orientation applied.

    Parameters (1)
    • theNode
  • NbNodes(): number

    Return number of nodes for the current face.

  • NodeLower(): number

    Lower node index in current triangulation.

  • NodeUpper(): number

    Upper node index in current triangulation.

  • NodeTexCoord(theNode: number): gp_Pnt2d

    Return texture coordinates for the node.

    Parameters (1)
    • theNode
  • node(theNode: number): gp_Pnt

    Return the node with specified index with applied transformation.

    Parameters (1)
    • theNode
  • normal(theNode: number): gp_Dir

    Return normal at specified node index without face transformation applied.

    Parameters (1)
    • theNode
  • triangle(theElemIndex: number): Poly_Triangle

    Return triangle with specified index.

    Parameters (1)
    • theElemIndex

RWMesh_MaterialMap

Material manager. Provides an interface for collecting all materials within the document before writing it into file, and for copying associated image files (textures) into sub-folder near by exported model.

Static methods(1)

Instance methods(8)

RWMesh_NameFormat

Properties(7)

RWMesh_ShapeIterator

This is a virtual base class for other shape iterators. Provides an abstract interface for iterating over the elements of a shape. It defines a set of pure virtual methods that must be implemented by derived classes to handle specific types of shapes and their elements.

Instance methods(14)

RWMesh_TriangulationReader

Interface for reading primitive array from the buffer.

Static methods(1)

Instance methods(14)

RWMesh_TriangulationSource

Mesh data wrapper for delayed triangulation loading. Class inherits Poly_Triangulation so that it can be put temporarily into TopoDS_Face within assembly structure.

Constructors(1)

Static methods(1)

Instance methods(15)

RWMesh_VertexIterator

Auxiliary class to iterate through vertices. Provides functionality to iterate through the vertices of a shape. It inherits from RWMesh_ShapeIterator and implements methods to access and manipulate vertex data.

Constructors(2)

Instance methods(12)

  • More(): boolean

    Return true if iterator points to the valid triangulation.

  • Next(): void

    Find next value.

  • Return current edge.

  • Return current vertex.

  • Return current vertex data.

  • IsEmpty(): boolean

    Return true if geometry data is defined.

  • ElemLower(): number

    Lower element index in current triangulation.

  • ElemUpper(): number

    Upper element index in current triangulation.

  • NbNodes(): number

    Return number of nodes for the current edge.

  • NodeLower(): number

    Lower node index in current triangulation.

  • NodeUpper(): number

    Upper node index in current triangulation.

  • node(argNo0: number): gp_Pnt

    Return the node with specified index with applied transformation.

    Parameters (1)
    • argNo0