更新多段线偏移结果

This commit is contained in:
ChenX
2024-12-17 10:26:37 +08:00
parent 5f91474644
commit 4570d082c5
49 changed files with 233 additions and 265 deletions

View File

@@ -1,12 +1,9 @@
import Geom3 from '@jscad/modeling/src/geometries/geom3/type';
import { Frustum, Geometry, Matrix3, Matrix4, Object3D, ShapeBufferGeometry, UVGenerator, Vector3 } from 'three';
import { Matrix4, Object3D, UVGenerator, Vector3 } from 'three';
import { ArcBoardBuild } from '../../Add-on/ArcBoard/ArcBoardBuild';
import { ArcBoardOptions } from '../../Add-on/ArcBoard/ArcBoardFeeding';
import { SplitBoardSideModelUtil } from '../../Add-on/BoardCutting/SplitBoardSideModel';
import { FaceDirection } from "../../Add-on/DrawDrilling/DrillType";
import { ObjectSnapMode } from '../../Editor/ObjectSnapMode';
import { Box3Ext } from '../../Geometry/Box';
import { RenderType } from '../../GraphicsSystem/RenderType';
import { BoardProcessOption } from "../../UI/Store/OptionInterface/BoardProcessOption";
import { CADFiler } from '../CADFiler';
import { ObjectId } from '../ObjectId';
@@ -164,7 +161,6 @@ export declare class Board extends ExtrudeSolid {
set Modeling2D(ms: I2DModeling[]);
get Modeling3D(): I3DModeling[];
set Modeling3D(ms: I3DModeling[]);
RelevanceSideModelMap: Map<number, ExtrudeSolid[]>;
get SideModelingMap(): Map<number, ExtrudeSolid[]>;
set SideModelingMap(sideModelingMap: Map<number, ExtrudeSolid[]>);
get AllSideModelGrooveMap(): Map<number, ExtrudeSolid[]>;
@@ -224,7 +220,6 @@ export declare class Board extends ExtrudeSolid {
};
protected ApplyMirrorMatrix(m: Matrix4): this;
get UCGenerator(): UVGenerator;
UpdateUV(geo: Geometry, ocs: Matrix4, isRev?: boolean): void;
CopyFrom(obj: Board): void;
Clone(cloneDraw?: boolean): this;
Join(target: this): import("../../Common/Status").Status;
@@ -236,20 +231,15 @@ export declare class Board extends ExtrudeSolid {
Clear3DPathCache(): void;
private Get3DPathDrawObject;
Clear2DPathCache(): void;
_2DPathCsgs: Geom3[];
_2DPathDrawObject: Object3D;
/**
* 这个函数生成了二维刀路的csg数组,并且同时生成了_2DPathDrawObject(二维刀路提刀线框显示对象)
*/
Get2DPathCsgs(): Geom3[];
_SideModeingCsgs: Geom3[];
GetSideModeingCsgs(): Geom3[];
ClearSideModelingCache(): void;
get HasSideModel(): boolean;
private _asyncSideModelIng;
get AsyncSideModeling(): boolean;
protected get Has2DPath(): boolean;
private _workerCalcedGeom;
private _async2DPathIng;
get Async2DPathing(): boolean;
GoodBye(): void;
@@ -257,34 +247,12 @@ export declare class Board extends ExtrudeSolid {
private _2DPathBuildPromise;
Load2DPathPromise(): Promise<boolean>;
HandleSpliteEntitys(splitEntitys: this[]): void;
private BuildArcGeometry;
UpdateDrawObject(renderType: RenderType, obj: Object3D): Object3D;
private DrawAsyncText;
private get PlaceColor();
private GetPlaceFace;
/** 获取大孔面的几何体 */
get BigHoleFaceGeo(): ShapeBufferGeometry;
private GetBigHoleFace;
OffsetPathCache: Map<Polyline, {
[key: string]: Polyline;
}>;
/**
* 根据板的信息修改绘制的实体
* 1.非拆单板 灰色
* 2.纹路 开门方向纹路
* 3.二维 三维刀路
*/
private UpdateDrawObjectByBoardInfo;
UpdateDrawObjectMaterial(renderType: RenderType, obj: Object3D): void;
CheckSealing(obj: Object3D): void;
private AddSideModelGripPoints;
GetStrectchPointCountList(dragType: DragPointType): number[];
GetGripPoints(): Vector3[];
private MapToArcPoints;
MoveGripPoints(indexList: number[], vec: Vector3): void;
GetStretchPoints(): Vector3[];
MoveStretchPoints(indexList: Array<number>, vec: Vector3): void;
GetObjectSnapPoints(snapMode: ObjectSnapMode, pickPoint: Vector3, lastPoint: Vector3, viewXform?: Matrix3, frustum?: Frustum): Vector3[];
private MoveArcBoardPoints;
private GetOffsetVecAlongPath;
/**

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +1,10 @@
import { BoxGeometry, BufferGeometry, Frustum, Geometry, Matrix3, Matrix4, Mesh, Object3D, UVGenerator, Vector3 } from "three";
import { Line2 } from "three/examples/jsm/lines/Line2";
import { BufferGeometry, Frustum, Matrix3, Matrix4, UVGenerator, Vector3 } from "three";
import { Status } from "../../Common/Status";
import { ObjectSnapMode } from "../../Editor/ObjectSnapMode";
import { Box3Ext } from "../../Geometry/Box";
import { EdgesGeometry } from "../../Geometry/EdgeGeometry";
import { OBB } from "../../Geometry/OBB/obb";
import { RenderType } from "../../GraphicsSystem/RenderType";
import { CADFiler } from "../CADFiler";
import { ObjectId } from "../ObjectId";
import { PhysicalMaterialRecord } from "../PhysicalMaterialRecord";
import { Shape } from "../Shape";
import { Circle } from "./Circle";
import { DragPointType } from "./DragPointType";
@@ -55,8 +51,7 @@ export declare class ExtrudeSolid extends Entity {
Version: number;
};
constructor();
set Material(materialId: ObjectId<PhysicalMaterialRecord>);
get Material(): ObjectId<PhysicalMaterialRecord>;
get Material(): ObjectId<import("../PhysicalMaterialRecord").PhysicalMaterialRecord>;
get DisplayAccuracy(): number;
set DisplayAccuracy(v: number);
get KnifeRadius(): number;
@@ -129,25 +124,17 @@ export declare class ExtrudeSolid extends Entity {
* @returns 切割是否成功
*/
Subtract(extrudes: ExtrudeSolid[], output?: ExtrudeSolid[], checkIntersect?: boolean): boolean;
ParseGrooves(knifeExtrudes: ExtrudeSolid[]): {
grooves: ExtrudeSolid[];
relevanceSideModelMap: Map<number, ExtrudeSolid[]>;
};
RelevanceSubtract(knif: ExtrudeSolid, check?: boolean): void;
/**
* 当实体被分裂后,加入新图纸时,需要修复关联拉槽
*/
RepairRelevance(): void;
AppendGroove(groove: ExtrudeSolid): void;
/** 添加槽进板件,并且自动分裂.
* 通常槽已经校验过准确性,所以不在校验
*/
AppendGrooves(grooves: ExtrudeSolid[], output?: ExtrudeSolid[]): void;
/**
* 添加侧面
* 通常槽已经校验过准确性,所以不在校验
* 添加槽进板件,并且自动分裂.
* 通常槽已经校验过准确性,所以不在校验
*/
AppendRelevanceSideModel(relevanceSideModelMap: Map<number, ExtrudeSolid[]>): void;
AppendGrooves(grooves: ExtrudeSolid[], output?: ExtrudeSolid[], outSplitExtrudeSolid?: ExtrudeSolid[]): void;
AppendSideModel(relevanceSideModelMap: Map<number, ExtrudeSolid[]>): void;
GetObjectSnapPoints(snapMode: ObjectSnapMode, pickPoint: Vector3, lastPoint: Vector3, viewXform?: Matrix3, frustum?: Frustum): Vector3[];
protected GetStrectchPointCountList(dragType: DragPointType): number[];
@@ -199,11 +186,9 @@ export declare class ExtrudeSolid extends Entity {
*/
GrooveCheckAll(splitEntitys: this[]): void;
/** 校验内部槽并且自动分裂 */
GrooveCheckAllAutoSplit(output?: ExtrudeSolid[]): void;
GrooveCheckAllAutoSplit(output?: ExtrudeSolid[], outSplitExtrudeSolid?: ExtrudeSolid[]): void;
HandleSpliteEntitys(splitEntitys: this[]): void;
LazyGrooveCheckAll(): void;
GetPrintObject3D(): (Line2 | Mesh<BufferGeometry, import("three").ShaderMaterial>)[];
InitDrawObject(renderType?: RenderType): Object3D;
get UCGenerator(): UVGenerator;
__CacheKnifVersion__: {
[key: number]: number;
@@ -211,33 +196,17 @@ export declare class ExtrudeSolid extends Entity {
get NeedUpdateRelevanceGroove(): boolean;
__CacheVolume__: number;
__CacheSplitExtrudes: this[];
/**
* 计算关联拉槽,更新绘制对象(MeshGeometry和EdgeGeometry)
*/
protected CalcRelevanceGroove(): void;
_WorkerCalcedBufferGeometryMap: Map<ExtrudeSolid, BufferGeometry[]>;
/**
* 如果实体被切割,那么将返回分裂的实体数组,否则返回自身
*/
get SplitExtrudes(): this[];
protected GetRelevanceKnifes(knifs: ExtrudeSolid[]): void;
ClearRelevance(en?: ExtrudeSolid): void;
protected _MeshGeometry: BufferGeometry;
get MeshGeometry(): BufferGeometry;
UpdateMeshGeom(geo: BufferGeometry | Geometry): BufferGeometry;
protected get Has2DPath(): boolean;
protected get HasSideModel(): boolean;
protected _EdgeGeometry: EdgesGeometry | BufferGeometry;
get EdgeGeometry(): BufferGeometry;
UpdateUV(geo: Geometry, ocs: Matrix4, isRev?: boolean): void;
GenWorldUV(geo: BufferGeometry): void;
UpdateBufferGeometryUvs(isRev: boolean): void;
DeferUpdate(): void;
ClearDraw(): this;
UpdateDrawObject(renderType: RenderType, obj: Object3D): Object3D;
UpdateDrawObjectMaterial(renderType: RenderType, obj: Object3D): void;
private GetConceptualMaterial;
private GetModelGroove;
private GetSideModelGroove;
UpdateJigMaterial(color?: number): void;
/**
* 简化的文件读取和写入,只写入必要的数据,没有id,没有其他版本号
@@ -249,5 +218,4 @@ export declare class ExtrudeSolid extends Entity {
protected _ReadFile(file: CADFiler): void;
WriteFile(file: CADFiler): void;
}
export declare function FastMeshGeometry(width: number, height: number, thickness: number): BoxGeometry;
//# sourceMappingURL=Extrude.d.ts.map

File diff suppressed because one or more lines are too long