UNPKG

@three3d/tools

Version:

@three3d/tools 提供了 ThreeJS 常用的工具库

185 lines (166 loc) 16.6 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@three3d/tools](./tools.md) ## tools package ThreeJS的工具库 ## Remarks ThreeJS 常用工具、类型等 ## Classes | Class | Description | | --- | --- | | [Azimuth](./tools.azimuth.md) | 计算方位的类 | ## Enumerations | Enumeration | Description | | --- | --- | | [DirectionSide](./tools.directionside.md) | | | [FrenetFrameRelation](./tools.frenetframerelation.md) | 表示两个 FrenetFrame 的关系 | | [GeometricRelationship](./tools.geometricrelationship.md) | 几何位置关系 | | [LineConnectionType](./tools.lineconnectiontype.md) | 线的衔接类型 | ## Functions | Function | Description | | --- | --- | | [adjustFrenetFrame(tangent, normal, fixNormal, binormalResult)](./tools.adjustfrenetframe.md) | 调整由 tangent 和 normal 决定的 Frenet 坐标系,以使其互相垂直 | | [adjustFrontUpFrame(front, up, fixUp, binormalResult)](./tools.adjustfrontupframe.md) | 调整由 front 和 up 决定的坐标系,以使其互相垂直 | | [adjustOrientation(front, up, fixUp, result)](./tools.adjustorientation.md) | 生成一个用于调整方向的矩阵 | | [closeCurvePath(curvePath)](./tools.closecurvepath.md) | 闭合曲线路径 | | [computeCurveFrenetFrames(curve, division, up, options)](./tools.computecurvefrenetframes.md) | 计算曲线的 FrenetFrames | | [computeCurveFrenetFramesByFixUp(curve, division, up, useU)](./tools.computecurvefrenetframesbyfixup.md) | 通过固定up方向的方式计算曲线的 FrenetFrames | | [computeCurveFrenetFramesByT(curve, division, up)](./tools.computecurvefrenetframesbyt.md) | 通过等分t的方式计算曲线的 FrenetFrames | | [computeCurveFrenetFramesByU(curve, division, up, closed)](./tools.computecurvefrenetframesbyu.md) | 通过等分u的方式计算曲线的 FrenetFrames | | [computeFrenetFrameRelation(frontFrame, backFrame, zeroThreshold)](./tools.computefrenetframerelation.md) | 计算FrenetFrame各轴的平行和垂直关系 | | [computeIntersectionFactorOfLine\_Circle(line, circle)](./tools.computeintersectionfactorofline_circle.md) | 计算线和圆的交点比例 | | [computeIntersectionLineOfBands(frontFrame, backFrame, zeroThreshold)](./tools.computeintersectionlineofbands.md) | 计算两个带的交线 | | [computeIntersectionOfLine\_Circle(line, circle)](./tools.computeintersectionofline_circle.md) | 计算线和圆的交点 | | [computeIntersectionOfLine\_Line(line1, line2)](./tools.computeintersectionofline_line.md) | 计算线和线的交点 | | [computeIntersectionOfLineSegment\_Circle(line, circle)](./tools.computeintersectionoflinesegment_circle.md) | 计算线段和圆的交点 | | [computeIntersectionOfLineSegment\_LineSegment(lineSegment1, lineSegment2)](./tools.computeintersectionoflinesegment_linesegment.md) | 计算线段和线段的交点 | | [computeIntersectionOfPolygon\_Circle(polygon, circle)](./tools.computeintersectionofpolygon_circle.md) | 计算多边形和圆的交点 | | [computeIntersectionOfRay\_Circle(ray, circle)](./tools.computeintersectionofray_circle.md) | 计算射线和圆的交点 | | [computeIntersectionOfRay\_LineSegment(ray, lineSegment)](./tools.computeintersectionofray_linesegment.md) | 计算射线和线段的交点 | | [computeIntersectSpheres(points)](./tools.computeintersectspheres.md) | 计算相交球 | | [computePolylineFrenetFrames(points, up)](./tools.computepolylinefrenetframes.md) | 计算折线的的 FrenetFrames | | [computePolylineFrenetFramesByFixUp(points, up)](./tools.computepolylinefrenetframesbyfixup.md) | 通过固定up方向的方式计算折线的的 FrenetFrames | | [computeVectorScalar(from, to)](./tools.computevectorscalar.md) | 计算从向量 from 到 向量 to 的 等比例缩放; | | [configUV(uv, options)](./tools.configuv.md) | 使用纹理选项来设置uv | | [configUVBufferAttribute(uvs, options)](./tools.configuvbufferattribute.md) | 使用纹理选项批量设置uv | | [configUVs(uvs, options)](./tools.configuvs.md) | 使用纹理选项批量设置uv | | [createBevelLineConnection(cornerPointInfo, frontFrame, backFrame, chamfer, zeroThreshold)](./tools.createbevellineconnection.md) | 创建斜角的线连接数据 | | [createCurveBufferGeometry(curve, options)](./tools.createcurvebuffergeometry.md) | 创建曲线几何体 | | [createLinearGradientTexture(gradient)](./tools.createlineargradienttexture.md) | 创建颜色梯度材质 | | [createLineConnection(cornerPointInfo, frontFrame, backFrame, options)](./tools.createlineconnection.md) | 创建圆角的线连接数据 | | [createLineCurve(start, end)](./tools.createlinecurve.md) | 创建 LineCurve | | [createLineCurves(points)](./tools.createlinecurves.md) | 通过顶点列表创建其所围成的折线的线段列表 | | [createLines(points)](./tools.createlines.md) | 通过顶点列表创建其所围成的折线的线段列表 | | [createLineSegmentConnection(cornerPointInfo, frontFrame, backFrame)](./tools.createlinesegmentconnection.md) | 创建线段连接器 | | [createLineSegmentsByCurve(curve, options)](./tools.createlinesegmentsbycurve.md) | | | [createPolylineBufferGeometry(points, options)](./tools.createpolylinebuffergeometry.md) | 创建曲线几何体 | | [createPolylineCurve(points)](./tools.createpolylinecurve.md) | 创建折线曲线 | | [createRoundLineConnection(cornerPointInfo, frontFrame, backFrame, options, zeroThreshold)](./tools.createroundlineconnection.md) | 创建圆角的线连接数据 | | [createSymmetricSegmentedTrigonometricIndexs(vertexCount, startIndex, connectPre)](./tools.createsymmetricsegmentedtrigonometricindexs.md) | 创建对称分段的三角面索引 | | [createSymmetricSegmentedTrigonometricIndexsByVertexs(vertexs, startIndex, connectPre)](./tools.createsymmetricsegmentedtrigonometricindexsbyvertexs.md) | 创建对称分段的三角面索引 | | [createUVTransformMatrix(transfrom, target)](./tools.createuvtransformmatrix.md) | 创建uv的变换矩阵 | | [discriminateRelationshipOfLine\_Circle(line, circle)](./tools.discriminaterelationshipofline_circle.md) | 判别线和圆的位置关系 | | [discriminateRelationshipOfLine\_Line(line1, line2)](./tools.discriminaterelationshipofline_line.md) | 判别线和线的位置关系 | | [discriminateRelationshipOfLineSegment\_Circle(line, circle)](./tools.discriminaterelationshipoflinesegment_circle.md) | 判别线段和圆的位置关系 有以下几种情况: - Contain:包含;线段包含在圆里;包括线段的两个端点在圆上的情况; - Tangency:相切;线段与圆相切,且切点在经线段内; - Dissociation:相离; - Intersect;相交;射线和线段相交; | | [discriminateRelationshipOfLineSegment\_LineSegment(lineSegment1, lineSegment2)](./tools.discriminaterelationshipoflinesegment_linesegment.md) | 判别线段和线段的位置关系 有以下几种情况: - Contain:包含;其中一个包含在另一个中; - Tangency:相切;两线段共线 且 有部分重合; - Dissociation:相离:没有重合的部分; - Intersect;相交; | | [discriminateRelationshipOfLineSegment\_Point(lineSegment, point)](./tools.discriminaterelationshipoflinesegment_point.md) | 判别点和线段的位置关系 | | [discriminateRelationshipOfPoint\_ConvexPolygon(point, polygon)](./tools.discriminaterelationshipofpoint_convexpolygon.md) | 判别点和凸多边形的位置关系 | | [discriminateRelationshipOfPoint\_Polygon(point, polygon)](./tools.discriminaterelationshipofpoint_polygon.md) | 判别点和多边形的位置关系 | | [discriminateRelationshipOfPolygon\_Circle(polygon, circle)](./tools.discriminaterelationshipofpolygon_circle.md) | 判别多边形和圆的位置关系 | | [discriminateRelationshipOfRay\_Circle(ray, circle)](./tools.discriminaterelationshipofray_circle.md) | 判别射线和圆的位置关系 | | [discriminateRelationshipOfRay\_LineSegment(ray, lineSegment)](./tools.discriminaterelationshipofray_linesegment.md) | 判别射线和线段的位置关系 | | [formatAzimuthDefineMap(map)](./tools.formatazimuthdefinemap.md) | 格式化方位定义映射对象 | | [frenetFrameToFrontUpFrame(frame)](./tools.frenetframetofrontupframe.md) | FrenetFrame 转为 FrontUpFrame | | [frontUpFrameToFrenetFrame(frame)](./tools.frontupframetofrenetframe.md) | FrontUpFrame 转为 FrenetFrame | | [get3DTextureItem(texture, coord)](./tools.get3dtextureitem.md) | 获取3D纹理中指定坐标处的数据项目 | | [get3DTextureSlice(texture, axis, depth)](./tools.get3dtextureslice.md) | 获取3D纹理的切片 | | [getAxisRotationAngle(from, to, axis)](./tools.getaxisrotationangle.md) | 以轴 axis 为旋转轴,获取从向量 from 到 向量 to 的旋转角度 | | [getAzimuthAngle(target, front, up)](./tools.getazimuthangle.md) | 获取方位角:即:偏航角、俯仰角、横滚角 | | [getClosestDistanceInfoOfPointToLines(point, lines)](./tools.getclosestdistanceinfoofpointtolines.md) | 获取最近的点相关的信息 | | [getCurveDivisionLength(options)](./tools.getcurvedivisionlength.md) | 获取曲线的分段和长度 | | [getCurvePointAwayFrom(options)](./tools.getcurvepointawayfrom.md) | 获取曲线上与指定位置(fromU)相距一定距离的点 | | [getCurvePointAwayFromOrigin(options)](./tools.getcurvepointawayfromorigin.md) | | | [getCurveULengths(curve, divisions)](./tools.getcurveulengths.md) | 获取曲线的累积段长度的列表。 | | [getDistanceInfoOfPointToLines(point, lines)](./tools.getdistanceinfoofpointtolines.md) | 获取点到所有线的距离信息 | | [getIncludedAngle(from, to)](./tools.getincludedangle.md) | 计算两个向量的夹角 | | [getLengthsOfPoints(points)](./tools.getlengthsofpoints.md) | 获取每个点对应的长度 | | [getLengthsOfPositionAttribute(positionAttribute)](./tools.getlengthsofpositionattribute.md) | 获取每个点对应的长度 | | [getLengthsOfTs(curve, ts, isU)](./tools.getlengthsofts.md) | 获取u列表对应的曲线累积长度列表。 | | [getLinesInfo(points)](./tools.getlinesinfo.md) | 获取折线的信息 | | [getProjectionLines(point, lines)](./tools.getprojectionlines.md) | 获取点的投影线 | | [getQuaternionBetweenVectorsAroundAxis(from, to, axis, result)](./tools.getquaternionbetweenvectorsaroundaxis.md) | 获取两个向量之间的绕轴旋转 | | [getRotationAngle(from, to, refAxis)](./tools.getrotationangle.md) | 以轴 refAxis 为参考轴,获取从向量 from 到 向量 to 的旋转角度 | | [getSampleNum(options, length)](./tools.getsamplenum.md) | 获取采样数(整数) | | [getTextureFormatSize(format)](./tools.gettextureformatsize.md) | 获取 Texture 的 format 对应的 item 尺寸(长度) | | [getVectorClass(vec)](./tools.getvectorclass.md) | 获取 IVector 对应的 Vector 类 | | [isCollinear(vec1, vec2)](./tools.iscollinear.md) | 判断两个向量是否共线 | | [ivectorMemberToVector(target, recursive, level)](./tools.ivectormembertovector.md) | 深度拷贝并转换所有的 IVector 成员及其子成员为 Vector | | [ivectorToVector(ivector)](./tools.ivectortovector.md) | IVector 类型转为 Vector 类型 | | [threeBugPatch()](./tools.threebugpatch.md) | 修复 three中发现的bug | | [transformUV(uv, transfrom, options)](./tools.transformuv.md) | 变换单个uv | | [transformUVBufferAttribute(uvs, transfrom, options)](./tools.transformuvbufferattribute.md) | 对 uv BufferAttribute 进行变换 | | [transformUVs(uvs, transfrom, options)](./tools.transformuvs.md) | 对 uv 数组进行变换 | ## Interfaces | Interface | Description | | --- | --- | | [AzimuthInfo](./tools.azimuthinfo.md) | | | [AzimuthOptions](./tools.azimuthoptions.md) | Azimuth 的选项 | | [AzimuthRange](./tools.azimuthrange.md) | 方位范围,用来描述方位对应的角度范围 | | [ClosestDistanceInfoOfPointToLines](./tools.closestdistanceinfoofpointtolines.md) | 点与一组线之间的最近信息 | | [ComputeCurveFrenetFramesOptions](./tools.computecurvefrenetframesoptions.md) | | | [ConfigUVOptions](./tools.configuvoptions.md) | 配置uv的选项 | | [CourseAzimuthMap](./tools.courseazimuthmap.md) | 航向方位映射 | | [CourseInfo](./tools.courseinfo.md) | 航向信息 | | [CreateLineConnectionOptions](./tools.createlineconnectionoptions.md) | | | [CreatePolylineBufferGeometryOptions](./tools.createpolylinebuffergeometryoptions.md) | 创建折线线几何体的选项 | | [CreateRoundLineConnectionOptions](./tools.createroundlineconnectionoptions.md) | | | [CurveHelperOptions](./tools.curvehelperoptions.md) | | | [DistanceInfoOfPointToLines](./tools.distanceinfoofpointtolines.md) | | | [FrenetFrame](./tools.frenetframe.md) | | | [FrenetFrameLocation](./tools.frenetframelocation.md) | | | [FrenetFrameLocations](./tools.frenetframelocations.md) | | | [FrenetFrames](./tools.frenetframes.md) | FrenetFrame列表 | | [FrontUpFrame](./tools.frontupframe.md) | | | [GetCurvePointAwayFromOptions](./tools.getcurvepointawayfromoptions.md) | getCurvePointAwayFrom 的选项 | | [GetCurvePointAwayFromOriginOptions](./tools.getcurvepointawayfromoriginoptions.md) | getCurvePointAwayFromOrigin 的选项 | | [IColor](./tools.icolor.md) | | | [IEuler](./tools.ieuler.md) | | | [IntersectionLineInfo](./tools.intersectionlineinfo.md) | 交线的关系 | | [SampleOptions](./tools.sampleoptions.md) | 采样选项 | | [UVTransformOptions](./tools.uvtransformoptions.md) | uv 变换选项 | | [VertexInfo](./tools.vertexinfo.md) | | | [YawPitchRoll](./tools.yawpitchroll.md) | 航向角 | ## Variables | Variable | Description | | --- | --- | | [azimuth](./tools.azimuth.md) | 计算方位对象 | | [defaultAzimuthOptions](./tools.defaultazimuthoptions.md) | 默认选项 | | [defaultCourseAzimuthMap](./tools.defaultcourseazimuthmap.md) | 默认的方位映射 | | [zeroThreshold\_Default](./tools.zerothreshold_default.md) | 零的阀值 | ## Type Aliases | Type Alias | Description | | --- | --- | | [AngleRange](./tools.anglerange.md) | 角度范围 | | [AzimuthDefine](./tools.azimuthdefine.md) | 方位定义 | | [AzimuthList](./tools.azimuthlist.md) | 方位范围列表 | | [AzimuthMap](./tools.azimuthmap.md) | 方位映射 | | [CreateCurveBufferGeometryOptions](./tools.createcurvebuffergeometryoptions.md) | 创建曲线几何体的选项 | | [FormatIVectorMemberToVector](./tools.formativectormembertovector.md) | 如果 V 是 IVector 类型,则转为对应的 Vector 类型,否则,保持不变 | | [FrenetFrameInfo](./tools.frenetframeinfo.md) | | | [FrenetFramesInfo](./tools.frenetframesinfo.md) | | | [GradientTextureOptions](./tools.gradienttextureoptions.md) | | | [IColorRepresentation](./tools.icolorrepresentation.md) | | | [InfinityGeometricRelationship](./tools.infinitygeometricrelationship.md) | 无限大的几何图形之间的关系 | | [IVectorMembersToVectors](./tools.ivectormemberstovectors.md) | 将对象所有属性为 IVector 类型的值转为 Vector 类型的值 将对象所有属性为 IVector\[\] 类型的值转为 Vector\[\] 类型的值 | | [IVectorToVector](./tools.ivectortovector.md) | 向量接口类型转向量类型 | | [IVectorToVectorClass](./tools.ivectortovectorclass.md) | 向量接口类型转向量类类型 | | [LineCurveClass](./tools.linecurveclass.md) | 2维和3维的LineCurve类的类型 | | [LineCurveInstance](./tools.linecurveinstance.md) | 2维和3维的LineCurve实例的类型 | | [Point\_Length\_FrenetFrames](./tools.point_length_frenetframes.md) | | | [Texture3D](./tools.texture3d.md) | 3D的纹理 | | [UT\_FrenetFrames](./tools.ut_frenetframes.md) | | | [UT\_Point\_FrenetFrames](./tools.ut_point_frenetframes.md) | | | [VectorClass](./tools.vectorclass.md) | 向量的类类型 | | [VectorClassToInstance](./tools.vectorclasstoinstance.md) | 将 VectorClass 类型 转为 Vector 类型 | | [VectorInstance](./tools.vectorinstance.md) | 向量 | | [VectorMembersToIVectors](./tools.vectormemberstoivectors.md) | 将对象所有属性为 Vector 类型的值转为 IVector 类型的值 将对象所有属性为 Vector\[\] 类型的值转为 IVector\[\] 类型的值 | | [VectorToIVector](./tools.vectortoivector.md) | 向量类型转向量接口类型 |