Codels
삼각형 696개2.10 × 0.88 × 0.77 m

코드에서 사용하기

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

const deg = THREE.MathUtils.degToRad;

export function createBikeRack() {
  const root = new THREE.Group();
  root.name = 'BikeRack';

  // Materials
  const tubeMat = new THREE.MeshStandardMaterial({ name: 'tube', color: 0x2f6fa8, roughness: 0.45, metalness: 0.35, flatShading: true });
  const steelMat = new THREE.MeshStandardMaterial({ name: 'steel', color: 0x5a6066, roughness: 0.5, metalness: 0.6, flatShading: true });
  const boltMat = new THREE.MeshStandardMaterial({ name: 'bolt', color: 0x2b2e31, roughness: 0.5, metalness: 0.5, flatShading: true });

  // Shared geometries
  const cylinderGeo = new THREE.CylinderGeometry(0.026, 0.026, 0.46, 8, 1, true);
  const torusGeo = new THREE.TorusGeometry(0.34, 0.026, 8, 10, Math.PI);
  const boxGeo = new THREE.BoxGeometry(2.1, 0.05, 0.09);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.014, 0.014, 0.012, 6);

  // Parts
  const hoop1 = new THREE.Group();
  hoop1.name = 'hoop1';
  hoop1.position.set(-0.8, 0, 0);
  root.add(hoop1);
  const leg = new THREE.Mesh(cylinderGeo, tubeMat);
  leg.name = 'leg';
  leg.position.set(0, 0.28, -0.34);
  hoop1.add(leg);
  const leg2 = new THREE.Mesh(cylinderGeo, tubeMat);
  leg2.name = 'leg';
  leg2.position.set(0, 0.28, 0.34);
  hoop1.add(leg2);
  const bend = new THREE.Mesh(torusGeo, tubeMat);
  bend.name = 'bend';
  bend.position.set(0, 0.51, 0);
  bend.rotation.set(0, deg(90), 0);
  hoop1.add(bend);
  const hoop2 = new THREE.Group();
  hoop2.name = 'hoop2';
  root.add(hoop2);
  const leg3 = new THREE.Mesh(cylinderGeo, tubeMat);
  leg3.name = 'leg';
  leg3.position.set(0, 0.28, -0.34);
  hoop2.add(leg3);
  const leg4 = new THREE.Mesh(cylinderGeo, tubeMat);
  leg4.name = 'leg';
  leg4.position.set(0, 0.28, 0.34);
  hoop2.add(leg4);
  const bend2 = new THREE.Mesh(torusGeo, tubeMat);
  bend2.name = 'bend';
  bend2.position.set(0, 0.51, 0);
  bend2.rotation.set(0, deg(90), 0);
  hoop2.add(bend2);
  const hoop3 = new THREE.Group();
  hoop3.name = 'hoop3';
  hoop3.position.set(0.8, 0, 0);
  root.add(hoop3);
  const leg5 = new THREE.Mesh(cylinderGeo, tubeMat);
  leg5.name = 'leg';
  leg5.position.set(0, 0.28, -0.34);
  hoop3.add(leg5);
  const leg6 = new THREE.Mesh(cylinderGeo, tubeMat);
  leg6.name = 'leg';
  leg6.position.set(0, 0.28, 0.34);
  hoop3.add(leg6);
  const bend3 = new THREE.Mesh(torusGeo, tubeMat);
  bend3.name = 'bend';
  bend3.position.set(0, 0.51, 0);
  bend3.rotation.set(0, deg(90), 0);
  hoop3.add(bend3);
  const rail = new THREE.Mesh(boxGeo, steelMat);
  rail.name = 'rail';
  rail.position.set(0, 0.025, -0.34);
  root.add(rail);
  const bolt = new THREE.Mesh(cylinderGeo2, boltMat);
  bolt.name = 'bolt';
  bolt.position.set(-0.98, 0.056, -0.34);
  root.add(bolt);
  const bolt2 = new THREE.Mesh(cylinderGeo2, boltMat);
  bolt2.name = 'bolt';
  bolt2.position.set(0.98, 0.056, -0.34);
  root.add(bolt2);
  const rail2 = new THREE.Mesh(boxGeo, steelMat);
  rail2.name = 'rail';
  rail2.position.set(0, 0.025, 0.34);
  root.add(rail2);
  const bolt3 = new THREE.Mesh(cylinderGeo2, boltMat);
  bolt3.name = 'bolt';
  bolt3.position.set(-0.98, 0.056, 0.34);
  root.add(bolt3);
  const bolt4 = new THREE.Mesh(cylinderGeo2, boltMat);
  bolt4.name = 'bolt';
  bolt4.position.set(0.98, 0.056, 0.34);
  root.add(bolt4);

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

export default createBikeRack;

평점 및 댓글

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

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

댓글 0개

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

관련 모델

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