1 import { PathPrototype } from './PathPrototype';
2 import { Path } from './Path';
5 * @author zz85 / http://www.lab4games.net/zz85/blog
6 * Defines a 2d shape plane using paths.
9 // STEP 1 Create a path.
10 // STEP 2 Turn path into shape.
11 // STEP 3 ExtrudeGeometry takes in Shape/Shapes
12 // STEP 3a - Extract points from each shape, turn to vertices
13 // STEP 3b - Triangulate each shape, add faces.
17 Path.apply( this, arguments );
23 Shape.prototype = Object.assign( Object.create( PathPrototype ), {
27 getPointsHoles: function ( divisions ) {
31 for ( var i = 0, l = this.holes.length; i < l; i ++ ) {
33 holesPts[ i ] = this.holes[ i ].getPoints( divisions );
41 // Get points of shape and holes (keypoints based on segments parameter)
43 extractAllPoints: function ( divisions ) {
47 shape: this.getPoints( divisions ),
48 holes: this.getPointsHoles( divisions )
54 extractPoints: function ( divisions ) {
56 return this.extractAllPoints( divisions );