|
|
@ -1,10 +1,10 @@
|
|
|
|
import * as THREE from 'three';
|
|
|
|
import * as THREE from 'three';
|
|
|
|
import { Box3, EllipseCurve, Geometry, Matrix4, Object3D, Vector3 } from 'three';
|
|
|
|
import { Box3, EllipseCurve, Geometry, Object3D, Vector3 } from 'three';
|
|
|
|
import { arrayFirst, arraySortByNumber, arrayRemoveDuplicateBySort, arrayLast } from '../Common/ArrayExt';
|
|
|
|
import { arrayLast, arrayRemoveDuplicateBySort } from '../Common/ArrayExt';
|
|
|
|
import { ColorMaterial } from '../Common/ColorPalette';
|
|
|
|
import { ColorMaterial } from '../Common/ColorPalette';
|
|
|
|
import { clamp } from '../Common/Utils';
|
|
|
|
import { clamp } from '../Common/Utils';
|
|
|
|
import { Arc } from '../DatabaseServices/Arc';
|
|
|
|
import { Arc } from '../DatabaseServices/Arc';
|
|
|
|
import { angle, equaln, polar, MoveMatrix } from '../Geometry/GeUtils';
|
|
|
|
import { MoveMatrix, angle, equaln, polar } from '../Geometry/GeUtils';
|
|
|
|
import { RenderType } from '../GraphicsSystem/Enum';
|
|
|
|
import { RenderType } from '../GraphicsSystem/Enum';
|
|
|
|
import { IntersectCircleAndArc, IntersectCircleAndCircle, IntersectLineAndCircle, IntersectOption, IntersectPolylineAndCurve, reverseIntersectOption } from '../GraphicsSystem/IntersectWith';
|
|
|
|
import { IntersectCircleAndArc, IntersectCircleAndCircle, IntersectLineAndCircle, IntersectOption, IntersectPolylineAndCurve, reverseIntersectOption } from '../GraphicsSystem/IntersectWith';
|
|
|
|
import { Factory } from './CADFactory';
|
|
|
|
import { Factory } from './CADFactory';
|
|
|
@ -293,6 +293,7 @@ export class Circle extends Curve
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GetClosestPointTo(pt: Vector3, extend: boolean): Vector3
|
|
|
|
GetClosestPointTo(pt: Vector3, extend: boolean): Vector3
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (pt.distanceToSquared(this.Center) == 0) return this.GetPointAtParam(0);
|
|
|
|
let l = new Line(this.Center, pt);
|
|
|
|
let l = new Line(this.Center, pt);
|
|
|
|
let pts = l.IntersectWith(this, IntersectOption.ExtendBoth);
|
|
|
|
let pts = l.IntersectWith(this, IntersectOption.ExtendBoth);
|
|
|
|
let ptIns = pt.distanceTo(pts[0]) < pt.distanceTo(pts[1]) ? pts[0] : pts[1];
|
|
|
|
let ptIns = pt.distanceTo(pts[0]) < pt.distanceTo(pts[1]) ? pts[0] : pts[1];
|
|
|
|