清理代码格式
This commit is contained in:
		
							
								
								
									
										4
									
								
								dist/createBoard.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/createBoard.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
import * as THREE from 'three';
 | 
			
		||||
import { Geometry, LineSegments } from 'three';
 | 
			
		||||
import { Geometry, LineSegments, Shape, Vector2 } from 'three';
 | 
			
		||||
export declare class Arc2d {
 | 
			
		||||
    m_StartAn: number;
 | 
			
		||||
    m_EndAn: number;
 | 
			
		||||
@@ -9,7 +9,7 @@ export declare class Arc2d {
 | 
			
		||||
    m_Radius: number;
 | 
			
		||||
    constructor(p1: THREE.Vector2, p2: THREE.Vector2, bul: number);
 | 
			
		||||
}
 | 
			
		||||
export declare function createPath(pts: THREE.Vector2[], buls: number[], shapeOut?: THREE.Shape): THREE.Shape;
 | 
			
		||||
export declare function createPath(pts: Vector2[], buls: number[], shapeOut?: Shape): Shape;
 | 
			
		||||
export declare function getVec(data: object): THREE.Vector3;
 | 
			
		||||
export declare function createBoard(boardData: object): {
 | 
			
		||||
    mesh: THREE.Mesh;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/createBoard.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/createBoard.js
									
									
									
									
										vendored
									
									
								
							@@ -34,7 +34,7 @@ class Arc2d {
 | 
			
		||||
exports.Arc2d = Arc2d;
 | 
			
		||||
//创建轮廓 通过点表和凸度    
 | 
			
		||||
function createPath(pts, buls, shapeOut) {
 | 
			
		||||
    let shape = shapeOut || new THREE.Shape();
 | 
			
		||||
    let shape = shapeOut || new three_1.Shape();
 | 
			
		||||
    if (pts.length === 0)
 | 
			
		||||
        return shape;
 | 
			
		||||
    let firstPt = pts[0];
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/createBoard.js.map
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/createBoard.js.map
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -1,14 +1,14 @@
 | 
			
		||||
import { Matrix2 } from './Matrix2';
 | 
			
		||||
import * as THREE from 'three';
 | 
			
		||||
import { Geometry, Vector2 } from 'three';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function RotateUVs(geo: THREE.Geometry)
 | 
			
		||||
export function RotateUVs(geo: Geometry)
 | 
			
		||||
{
 | 
			
		||||
    let roMat = new Matrix2();
 | 
			
		||||
    roMat.set(0, -1,
 | 
			
		||||
        1, 0);
 | 
			
		||||
 | 
			
		||||
    let addV = new THREE.Vector2(1, 0);
 | 
			
		||||
    let addV = new Vector2(1, 0);
 | 
			
		||||
 | 
			
		||||
    for (let uvs of geo.faceVertexUvs)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								src/Text.ts
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								src/Text.ts
									
									
									
									
									
								
							@@ -2,10 +2,13 @@ import { Font, FontLoader, Mesh, ShapeGeometry, Vector3 } from "three";
 | 
			
		||||
import { ColorMaterial } from "./ColorPalette";
 | 
			
		||||
import { MoveMatrix } from "./GeUtils";
 | 
			
		||||
 | 
			
		||||
class FontLoaderUtil {
 | 
			
		||||
class FontLoaderUtil
 | 
			
		||||
{
 | 
			
		||||
  private static defFont: Font;
 | 
			
		||||
  static Load(): Font {
 | 
			
		||||
    if (!this.defFont) {
 | 
			
		||||
  static Load(): Font
 | 
			
		||||
  {
 | 
			
		||||
    if (!this.defFont)
 | 
			
		||||
    {
 | 
			
		||||
      const f = require("../resources/fonts/helvetiker_regular.typeface.json");
 | 
			
		||||
      let loader = new FontLoader();
 | 
			
		||||
      this.defFont = loader.parse(f);
 | 
			
		||||
@@ -14,7 +17,8 @@ class FontLoaderUtil {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export class DbText extends Mesh {
 | 
			
		||||
export class DbText extends Mesh
 | 
			
		||||
{
 | 
			
		||||
  /**
 | 
			
		||||
   *
 | 
			
		||||
   * 构造一个文本对象,8位点(中心点下面)在0点
 | 
			
		||||
@@ -22,7 +26,8 @@ export class DbText extends Mesh {
 | 
			
		||||
   * @param {number} height 文本高度
 | 
			
		||||
   * @memberof DbText
 | 
			
		||||
   */
 | 
			
		||||
  constructor(str: string, height: number = 5) {
 | 
			
		||||
  constructor(str: string, height: number = 5)
 | 
			
		||||
  {
 | 
			
		||||
    let font = FontLoaderUtil.Load();
 | 
			
		||||
 | 
			
		||||
    let shapes: THREE.Shape[] = font.generateShapes(str, height, 0.1);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
import * as THREE from 'three';
 | 
			
		||||
import { Geometry, LineSegments, Vector2 } from 'three';
 | 
			
		||||
import { Geometry, LineSegments, Shape, Vector2 } from 'three';
 | 
			
		||||
import { polar } from './GeUtils';
 | 
			
		||||
import { boardMaterial, edgeMaterial } from './Material';
 | 
			
		||||
import { RotateUVs } from './RotateUV';
 | 
			
		||||
@@ -44,9 +44,9 @@ export class Arc2d
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//创建轮廓 通过点表和凸度    
 | 
			
		||||
export function createPath(pts: THREE.Vector2[], buls: number[], shapeOut?: THREE.Shape): THREE.Shape
 | 
			
		||||
export function createPath(pts: Vector2[], buls: number[], shapeOut?: Shape): Shape
 | 
			
		||||
{
 | 
			
		||||
    let shape = shapeOut || new THREE.Shape();
 | 
			
		||||
    let shape = shapeOut || new Shape();
 | 
			
		||||
    if (pts.length === 0) return shape;
 | 
			
		||||
    let firstPt = pts[0];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user