Class TorusMesh

A procedural torus.

Hierarchy

Constructors

  • Make a new torus at (0, 0, 0), which revolves around the Y axis.

    Parameters

    • engine: WonderlandEngine

      The Wonderland Engine instance to use this mesh for

    • innerRadius: number

      The inner radius of the torus.

    • outerRadius: number

      The outer radius of the torus. The thickness of the slice is the outer radius minus the inner radius, therefore, this must be bigger than the inner radius.

    • Optional options: TorusOptions

      Optional arguments for torus generation.

    Returns TorusMesh

Properties

autoDispose: boolean = false

If this flag is set, then dispose will be called after a CSG operation is done. It's recommended to call mark instead of setting this manually, since the method is chainable.

premadeMergeMap: null | MergeMap = null

A merge map that defines how to create a manifold from the submeshes.

submeshes: Submesh[] = []

The list of submeshes to assign to this group.

Accessors

  • get mergeMap(): MergeMap
  • Get the merge map of this MeshGroup. If the MeshGroup has no merge map yet, then a merge map will be automatically generated and cached. Note that this process can throw.

    Returns MergeMap

  • get submeshCount(): number
  • Get the number of submeshes inside this MeshGroup.

    Returns number

Methods

  • Encode into a format that is passable to the Manifold worker, along with a numeric mapping for materials.

    Parameters

    • materials: Material[]
    • transferables: Transferable[]

    Returns EncodedMeshGroup

  • Create a new MeshGroup from a WL.Mesh.

    WARNING: The submeshes array and the manifold mesh will have their ownership tranferred to this object. If you modify them later, they will be modified here as well, possibly corrupting the mesh. To avoid issues with this, do a deep clone of the inputs

    Parameters

    • mesh: Mesh

      A WL.Mesh instance.

    • material: null | Material = null

      A WL.Material instance. Null by default.

    Returns MeshGroup

Generated using TypeDoc