二、类名称:Math_01KJ | | | |
三、类变量: | | | |
| 1、Verson | String | "1.0" |
| 2、DevelopCompany | String | "重庆天筑比盟科技公司" |
| 3、Developer | String | "李总" |
| 4、DevelopTime | String | "2017.02.01-2017.02.05" |
| 5、DevelopAddress | String | DevelopAddress="聚信广场15-1" |
四、类函数: | | | |
| 1、getVerson() | String | 返回Verson |
| 2、getDevelopCompany() | String | 返回DevelopCompany |
| 3、getDeveloper | String | 返回Developer |
| 4、getDevelopTime() | String | 返回DevelopTime |
| 5、getDevelopAddress() | String | 返回DevelopAddress |
五、实例变量: | | | |
| 1、@m_DelterArc=10.mm; | Length | 弧线精度 |
| 2、@mModel=Sketchup.active_model; | | 模型空间 |
| 3、@m_Entities=@mModel.entities; | | 实体集 |
| 4、@mSelection=@mModel.selection; | | 选择集 |
| 5、@mMaterials=@mModel.materials; | | 材质集 |
| 6、@mAttrDicts=@mModel.attribute_dictionaries; | | 属性字典集 |
| 7、@mVtX=Geom::Vector3d.new(1,0,0); | | X轴 |
| 8、@mVtY=Geom::Vector3d.new(0,1,0); | | Y轴 |
| 9、@mVtZ=Geom::Vector3d.new(0,0,1); | | Z轴 |
六、成员函数和方法: | | | |
| (一)初始化 | | |
| 0、initialize | | |
| (二)修改输入实例变量 | | |
| 1、m_DelterArc=(m_DelterArc)
和setDelterArc(m_DelterArc) | true/false | |
| 2、m_Entities=(m_Entities)
和setEntities(m_Entities) | true/false | |
| (三)计算函数 | | |
| 3、numCircle(radius) | | 返回满足@m_DelterArc精度要求的圆弧段数,且大于等于16。 |
| 4、minArr(numArr) | | 返回参数numArr数组中的最小值,numArr不为数组返回nil,numArr元素不全为Float或Fixnum返回nil。 |
| 5、maxArr(numArr) | | 返回参数numArr数组中的最大值,numArr不为数组返回nil,numArr元素不全为Float或Fixnum返回nil。 |
| 6、transform(vt1,vt2,point) | | 返回向量 1到向量2,以参考点point为中心的旋转矩阵。若向量 1或向量2不是向量,则返回nil。 |
| 7、pt2ConvertLineF(point1,point2) | | 返回两点的直线方程[Gom: oint3d,Geom::Vector3d],或nil。 |
| 8、lineFConvertPt2(line) | | 返回直线方程的两点组[Gom: oint3d,Geom: oint3d],或nil。 |
| 9、pt3ConvertPlaneF(point1,point2,point3) | | 返回三点的平面方程[Gom: oint3d,Geom::Vector3d],或nil。 |
| 10、planeFConvertPt3(plane) | | 返回平面方程的三点[Gom: oint3d,Geom: oint3d,Geom: oint3d],或nil。 |
| 11、pointOnLineF?(point,lineF) | | 判断给定点是否在直线方程确定的直线上,返回nil、false、true。 |
| 12、pointOnLineP(point,linePts) | | 判断给定点是否在两点数组确定的直线段内,返回0—直线段外且直线上;1—直线段上;2—直线开始点;3—直线结束点;4—直线段外且不在直线上。 |
| 13、pointOnPlaneF?(point,planeF) | | 判断给定点point是否在planeF[Geom: oint3d,Geom::Vector3d]三点数组确定的平面上,返回nil、false、true |
| 14、pointOnPlaneP?(point,ptArr) | | 判断给定点是否在三点数组确定的平面上,返回nil、false、true |
| 15、pointOnArc?(point,arcPts) | | 判断给定点是否在三点数组确定的圆弧段内,返回0—园弧段外且园弧上;1—园弧段上;2—园弧开始点;3—园弧结束点;4—园弧段外且不在园弧上。 |
| 16、intLineLine(p1,p2,pt1,pt2) | | 返回直线1两点与直线2两点的交点数组,返回为[]、[pp,num]。
num=0时:交点pp在p1p2和pt1pt2直线段上;
num=1时:交点pp仅在第一条直线段上,第二条的延伸线上;
num=2时:交点pp仅在直线段第二条,第一条的延伸线上;上;
num=3时:交点pp在第一条和第二条的延伸线上; |
| 17、intLineArc(p1,p2,arcP1,arcP2,arcP3) | | 返回直线1两点与圆2三点的交点数组,返回为[]、[pt]、[pt1,pt2]。 |
| 18、intLineFArc(line,arcP2,arcP3) | | 返回直线方程式与圆2三点的交点数组,返回为[]、[pt]、[pt1,pt2]。pt1为与line[0]较近点。 |
| 19、intLineFArcCR(line,centerPt,radius) | | 返回直线1line与园center和radius的交点数组,返回为[]、[pt]、[pt1,pt2]。pt1为与line[0]较近点。 |
| 20、intersectArcArc(pArc1,pArc2,pArc3,ptArc1,ptArc2,ptArc3) | | 返回圆1三点与圆2三点的交点数组,返回为[]、[pt]、[pt1,pt2]。 |
| 21、arcPt3Center(pt1_Center,pt2_Center,pt3_Center) | | 返回圆三点的圆心点,返回值为nil和Geom: oint3d。 |
| 22、arcPt3Radius(pt1_Radius,pt2_Radius,pt3_Radius) | | 返回圆三点的半径,返回值为nil和Length。 |
| 23、arcPt3Angle(pt1_Angle,pt2_Angle,pt3_Angle) | | 返回圆三点的弧度,返回值为nil和Float。 |
| 24、arcPt3Length(pt1_Length,pt2_Length,pt3_Length) | | 返回圆三点的弧长,返回值为nil和Length。 |
| 25、arcPt3Normal(pt1_Normal,pt2_Normal,pt3_Normal) | | 返回圆三点的法线,返回值Geom::Vector3d。 |
| 26、xuanPtArrArr(vector3d,pt1,pt2,pt3) | | 已知玄的向量vector3d,组成园的三点pt1、pt2、pt3,返回[[point11,point12],[point21,point22]]。 |
| 27、fillet(pp1,pp2,pt1,pt2,radius) | | 已知直线1(pp1,pp2) 直线2(pt1,pt2)半径radius,返回[point1,ptArc1,ptArc,ptArc2,point2]。 |
| (四)绘制方法 | | |
| 28、DrawArcPt3(point1,point2,point3) | | 三点绘弧,返回绘制的实体。 |