|
|
@ -5,6 +5,7 @@ import { ColorMaterial } from '../Common/ColorPalette';
|
|
|
|
import { getArcAngle, isAtArc, Vec3DTo2D } from '../Common/CurveUtils';
|
|
|
|
import { getArcAngle, isAtArc, Vec3DTo2D } from '../Common/CurveUtils';
|
|
|
|
import { equal, polar } from '../Geometry/GeUtils';
|
|
|
|
import { equal, polar } from '../Geometry/GeUtils';
|
|
|
|
import { RenderType } from '../GraphicsSystem/Enum';
|
|
|
|
import { RenderType } from '../GraphicsSystem/Enum';
|
|
|
|
|
|
|
|
import { Intersect, IntersectArcAndArc } from '../GraphicsSystem/IntersectWith';
|
|
|
|
import { Factory } from './CADFactory';
|
|
|
|
import { Factory } from './CADFactory';
|
|
|
|
import { CADFile } from './CADFile';
|
|
|
|
import { CADFile } from './CADFile';
|
|
|
|
import { Curve } from './Curve';
|
|
|
|
import { Curve } from './Curve';
|
|
|
@ -265,6 +266,14 @@ export class Arc extends Curve
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
IntersectWith(curve: Curve, intType: Intersect): Vector3[]
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (curve instanceof Arc)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return IntersectArcAndArc(this, curve, intType);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//******************** Curve function end*****************//
|
|
|
|
//******************** Curve function end*****************//
|
|
|
|
SetExtendPointAngle(newParam: number, allAngle: number)
|
|
|
|
SetExtendPointAngle(newParam: number, allAngle: number)
|
|
|
@ -286,7 +295,6 @@ export class Arc extends Curve
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getArcBul(param: number = 1)//圆心角
|
|
|
|
getArcBul(param: number = 1)//圆心角
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let ptArr = this.GetStretchPoints();
|
|
|
|
let ptArr = this.GetStretchPoints();
|
|
|
@ -378,9 +386,8 @@ export class Arc extends Curve
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let obj = super.Draw(renderType);
|
|
|
|
let obj = super.Draw(renderType);
|
|
|
|
if (obj) return obj;
|
|
|
|
if (obj) return obj;
|
|
|
|
//创建
|
|
|
|
|
|
|
|
let shape = new THREE.Shape();
|
|
|
|
let shape = new THREE.Shape();
|
|
|
|
//圆心x,圆心y,半径,起点角度,端点角度,时针方向
|
|
|
|
|
|
|
|
shape.absarc(this.m_Center.x, this.m_Center.y, this.m_Radius, this.m_StartAngle, this.m_EndAngle, true);
|
|
|
|
shape.absarc(this.m_Center.x, this.m_Center.y, this.m_Radius, this.m_StartAngle, this.m_EndAngle, true);
|
|
|
|
let geo = new THREE.Geometry().setFromPoints(shape.getPoints(60));
|
|
|
|
let geo = new THREE.Geometry().setFromPoints(shape.getPoints(60));
|
|
|
|
let arc = new THREE.Line(geo, ColorMaterial.GetLineMaterial(this.m_Color));
|
|
|
|
let arc = new THREE.Line(geo, ColorMaterial.GetLineMaterial(this.m_Color));
|
|
|
@ -398,7 +405,6 @@ export class Arc extends Curve
|
|
|
|
let shape = new THREE.Shape();
|
|
|
|
let shape = new THREE.Shape();
|
|
|
|
//圆心x,圆心y,半径,起点角度,端点角度,时针方向
|
|
|
|
//圆心x,圆心y,半径,起点角度,端点角度,时针方向
|
|
|
|
shape.absarc(this.m_Center.x, this.m_Center.y, this.m_Radius, this.m_StartAngle, this.m_EndAngle, true);
|
|
|
|
shape.absarc(this.m_Center.x, this.m_Center.y, this.m_Radius, this.m_StartAngle, this.m_EndAngle, true);
|
|
|
|
// //调用setFromPoints()方法, 重新设置边界.
|
|
|
|
|
|
|
|
geo.setFromPoints(shape.getPoints(60));
|
|
|
|
geo.setFromPoints(shape.getPoints(60));
|
|
|
|
geo.verticesNeedUpdate = true;
|
|
|
|
geo.verticesNeedUpdate = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|