Vectary Documentation
ChangelogFeedbackHelpOpen Studio
  • Welcome to Vectary Docs
  • Documentation
    • Getting started
      • System requirements
      • User interface
      • Rendering
      • Dashboard
      • Account settings
      • Roles
      • Scene orientation
      • Units
    • Importing
      • Import formats
      • Figma frames import
      • CAD files
      • Vectary Processor
    • Design process
      • Design mode
        • Selections tools
        • Primitives
        • 3D Text
        • Light sources
        • Modifiers
          • Array Linear
          • Array Radial
          • Array Grid
          • Array Object
          • Subdivide
          • Bevel
          • Randomize
          • Symmetry
          • Boolean
        • Deformers
          • Bend
          • Twist
          • Taper
          • Skew
          • Stretch
          • Spherify
          • Noise
          • Simplify
        • Setup
          • Group
          • Empty
          • Camera
          • Backdrop
          • Smooth normals
          • Clipping plane
        • Interactive elements
      • Materials and Textures
        • Basic materials
          • Color
          • Roughness
          • Metalness
          • Opacity
          • Emission
          • Normal map
        • Advanced materials
          • Subsurface
          • Refraction
          • Clearcoat
          • Thinfilm
          • Reflectivity
          • Double sided material
        • Baked textures
          • Ambient occlusion (texture)
          • Lightmap
          • Texture remapping
        • Importing own textures
      • Animated materials
      • Decals
      • Camera
      • Environment
      • Background
      • Ground plane
      • Effects
        • Reflections
        • Ambient Occlusion
        • Soft Shadows
        • Fading
        • Smooth edges
        • Adjustments
        • Color Balance
        • Vignette
        • Grain
        • Bloom
      • Control bar
        • Fit View
        • Viewport display modes
        • Gizmo & Origin
        • Snapping
        • Download image
      • Libraries
        • Asset library
        • Materials library
        • Environments library
      • Edit mode
        • Selection tools
        • New object
        • Draw
        • Primitives
        • Extrude
        • Bevel
        • Make circle
        • Bridge
        • Slide
        • Cut
        • Collapse
        • Cap open boundaries
        • Merge faces
        • Mesh Tools
        • Normals
    • 3D configurator
      • Variants
      • Interactions
        • Triggers
        • Conditions
        • Actions
          • Animated texture
          • Animation
          • Cameras
          • Download image
          • Highlight
          • Interactions
          • Materials
          • Link
          • Sounds
          • Transformation
          • Upload image
          • Variants
          • Visibility
          • Send event
          • Set variable
        • Events (for API)
      • Animations
      • Floating UI
        • Floating UI settings
        • Container
        • Materials (UI)
        • Variants (UI)
        • Text
        • Image
        • Button
        • Slider
        • Input
        • Tips
      • Hotspots
      • Variables & Expressions
        • Syntax
        • Functions
        • List of inputs
        • Data import (.csv)
    • Project settings
      • Version history
      • Augmented Reality (WebAR)
      • WebXR (beta)
      • Loading screen
      • Mouse controls
      • Interaction prompt
      • Menu - Settings
    • Sharing, exporting, embedding
      • Sharing
      • Performance analyzer
      • Optimizing a shared project
        • Geometry
        • Textures
        • Materials
        • Effects
        • Light and shadows
        • HDRI
        • Ground plane
        • Tips
      • Project cloning
      • Embedding to other software
      • Export options
    • Other
      • Vectary Plugin for Figma
      • 2D to 3D
      • Selections
      • Comments
      • Shortcuts
  • API
    • Model API
      • Quick Start
      • API Reference
      • Type Definitions
      • Events & Listeners
      • Floating UI
      • Ecommerce
        • Webflow
        • Shopify
        • Custom code
Powered by GitBook
LogoLogo

Website

  • Pricing
  • Blog
  • Security
  • Website

Social

  • YouTube
  • LinkedIn
  • Discord

Copyright © 2025 Vectary Inc. All rights reserved

On this page
  • Init
  • EventListeners
  • Configurators
  • Math
  • Objects
  • Primitives
  • Text3D
  • Materials
  • Material
  • Textures
  • TextureConfig
  • TextureData
  • Cameras
  • CameraSettings
  • CameraType
  • CameraViewState
  • Exports
  • Export3dFormats
  • ExportOptions
