add dimension to origin
parent
ea32b0cc73
commit
f61b750775
|
@ -49,7 +49,7 @@ class Sketch {
|
||||||
this.constraints = new Map()
|
this.constraints = new Map()
|
||||||
this.c_id = 1;
|
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());
|
||||||
this.obj3d.add(new THREE.Group());
|
this.obj3d.add(new THREE.Group());
|
||||||
|
|
||||||
|
|
23
src/patch.js
23
src/patch.js
|
@ -12,14 +12,26 @@ class Patch extends THREE.Mesh {
|
||||||
|
|
||||||
constructor(s = 1) {
|
constructor(s = 1) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const positions = [
|
const positions = [
|
||||||
0.5 * s, 0, 0,
|
0.5, 0,
|
||||||
0.3 * s, 0.08*s, 0,
|
0.3, 0.08,
|
||||||
0.3 * s, -0.08*s, 0
|
0.3, -0.08,
|
||||||
];
|
];
|
||||||
|
|
||||||
const geometry = new BufferGeometry();
|
const shape = new THREE.Shape()
|
||||||
geometry.setAttribute('position', new Float32BufferAttribute(positions, 3));
|
|
||||||
|
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(
|
super(
|
||||||
|
@ -34,6 +46,7 @@ class Patch extends THREE.Mesh {
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
this.scale.set( 1, 1, 1 );
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue