diff --git a/src/Sketch.js b/src/Sketch.js index d019f06..1a04494 100644 --- a/src/Sketch.js +++ b/src/Sketch.js @@ -49,7 +49,7 @@ class Sketch { this.constraints = new Map() this.c_id = 1; - this.obj3d.add(new THREE.Group().add(new AxesHelper(0.5))); + this.obj3d.add(new THREE.Group().add(new AxesHelper(1))); this.obj3d.add(new THREE.Group()); this.obj3d.add(new THREE.Group()); diff --git a/src/patch.js b/src/patch.js index 75e9d99..68b149a 100644 --- a/src/patch.js +++ b/src/patch.js @@ -12,14 +12,26 @@ class Patch extends THREE.Mesh { constructor(s = 1) { + + + const positions = [ - 0.5 * s, 0, 0, - 0.3 * s, 0.08*s, 0, - 0.3 * s, -0.08*s, 0 + 0.5, 0, + 0.3, 0.08, + 0.3, -0.08, ]; - const geometry = new BufferGeometry(); - geometry.setAttribute('position', new Float32BufferAttribute(positions, 3)); + const shape = new THREE.Shape() + + shape.moveTo(positions[0], positions[1]) + + for (let i = 2; i < positions.length; i += 2) { + shape.lineTo(positions[i], positions[i+1]) + } + + console.log(shape) + + const geometry = new THREE.ShapeGeometry( shape );; super( @@ -34,6 +46,7 @@ class Patch extends THREE.Mesh { }) ) + this.scale.set( 1, 1, 1 ); return this; }