Bodygram
DrawUtils

DrawUtils

Drop-in helpers for visualizing Bodygram avatars in your web app.

What is DrawUtils?

BodygramSDKDrawUtils is a small companion package to the Headless SDK. It renders Bodygram avatars — and the overlays that come with them — directly into your DOM, so you don't have to write any three.js boilerplate, manage a render loop, or wire up custom shaders.

Pass a Bodygram response, point at a container, and a fully interactive avatar shows up.

const utils = new BodygramSDKDrawUtils({ locale: 'en' });

utils.drawAvatar(response, { container: 'avatar' });

Why use it?

  • Zero setup. No three.js scene, no camera, no lighting, no controls — just call a method.
  • One line per avatar. Renders with sensible defaults out of the box and returns the DOM node so you can keep manipulating it.
  • Self-contained. Ships as its own UMD and ES build, separate from the main SDK, so you only pay for it when you use it.

What can I draw?

DrawUtils exposes four draw methods. Each one accepts a full estimation response (not just the avatar field) and a container, and returns the rendered DOM node.

MethodRendersCompatible responses
drawAvatarThe 3D avatar mesh, on its own.Bodygram Scanner Platform · Body2Fit
drawAvatarWithRingsAndIndicatorsThe avatar with measurement rings and labeled value indicators.Bodygram Scanner Platform · Body2Fit
drawFrontPostureThe avatar with front posture lines (shoulder, hip, ear-tilt).Bodygram Scanner Platform photo only
drawSidePostureThe avatar with side posture body line.Bodygram Scanner Platform photo only

Posture overlays are limited to getBodygramScannerPlatformPhotoEstimation responses — Body2Fit responses do not carry posture data, and stats-based platform responses have entry.posture === null.


What's next

On this page