# Wooden Table

> A rustic low-poly plank table with breadboard ends, tapered square legs and an optional apron frame. Resize the top and switch between dining height (75 cm) and coffee-table height. Matches the Wooden Chair; perfect for taverns, cabins, kitchens and cozy interiors.

![Wooden Table preview](https://codels.download/m/wooden-table.png)

Multi-view sheet (3/4, front, side, top): https://codels.download/m/wooden-table.sheet.png

## Facts

- Category: Props › Furniture
- Size (W × H × D): 1.40 × 0.75 × 0.80 m — units are meters, +Y up, front faces +Z
- Origin: center of the base (y = 0)
- Triangles: 208 · Meshes: 16 · Materials: 5
- License: CC0-1.0 (Codels built-in)
- Tags: rustic, table, tavern, low-poly, stylized, kitchen, medieval, interior, village, city-builder, rpg, furniture, prop, wood, flat, game-ready, mobile-friendly, parametric, color-brown, size-medium, poly-ultra-low
- Page: https://codels.download/models/wooden-table

## Files

| Format | URL |
|---|---|
| three.js ES module (`createWoodenTable()`) | https://codels.download/m/wooden-table.js |
| React Three Fiber component (`<WoodenTable />`) | https://codels.download/m/wooden-table.jsx |
| Instancing module (`createWoodenTableInstances(count, place)`, one draw call per material) | https://codels.download/m/wooden-table.instanced.js |
| Standalone HTML demo | https://codels.download/m/wooden-table.html |
| glTF binary | https://codels.download/m/wooden-table.glb |
| glTF binary, Meshopt-compressed (2–3× smaller; GLTFLoader needs `setMeshoptDecoder(MeshoptDecoder)`) | https://codels.download/m/wooden-table.glb?compress=meshopt |
| glTF JSON | https://codels.download/m/wooden-table.gltf |
| OBJ (vertex colors) + MTL | https://codels.download/m/wooden-table.obj · https://codels.download/m/wooden-table.mtl |
| STL | https://codels.download/m/wooden-table.stl |
| CodelSpec JSON | https://codels.download/m/wooden-table.json |

## Parameters

Append them as query parameters to any URL above to get a customized variant (e.g. `?width=...`).

| Param | Type | Range / options | Default | Current |
|---|---|---|---|---|
| `width` | number | 0.8 – 2.4 | 1.4 | 1.4 |
| `depth` | number | 0.6 – 1.2 | 0.8 | 0.8 |
| `height` | select | dining \| coffee | dining | dining |
| `apron` | boolean | true \| false | true | true |
| `wood` | color | #rrggbb | #a5693a | #a5693a |

## Parts

- plank (box · plankAlt)
- plank (box · plankAlt)
- plank (box · plank)
- plank (box · plankDark)
- plank (box · plank)
- breadboard (box · frame)
- breadboard (box · frame)
- underboard (box · under)
- leg (cylinder · frame)
- leg (cylinder · frame)
- leg (cylinder · frame)
- leg (cylinder · frame)
- apronLong (box · plankDark)
- apronShort (box · plankDark)
- apronLong (box · plankDark)
- apronShort (box · plankDark)

## How to use

Save the code below as `wooden-table.js`, then:

```js
import { createWoodenTable } from './wooden-table.js';
const model = createWoodenTable();
scene.add(model);
```

## Code

```js
/**
 * Wooden Table — Codels 3D model library (https://codels.download/models/wooden-table)
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 208 · Size (W × H × D): 1.40 × 0.75 × 0.80 m
 *
 * Usage:
 *   import { createWoodenTable } from './wooden-table.js';
 *   
 *   const model = createWoodenTable();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

export function createWoodenTable() {
  const root = new THREE.Group();
  root.name = 'WoodenTable';

  // Materials
  const plankMat = new THREE.MeshStandardMaterial({ name: 'plank', color: 0xa5693a, roughness: 0.85, flatShading: true });
  const plankAltMat = new THREE.MeshStandardMaterial({ name: 'plankAlt', color: 0xb97641, roughness: 0.85, flatShading: true });
  const plankDarkMat = new THREE.MeshStandardMaterial({ name: 'plankDark', color: 0x915c33, roughness: 0.85, flatShading: true });
  const frameMat = new THREE.MeshStandardMaterial({ name: 'frame', color: 0x774c2a, roughness: 0.9, flatShading: true });
  const underMat = new THREE.MeshStandardMaterial({ name: 'under', color: 0x422a17, roughness: 1, flatShading: true });

  // Shared geometries
  const boxGeo = new THREE.BoxGeometry(1.24, 0.05, 0.153);
  const boxGeo2 = new THREE.BoxGeometry(0.08, 0.054, 0.8);
  const cylinderGeo = new THREE.CylinderGeometry(0.0566, 0.0389, 0.7, 4);
  const boxGeo3 = new THREE.BoxGeometry(1.18, 0.1, 0.025);
  const boxGeo4 = new THREE.BoxGeometry(0.025, 0.1, 0.58);

  // Parts
  const plank = new THREE.Mesh(boxGeo, plankAltMat);
  plank.name = 'plank';
  plank.position.set(0, 0.7276, -0.32);
  root.add(plank);
  const plank2 = new THREE.Mesh(boxGeo, plankAltMat);
  plank2.name = 'plank';
  plank2.position.set(0, 0.725, -0.16);
  root.add(plank2);
  const plank3 = new THREE.Mesh(boxGeo, plankMat);
  plank3.name = 'plank';
  plank3.position.set(0, 0.7265, 0);
  root.add(plank3);
  const plank4 = new THREE.Mesh(boxGeo, plankDarkMat);
  plank4.name = 'plank';
  plank4.position.set(0, 0.7266, 0.16);
  root.add(plank4);
  const plank5 = new THREE.Mesh(boxGeo, plankMat);
  plank5.name = 'plank';
  plank5.position.set(0, 0.7258, 0.32);
  root.add(plank5);
  const breadboard = new THREE.Mesh(boxGeo2, frameMat);
  breadboard.name = 'breadboard';
  breadboard.position.set(-0.66, 0.727, 0);
  root.add(breadboard);
  const breadboard2 = new THREE.Mesh(boxGeo2, frameMat);
  breadboard2.name = 'breadboard';
  breadboard2.position.set(0.66, 0.727, 0);
  root.add(breadboard2);
  const underboard = new THREE.Mesh(new THREE.BoxGeometry(1.24, 0.02, 0.76), underMat);
  underboard.name = 'underboard';
  underboard.position.set(0, 0.69, 0);
  root.add(underboard);
  const leg = new THREE.Mesh(cylinderGeo, frameMat);
  leg.name = 'leg';
  leg.position.set(-0.59, 0.35, -0.29);
  leg.rotation.set(0, deg(45), 0);
  root.add(leg);
  const leg2 = new THREE.Mesh(cylinderGeo, frameMat);
  leg2.name = 'leg';
  leg2.position.set(0.59, 0.35, -0.29);
  leg2.rotation.set(0, deg(45), 0);
  root.add(leg2);
  const leg3 = new THREE.Mesh(cylinderGeo, frameMat);
  leg3.name = 'leg';
  leg3.position.set(0.59, 0.35, 0.29);
  leg3.rotation.set(0, deg(45), 0);
  root.add(leg3);
  const leg4 = new THREE.Mesh(cylinderGeo, frameMat);
  leg4.name = 'leg';
  leg4.position.set(-0.59, 0.35, 0.29);
  leg4.rotation.set(0, deg(45), 0);
  root.add(leg4);
  const apronLong = new THREE.Mesh(boxGeo3, plankDarkMat);
  apronLong.name = 'apronLong';
  apronLong.position.set(0, 0.63, -0.3055);
  root.add(apronLong);
  const apronShort = new THREE.Mesh(boxGeo4, plankDarkMat);
  apronShort.name = 'apronShort';
  apronShort.position.set(-0.6055, 0.63, 0);
  root.add(apronShort);
  const apronLong2 = new THREE.Mesh(boxGeo3, plankDarkMat);
  apronLong2.name = 'apronLong';
  apronLong2.position.set(0, 0.63, 0.3055);
  root.add(apronLong2);
  const apronShort2 = new THREE.Mesh(boxGeo4, plankDarkMat);
  apronShort2.name = 'apronShort';
  apronShort2.position.set(0.6055, 0.63, 0);
  root.add(apronShort2);

  root.traverse((o) => {
    if (o.isMesh) {
      o.castShadow = true;
      o.receiveShadow = true;
    }
  });
  return root;
}

export default createWoodenTable;
```

---
Codels — 3D models as code for three.js. Search more: https://codels.download/api/v1/models?q=<query> · Guide: https://codels.download/llms.txt