Export as PDF
  1. API
  2. Model API

Type Definitions

This section contains all type definitions used within the API, offering clarity for developers implementing custom logic and integrations.

Init

ProjectInfo

type ProjectInfo {
	projectName: string;
	modelId: string;
	modelIdBase62: string;
	publishedId: string;
	workspaceId: string;
};

EventListeners

Api Events

enum ApiEvents 
	INTERACTION_CUSTOM_EVENT = "{custom_event_name}",
	MOUSE_MOVE = "mouse_move",
	MOUSE_DRAG = 'mouse_drag',
	MOUSE_DOWN = "mouse_down",
	MOUSE_UP = 'mouse_up',
	MOUSE_CLICK = "mouse_click",
	MOUSE_WHEEL = 'mouse_wheel',
	KEY_DOWN = 'key_down',
	HOVERED_OBJECT = 'hovered_object',
	CONFIGURATOR_STATE_CHANGE = "configurator_state_change",
	SELECTION_STATE_CHANGE = "configurator_state_change",
}

Event Responses

{custom_event_name}

Custom events need to be setup directly in studio Events (for API)

configurator_state_change

return ConfigurationState[]

Configurators

ConfigurationState

type ConfigurationState = VariantSwitcherData | MaterialSwitcherData;

VariantSwitcherData

type VariantSwitcherData {
	variant: string;
	active_object: string;
};

MaterialSwitcherData

type MaterialSwitcherData {
	object: string;
	active_material: string;
};

Math

Vector3

type Vector3 = {
	x: number;
	y: number;
	z: number;
};

Euler

type Euler = Vector3 & {
	order?: string // default: 'XYZ'
};

Ray

type Ray = {
	start: Vector3;
	direction: Vector3;
};

RayObjectHit

type RayObjectHit = {
	id: string;
	name: string;
	position: Vector3;
	normal: Vector3;
	uv: Vector3;
};

Objects

Object

type Object = {
		id: string;
		name: string;
		type: sceneObjects;
		position: Vector3;
		rotation: Euler;
		scale: Vector3;
		materials?: Material[];
		primitive?: PrimitiveNodeSettings;
		text3d?: Text3DNodeSettings;
};

SceneObjects

enum sceneObjects {
    BUFFER_OBJECT = "BUFFER_OBJECT",

    EMPTY_OBJECT = "EMPTY_OBJECT",
    TEXT3D = "TEXT3D",
    IMAGE_PLANE = "IMAGE_PLANE",
    SVG_OBJECT = "SVG_OBJECT",

    SPOT_LIGHT = "SPOT_LIGHT",
    POINT_LIGHT = "POINT_LIGHT",
    DIRECTIONAL_LIGHT = "DIRECTIONAL_LIGHT",
    RECTANGLE_LIGHT = "RECTANGLE_LIGHT",

    CAMERA = "CAMERA",

    BEND = "BEND",
    NOISE = "NOISE",
    TAPER = "TAPER",
    TWIST = "TWIST",
    SIMPLIFY = "SIMPLIFY",
    SPHERIFY = "SPHERIFY",
    STRETCH = "STRETCH",
    SKEW = "SKEW",
    SMOOTH_NORMALS = "SMOOTH_NORMALS",

    LINEAR_CLONER = "LINEAR_ARRAY",
    RADIAL_CLONER = "RADIAL_ARRAY",
    GRID_CLONER = "GRID_ARRAY",
    OBJECT_CLONER = "OBJECT_ARRAY",
    SYMMETRY = "SYMMETRY",
    RANDOMIZE = "RANDOMIZE",

    SUBDIVISION_SURFACE = "SUBDIVISION_SURFACE",
    BEVEL = "BEVEL",

    BOOLEAN_OPERATOR = "BOOLEAN_OPERATOR",

    PRIMITIVE_BOX = "PRIMITIVE_BOX",
    PRIMITIVE_SPHERE = "PRIMITIVE_SPHERE",
    PRIMITIVE_CYLINDER = "PRIMITIVE_CYLINDER",
    PRIMITIVE_TUBE = "PRIMITIVE_TUBE",
    PRIMITIVE_CONE = "PRIMITIVE_CONE",
    PRIMITIVE_POLYHEDRON = "PRIMITIVE_POLYHEDRON",
    PRIMITIVE_TORUS = "PRIMITIVE_TORUS",
    SQUARE_PLANE = "SQUARE_PLANE",
    SHADOW_PLANE = "SHADOW_PLANE",
    INFINITE_PLANE = "INFINITE_PLANE",

