Capítulo 344 de 859

Chapter 344: EllipseCurve

Core Idea

A curve representing an ellipse.

Key Concepts

  • aClockwise : boolean: Whether the ellipse is drawn clockwise or not.
  • aEndAngle : number: The end angle of the curve in radians starting from the positive X axis.
  • aRotation : number: The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
  • aStartAngle : number: The start angle of the curve in radians starting from the positive X axis.
  • aX : number: The X center of the ellipse.
  • aY : number: The Y center of the ellipse.
  • isEllipseCurve : boolean (readonly): This flag can be used for type testing.
  • xRadius : number: The radius of the ellipse in the x direction. Setting the this value equal to the EllipseCurve#yRadius will re…
  • yRadius : number: The radius of the ellipse in the y direction. Setting the this value equal to the EllipseCurve#xRadius will re…

Code Examples

const curve = new THREE.EllipseCurve(
	0, 0,
	10, 10,
	0, 2 * Math.PI,
	false,
	0
);
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
// Create the final object to add to the scene
const ellipse = new THREE.Line( geometry, material );
  • What it demonstrates: Typical usage of EllipseCurve.

Reference Tables

Constructor

Signature
new EllipseCurve( aX : number, aY : number, xRadius : number, yRadius : number, aStartAngle : number, aEndAngle : number, aClockwise : boolean, aRotation : number )

Properties

PropertyDescription
.aClockwise : booleanWhether the ellipse is drawn clockwise or not.
.aEndAngle : numberThe end angle of the curve in radians starting from the positive X axis.
.aRotation : numberThe rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
.aStartAngle : numberThe start angle of the curve in radians starting from the positive X axis.
.aX : numberThe X center of the ellipse.
.aY : numberThe Y center of the ellipse.
.isEllipseCurve : boolean (readonly)This flag can be used for type testing.
.xRadius : numberThe radius of the ellipse in the x direction. Setting the this value equal to the EllipseCurve#yRadius will result in a circle.
.yRadius : numberThe radius of the ellipse in the y direction. Setting the this value equal to the EllipseCurve#xRadius will result in a circle.

Methods

MethodDescription
.getPoint( t : number, optionalTarget : Vector2 ) : Vector2Returns a point on the curve.

Key Takeaways

  1. EllipseCurve extends: Curve
  2. Most relevant properties: aClockwise, aEndAngle, aRotation, aStartAngle.
  3. Key methods: getPoint.

Connects To