Curve

EllipseCurve

Creates a 2d curve in the shape of an ellipse. Setting the xRadius equal to the yRadius will result in a circle.

Example

var curve = new v3d.EllipseCurve( 0, 0, // ax, aY 10, 10, // xRadius, yRadius 0, 2 * Math.PI, // aStartAngle, aEndAngle false, // aClockwise 0 // aRotation ); var points = curve.getPoints(50); var geometry = new v3d.BufferGeometry().setFromPoints(points); var material = new v3d.LineBasicMaterial({ color : 0xff0000 }); // Create the final object to add to the scene var ellipse = new v3d.Line(geometry, material);

Constructor

EllipseCurve(aX : Float, aY : Float, xRadius : Float, yRadius : Float, aStartAngle : Radians, aEndAngle : Radians, aClockwise : Boolean, aRotation : Radians)

aX – The X center of the ellipse. Default is 0.
aY – The Y center of the ellipse. Default is 0.
xRadius – The radius of the ellipse in the x direction. Default is 1.
yRadius – The radius of the ellipse in the y direction. Default is 1.
aStartAngle – The start angle of the curve in radians starting from the middle right side. Default is 0.
aEndAngle – The end angle of the curve in radians starting from the middle right side. Default is 2 x Math.PI.
aClockwise – Whether the ellipse is drawn clockwise. Default is false.
aRotation – The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is 0.

Note: When going clockwise it's best to set the start angle to (Math.PI * 2) and then work towards lower numbers.

Properties

See the base Curve class for common properties.

.isEllipseCurve : Boolean

Used to check whether this or derived classes are EllipseCurves. Default is true.

You should not change this, as it used internally for optimisation.

.aX : Float

The X center of the ellipse.

.aY : Float

The Y center of the ellipse.

.xRadius : Radians

The radius of the ellipse in the x direction.

.yRadius : Radians

The radius of the ellipse in the y direction.

.aStartAngle : Float

The start angle of the curve in radians starting from the middle right side.

.aEndAngle : Float

The end angle of the curve in radians starting from the middle right side.

.aClockwise : Boolean

Whether the ellipse is drawn clockwise.

.aRotation : Float

The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is 0.

.isEllipseCurve : Boolean

Used to check whether this or derived classes are ellipses. Default is true.

You should not change this, as it used internally for optimisation.

Methods

See the base Curve class for common methods.

Source

For more info on how to obtain the source code of this module see this page.