    TEXTURE_BAKER = "TEXTURE_BAKER",

    OBJECT_SWITCHER = "OBJECT_SWITCHER",

    HOTSPOT = "HOTSPOT",

    NURBS_OBJECT = "NURBS_OBJECT",
}

Primitives

PrimitiveNodeSettings

type PrimitiveNodeSettings =
	| PrimitiveBoxSettings
	| PrimitiveConeSettings
	| PrimitiveCylinderSettings
	| PrimitivePolyhedronSettings
	| PrimitiveSphereSettings
	| PrimitiveTorusSettings
	| PrimitiveTubeSettings
	| PrimitiveCapsuleSettings
	| PrimitiveSquarePlaneSettings
	| PrimitiveCirclePlaneSettings
	| PrimitiveInfinitePlaneSettings;

PrimitiveBoxSettings

type PrimitiveBoxSettings = {
	boxDimensions: {
		x: number;
		y: number;
		z: number;
	};
	boxSegments: {
		x: number;
		y: number;
		z: number;
	};
	roundnessEnabled: boolean;
	roundnessRadius: number;
	roundnessRadiusSegments: number;
	computeNormals: boolean;
}

PrimitiveConeSettings

type PrimitiveConeSettings = {
	coneRadiusBottom: number;
	coneHeight: number;
	coneRadiusSegments: number;
	coneHeightSegments: number;
	coneCloseEnds: boolean;
	roundnessEnabled: boolean;
	roundnessRadius: number;
	roundnessRadiusSegments: number;
	computeNormals: boolean;
}

PrimitiveCylinderSettings

type PrimitiveCylinderSettings = {
	cylinderRadiusTop: number;
	cylinderRadiusBottom: number;
	cylinderHeight: number;
	cylinderRadiusSegments: number;
	cylinderHeightSegments: number;
	cylinderCapSegments: number;
	cylinderCloseEnds: boolean;
	roundnessEnabled: boolean;
	roundnessRadius: number;
	roundnessRadiusSegments: number;
	computeNormals: boolean;
}

PrimitivePolyhedronSettings

type PrimitivePolyhedronSettings = {
	polyhedronRadius: number;
	polyhedronDetail: number;
	computeNormals: boolean;
}

PrimitiveSphereSettings

type PrimitiveSphereSettings = {
	sphereRadius: number;
	sphereWidthSegments: number;
	sphereHeightSegments: number;
	computeNormals: boolean;
}

PrimitiveTorusSettings

type PrimitiveTorusSettings = {
	torusRingRadius: number;
	torusTubeRadius: number;
	torusTubeSegments: number;
	torusRingSegments: number;
	computeNormals: boolean;
}

PrimitiveTubeSettings

type PrimitiveTubeSettings = {
	tubeRadiusIn: number;
	tubeRadiusOut: number;
	tubeHeight: number;
	tubeRadiusSegments: number;
	tubeHeightSegments: number;
	tubeSideSegments: number;
	roundnessEnabled: boolean;
	roundnessRadius: number;
	roundnessRadiusSegments: number;
	computeNormals: boolean;
}

PrimitiveSquarePlaneSettings

type PrimitiveSquarePlaneSettings = {
	width: number;
	depth: number;
	widthSegments: number;
	depthSegments: number;
	cropSettings: {
		x: number;
		y: number;
		width: number;
		height: number;
	};
	roundnessEnabled: boolean;
	roundnessRadius: number;
	roundnessRadiusSegments: number;
	computeNormals: boolean;
}

PrimitiveInfinitePlaneSettings

type PrimitiveInfinitePlaneSettings = {
	dimensions: { x: number; y: number; z: number };
	offset: number;
	angle: number;
	segments: number;
	computeNormals: boolean;
}

Text3D

export type Text3DNodeSettings = {
	text?: string;
	fontFamily?: string;
	fontSize?: number;
	weight?: string;
	distanceX?: number;
	distanceY?: number;
	textAlign?: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFY';
	textHeight?: 'DEFAULT' | 'CAMELCASE' | 'UPPERCASE' | 'LOWERCASE';
	curveSegments?: number;
	contourOffset?: number;
	amount?: number;
};

