Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CSG

Class for building Constructive Solid Geometry

Hierarchy

  • CSG

Index

Properties

matrixSearch playground for matrix

matrix: Matrix

The world matrix

positionSearch playground for position

position: Vector3

Stores the position

rotationSearch playground for rotation

rotation: Vector3

Stores the rotation

rotationQuaternionSearch playground for rotationQuaternion

rotationQuaternion: Nullable<Quaternion>

Stores the rotation quaternion

scalingSearch playground for scaling

scaling: Vector3

Stores the scaling vector

Methods

buildMeshGeometrySearch playground for buildMeshGeometry

  • buildMeshGeometry(name: string, scene?: Scene, keepSubMeshes?: boolean): Mesh
  • Build Raw mesh from CSG Coordinates here are in world space

    Parameters

    • name: string

      The name of the mesh geometry

    • Optional scene: Scene

      The Scene

    • Optional keepSubMeshes: boolean

      Specifies if the submeshes should be kept

    Returns Mesh

    A new Mesh

cloneSearch playground for clone

  • Clones, or makes a deep copy, of the CSG

    Returns CSG

    A new CSG

copyTransformAttributesSearch playground for copyTransformAttributes

  • copyTransformAttributes(csg: CSG): CSG
  • This is used to keep meshes transformations so they can be restored when we build back a Babylon Mesh NB : All CSG operations are performed in world coordinates

    Parameters

    • csg: CSG

      The CSG to copy the transform attributes from

    Returns CSG

    This CSG

intersectSearch playground for intersect

  • Intersect this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to intersect against this CSG

    Returns CSG

    A new CSG

intersectInPlaceSearch playground for intersectInPlace

  • intersectInPlace(csg: CSG): void
  • Intersects this CSG with another CSG in place

    Parameters

    • csg: CSG

      The CSG to intersect against this CSG

    Returns void

inverseSearch playground for inverse

  • inverse(): CSG
  • Return a new CSG solid with solid and empty space switched. This solid is not modified.

    Returns CSG

    A new CSG solid with solid and empty space switched

inverseInPlaceSearch playground for inverseInPlace

  • inverseInPlace(): void
  • Inverses the CSG in place

    Returns void

subtractSearch playground for subtract

  • Subtracts this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to subtract against this CSG

    Returns CSG

    A new CSG

subtractInPlaceSearch playground for subtractInPlace

  • subtractInPlace(csg: CSG): void
  • Subtracts this CSG with another CSG in place

    Parameters

    • csg: CSG

      The CSG to subtract against this CSG

    Returns void

toMeshSearch playground for toMesh

  • Build Mesh from CSG taking material and transforms into account

    Parameters

    • name: string

      The name of the Mesh

    • Optional material: Nullable<Material>

      The material of the Mesh

    • Optional scene: Scene

      The Scene

    • Optional keepSubMeshes: boolean

      Specifies if submeshes should be kept

    Returns Mesh

    The new Mesh

unionSearch playground for union

  • Unions this CSG with another CSG

    Parameters

    • csg: CSG

      The CSG to union against this CSG

    Returns CSG

    The unioned CSG

unionInPlaceSearch playground for unionInPlace

  • unionInPlace(csg: CSG): void
  • Unions this CSG with another CSG in place

    Parameters

    • csg: CSG

      The CSG to union against this CSG

    Returns void

Static FromMeshSearch playground for FromMesh

  • FromMesh(mesh: Mesh, absolute?: boolean): CSG
  • Convert the Mesh to CSG

    Parameters

    • mesh: Mesh

      The Mesh to convert to CSG

    • Optional absolute: boolean

      If true, the final (local) matrix transformation is set to the identity and not to that of mesh. It can help when dealing with right-handed meshes (default: false)

    Returns CSG

    A new CSG from the Mesh

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method