BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

Path.absarc()

Path.absarc() 方法可以在当前路径中添加一个以给定坐标为圆心,给定半径和起始角度、终止角度为边界的圆弧。这个圆弧会以当前坐标为起点,按照顺时针方向绘制。

语法

Path.absarc( x, y, radius, startAngle, endAngle, clockwise )

参数

  • x(必须):圆心的 x 坐标。
  • y(必须):圆心的 y 坐标。
  • radius(必须):圆的半径。
  • startAngle(必须):起始角度(也就是圆弧的起点)。
  • endAngle(必须):终止角度(也就是圆弧的终点)。
  • clockwise(可选,默认值:false):圆弧绘制的方向。如果值为 true,则表示以逆时针方向绘制。

示例

var path = new THREE.Path();

// 绘制以 (100, 100) 为圆心,半径为 50,起点为 0,终点为 Math.PI 的圆弧
path.absarc( 100, 100, 50, 0, Math.PI );

// 绘制以 (100, 100) 为圆心,半径为 50,起点为 Math.PI,终点为 2*Math.PI 的圆弧
path.absarc( 100, 100, 50, Math.PI, 2*Math.PI );

// 绘制以 (200, 200) 为圆心,半径为 100,起点为 0,终点为 2*Math.PI 的圆
path.absarc( 200, 200, 100, 0, 2*Math.PI );

Path.absarc 示例

注意事项

  • Path.absarc() 方法只会在路径上添加圆弧的边界,而不会填充圆弧的内部区域。如果想要填充圆弧内部的区域可以使用 THREE.ShapeBufferGeometry 或者 THREE.ShapeGeometry 来生成几何体。
  • startAngleendAngle 参数的单位是弧度,取值范围为 02*Math.PI
  • 如果想要以逆时针方向绘制圆弧,需要将 clockwise 参数设置为 true

参考文献