添加精度设置

pull/245/MERGE
ChenX 6 years ago
parent 428982e645
commit a694a41f3b

@ -11,6 +11,10 @@ import { ToFixed } from "../Common/Utils";
*/
export class CurveMap
{
constructor(public fractionDigits = 4)
{
}
/*
.
@ -73,7 +77,7 @@ export class CurveMap
*/
private GenerateP(v: Vector3): Vector3
{
let str = v.toArray().map(v => ToFixed(v, 4)).join(",");
let str = v.toArray().map(v => ToFixed(v, this.fractionDigits)).join(",");
if (this.m_vecMap.has(str))
return this.m_vecMap.get(str);
this.m_vecMap.set(str, v);

@ -46,7 +46,7 @@ export class RegionParse
* @param {Curve[]} cuList .
* @memberof RegionParse
*/
constructor(cuList: Curve[])
constructor(cuList: Curve[], public fractionDigits?)
{
//需要搜索的站
let needFinds = this.GenerateNodeMap(cuList);
@ -194,7 +194,7 @@ export class RegionParse
*/
private GenerateNodeMap(cuList: Curve[]): Set<Stand>
{
let curveMap = new CurveMap();
let curveMap = new CurveMap(this.fractionDigits);
//将多段线炸开
let plcus: Curve[] = [];

Loading…
Cancel
Save