simulator2D(id, params)

new simulator2D(id, params)

Create an instance of 2D simulator

.

Create an instance of 2D simulator

Parameters:
Name Type Description
id

name container simulator

params

a container with parameters.

Properties
Name Type Description
token string

Must be defined to download models from 3dmapp.

pointerMouse string

Set mouse's cursor when object is detected. Default pointer.

deltaMouseWheel float

Set speed mousewheel. Negative to invert movement

clearTextureOnUnJoin boolean

if true, reset texture after unjoin object from group

effectApplyTexture int

See setEffectApplyTexture documentation

backgroundColor object

See setBackgroundColor documentation

Properties
Name Type Description
r number

red component.From 0 to 255. default 255

g number

green component.From 0 to 255. default 255

b number

blue component.From 0 to 255. default 255

a number

alpha component.From 0 to 255. default 255

hex hex

define color from hex. Default #ffffff

selectedColorWhenMoveTexture object

See setSelectedColorWhenMoveTexture documentation

Properties
Name Type Description
r number

red component.From 0 to 255. default 255

g number

green component.From 0 to 255. default 255

b number

blue component.From 0 to 255. default 255

a number

alpha component.From 0 to 255. default 255

hex hex

define color from hex. Default #ffffff

selectColor object

See setSelectColor documentation

Properties
Name Type Description
r number

red component.Fromm 0 to 255. default 255

g number

green component.Fromm 0 to 255. default 255

b number

blue component.Fromm 0 to 255. default 255

a number

alpha component.Fromm 0 to 255. default 255

hex hex

define color from hex. Default #ffffff

Methods

inner entireZoom()

  • Set Full View of Model

inner getFunction() → {int}

  • Returns the function value activated
Returns:
int -
  • Function . 0: Apply Texture 1: Move Texture

inner getIDObjectMouseOver() → {string}

  • Get ID from object is below mouse pointer
Returns:
string -
  • return null if not object are below mouse

inner getLights() → {float}

  • Get Lights value from model
Returns:
float

inner getLightsObject(id) → {float}

  • Get Lights value from object.
Parameters:
Name Type Description
id string

unique id that represent Object

Returns:
float -
  • this value is independent from model's Lights.

inner getModel() → {string}

  • Get filename from actived model
Returns:
string -
  • filename of model

inner getModelInfo() → {json}

  • Get json model's data
Returns:
json -

represent an entire model with textures, displacement, sizes, groups, etc..

inner getShadows() → {float}

  • Get Shadows value from model
Returns:
float

inner getShadowsObject(id) → {float}

  • Get Shadows value from object.
Parameters:
Name Type Description
id string

unique id that represent Object

Returns:
float -
  • this value is independent from model's shadows.

inner getTexture() → {string}

  • Get filename from actived texture
Returns:
string -
  • filename of texture

inner loadScene(json)

  • Load an entire model from json data
Parameters:
Name Type Description
json

inner resetJoinedGroups()

  • Delete all join groups of objects made by user

inner resetTexturesModel()

  • Delete all textures mapped on model.

inner saveFullImage()

  • Take an screenShot of Full view Model. Open a new web window to show the result

inner saveImage()

  • Take an screenShot of simulator view and open a new web window to show the result. Open a new web window to show the result

inner setAbsoluteZoom(value)

  • Define zoom view of model
Parameters:
Name Type Description
value float

Numeric value of zoom

inner setBackGroundColor(params)

Define background color of simulator

.

Define background color of simulator

Parameters:
Name Type Description
params

a container with parameters.

Properties
Name Type Description
r int

define color from r value. From 0 to 255. Default value 255

g int

define color from g value. From 0 to 255. Default value 255

b int

define color from b value. From 0 to 255. Default value 255

a int

define alpha from a value. From 0 to 255. Default value 255

hex hex

define color from hex value. . Default value "#ffffff"

inner setEffectApplyTexture(value)

  • Define Screen effect that will show when simulator is calculating mapping process of a texture
Parameters:
Name Type Description
value int

0 not effect . 1 blur effect

inner setFunction(value)

  • Set function
Parameters:
Name Type Description
value int

define function to activate. 0: Apply Texture 1: Move Texture

inner setLights(light, relative)

  • Define Lights values of entire model
Parameters:
Name Type Description
light float

Algorithm value to work bright areas of model

relative boolean

. if true light will add to current values

inner setLightsObject(id, light, relative)

  • Define Lights values of object
Parameters:
Name Type Description
id string

unique id that represent Object

light float

Algorithm value to work bright areas of object

relative boolean

. if true light values will add to current values

inner setLightsShadows(light, shadow-, relative)

  • Define Lights and Shadows values of entire model
Parameters:
Name Type Description
light float

Algorithm value to work bright areas of model

shadow- float

Algorithm value to work shadow areas of model

relative boolean

. if true light and shadows values will add to current values

inner setModel(item)

  • Open a model
Parameters:
Name Type Description
item string

name of model

inner setRelativeZoom(value)

  • Increase or decrease zoom adding value to actual zoom
Parameters:
Name Type Description
value float

positive to increase zoom, negative to decrease zoom

inner setSelectedColor(params)

When mouse will be over object, this color will show for a while to indicate

.

When mouse will be over object, this color will show for a while to indicate

Parameters:
Name Type Description
params

a container with parameters.

Properties
Name Type Description
r int

define color from r value. From 0 to 255. Default value 255

g int

define color from g value. From 0 to 255. Default value 255

b int

define color from b value. From 0 to 255. Default value 255

a int

define alpha from a value. From 0 to 255. Default value 255

hex hex

define color from hex value. . Default value "#ffffff"

inner setSelectedColorWhenMoveTexture(params)

Color will be showed when user do displacement of texture

.

Color will be showed when user do displacement of texture

Parameters:
Name Type Description
params

a container with parameters.

Properties
Name Type Description
r int

define color from r value. From 0 to 255. Default value 255

g int

define color from g value. From 0 to 255. Default value 255

b int

define color from b value. From 0 to 255. Default value 255

a int

define alpha from a value. From 0 to 255. Default value 255

hex hex

define color from hex value. . Default value "#ffffff"

inner setShadows(shadow-, relative)

  • Define Shadows values of entire model
Parameters:
Name Type Description
shadow- float

Algorithm value to work shadow areas of model

relative boolean

. if true shadows values will add to current values

inner setShadowsObject(id, shadow-, relative)

  • Define Shadows values of object
Parameters:
Name Type Description
id string

unique id that represent Object

shadow- float

Algorithm value to work shadow areas of object

relative boolean

. if true shadows values will add to current values

inner setTexture(path, width, height-)

  • Define actived texture to map when user use mapping function
Parameters:
Name Type Description
path string

the path or URL to the file

width float

the width in mm of texture rapport

height- float

the height in mm of texture rapport