3d-assets

3D Assets

Mug

This generator creates a 3D mug with a handle. A set of parameters control the size and the shape of the mug and its handle. It is possible to generale low-poly mug by reducing the complexity, removing edges and using flat shading. Click on a snapshot to open it online.

Code example

import { Mug } from "3d-assets/mug.js";

var model = new Mug ({
	mugHeight: 19.8,
	mugSize: 8.64,
	mugShape: 3.2,
	mugWidth: 0.329,
	mugComplexity: 50,
	handlePosition: 95,
	handleHeight: 7.3,
	handleSize: 6.07,
	handleShape: -34.9,
	handleWidth: 1.42,
	handleThickness: 0.74,
	handleComplexity: 30,
	simple: false,
	flat: false
});

Parameters

Mug parameters

Handle parameters

Complexity parameters

Internal structure

An instance of Mug is a THREE.Group with two submeshes called body and handle.

Minimal example

demos/minimal-mug.html

Online generator

online/mug.html

Source

src/mug.js

Home