浏览代码

Passes curveSegments to Shape.extractPoints() #2669

zz85 12 年之前
父节点
当前提交
a61d060990
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      src/extras/geometries/ExtrudeGeometry.js
  2. 2 1
      src/extras/geometries/ShapeGeometry.js

+ 1 - 1
src/extras/geometries/ExtrudeGeometry.js

@@ -134,7 +134,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 	var shapesOffset = this.vertices.length;
 
-	var shapePoints = shape.extractPoints();
+	var shapePoints = shape.extractPoints( curveSegments );
 
 	var vertices = shapePoints.shape;
 	var holes = shapePoints.holes;

+ 2 - 1
src/extras/geometries/ShapeGeometry.js

@@ -52,6 +52,7 @@ THREE.ShapeGeometry.prototype.addShapeList = function ( shapes, options ) {
 THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
 
 	if ( options === undefined ) options = {};
+	var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;
 
 	var material = options.material;
 	var uvgen = options.UVGenerator === undefined ? THREE.ExtrudeGeometry.WorldUVGenerator : options.UVGenerator;
@@ -63,7 +64,7 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
 	var i, l, hole, s;
 
 	var shapesOffset = this.vertices.length;
-	var shapePoints = shape.extractPoints();
+	var shapePoints = shape.extractPoints( curveSegments );
 
 	var vertices = shapePoints.shape;
 	var holes = shapePoints.holes;