加入绿色材质. 对圆进行精度提高

pull/7/head
ChenX 7 years ago
parent d59643c4e5
commit e028fe72f3

@ -247,6 +247,7 @@ export class Circle extends Curve
this.m_Radius = r; this.m_Radius = r;
this.m_DrawEntity.forEach(obj => this.m_DrawEntity.forEach(obj =>
{ {
(<THREE.Line>obj).geometry.dispose();
let curve = new THREE.EllipseCurve( let curve = new THREE.EllipseCurve(
this.m_Center.x, this.m_Center.y, // ax, aY this.m_Center.x, this.m_Center.y, // ax, aY
this.m_Radius, this.m_Radius, // xRadius, yRadius this.m_Radius, this.m_Radius, // xRadius, yRadius
@ -254,7 +255,7 @@ export class Circle extends Curve
false, // aClockwise false, // aClockwise
0 // aRotation 0 // aRotation
); );
let geometry = new THREE.Geometry().setFromPoints(curve.getPoints(8)); let geometry = new THREE.Geometry().setFromPoints(curve.getPoints(60));
(<THREE.Line>obj).geometry = geometry; (<THREE.Line>obj).geometry = geometry;
}) })
} }
@ -272,7 +273,7 @@ export class Circle extends Curve
false, // aClockwise false, // aClockwise
0 // aRotation 0 // aRotation
); );
let geometry = new THREE.Geometry().setFromPoints(curve.getPoints(8)); let geometry = new THREE.Geometry().setFromPoints(curve.getPoints(60));
var material = new THREE.LineBasicMaterial({ color: 0xff0000 }); var material = new THREE.LineBasicMaterial({ color: 0xff0000 });
var ellipse = new THREE.Line(geometry, material); var ellipse = new THREE.Line(geometry, material);
this.m_DrawEntity.set(renderType, ellipse); this.m_DrawEntity.set(renderType, ellipse);

@ -13,11 +13,19 @@ export class PreViewer
//线材质 //线材质
private m_LineMaterial: THREE.LineBasicMaterial = new THREE.LineBasicMaterial({ color: 0xffffff }); private m_LineMaterial: THREE.LineBasicMaterial = new THREE.LineBasicMaterial({ color: 0xffffff });
private m_SnapMaterial: THREE.LineBasicMaterial = new THREE.LineBasicMaterial({ color: 0x008B00 }); private m_SnapMaterial: THREE.LineBasicMaterial = new THREE.LineBasicMaterial({ color: 0x008B00 });
//点划线 黄色
m_DashMaterial = new THREE.LineDashedMaterial({ m_DashMaterial = new THREE.LineDashedMaterial({
color: 0x008B00, color: 0xF0B41E,
dashSize: 30, dashSize: 20,
gapSize: 15, gapSize: 8,
}); });
//点划线 绿色 极轴捕捉
m_BlueDashMaterial = new THREE.LineDashedMaterial({
color: 0x008B00,
dashSize: 5,
gapSize: 5
})
//光标对象 //光标对象
private m_CursorObject: THREE.Group; private m_CursorObject: THREE.Group;

Loading…
Cancel
Save