|
|
|
@ -123,6 +123,7 @@ export class LineAngularDimension extends Entity
|
|
|
|
|
}
|
|
|
|
|
MoveGripPoints(indexList: number[], vec: Vector3)
|
|
|
|
|
{
|
|
|
|
|
this.WriteAllObjectRecord();
|
|
|
|
|
let arr = [
|
|
|
|
|
this._L1StartPoint,
|
|
|
|
|
this._L1EndPoint,
|
|
|
|
@ -194,8 +195,6 @@ export class LineAngularDimension extends Entity
|
|
|
|
|
|
|
|
|
|
let colorMaterial = GetDimLineMaterial(this, renderType);
|
|
|
|
|
|
|
|
|
|
let line = this._Arc.GetDrawObjectFromRenderType(renderType);
|
|
|
|
|
|
|
|
|
|
let arrow1 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial);
|
|
|
|
|
let arrow2 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial);
|
|
|
|
|
let arrowSize = 10;
|
|
|
|
@ -218,8 +217,7 @@ export class LineAngularDimension extends Entity
|
|
|
|
|
arrow2.scale.set(arrowSize, arrowSize, arrowSize);
|
|
|
|
|
|
|
|
|
|
let obj = new Object3D();
|
|
|
|
|
obj.add(arrow1, arrow2, l, l2, line);
|
|
|
|
|
AddEntityDrawObject(obj, this._Text, renderType);
|
|
|
|
|
obj.add(arrow1, arrow2, l, l2);
|
|
|
|
|
this.UpdateDrawObject(renderType, obj);
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
@ -286,7 +284,8 @@ export class LineAngularDimension extends Entity
|
|
|
|
|
}
|
|
|
|
|
UpdateDrawObject(renderType: RenderType, obj: Object3D)
|
|
|
|
|
{
|
|
|
|
|
let [arrow1, arrow2, li1, li2, line, textObj] = obj.children;
|
|
|
|
|
let [arrow1, arrow2, li1, li2] = obj.children;
|
|
|
|
|
obj.remove(...obj.children.splice(4));
|
|
|
|
|
|
|
|
|
|
let l1 = new Line(this._L1StartPoint, this._L1EndPoint);
|
|
|
|
|
let l2 = new Line(this._L2StartPoint, this._L2EndPoint);
|
|
|
|
@ -294,6 +293,7 @@ export class LineAngularDimension extends Entity
|
|
|
|
|
let insP = l1.IntersectWith(l2, IntersectOption.ExtendBoth)[0];
|
|
|
|
|
if (insP)
|
|
|
|
|
{
|
|
|
|
|
this._Arc.AutoUpdate = false;//如果没有在这边关闭这个,那么Arc的盒子将错误
|
|
|
|
|
this._Arc.Center = insP;
|
|
|
|
|
this._Arc.Radius = insP.distanceTo(this._DimPoint);
|
|
|
|
|
|
|
|
|
@ -313,12 +313,15 @@ export class LineAngularDimension extends Entity
|
|
|
|
|
for (let i = 0; i < ans.length; i++)
|
|
|
|
|
{
|
|
|
|
|
let ni = FixIndex(i + 1, ans.length);
|
|
|
|
|
|
|
|
|
|
this._Arc.StartAngle = ans[ni];
|
|
|
|
|
this._Arc.EndAngle = ans[i];
|
|
|
|
|
|
|
|
|
|
if (this._Arc.ParamOnCurve(this._Arc.GetParamAtAngle(dimAn)))
|
|
|
|
|
{
|
|
|
|
|
obj.remove(line);
|
|
|
|
|
obj.remove(textObj);
|
|
|
|
|
this._Arc.AutoUpdate = true;
|
|
|
|
|
this._Arc.DeferUpdate();
|
|
|
|
|
|
|
|
|
|
AddEntityDrawObject(obj, this._Arc, renderType);
|
|
|
|
|
arrow1.position.copy(this._Arc.StartPoint);
|
|
|
|
|
arrow1.rotation.z = this._Arc.GetFistDerivAngle(0) + Math.PI / 2;
|
|
|
|
@ -328,10 +331,14 @@ export class LineAngularDimension extends Entity
|
|
|
|
|
arrow2.rotation.z = this._Arc.GetFistDerivAngle(1) - Math.PI / 2;
|
|
|
|
|
arrow2.updateMatrix();
|
|
|
|
|
|
|
|
|
|
this._Text.AutoUpdate = false;//更新标记
|
|
|
|
|
|
|
|
|
|
this._Text.TextString = this._TextString ? this._TextString.replace("<>", this.GetString()) : this.GetString();
|
|
|
|
|
this._Text.Position = this._Arc.GetPointAtParam(0.5);
|
|
|
|
|
this._Text.TextRotation = this._Arc.GetAngleAtParam(0.5) % (Math.PI) - Math.PI / 2;
|
|
|
|
|
|
|
|
|
|
this._Text.AutoUpdate = true;//更新标记
|
|
|
|
|
this._Text.DeferUpdate();
|
|
|
|
|
AddEntityDrawObject(obj, this._Text, renderType);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|