Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ComputeServer

A compute server instance holds all nessecary information to communicate with a WebSDK Compute Server and make requests to its endpoints. The endpoint version is hardcoded to be in sync with the sdk version.

Hierarchy

  • ComputeServer

Index

Constructors

constructor

  • new ComputeServer(baseUrl: string, token: string): ComputeServer
  • Create a new compute server instance.

    Parameters

    • baseUrl: string

      The base url of the compute server. e.g. "http://0.0.0.0:8000"

    • token: string

      The authentication token. Must not include the authentication scheme "Bearer".

    Returns ComputeServer

Properties

baseUrl

baseUrl: string

The base url of the compute server. Example: 'http://0.0.0.0:8000'

token

token: string

The auth token if one is set. Must not include the authentication scheme "Bearer".

Methods

requestBodyModelIds

  • requestBodyModelIds(): Promise<string>
  • Request all currently available bodymodel ids on the server.

    Returns Promise<string>

requestFittedGarments

  • Request a set of fitted garment models. Their meshes will be deformed to fit the provided bodymodel state. MixMatch3D.compute calls this internally and is best to be used this way.

    Parameters

    Returns Promise<Array<Blob>>

    All fitted garments as blobs.

    const fittedGarmentBlobs = await requestFittedGarments(info);

requestMannequin

  • Request a custom mannequin. The endpoint can return a bodymodelstate which can be used for 3D Mix and Match and / or a model file to render in a babylon scene.

    Parameters

    Returns Promise<__type>

    An object that holds key value pairs for every requested file. Example for the bodyModelState:

    info.returnFiles.push(MannequinRequestReturnFile.BODY_MODEL_STATE);
    const returnedFiles = await requestMannequin(info);
    const bodyModelStateBlob = returnedFiles[MannequinRequestReturnFile.BODY_MODEL_STATE]

requestMeasurements

  • requestMeasurements(bodymodelId: string, configUrl?: string): Promise<Array<Measurement>>
  • Request all valid measurements for a specific bodymodel id. The value defines the default value for each measurement id in this case.

    Parameters

    • bodymodelId: string

      The bodymodel id of the desired bodymodel.

    • Default value configUrl: string = undefined

      A link to a custom config. If none was set the default config on the server will be used.

    Returns Promise<Array<Measurement>>

requestShapeTypes

  • requestShapeTypes(): Promise<string>
  • Request all available shape types. These can be used to specify the {@link CustomMannequin.shapeType}.

    Returns Promise<string>

requestSizeRecommendation

  • Perform a request to the size recommendation endpoint, given a set pf parameters. SizeVisualisation.compute calls this internally and is best to be used this way.

    Parameters

    Returns Promise<object>

    A Promise that can be deconstructed into { blob: Blob, fitInformation: object, recommendedSize: string }. Notice that the blob might be undefined depending on your request configuration.

requestSlotLayoutRendering

  • requestSlotLayoutRendering(dto: SlotLayout): Promise<string>
  • Request a slot layout rendering.

    Parameters

    Returns Promise<string>

    A Promise which returns the rendered image a base64 string.

Generated using TypeDoc