# Street Lamp

> A street light in two styles: a classic cast-iron lamp post with a fluted base, collar rings, a curled shepherd-crook arm and a hanging glowing lantern, or a sleek modern pole with an angled arm and a flat LED head. Set the height, pole color and switch the emissive light on or off. Street furniture for city sidewalks, parks and plazas.

![Street Lamp preview](https://codels.download/m/street-lamp.png)

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

## Facts

- Category: Urban & Street › Street Furniture
- Size (W × H × D): 1.44 × 4.76 × 0.57 m — units are meters, +Y up, front faces +Z
- Origin: center of the base (y = 0)
- Triangles: 804 · Meshes: 21 · Materials: 3
- License: CC0-1.0 (Codels built-in)
- Tags: lamp, street-lamp, low-poly, stylized, modern, steampunk, city, garden, road, city-builder, decoration, light-source, prop, street-furniture, metal, tall, emissive, instancing-friendly, mobile-friendly, parametric, color-gray, size-large, poly-low
- Page: https://codels.download/models/street-lamp

## Files

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

## Parameters

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

| Param | Type | Range / options | Default | Current |
|---|---|---|---|---|
| `style` | select | classic \| modern | classic | classic |
| `height` | number | 3.5 – 6 | 4.5 | 4.5 |
| `color` | color | #rrggbb | #2f3c37 | #2f3c37 |
| `light` | boolean | true \| false | true | true |

## Parts

- lamp (group)
  - base (lathe · pole)
  - pole (cylinder · pole)
  - collar (cylinder · pole)
  - collar (cylinder · pole)
  - collar (cylinder · pole)
  - poleTop (sphere · pole)
  - finial (cone · accent)
  - arm (tube · pole)
  - scroll (torus · pole)
  - lantern (group)
    - lanternHook (cylinder · pole)
    - lanternRoof (cone · pole)
    - lanternBrim (cylinder · accent)
    - lanternGlass (cylinder · glass)
    - lanternFrame (tube · pole)
    - lanternFrame (tube · pole)
    - lanternFrame (tube · pole)
    - lanternFrame (tube · pole)
    - lanternFrame (tube · pole)
    - lanternFrame (tube · pole)
    - lanternBottom (cylinder · pole)
    - lanternDrop (cone · accent)

## How to use

Save the code below as `street-lamp.js`, then:

```js
import { createStreetLamp } from './street-lamp.js';
const model = createStreetLamp();
scene.add(model);
```

## Code

```js
/**
 * Street Lamp — Codels 3D model library (https://codels.download/models/street-lamp)
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 804 · Size (W × H × D): 1.44 × 4.76 × 0.57 m
 *
 * Usage:
 *   import { createStreetLamp } from './street-lamp.js';
 *   
 *   const model = createStreetLamp();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

// Revolve a 2D profile [[radius, y], ...] around the Y axis.
function lathe(points, segments, phiStart = 0, phiLength = Math.PI * 2) {
  return new THREE.LatheGeometry(points.map(([x, y]) => new THREE.Vector2(x, y)), segments, phiStart, phiLength);
}

// Tube along a smooth curve through the given points.
function tube(path, radius, tubularSegments, radialSegments, closed = false) {
  const curve = new THREE.CatmullRomCurve3(path.map(([x, y, z]) => new THREE.Vector3(x, y, z)), closed);
  return new THREE.TubeGeometry(curve, tubularSegments, radius, radialSegments, closed);
}

export function createStreetLamp() {
  const root = new THREE.Group();
  root.name = 'StreetLamp';

  // Materials
  const poleMat = new THREE.MeshStandardMaterial({ name: 'pole', color: 0x2f3c37, roughness: 0.5, metalness: 0.5, flatShading: true });
  const accentMat = new THREE.MeshStandardMaterial({ name: 'accent', color: 0xb08d4a, roughness: 0.4, metalness: 0.7, flatShading: true });
  const glassMat = new THREE.MeshStandardMaterial({ name: 'glass', color: 0xfff1c2, roughness: 0.2, emissive: 0xffd36b, emissiveIntensity: 1.2, flatShading: true });

  // Shared geometries
  const cylinderGeo = new THREE.CylinderGeometry(0.095, 0.095, 0.07, 8);

  // Parts
  const lamp = new THREE.Group();
  lamp.name = 'lamp';
  lamp.position.set(-0.47, 0, 0);
  root.add(lamp);
  const base = new THREE.Mesh(lathe([[0.24, 0], [0.24, 0.07], [0.18, 0.12], [0.17, 0.2], [0.14, 0.55], [0.11, 0.66], [0.075, 0.72]], 8), poleMat);
  base.name = 'base';
  lamp.add(base);
  const pole = new THREE.Mesh(new THREE.CylinderGeometry(0.055, 0.075, 3.8, 8), poleMat);
  pole.name = 'pole';
  pole.position.set(0, 2.6, 0);
  lamp.add(pole);
  const collar = new THREE.Mesh(cylinderGeo, poleMat);
  collar.name = 'collar';
  collar.position.set(0, 0.755, 0);
  lamp.add(collar);
  const collar2 = new THREE.Mesh(cylinderGeo, poleMat);
  collar2.name = 'collar';
  collar2.position.set(0, 1.635, 0);
  lamp.add(collar2);
  const collar3 = new THREE.Mesh(cylinderGeo, poleMat);
  collar3.name = 'collar';
  collar3.position.set(0, 3.985, 0);
  lamp.add(collar3);
  const poleTop = new THREE.Mesh(new THREE.SphereGeometry(0.09, 8, 5), poleMat);
  poleTop.name = 'poleTop';
  poleTop.position.set(0, 4.52, 0);
  lamp.add(poleTop);
  const finial = new THREE.Mesh(new THREE.ConeGeometry(0.05, 0.18, 6), accentMat);
  finial.name = 'finial';
  finial.position.set(0, 4.67, 0);
  lamp.add(finial);
  const arm = new THREE.Mesh(tube([[0, 4, 0], [0.04, 4.35, 0], [0.25, 4.56, 0], [0.6, 4.6, 0], [0.88, 4.48, 0], [0.95, 4.28, 0]], 0.035, 20, 6), poleMat);
  arm.name = 'arm';
  lamp.add(arm);
  const scroll = new THREE.Mesh(new THREE.TorusGeometry(0.12, 0.022, 4, 12, Math.PI * 1.5), poleMat);
  scroll.name = 'scroll';
  scroll.position.set(0.2, 4.3, 0);
  scroll.rotation.set(0, 0, deg(200));
  lamp.add(scroll);
  const lantern = new THREE.Group();
  lantern.name = 'lantern';
  lantern.position.set(0.95, 4.26, 0);
  lantern.scale.setScalar(1.25);
  lamp.add(lantern);
  const lanternHook = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.05, 0.08, 6), poleMat);
  lanternHook.name = 'lanternHook';
  lanternHook.position.set(0, -0.02, 0);
  lantern.add(lanternHook);
  const lanternRoof = new THREE.Mesh(new THREE.ConeGeometry(0.22, 0.2, 6), poleMat);
  lanternRoof.name = 'lanternRoof';
  lanternRoof.position.set(0, -0.16, 0);
  lantern.add(lanternRoof);
  const lanternBrim = new THREE.Mesh(new THREE.CylinderGeometry(0.23, 0.23, 0.04, 6), accentMat);
  lanternBrim.name = 'lanternBrim';
  lanternBrim.position.set(0, -0.28, 0);
  lantern.add(lanternBrim);
  const lanternGlass = new THREE.Mesh(new THREE.CylinderGeometry(0.19, 0.13, 0.42, 6), glassMat);
  lanternGlass.name = 'lanternGlass';
  lanternGlass.position.set(0, -0.51, 0);
  lantern.add(lanternGlass);
  const lanternFrame = new THREE.Mesh(tube([[0, -0.72, 0.135], [0, -0.3, 0.195]], 0.012, 1, 4), poleMat);
  lanternFrame.name = 'lanternFrame';
  lantern.add(lanternFrame);
  const lanternFrame2 = new THREE.Mesh(tube([[0.1169, -0.72, 0.0675], [0.1689, -0.3, 0.0975]], 0.012, 1, 4), poleMat);
  lanternFrame2.name = 'lanternFrame';
  lantern.add(lanternFrame2);
  const lanternFrame3 = new THREE.Mesh(tube([[0.1169, -0.72, -0.0675], [0.1689, -0.3, -0.0975]], 0.012, 1, 4), poleMat);
  lanternFrame3.name = 'lanternFrame';
  lantern.add(lanternFrame3);
  const lanternFrame4 = new THREE.Mesh(tube([[0, -0.72, -0.135], [0, -0.3, -0.195]], 0.012, 1, 4), poleMat);
  lanternFrame4.name = 'lanternFrame';
  lantern.add(lanternFrame4);
  const lanternFrame5 = new THREE.Mesh(tube([[-0.1169, -0.72, -0.0675], [-0.1689, -0.3, -0.0975]], 0.012, 1, 4), poleMat);
  lanternFrame5.name = 'lanternFrame';
  lantern.add(lanternFrame5);
  const lanternFrame6 = new THREE.Mesh(tube([[-0.1169, -0.72, 0.0675], [-0.1689, -0.3, 0.0975]], 0.012, 1, 4), poleMat);
  lanternFrame6.name = 'lanternFrame';
  lantern.add(lanternFrame6);
  const lanternBottom = new THREE.Mesh(new THREE.CylinderGeometry(0.14, 0.1, 0.06, 6), poleMat);
  lanternBottom.name = 'lanternBottom';
  lanternBottom.position.set(0, -0.75, 0);
  lantern.add(lanternBottom);
  const lanternDrop = new THREE.Mesh(new THREE.ConeGeometry(0.04, 0.1, 6), accentMat);
  lanternDrop.name = 'lanternDrop';
  lanternDrop.position.set(0, -0.81, 0);
  lanternDrop.rotation.set(deg(180), 0, 0);
  lantern.add(lanternDrop);

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

export default createStreetLamp;
```

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