808 tris0.82 × 0.52 × 0.74 m
Use it in code
Remix in the editorhand-saw.js · 174 lines
Self-contained ES module — only depends on three. Call the factory and add the group to your scene.
/**
* Hand Saw — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 808 · Size (W × H × D): 0.82 × 0.52 × 0.74 m
*
* Usage:
* import { createHandSaw } from './hand-saw.js';
*
* const model = createHandSaw();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
const deg = THREE.MathUtils.degToRad;
// Deterministic vertex displacement (organic low-poly look).
function jitter(geometry, amount, seed) {
const pos = geometry.attributes.position;
const h = (a, b, c, s) => {
let x = Math.imul(a, 73856093) ^ Math.imul(b, 19349663) ^ Math.imul(c, 83492791) ^ Math.imul(s, 2654435761);
x = Math.imul(x ^ (x >>> 16), 2246822507);
x = Math.imul(x ^ (x >>> 13), 3266489909);
return ((x ^ (x >>> 16)) >>> 0) / 4294967295 - 0.5;
};
for (let i = 0; i < pos.count; i++) {
const x = pos.getX(i), y = pos.getY(i), z = pos.getZ(i);
const qx = Math.round(x * 1000), qy = Math.round(y * 1000), qz = Math.round(z * 1000);
pos.setXYZ(i, x + h(qx, qy, qz, seed) * 2 * amount, y + h(qx, qy, qz, seed + 1) * 2 * amount, z + h(qx, qy, qz, seed + 2) * 2 * amount);
}
pos.needsUpdate = true;
geometry.computeVertexNormals();
return geometry;
}
// Extrude a 2D outline along Z (centered). bevel = [thickness, size, segments].
function extrude(outline, depth, holes = [], bevel = null) {
const shape = new THREE.Shape(outline.map(([x, y]) => new THREE.Vector2(x, y)));
for (const hole of holes) shape.holes.push(new THREE.Path(hole.map(([x, y]) => new THREE.Vector2(x, y))));
const options = bevel
? { depth, bevelEnabled: true, bevelThickness: bevel[0], bevelSize: bevel[1], bevelSegments: bevel[2] }
: { depth, bevelEnabled: false };
return new THREE.ExtrudeGeometry(shape, options).translate(0, 0, -depth / 2);
}
export function createHandSaw() {
const root = new THREE.Group();
root.name = 'HandSaw';
// Materials
const bladeMat = new THREE.MeshStandardMaterial({ name: 'blade', color: 0xb8bec6, roughness: 0.3, metalness: 0.55, flatShading: true });
const handleMat = new THREE.MeshStandardMaterial({ name: 'handle', color: 0x9c5b2f, roughness: 0.7, flatShading: true });
const brassMat = new THREE.MeshStandardMaterial({ name: 'brass', color: 0xd8ae52, roughness: 0.35, metalness: 0.5, flatShading: true });
const barkMat = new THREE.MeshStandardMaterial({ name: 'bark', color: 0x5d4029, roughness: 1, flatShading: true });
const endGrainMat = new THREE.MeshStandardMaterial({ name: 'endGrain', color: 0xd9b27c, roughness: 0.9, flatShading: true });
const ringMat = new THREE.MeshStandardMaterial({ name: 'ring', color: 0xb88b55, roughness: 0.9, flatShading: true });
const kerfMat = new THREE.MeshStandardMaterial({ name: 'kerf', color: 0x2b1d12, roughness: 1, flatShading: true });
const sawdustMat = new THREE.MeshStandardMaterial({ name: 'sawdust', color: 0xdcb676, roughness: 1, flatShading: true });
// Shared geometries
const cylinderGeo = new THREE.CylinderGeometry(0.118, 0.118, 0.012, 9);
const cylinderGeo2 = new THREE.CylinderGeometry(0.065, 0.065, 0.004, 9);
const boxGeo = new THREE.BoxGeometry(0.012, 0.004, 0.012);
const cylinderGeo3 = new THREE.CylinderGeometry(0.0075, 0.0075, 0.03, 6);
// Parts
const log = new THREE.Mesh(new THREE.CylinderGeometry(0.13, 0.13, 0.8, 9), barkMat);
log.name = 'log';
log.position.set(0, 0.13, -0.08);
log.rotation.set(0, 0, deg(90));
root.add(log);
const endGrain = new THREE.Mesh(cylinderGeo, endGrainMat);
endGrain.name = 'endGrain';
endGrain.position.set(-0.401, 0.13, -0.08);
endGrain.rotation.set(0, 0, deg(90));
root.add(endGrain);
const treeRing = new THREE.Mesh(cylinderGeo2, ringMat);
treeRing.name = 'treeRing';
treeRing.position.set(-0.408, 0.13, -0.08);
treeRing.rotation.set(0, 0, deg(90));
root.add(treeRing);
const endGrain2 = new THREE.Mesh(cylinderGeo, endGrainMat);
endGrain2.name = 'endGrain';
endGrain2.position.set(0.401, 0.13, -0.08);
endGrain2.rotation.set(0, 0, deg(90));
root.add(endGrain2);
const treeRing2 = new THREE.Mesh(cylinderGeo2, ringMat);
treeRing2.name = 'treeRing';
treeRing2.position.set(0.408, 0.13, -0.08);
treeRing2.rotation.set(0, 0, deg(90));
root.add(treeRing2);
const kerf = new THREE.Mesh(new THREE.CylinderGeometry(0.133, 0.133, 0.007, 3, 1, false, 0.6981, Math.PI * 0.6667), kerfMat);
kerf.name = 'kerf';
kerf.position.set(0.14, 0.13, -0.08);
kerf.rotation.set(0, 0, deg(90));
root.add(kerf);
const sawdust = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.07, 0), 0.008, 2), sawdustMat);
sawdust.name = 'sawdust';
sawdust.position.set(0.13, 0.008, -0.25);
sawdust.scale.set(1.3, 0.15, 0.9);
root.add(sawdust);
const sawdust2 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.07, 0), 0.008, 4), sawdustMat);
sawdust2.name = 'sawdust';
sawdust2.position.set(0.15, 0.008, 0.09);
sawdust2.scale.set(1.3, 0.15, 0.9);
root.add(sawdust2);
const speck = new THREE.Mesh(boxGeo, sawdustMat);
speck.name = 'speck';
speck.position.set(0.2061, 0.002, -0.3568);
speck.rotation.set(0, deg(41.0573), 0);
root.add(speck);
const speck2 = new THREE.Mesh(boxGeo, sawdustMat);
speck2.name = 'speck';
speck2.position.set(0.0125, 0.002, 0.0778);
speck2.rotation.set(0, deg(43.3062), 0);
root.add(speck2);
const speck3 = new THREE.Mesh(boxGeo, sawdustMat);
speck3.name = 'speck';
speck3.position.set(0.136, 0.002, -0.2829);
speck3.rotation.set(0, deg(23.6931), 0);
root.add(speck3);
const speck4 = new THREE.Mesh(boxGeo, sawdustMat);
speck4.name = 'speck';
speck4.position.set(0.1558, 0.002, -0.2631);
speck4.rotation.set(0, deg(7.5234), 0);
root.add(speck4);
const speck5 = new THREE.Mesh(boxGeo, sawdustMat);
speck5.name = 'speck';
speck5.position.set(0.2041, 0.002, -0.094);
speck5.rotation.set(0, deg(71.4359), 0);
root.add(speck5);
const speck6 = new THREE.Mesh(boxGeo, sawdustMat);
speck6.name = 'speck';
speck6.position.set(0.2539, 0.002, -0.1858);
speck6.rotation.set(0, deg(62.1523), 0);
root.add(speck6);
const saw = new THREE.Group();
saw.name = 'saw';
saw.position.set(0.14, 0.3104, 0.2443);
saw.rotation.set(deg(-18), deg(90), 0);
root.add(saw);
const blade = new THREE.Mesh(extrude([[-0.01, 0], [0.02, 0], [0.0336, -0.0105], [0.0389, 0], [0.0526, -0.0105], [0.0579, 0], [0.0715, -0.0105], [0.0768, 0], [0.0904, -0.0105], [0.0957, 0], [0.1093, -0.0105], [0.1146, 0], [0.1283, -0.0105], [0.1336, 0], [0.1472, -0.0105], [0.1525, 0], [0.1661, -0.0105], [0.1714, 0], [0.1851, -0.0105], [0.1904, 0], [0.204, -0.0105], [0.2093, 0], [0.2229, -0.0105], [0.2282, 0], [0.2418, -0.0105], [0.2471, 0], [0.2608, -0.0105], [0.2661, 0], [0.2797, -0.0105], [0.285, 0], [0.2986, -0.0105], [0.3039, 0], [0.3176, -0.0105], [0.3229, 0], [0.3365, -0.0105], [0.3418, 0], [0.3554, -0.0105], [0.3607, 0], [0.3743, -0.0105], [0.3796, 0], [0.3933, -0.0105], [0.3986, 0], [0.4122, -0.0105], [0.4175, 0], [0.4311, -0.0105], [0.4364, 0], [0.4501, -0.0105], [0.4554, 0], [0.469, -0.0105], [0.4743, 0], [0.4879, -0.0105], [0.4932, 0], [0.5068, -0.0105], [0.5121, 0], [0.5258, -0.0105], [0.5311, 0], [0.5447, -0.0105], [0.55, 0], [0.554, 0.085], [0.538, 0.09], [-0.01, 0.13]], 0.003), bladeMat);
blade.name = 'blade';
saw.add(blade);
const handle = new THREE.Mesh(extrude([[0.04, -0.004], [-0.04, -0.012], [-0.115, -0.024], [-0.135, -0.005], [-0.122, 0.022], [-0.135, 0.07], [-0.152, 0.125], [-0.148, 0.16], [-0.115, 0.175], [-0.075, 0.162], [-0.03, 0.148], [0.04, 0.142]], 0.016, [[[-0.0601, 0.0785], [-0.076, 0.1058], [-0.093, 0.1133], [-0.1013, 0.0966], [-0.0959, 0.0655], [-0.08, 0.0382], [-0.063, 0.0307], [-0.0547, 0.0474]]], [0.004, 0.003, 1]), handleMat);
handle.name = 'handle';
saw.add(handle);
const screw = new THREE.Mesh(cylinderGeo3, brassMat);
screw.name = 'screw';
screw.position.set(0.018, 0.03, 0);
screw.rotation.set(deg(90), 0, 0);
saw.add(screw);
const screw2 = new THREE.Mesh(cylinderGeo3, brassMat);
screw2.name = 'screw';
screw2.position.set(0.018, 0.112, 0);
screw2.rotation.set(deg(90), 0, 0);
saw.add(screw2);
const screw3 = new THREE.Mesh(cylinderGeo3, brassMat);
screw3.name = 'screw';
screw3.position.set(-0.03, 0.128, 0);
screw3.rotation.set(deg(90), 0, 0);
saw.add(screw3);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createHandSaw;
Ratings & comments
0 comments
No comments yet. Share how you used this model or what could be better.
Related models
Same category or similar tags









