Codels
삼각형 630개2.63 × 0.95 × 0.24 m

코드에서 사용하기

에디터에서 리믹스
독립형 ES 모듈이에요 — three에만 의존해요. 팩토리 함수를 호출하고 그룹을 씬에 추가하세요.
/**
 * Bollard — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 630 · Size (W × H × D): 2.63 × 0.95 × 0.24 m
 *
 * Usage:
 *   import { createBollard } from './bollard.js';
 *   
 *   const model = createBollard();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

export function createBollard() {
  const root = new THREE.Group();
  root.name = 'Bollard';

  // Materials
  const steelMat = new THREE.MeshStandardMaterial({ name: 'steel', color: 0x3a4046, roughness: 0.45, metalness: 0.6, flatShading: true });
  const darkMat = new THREE.MeshStandardMaterial({ name: 'dark', color: 0x24272a, roughness: 0.6, metalness: 0.4, flatShading: true });
  const accentMat = new THREE.MeshStandardMaterial({ name: 'accent', color: 0xe3b12c, roughness: 0.4, flatShading: true });

  // Shared geometries
  const cylinderGeo = new THREE.CylinderGeometry(0.11, 0.12, 0.02, 10);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.07, 0.07, 0.86, 10);
  const sphereGeo = new THREE.SphereGeometry(0.07, 10, 3, 0, Math.PI * 2, 0, Math.PI / 2);
  const cylinderGeo3 = new THREE.CylinderGeometry(0.073, 0.073, 0.05, 10);

  // Parts
  const bollard1 = new THREE.Group();
  bollard1.name = 'bollard1';
  bollard1.position.set(-1.2, 0, 0);
  root.add(bollard1);
  const flange = new THREE.Mesh(cylinderGeo, darkMat);
  flange.name = 'flange';
  flange.position.set(0, 0.01, 0);
  bollard1.add(flange);
  const post = new THREE.Mesh(cylinderGeo2, steelMat);
  post.name = 'post';
  post.position.set(0, 0.45, 0);
  bollard1.add(post);
  const cap = new THREE.Mesh(sphereGeo, steelMat);
  cap.name = 'cap';
  cap.position.set(0, 0.88, 0);
  bollard1.add(cap);
  const reflectiveRing = new THREE.Mesh(cylinderGeo3, accentMat);
  reflectiveRing.name = 'reflectiveRing';
  reflectiveRing.position.set(0, 0.685, 0);
  bollard1.add(reflectiveRing);
  const reflectiveRing2 = new THREE.Mesh(cylinderGeo3, accentMat);
  reflectiveRing2.name = 'reflectiveRing';
  reflectiveRing2.position.set(0, 0.785, 0);
  bollard1.add(reflectiveRing2);
  const bollard2 = new THREE.Group();
  bollard2.name = 'bollard2';
  root.add(bollard2);
  const flange2 = new THREE.Mesh(cylinderGeo, darkMat);
  flange2.name = 'flange';
  flange2.position.set(0, 0.01, 0);
  bollard2.add(flange2);
  const post2 = new THREE.Mesh(cylinderGeo2, steelMat);
  post2.name = 'post';
  post2.position.set(0, 0.45, 0);
  bollard2.add(post2);
  const cap2 = new THREE.Mesh(sphereGeo, steelMat);
  cap2.name = 'cap';
  cap2.position.set(0, 0.88, 0);
  bollard2.add(cap2);
  const reflectiveRing3 = new THREE.Mesh(cylinderGeo3, accentMat);
  reflectiveRing3.name = 'reflectiveRing';
  reflectiveRing3.position.set(0, 0.685, 0);
  bollard2.add(reflectiveRing3);
  const reflectiveRing4 = new THREE.Mesh(cylinderGeo3, accentMat);
  reflectiveRing4.name = 'reflectiveRing';
  reflectiveRing4.position.set(0, 0.785, 0);
  bollard2.add(reflectiveRing4);
  const bollard3 = new THREE.Group();
  bollard3.name = 'bollard3';
  bollard3.position.set(1.2, 0, 0);
  root.add(bollard3);
  const flange3 = new THREE.Mesh(cylinderGeo, darkMat);
  flange3.name = 'flange';
  flange3.position.set(0, 0.01, 0);
  bollard3.add(flange3);
  const post3 = new THREE.Mesh(cylinderGeo2, steelMat);
  post3.name = 'post';
  post3.position.set(0, 0.45, 0);
  bollard3.add(post3);
  const cap3 = new THREE.Mesh(sphereGeo, steelMat);
  cap3.name = 'cap';
  cap3.position.set(0, 0.88, 0);
  bollard3.add(cap3);
  const reflectiveRing5 = new THREE.Mesh(cylinderGeo3, accentMat);
  reflectiveRing5.name = 'reflectiveRing';
  reflectiveRing5.position.set(0, 0.685, 0);
  bollard3.add(reflectiveRing5);
  const reflectiveRing6 = new THREE.Mesh(cylinderGeo3, accentMat);
  reflectiveRing6.name = 'reflectiveRing';
  reflectiveRing6.position.set(0, 0.785, 0);
  bollard3.add(reflectiveRing6);

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

export default createBollard;

평점 및 댓글

—
아직 평점이 없어요 — 첫 평점을 남겨 보세요.
5
0
4
0
3
0
2
0
1
0

평점과 댓글을 남기려면 로그인하세요.

댓글 0개

아직 댓글이 없어요. 이 모델을 어떻게 사용했는지, 어떤 점이 더 나아질 수 있을지 공유해 주세요.

관련 모델

같은 카테고리 또는 비슷한 태그