Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //shapeConfig
- import * as THREE from 'three';
- const lShape = new THREE.Shape()
- .moveTo(0, 0)
- .lineTo(5, 0)
- .lineTo(5, 10)
- .lineTo(0, 10)
- .lineTo(0, 5)
- .lineTo(-5, 5)
- .lineTo(-5, 0)
- .lineTo(0, 0);
- const lShapeGeometry = new THREE.ShapeGeometry(lShape);
- lShapeGeometry.rotateX(Math.PI / 2);
- const squareShape = new THREE.Shape()
- .moveTo(0, 0)
- .lineTo(10, 0)
- .lineTo(10, 10)
- .lineTo(0, 10)
- .lineTo(0, 0);
- const squareGeometry = new THREE.ShapeGeometry(squareShape);
- squareGeometry.rotateX(Math.PI / 2);
- const rectangleShape = new THREE.Shape()
- .moveTo(0, 0)
- .lineTo(10, 0)
- .lineTo(10, 5)
- .lineTo(0, 5)
- .lineTo(0, 0);
- const rectangleGeometry = new THREE.ShapeGeometry(rectangleShape);
- rectangleGeometry.rotateX(Math.PI / 2);
- export const shapes = {
- square: squareGeometry,
- rectangle: rectangleGeometry,
- lshape: lShapeGeometry,
- custom: null, // Placeholder for freehand shape
- };
Advertisement
Add Comment
Please, Sign In to add comment