Materials

Material

type Material = {
	id?: string;
	name: string;

	baseColor?: {
		textureConfig?: TextureConfig;
		color?: Vector3;
	};
	roughness?: {
		textureConfig?: TextureConfig;
		value?: number;
	};
	metalness?: {
		textureConfig?: TextureConfig;
		value?: number;
	};
	emission?: {
		textureConfig?: TextureConfig;
		color?: Vector3;
		value?: number;
	};
	normal?: {
		textureConfig?: TextureConfig;
		value?: number;
	};
	opacity?: {
		textureConfig?: TextureConfig;
		value?: number;
		alphaMode?: AlphaMode;
		alphaCutoff?: number;
	};
	doubleSided?: boolean;
	clearcoat?: {
		amount?: number;
		reflectivity?: number;
		roughness?: number;
	};
	refraction: {
		amount?: number;
		IOR?: number;
		absorptionDepth?: number;
		absorptionColor?: Vector3;
		thicknessTextureConfig?: TextureConfig;
		thicknessValue?: number;
	};
	subsurface?: {
		amount?: number;
		color?: Vector3;
		radius?: number;
	};
	iridescence?: {
		textureConfig?: TextureConfig;
		value?: number;
	};
	reflectivity?: {
		textureConfig?: TextureConfig;
		value?: number;
	};
	baked?: {
		ambientOcclusion?: {
			textureConfig?: TextureConfig;
			value?: number;
		};
		lightmap: {
			textureConfig?: TextureConfig;
			value?: number;
		};
	};
	globalMapping?: TextureMapSettings;
};

AlphaMode
enum AlphaMode {
	BLEND = 0,
	MASK = 1,
	ADDITIVE = 2,
}

Textures

TextureConfig

type TextureConfig<T> = {
	id?: string;
	name?: string;
	filters?: TextureFilterSettings;
	mapping?: TextureMapSettings;
	wrapping?: WrapMode;
};

TextureFilterSettings
type TextureFilterSettings = {
	brightness: number;
	contrast: number;
	hue: number;
	saturation: number;
	invert: boolean;
};
TextureMapSettings
type TextureMapSettings = {
	offsetY: number;
	offsetX: number;
	repeatX: number;
	repeatY: number;
	rotation: number;
};
WrapMode
enum WrapMode {
    REPEAT = 0,
    MIRRORED_REPEAT = 1,
    CLAMP = 2
}

TextureData

type TextureData = {
	image: ArrayBuffer;
	width: number;
	height: number;
};

Cameras

CameraSettings

type CameraSettings = {
	cameraType?: CameraType;
	previewControls?: {
		orbitLimits?: {
			upLimit?: number;
			downLimit?: number;
			leftLimit?: number;
			rightLimit?: number;
		};
		dollyLimits?: {
			inLimit?: number;
			outLimit?: number;
		};
		panLimits?: {
			enabled?: boolean;
		};
	};
	previewTurntable?: {
		delay?: number;
		duration?: number;
		resume?: boolean;
		easing?: number;
	};
	perspective?: {
		fov?: number;
	};
	depthOfField?: {
		intensity?: number;
		depthOffset?: number;
	};
	aspectRatio?: {
		customWidth?: number;
		customHeight?: number;
	};
};

CameraType

enum CameraType {
    UNKNOWN = 0,
    PERSPECTIVE = 1,
    ORTHOGRAPHIC = 2,
}

CameraViewState

type CameraViewState = {
	target: Vector3;
	position: Vector3;
	upVector: Vector3;
};

Exports

Export3dFormats

enum Export3DFormats {
	OBJ = 'OBJ',
	GLTF = 'GLTF',
	GLB = 'GLB',
	DAE = 'DAE',
	USDZ = 'USDZ',
	FBX = 'FBX',
	STL = 'STL',
}

ExportOptions

type ExportOptions = {
	fbx?: 'ASCII' | 'Binary';
	applyParentMatrix?: boolean;
	exportOnlyUsedUVs?: boolean;
};

PreviousAPI ReferenceNextEvents & Listeners

Last updated 1 month ago